Fix Bug 44520

This commit is contained in:
Julia Radzhabova 2020-02-17 16:43:02 +03:00 committed by Alexey Golubev
parent 7ed55b92f0
commit 0a41040bff
15 changed files with 134 additions and 20 deletions

View file

@ -470,6 +470,10 @@ define([
this.getApplication().getController('Common.Controllers.ReviewChanges').commentsShowHide(value ? 'show' : 'hide');
/** coauthoring end **/
value = Common.localStorage.getBool("de-settings-cachemode", true);
Common.Utils.InternalSettings.set("de-settings-cachemode", value);
this.api.asc_setDefaultBlitMode(value);
value = Common.localStorage.getItem("de-settings-fontrender");
Common.Utils.InternalSettings.set("de-settings-fontrender", value);
switch (value) {

View file

@ -164,17 +164,21 @@ define([
return;
}
var value = Common.localStorage.getItem("de-settings-fontrender");
if (value === null)
value = '0';
Common.Utils.InternalSettings.set("de-settings-fontrender", value);
// Initialize api
window["flat_desine"] = true;
this.api = this.getApplication().getController('Viewport').getApi();
if (this.api){
this.api.SetDrawingFreeze(true);
var value = Common.localStorage.getBool("de-settings-cachemode", true);
Common.Utils.InternalSettings.set("de-settings-cachemode", value);
this.api.asc_setDefaultBlitMode(!!value);
value = Common.localStorage.getItem("de-settings-fontrender");
if (value === null)
value = '0';
Common.Utils.InternalSettings.set("de-settings-fontrender", value);
switch (value) {
case '0': this.api.SetFontRenderingMode(3); break;
case '1': this.api.SetFontRenderingMode(1); break;

View file

@ -355,17 +355,26 @@ define([
this.lblCoAuthMode = $markup.findById('#fms-lbl-coauth-mode');
/** coauthoring end **/
var itemsTemplate =
_.template([
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>" <% if (item.value === "custom") { %> style="border-top: 1px solid #e5e5e5;margin-top: 5px;" <% } %> ><a tabindex="-1" type="menuitem" <% if (typeof(item.checked) !== "undefined" && item.checked) { %> class="checked" <% } %> ><%= scope.getDisplayValue(item) %></a></li>',
'<% }); %>'
].join(''));
this.cmbFontRender = new Common.UI.ComboBox({
el : $markup.find('#fms-cmb-font-render'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
itemsTemplate: itemsTemplate,
data : [
{ value: 0, displayValue: this.txtWin },
{ value: 1, displayValue: this.txtMac },
{ value: 2, displayValue: this.txtNative }
{ value: 2, displayValue: this.txtNative },
{ value: 'custom', displayValue: this.txtCacheMode }
]
});
this.cmbFontRender.on('selected', _.bind(this.onFontRenderSelected, this));
this.cmbUnit = new Common.UI.ComboBox({
el : $markup.findById('#fms-cmb-unit'),
@ -445,6 +454,12 @@ define([
value = Common.Utils.InternalSettings.get("de-settings-fontrender");
item = this.cmbFontRender.store.findWhere({value: parseInt(value)});
this.cmbFontRender.setValue(item ? item.get('value') : 0);
this._fontRender = this.cmbFontRender.getValue();
value = Common.Utils.InternalSettings.get("de-settings-cachemode");
item = this.cmbFontRender.store.findWhere({value: 'custom'});
item && value && item.set('checked', !!value);
item && value && this.cmbFontRender.cmpEl.find('#' + item.get('id') + ' a').addClass('checked');
value = Common.Utils.InternalSettings.get("de-settings-unit");
item = this.cmbUnit.store.findWhere({value: value});
@ -476,6 +491,8 @@ define([
}
/** coauthoring end **/
Common.localStorage.setItem("de-settings-fontrender", this.cmbFontRender.getValue());
var item = this.cmbFontRender.store.findWhere({value: 'custom'});
Common.localStorage.setItem("de-settings-cachemode", item && !item.get('checked') ? 0 : 1);
Common.localStorage.setItem("de-settings-unit", this.cmbUnit.getValue());
Common.localStorage.setItem("de-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
if (this.mode.canForcesave)
@ -508,6 +525,16 @@ define([
this.cmbShowChanges.setValue((record.value == 1) ? 'none' : 'last');
},
onFontRenderSelected: function(combo, record) {
if (record.value == 'custom') {
var item = combo.store.findWhere({value: 'custom'});
item && item.set('checked', !record.checked);
combo.cmpEl.find('#' + record.id + ' a').toggleClass('checked', !record.checked);
combo.setValue(this._fontRender);
}
this._fontRender = combo.getValue();
},
strLiveComment: 'Turn on option',
strInputMode: 'Turn on hieroglyphs',
strZoom: 'Default Zoom Value',
@ -547,7 +574,8 @@ define([
strForcesave: 'Always save to server (otherwise save to server on document close)',
strResolvedComment: 'Turn on display of the resolved comments',
textCompatible: 'Compatibility',
textOldVersions: 'Make the files compatible with older MS Word versions when saved as DOCX'
textOldVersions: 'Make the files compatible with older MS Word versions when saved as DOCX',
txtCacheMode: 'Default cache mode'
}, DE.Views.FileMenuPanels.Settings || {}));
DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({

View file

@ -1532,6 +1532,7 @@
"DE.Views.FileMenuPanels.Settings.txtPt": "Point",
"DE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking",
"DE.Views.FileMenuPanels.Settings.txtWin": "as Windows",
"DE.Views.FileMenuPanels.Settings.txtCacheMode": "Default cache mode",
"DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom center",
"DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom left",
"DE.Views.HeaderFooterSettings.textBottomPage": "Bottom of Page",

View file

@ -1532,6 +1532,7 @@
"DE.Views.FileMenuPanels.Settings.txtPt": "Пункт",
"DE.Views.FileMenuPanels.Settings.txtSpellCheck": "Проверка орфографии",
"DE.Views.FileMenuPanels.Settings.txtWin": "как Windows",
"DE.Views.FileMenuPanels.Settings.txtCacheMode": "Режим кэширования по умолчанию",
"DE.Views.HeaderFooterSettings.textBottomCenter": "Снизу по центру",
"DE.Views.HeaderFooterSettings.textBottomLeft": "Снизу слева",
"DE.Views.HeaderFooterSettings.textBottomPage": "Внизу страницы",

View file

@ -310,6 +310,10 @@ define([
}
/** coauthoring end **/
value = Common.localStorage.getBool("pe-settings-cachemode", true);
Common.Utils.InternalSettings.set("pe-settings-cachemode", value);
this.api.asc_setDefaultBlitMode(value);
value = Common.localStorage.getItem("pe-settings-fontrender");
Common.Utils.InternalSettings.set("pe-settings-fontrender", value);
this.api.SetFontRenderingMode(parseInt(value));

View file

@ -152,10 +152,6 @@ define([
return;
}
var value = Common.localStorage.getItem("pe-settings-fontrender");
if (value===null) value = '3';
Common.Utils.InternalSettings.set("pe-settings-fontrender", value);
// Initialize api
window["flat_desine"] = true;
this.api = this.getApplication().getController('Viewport').getApi();
@ -163,6 +159,14 @@ define([
if (this.api){
this.api.SetDrawingFreeze(true);
this.api.SetThemesPath("../../../../sdkjs/slide/themes/");
var value = Common.localStorage.getBool("pe-settings-cachemode", true);
Common.Utils.InternalSettings.set("pe-settings-cachemode", value);
this.api.asc_setDefaultBlitMode(!!value);
value = Common.localStorage.getItem("pe-settings-fontrender");
if (value===null) value = '3';
Common.Utils.InternalSettings.set("pe-settings-fontrender", value);
this.api.SetFontRenderingMode(parseInt(value));
this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this));

View file

@ -298,17 +298,26 @@ define([
labelText: this.strAlignGuides
});
var itemsTemplate =
_.template([
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>" <% if (item.value === "custom") { %> style="border-top: 1px solid #e5e5e5;margin-top: 5px;" <% } %> ><a tabindex="-1" type="menuitem" <% if (typeof(item.checked) !== "undefined" && item.checked) { %> class="checked" <% } %> ><%= scope.getDisplayValue(item) %></a></li>',
'<% }); %>'
].join(''));
this.cmbFontRender = new Common.UI.ComboBox({
el : $markup.findById('#fms-cmb-font-render'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
itemsTemplate: itemsTemplate,
data : [
{ value: Asc.c_oAscFontRenderingModeType.hintingAndSubpixeling, displayValue: this.txtWin },
{ value: Asc.c_oAscFontRenderingModeType.noHinting, displayValue: this.txtMac },
{ value: Asc.c_oAscFontRenderingModeType.hinting, displayValue: this.txtNative }
{ value: Asc.c_oAscFontRenderingModeType.hinting, displayValue: this.txtNative },
{ value: 'custom', displayValue: this.txtCacheMode }
]
});
this.cmbFontRender.on('selected', _.bind(this.onFontRenderSelected, this));
this.cmbUnit = new Common.UI.ComboBox({
el : $markup.findById('#fms-cmb-unit'),
@ -380,6 +389,12 @@ define([
value = Common.Utils.InternalSettings.get("pe-settings-fontrender");
item = this.cmbFontRender.store.findWhere({value: parseInt(value)});
this.cmbFontRender.setValue(item ? item.get('value') : Asc.c_oAscFontRenderingModeType.hintingAndSubpixeling);
this._fontRender = this.cmbFontRender.getValue();
value = Common.Utils.InternalSettings.get("pe-settings-cachemode");
item = this.cmbFontRender.store.findWhere({value: 'custom'});
item && value && item.set('checked', !!value);
item && value && this.cmbFontRender.cmpEl.find('#' + item.get('id') + ' a').addClass('checked');
value = Common.Utils.InternalSettings.get("pe-settings-unit");
item = this.cmbUnit.store.findWhere({value: value});
@ -407,6 +422,8 @@ define([
}
/** coauthoring end **/
Common.localStorage.setItem("pe-settings-fontrender", this.cmbFontRender.getValue());
var item = this.cmbFontRender.store.findWhere({value: 'custom'});
Common.localStorage.setItem("pe-settings-cachemode", item && !item.get('checked') ? 0 : 1);
Common.localStorage.setItem("pe-settings-unit", this.cmbUnit.getValue());
Common.localStorage.setItem("pe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
if (this.mode.canForcesave)
@ -423,6 +440,16 @@ define([
}
},
onFontRenderSelected: function(combo, record) {
if (record.value == 'custom') {
var item = combo.store.findWhere({value: 'custom'});
item && item.set('checked', !record.checked);
combo.cmpEl.find('#' + record.id + ' a').toggleClass('checked', !record.checked);
combo.setValue(this._fontRender);
}
this._fontRender = combo.getValue();
},
strInputMode: 'Turn on hieroglyphs',
strZoom: 'Default Zoom Value',
okButtonText: 'Apply',
@ -456,7 +483,8 @@ define([
textForceSave: 'Save to Server',
strForcesave: 'Always save to server (otherwise save to server on document close)',
txtSpellCheck: 'Spell Checking',
strSpellCheckMode: 'Turn on spell checking option'
strSpellCheckMode: 'Turn on spell checking option',
txtCacheMode: 'Default cache mode'
}, PE.Views.FileMenuPanels.Settings || {}));
PE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({

View file

@ -1234,6 +1234,7 @@
"PE.Views.FileMenuPanels.Settings.txtPt": "Point",
"PE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking",
"PE.Views.FileMenuPanels.Settings.txtWin": "as Windows",
"PE.Views.FileMenuPanels.Settings.txtCacheMode": "Default cache mode",
"PE.Views.HeaderFooterDialog.applyAllText": "Apply to all",
"PE.Views.HeaderFooterDialog.applyText": "Apply",
"PE.Views.HeaderFooterDialog.diffLanguage": "You cant use a date format in a different language than the slide master.<br>To change the master, click 'Apply to all' instead of 'Apply'",

View file

@ -1234,6 +1234,7 @@
"PE.Views.FileMenuPanels.Settings.txtPt": "Пункт",
"PE.Views.FileMenuPanels.Settings.txtSpellCheck": "Проверка орфографии",
"PE.Views.FileMenuPanels.Settings.txtWin": "как Windows",
"PE.Views.FileMenuPanels.Settings.txtCacheMode": "Режим кэширования по умолчанию",
"PE.Views.HeaderFooterDialog.applyAllText": "Применить ко всем",
"PE.Views.HeaderFooterDialog.applyText": "Применить",
"PE.Views.HeaderFooterDialog.diffLanguage": "Формат даты должен использовать тот же язык, что и образец слайдов.<br>Чтобы изменить образец, вместо кнопки 'Применить' нажмите кнопку 'Применить ко всем'",

View file

@ -355,7 +355,11 @@ define([
},
applySettings: function(menu) {
var value = Common.localStorage.getItem("sse-settings-fontrender");
var value = Common.localStorage.getBool("sse-settings-cachemode", true);
Common.Utils.InternalSettings.set("sse-settings-cachemode", value);
this.api.asc_setDefaultBlitMode(value);
value = Common.localStorage.getItem("sse-settings-fontrender");
Common.Utils.InternalSettings.set("sse-settings-fontrender", value);
this.api.asc_setFontRenderingMode(parseInt(value));

View file

@ -154,12 +154,16 @@ define([
// viewport.applicationUI.setVisible(true);
}
var value = Common.localStorage.getItem("sse-settings-fontrender");
if (value===null) value = '3';
Common.Utils.InternalSettings.set("sse-settings-fontrender", value);
// Initialize api
this.api = this.getApplication().getController('Viewport').getApi();
var value = Common.localStorage.getBool("sse-settings-cachemode", true);
Common.Utils.InternalSettings.set("sse-settings-cachemode", value);
this.api.asc_setDefaultBlitMode(!!value);
value = Common.localStorage.getItem("sse-settings-fontrender");
if (value===null) value = '3';
Common.Utils.InternalSettings.set("sse-settings-fontrender", value);
this.api.asc_setFontRenderingMode(parseInt(value));
this.api.asc_registerCallback('asc_onOpenDocumentProgress', _.bind(this.onOpenDocument, this));

View file

@ -686,17 +686,26 @@ define([
]
});
var itemsTemplate =
_.template([
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>" <% if (item.value === "custom") { %> style="border-top: 1px solid #e5e5e5;margin-top: 5px;" <% } %> ><a tabindex="-1" type="menuitem" <% if (typeof(item.checked) !== "undefined" && item.checked) { %> class="checked" <% } %> ><%= scope.getDisplayValue(item) %></a></li>',
'<% }); %>'
].join(''));
this.cmbFontRender = new Common.UI.ComboBox({
el : $markup.findById('#fms-cmb-font-render'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
itemsTemplate: itemsTemplate,
data : [
{ value: Asc.c_oAscFontRenderingModeType.hintingAndSubpixeling, displayValue: this.txtWin },
{ value: Asc.c_oAscFontRenderingModeType.noHinting, displayValue: this.txtMac },
{ value: Asc.c_oAscFontRenderingModeType.hinting, displayValue: this.txtNative }
{ value: Asc.c_oAscFontRenderingModeType.hinting, displayValue: this.txtNative },
{ value: 'custom', displayValue: this.txtCacheMode }
]
});
this.cmbFontRender.on('selected', _.bind(this.onFontRenderSelected, this));
this.chAutosave = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-autosave'),
@ -894,6 +903,12 @@ define([
value = Common.Utils.InternalSettings.get("sse-settings-fontrender");
item = this.cmbFontRender.store.findWhere({value: parseInt(value)});
this.cmbFontRender.setValue(item ? item.get('value') : Asc.c_oAscFontRenderingModeType.hintingAndSubpixeling);
this._fontRender = this.cmbFontRender.getValue();
value = Common.Utils.InternalSettings.get("sse-settings-cachemode");
item = this.cmbFontRender.store.findWhere({value: 'custom'});
item && value && item.set('checked', !!value);
item && value && this.cmbFontRender.cmpEl.find('#' + item.get('id') + ' a').addClass('checked');
value = Common.Utils.InternalSettings.get("sse-settings-unit");
item = this.cmbUnit.store.findWhere({value: value});
@ -959,6 +974,8 @@ define([
/** coauthoring end **/
Common.localStorage.setItem("sse-settings-r1c1", this.chR1C1Style.isChecked() ? 1 : 0);
Common.localStorage.setItem("sse-settings-fontrender", this.cmbFontRender.getValue());
var item = this.cmbFontRender.store.findWhere({value: 'custom'});
Common.localStorage.setItem("sse-settings-cachemode", item && !item.get('checked') ? 0 : 1);
Common.localStorage.setItem("sse-settings-unit", this.cmbUnit.getValue());
Common.localStorage.setItem("sse-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
if (this.mode.canForcesave)
@ -1018,6 +1035,16 @@ define([
$('#fms-lbl-func-locale').text(_.isEmpty(text) ? '' : this.strRegSettingsEx + text);
},
onFontRenderSelected: function(combo, record) {
if (record.value == 'custom') {
var item = combo.store.findWhere({value: 'custom'});
item && item.set('checked', !record.checked);
combo.cmpEl.find('#' + record.id + ' a').toggleClass('checked', !record.checked);
combo.setValue(this._fontRender);
}
this._fontRender = combo.getValue();
},
strLiveComment: 'Turn on option',
strZoom: 'Default Zoom Value',
okButtonText: 'Apply',
@ -1067,7 +1094,8 @@ define([
strSeparator: 'Separator',
strUseSeparatorsBasedOnRegionalSettings: 'Use separators based on regional settings',
strDecimalSeparator: 'Decimal separator',
strThousandsSeparator: 'Thousands separator'
strThousandsSeparator: 'Thousands separator',
txtCacheMode: 'Default cache mode'
}, SSE.Views.FileMenuPanels.MainSettingsGeneral || {}));
SSE.Views.FileMenuPanels.MainSpellCheckSettings = Common.UI.BaseView.extend(_.extend({

View file

@ -1600,6 +1600,7 @@
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPt": "Point",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtRu": "Russian",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWin": "as Windows",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtCacheMode": "Default cache mode",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.okButtonText": "Apply",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.strDictionaryLanguage": "Dictionary language",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.strIgnoreWordsInUPPERCASE": "Ignore words in UPPERCASE",

View file

@ -1600,6 +1600,7 @@
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPt": "Пункт",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtRu": "Русский",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWin": "как Windows",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtCacheMode": "Режим кэширования по умолчанию",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.okButtonText": "Применить",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.strDictionaryLanguage": "Язык словаря",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.strIgnoreWordsInUPPERCASE": "Пропускать слова из ПРОПИСНЫХ БУКВ",