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

Luboš Luňák l.lunak at collabora.com
Wed Mar 12 06:21:35 PDT 2014


 writerfilter/source/dmapper/ConversionHelper.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 63295d1498877549d54e31abb75b74aec76a8b64
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Wed Mar 12 13:45:36 2014 +0100

    ignore large twips values like MSO does (cp#1000043)
    
    Conflicts:
    	writerfilter/source/dmapper/ConversionHelper.cxx
    
    Change-Id: Ib304245b6ae64c15cfb6c999580f73e5e228c440

diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index bb1f204..3ce0133 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -40,8 +40,6 @@ const sal_Int16  API_LINE_SOLID    = 0;
 const sal_Int16  API_LINE_DOTTED   = 1;
 const sal_Int16  API_LINE_DASHED   = 2;
 
-#define TWIP_TO_MM100(TWIP)     ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
-
 sal_Int32 MakeBorderLine( sal_Int32 nSprmValue, table::BorderLine2& rToFill )
 {
     //TODO: Lines are always solid
@@ -235,6 +233,11 @@ OUString ConvertMSFormatStringToSO(
 
 sal_Int32 convertTwipToMM100(sal_Int32 _t)
 {
+    // It appears that MSO handles large twip values specially, probably legacy 16bit handling,
+    // anything that's bigger than 32767 appears to be simply ignored.
+    if( _t >= 0x8000 )
+        return 0;
+#define TWIP_TO_MM100(TWIP)     ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
     return TWIP_TO_MM100( _t );
 }
 


More information about the Libreoffice-commits mailing list