Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
edb20f62
Commit
edb20f62
authored
Jun 22, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style image set name without translate
add translate word styles
parent
b1aa377f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
cell/utils/utils.js
cell/utils/utils.js
+2
-4
word/Drawing/DrawingDocument.js
word/Drawing/DrawingDocument.js
+8
-8
No files found.
cell/utils/utils.js
View file @
edb20f62
...
...
@@ -2015,7 +2015,6 @@
asc_CStylesPainter
.
prototype
.
generateDefaultStyles
=
function
(
cellStylesAll
,
fmgrGraphics
,
oFont
,
sr
)
{
var
cellStyles
=
cellStylesAll
.
DefaultStyles
;
var
translateName
;
var
oCanvas
=
document
.
createElement
(
'
canvas
'
);
oCanvas
.
width
=
this
.
styleThumbnailWidthWithRetina
;
oCanvas
.
height
=
this
.
styleThumbnailHeightWithRetina
;
...
...
@@ -2032,9 +2031,8 @@
// ToDo Возможно стоит переписать немного, чтобы не пробегать каждый раз по массиву custom-стилей (нужно генерировать AllStyles)
oCustomStyle
=
cellStylesAll
.
getCustomStyleByBuiltinId
(
oStyle
.
BuiltinId
);
translateName
=
AscCommon
.
translateManager
.
getValue
(
oStyle
.
Name
);
this
.
drawStyle
(
oGraphics
,
sr
,
oCustomStyle
||
oStyle
,
translateName
);
this
.
defaultStyles
.
push
(
new
AscCommon
.
CStyleImage
(
translateName
,
AscCommon
.
c_oAscStyleImage
.
Default
,
this
.
drawStyle
(
oGraphics
,
sr
,
oCustomStyle
||
oStyle
,
AscCommon
.
translateManager
.
getValue
(
oStyle
.
Name
));
this
.
defaultStyles
.
push
(
new
AscCommon
.
CStyleImage
(
oStyle
.
Name
,
AscCommon
.
c_oAscStyleImage
.
Default
,
oCanvas
.
toDataURL
(
"
image/png
"
)));
}
};
...
...
word/Drawing/DrawingDocument.js
View file @
edb20f62
...
...
@@ -7463,7 +7463,6 @@ CStylesPainter.prototype =
},
GenerateDefaultStyles
:
function
(
_api
,
ds
)
{
var
translateName
;
var
styles
=
ds
;
// добавили переводы => нельзя кэшировать
...
...
@@ -7495,9 +7494,8 @@ CStylesPainter.prototype =
var
style
=
styles
[
i
];
if
(
true
==
style
.
qFormat
&&
null
===
DocumentStyles
.
Get_StyleIdByName
(
style
.
Name
,
false
))
{
translateName
=
AscCommon
.
translateManager
.
getValue
(
style
.
Name
);
this
.
drawStyle
(
graphics
,
style
,
translateName
);
this
.
defaultStyles
.
push
(
new
AscCommon
.
CStyleImage
(
translateName
,
AscCommon
.
c_oAscStyleImage
.
Default
,
this
.
drawStyle
(
graphics
,
style
,
AscCommon
.
translateManager
.
getValue
(
style
.
Name
));
this
.
defaultStyles
.
push
(
new
AscCommon
.
CStyleImage
(
style
.
Name
,
AscCommon
.
c_oAscStyleImage
.
Default
,
_canvas
.
toDataURL
(
"
image/png
"
),
style
.
uiPriority
));
}
}
...
...
@@ -7505,7 +7503,7 @@ CStylesPainter.prototype =
GenerateDocumentStyles
:
function
(
_api
)
{
if
(
_api
.
WordControl
.
m_oLogicDocument
==
null
)
if
(
!
_api
.
WordControl
.
m_oLogicDocument
)
{
return
;
}
...
...
@@ -7513,7 +7511,7 @@ CStylesPainter.prototype =
var
__Styles
=
_api
.
WordControl
.
m_oLogicDocument
.
Get_Styles
();
var
styles
=
__Styles
.
Style
;
if
(
styles
==
null
)
if
(
!
styles
)
{
return
;
}
...
...
@@ -7560,8 +7558,10 @@ CStylesPainter.prototype =
_dr_style
.
Name
=
style
.
Name
;
_dr_style
.
Id
=
i
;
this
.
drawStyle
(
graphics
,
_dr_style
,
style
.
Name
);
this
.
docStyles
[
cur_index
]
=
new
AscCommon
.
CStyleImage
(
style
.
Name
,
AscCommon
.
c_oAscStyleImage
.
Document
,
_canvas
.
toDataURL
(
"
image/png
"
),
style
.
uiPriority
);
this
.
drawStyle
(
graphics
,
_dr_style
,
styles
.
Is_StyleDefault
(
style
.
Name
)
?
AscCommon
.
translateManager
.
getValue
(
style
.
Name
)
:
style
.
Name
);
this
.
docStyles
[
cur_index
]
=
new
AscCommon
.
CStyleImage
(
style
.
Name
,
AscCommon
.
c_oAscStyleImage
.
Document
,
_canvas
.
toDataURL
(
"
image/png
"
),
style
.
uiPriority
);
// алгоритм смены имени
if
(
style
.
Default
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment