Commit edb20f62 authored by Alexander.Trofimov's avatar Alexander.Trofimov

style image set name without translate

add translate word styles
parent b1aa377f
...@@ -2015,7 +2015,6 @@ ...@@ -2015,7 +2015,6 @@
asc_CStylesPainter.prototype.generateDefaultStyles = function (cellStylesAll, fmgrGraphics, oFont, sr) { asc_CStylesPainter.prototype.generateDefaultStyles = function (cellStylesAll, fmgrGraphics, oFont, sr) {
var cellStyles = cellStylesAll.DefaultStyles; var cellStyles = cellStylesAll.DefaultStyles;
var translateName;
var oCanvas = document.createElement('canvas'); var oCanvas = document.createElement('canvas');
oCanvas.width = this.styleThumbnailWidthWithRetina; oCanvas.width = this.styleThumbnailWidthWithRetina;
oCanvas.height = this.styleThumbnailHeightWithRetina; oCanvas.height = this.styleThumbnailHeightWithRetina;
...@@ -2032,9 +2031,8 @@ ...@@ -2032,9 +2031,8 @@
// ToDo Возможно стоит переписать немного, чтобы не пробегать каждый раз по массиву custom-стилей (нужно генерировать AllStyles) // ToDo Возможно стоит переписать немного, чтобы не пробегать каждый раз по массиву custom-стилей (нужно генерировать AllStyles)
oCustomStyle = cellStylesAll.getCustomStyleByBuiltinId(oStyle.BuiltinId); oCustomStyle = cellStylesAll.getCustomStyleByBuiltinId(oStyle.BuiltinId);
translateName = AscCommon.translateManager.getValue(oStyle.Name); this.drawStyle(oGraphics, sr, oCustomStyle || oStyle, AscCommon.translateManager.getValue(oStyle.Name));
this.drawStyle(oGraphics, sr, oCustomStyle || oStyle, translateName); this.defaultStyles.push(new AscCommon.CStyleImage(oStyle.Name, AscCommon.c_oAscStyleImage.Default,
this.defaultStyles.push(new AscCommon.CStyleImage(translateName, AscCommon.c_oAscStyleImage.Default,
oCanvas.toDataURL("image/png"))); oCanvas.toDataURL("image/png")));
} }
}; };
......
...@@ -7463,7 +7463,6 @@ CStylesPainter.prototype = ...@@ -7463,7 +7463,6 @@ CStylesPainter.prototype =
}, },
GenerateDefaultStyles: function (_api, ds) GenerateDefaultStyles: function (_api, ds)
{ {
var translateName;
var styles = ds; var styles = ds;
// добавили переводы => нельзя кэшировать // добавили переводы => нельзя кэшировать
...@@ -7495,9 +7494,8 @@ CStylesPainter.prototype = ...@@ -7495,9 +7494,8 @@ CStylesPainter.prototype =
var style = styles[i]; var style = styles[i];
if (true == style.qFormat && null === DocumentStyles.Get_StyleIdByName(style.Name, false)) if (true == style.qFormat && null === DocumentStyles.Get_StyleIdByName(style.Name, false))
{ {
translateName = AscCommon.translateManager.getValue(style.Name); this.drawStyle(graphics, style, AscCommon.translateManager.getValue(style.Name));
this.drawStyle(graphics, style, translateName); this.defaultStyles.push(new AscCommon.CStyleImage(style.Name, AscCommon.c_oAscStyleImage.Default,
this.defaultStyles.push(new AscCommon.CStyleImage(translateName, AscCommon.c_oAscStyleImage.Default,
_canvas.toDataURL("image/png"), style.uiPriority)); _canvas.toDataURL("image/png"), style.uiPriority));
} }
} }
...@@ -7505,7 +7503,7 @@ CStylesPainter.prototype = ...@@ -7505,7 +7503,7 @@ CStylesPainter.prototype =
GenerateDocumentStyles: function (_api) GenerateDocumentStyles: function (_api)
{ {
if (_api.WordControl.m_oLogicDocument == null) if (!_api.WordControl.m_oLogicDocument)
{ {
return; return;
} }
...@@ -7513,7 +7511,7 @@ CStylesPainter.prototype = ...@@ -7513,7 +7511,7 @@ CStylesPainter.prototype =
var __Styles = _api.WordControl.m_oLogicDocument.Get_Styles(); var __Styles = _api.WordControl.m_oLogicDocument.Get_Styles();
var styles = __Styles.Style; var styles = __Styles.Style;
if (styles == null) if (!styles)
{ {
return; return;
} }
...@@ -7560,8 +7558,10 @@ CStylesPainter.prototype = ...@@ -7560,8 +7558,10 @@ CStylesPainter.prototype =
_dr_style.Name = style.Name; _dr_style.Name = style.Name;
_dr_style.Id = i; _dr_style.Id = i;
this.drawStyle(graphics, _dr_style, style.Name); this.drawStyle(graphics, _dr_style,
this.docStyles[cur_index] = new AscCommon.CStyleImage(style.Name, AscCommon.c_oAscStyleImage.Document, _canvas.toDataURL("image/png"), style.uiPriority); 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) if (style.Default)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment