[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - writerfilter/source

Aron Budea aron.budea at collabora.com
Tue Feb 21 16:31:20 UTC 2017


 writerfilter/source/dmapper/DomainMapper.cxx |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit e75cdbb5d1abda25b4526c719e89e58b06ea8432
Author: Aron Budea <aron.budea at collabora.com>
Date:   Thu Feb 16 19:36:54 2017 +0100

    tdf#106001: Treat CharScaleWidth outliers as 100 in DOCX import
    
    Spec limit is [1..600], sometimes documents contain 0,
    which, similar to other values outside the limit should be
    treated as 100.
    
    Change-Id: I04aec25b638762392de3f9881cd72588f2753e71
    Reviewed-on: https://gerrit.libreoffice.org/34341
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Reviewed-on: https://gerrit.libreoffice.org/34479
    Reviewed-by: Aron Budea <aron.budea at collabora.com>
    Tested-by: Aron Budea <aron.budea at collabora.com>

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 96ef165..c98315f 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1686,8 +1686,17 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
         rContext->Insert(PROP_CHAR_AUTO_KERNING, uno::makeAny( nIntValue != 0 ) );
         break;
     case NS_ooxml::LN_EG_RPrBase_w:
-        rContext->Insert(PROP_CHAR_SCALE_WIDTH,
-                         uno::makeAny( sal_Int16(nIntValue) ));
+        // ST_TextScale must fall between 1% and 600% according to spec, otherwise resets to 100% according to experience
+        if ((1 <= nIntValue) && (nIntValue <= 600))
+        {
+            rContext->Insert(PROP_CHAR_SCALE_WIDTH,
+                             uno::makeAny( sal_Int16(nIntValue) ));
+        }
+        else
+        {
+            rContext->Insert(PROP_CHAR_SCALE_WIDTH,
+                             uno::makeAny( sal_Int16(100) ));
+        }
         break;
     case NS_ooxml::LN_EG_RPrBase_imprint:
         // FontRelief: NONE, EMBOSSED, ENGRAVED


More information about the Libreoffice-commits mailing list