Merge pull request #941 from ONLYOFFICE/feature/bug-fixes
Feature/bug fixes
This commit is contained in:
commit
164e2c7815
|
@ -134,11 +134,11 @@ class EditTextController extends Component {
|
|||
let size = curSize;
|
||||
|
||||
if (isDecrement) {
|
||||
typeof size === 'undefined' ? api.FontSizeOut() : size = Math.max(1, --size);
|
||||
typeof size === 'undefined' || size == '' ? api.FontSizeOut() : size = Math.max(1, --size);
|
||||
} else {
|
||||
typeof size === 'undefined' ? api.FontSizeIn : size = Math.min(300, ++size);
|
||||
typeof size === 'undefined' || size == '' ? api.FontSizeIn() : size = Math.min(300, ++size);
|
||||
}
|
||||
if (typeof size !== 'undefined') {
|
||||
if (typeof size !== 'undefined' || size == '') {
|
||||
api.put_TextPrFontSize(size);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ const EditText = props => {
|
|||
const fontName = storeTextSettings.fontName || _t.textFonts;
|
||||
const fontSize = storeTextSettings.fontSize;
|
||||
const fontColor = storeTextSettings.textColor;
|
||||
const displaySize = typeof fontSize === 'undefined' ? _t.textAuto : fontSize + ' ' + _t.textPt;
|
||||
const displaySize = typeof fontSize === 'undefined' || fontSize == '' ? _t.textAuto : fontSize + ' ' + _t.textPt;
|
||||
const isBold = storeTextSettings.isBold;
|
||||
const isItalic = storeTextSettings.isItalic;
|
||||
const isUnderline = storeTextSettings.isUnderline;
|
||||
|
@ -173,7 +173,7 @@ const PageFonts = props => {
|
|||
const _t = t('View.Edit', {returnObjects: true});
|
||||
const storeTextSettings = props.storeTextSettings;
|
||||
const size = storeTextSettings.fontSize;
|
||||
const displaySize = typeof size === 'undefined' ? _t.textAuto : size + ' ' + _t.textPt;
|
||||
const displaySize = typeof size === 'undefined' || size == '' ? _t.textAuto : size + ' ' + _t.textPt;
|
||||
const curFontName = storeTextSettings.fontName;
|
||||
const fonts = storeTextSettings.fontsArray;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ import React, { Component } from "react";
|
|||
import { ApplicationSettings } from "../../view/settings/ApplicationSettings";
|
||||
import {observer, inject} from "mobx-react";
|
||||
import { LocalStorage } from '../../../../../common/mobile/utils/LocalStorage';
|
||||
import {FunctionGroups} from '../../controller/add/AddFunction';
|
||||
|
||||
class ApplicationSettingsController extends Component {
|
||||
constructor(props) {
|
||||
|
@ -16,11 +17,9 @@ class ApplicationSettingsController extends Component {
|
|||
}
|
||||
|
||||
initRegSettings() {
|
||||
this.props.storeApplicationSettings.getRegCode();
|
||||
|
||||
const info = new Asc.asc_CFormatCellsInfo();
|
||||
const api = Common.EditorApi.get();
|
||||
const regCode = this.props.storeApplicationSettings.regCode;
|
||||
const regCode = this.props.storeApplicationSettings.getRegCode();
|
||||
|
||||
info.asc_setType(Asc.c_oAscNumFormatType.None);
|
||||
info.asc_setSymbol(regCode);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {makeObservable, action, observable} from 'mobx';
|
||||
import { LocalStorage } from '../../../../common/mobile/utils/LocalStorage';
|
||||
|
||||
export class storeApplicationSettings {
|
||||
constructor() {
|
||||
|
@ -27,7 +28,7 @@ export class storeApplicationSettings {
|
|||
|
||||
unitMeasurement = Common.Utils.Metric.getCurrentMetric();
|
||||
macrosMode = 0;
|
||||
formulaLang = Common.Locale.currentLang || dataLang[0].value;
|
||||
formulaLang = LocalStorage.getItem('sse-settings-func-lang') || dataLang[0].value;
|
||||
regCode = undefined;
|
||||
regExample = '';
|
||||
regData = [];
|
||||
|
@ -70,7 +71,7 @@ export class storeApplicationSettings {
|
|||
|
||||
getRegCode() {
|
||||
const regData = this.regData;
|
||||
let value = Number(Common.localStorage.getItem('sse-settings-regional'));
|
||||
let value = Number(LocalStorage.getItem('sse-settings-regional'));
|
||||
|
||||
regData.forEach(obj => {
|
||||
if(obj.code === value) {
|
||||
|
@ -81,6 +82,8 @@ export class storeApplicationSettings {
|
|||
if(!this.regCode) {
|
||||
this.regCode = 0x0409;
|
||||
}
|
||||
|
||||
return this.regCode;
|
||||
}
|
||||
|
||||
changeRegCode(value) {
|
||||
|
|
|
@ -16,6 +16,7 @@ export class storeTextSettings {
|
|||
paragraphValign: observable,
|
||||
textIn: observable,
|
||||
initTextSettings: action,
|
||||
initFontSettings: action,
|
||||
initEditorFonts: action,
|
||||
initFontInfo: action,
|
||||
changeTextColor: action,
|
||||
|
@ -46,6 +47,10 @@ export class storeTextSettings {
|
|||
default: this.textIn = 0;
|
||||
}
|
||||
|
||||
this.initFontSettings(xfs);
|
||||
}
|
||||
|
||||
initFontSettings(xfs) {
|
||||
this.fontName = xfs.asc_getFontName();
|
||||
this.fontSize = xfs.asc_getFontSize();
|
||||
|
||||
|
|
Loading…
Reference in a new issue