diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-02 11:16:30 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-03 16:41:59 +0200 |
commit | a3daf52dd21ae03a8b04e1f9132a6713c9cc414f (patch) | |
tree | 3da8eac339f92e9a22feb1449db9115e6bf02413 /oox | |
parent | 387a9c445793e8377f85e508d935dc070fd8ab74 (diff) |
Base scale on 1.0, not on 100.0
Simplifies things by avoiding many repeated multiplications / divisions
by 100 during calculations.
Change-Id: Ib063d343549139c8d83e5b06570dc61f39ea0df6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165666
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/textbodypropertiescontext.cxx | 4 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 598bee8daa4e..15adc15658d3 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -240,8 +240,8 @@ ContextHandlerRef TextBodyPropertiesContext::onCreateContext( sal_Int32 aElement mrTextBodyProp.maPropertyMap.setProperty(PROP_TextAutoGrowHeight, false); mrTextBodyProp.mnFontScale = rAttribs.getInteger(XML_fontScale, 100000); mrTextBodyProp.mnSpacingScale = rAttribs.getInteger(XML_lnSpcReduction, 100000); - mrTextBodyProp.maPropertyMap.setProperty(PROP_TextFitToSizeFontScale, double(mrTextBodyProp.mnFontScale) / 1000.0); - mrTextBodyProp.maPropertyMap.setProperty(PROP_TextFitToSizeSpacingScale, 100.0 - double(mrTextBodyProp.mnSpacingScale) / 1000.0); + mrTextBodyProp.maPropertyMap.setProperty(PROP_TextFitToSizeFontScale, mrTextBodyProp.mnFontScale / 100000.0); + mrTextBodyProp.maPropertyMap.setProperty(PROP_TextFitToSizeSpacingScale, 1.0 - mrTextBodyProp.mnSpacingScale / 100000.0); break; } case A_TOKEN( spAutoFit ): diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 450d374b3b89..92aa84438e62 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -4271,8 +4271,8 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo SdrTextObj* pTextObject = DynCastSdrTextObj(pTextShape->GetSdrObject()); if (pTextObject) { - nFontScale = sal_Int32(pTextObject->GetFontScale() * 1000.0); - nSpacingReduction = sal_Int32((100.0 - pTextObject->GetSpacingScale()) * 1000.0); + nFontScale = sal_Int32(pTextObject->GetFontScale() * 100000.0); + nSpacingReduction = sal_Int32((1.0 - pTextObject->GetSpacingScale()) * 100000.0); } } |