From dabc31a8c71f7dce2d198af18e63e4433174fcb5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 2 Nov 2020 19:14:32 +0300 Subject: [PATCH] Fix Bug 47163 --- .../documenteditor/mobile/app/controller/edit/EditText.js | 8 ++++---- .../mobile/app/controller/edit/EditText.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/edit/EditText.js b/apps/documenteditor/mobile/app/controller/edit/EditText.js index aa1c9bd8f..08f0ba0af 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditText.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditText.js @@ -132,8 +132,8 @@ define([ _paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small'); _paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all'); - _fontInfo.letterSpacing = Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); - $('#letter-spacing .item-after label').text(_fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); + _fontInfo.letterSpacing = (_paragraphObject.get_TextSpacing()===null || _paragraphObject.get_TextSpacing()===undefined) ? _paragraphObject.get_TextSpacing() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); + $('#letter-spacing .item-after label').text((_fontInfo.letterSpacing===null || _fontInfo.letterSpacing===undefined) ? '' : _fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); } }, @@ -327,9 +327,9 @@ define([ spacing = _fontInfo.letterSpacing; if ($button.hasClass('decrement')) { - spacing = Math.max(-100, --spacing); + spacing = (spacing===null || spacing===undefined) ? 0 : Math.max(-100, --spacing); } else { - spacing = Math.min(100, ++spacing); + spacing = (spacing===null || spacing===undefined) ? 0 : Math.min(100, ++spacing); } _fontInfo.letterSpacing = spacing; diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditText.js b/apps/presentationeditor/mobile/app/controller/edit/EditText.js index 9f66c7b0b..6e85dd2b7 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditText.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditText.js @@ -146,8 +146,8 @@ define([ _paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small'); _paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all'); - _fontInfo.letterSpacing = Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); - $('#letter-spacing .item-after label').text(_fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); + _fontInfo.letterSpacing = (_paragraphObject.get_TextSpacing()===null || _paragraphObject.get_TextSpacing()===undefined) ? _paragraphObject.get_TextSpacing() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); + $('#letter-spacing .item-after label').text((_fontInfo.letterSpacing===null || _fontInfo.letterSpacing===undefined) ? '' : _fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); } _paragraphInfo.spaceBefore = _paragraphObject.get_Spacing().get_Before() < 0 ? _paragraphObject.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_Before()); @@ -304,9 +304,9 @@ define([ spacing = _fontInfo.letterSpacing; if ($button.hasClass('decrement')) { - spacing = Math.max(-100, --spacing); + spacing = (spacing===null || spacing===undefined) ? 0 : Math.max(-100, --spacing); } else { - spacing = Math.min(100, ++spacing); + spacing = (spacing===null || spacing===undefined) ? 0 : Math.min(100, ++spacing); } _fontInfo.letterSpacing = spacing;