[Libreoffice-commits] .: sw/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Fri Apr 27 05:35:18 PDT 2012


 sw/source/filter/ww8/ww8graf.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit e652ba3c7357e0396498629891a1391ace67c4d7
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Apr 27 14:30:16 2012 +0200

    n#757910 fix WW8 import of textboxes with thin border/inner margin
    
    There were two problems here:
    
    First, nLineThick was already in twips, so converting it again from EMU
    rendered thin borders invisible.
    
    Second, when the border width is set to zero, that means a minimal
    border, but we interpreted it as default width (which resulted in less
    space for the textbox contents than required).

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index b044636..65431a5 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1568,7 +1568,7 @@ sal_Int32 SwWW8ImplReader::MatchSdrBoxIntoFlyBoxItem(const Color& rLineColor,
         SvxBorderLine aLine;
         aLine.SetColor( rLineColor );
 
-        aLine.SetWidth( long ( nLineThick / 65 ) ); // Convert EMUs to Twips
+        aLine.SetWidth( nLineThick ); // No conversion here, nLineThick is already in twips
         aLine.SetStyle( nIdx );
 
         for(sal_uInt16 nLine = 0; nLine < 4; ++nLine)
@@ -1625,7 +1625,8 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
     // Rahmen-GROESSE benoetigt!
     SvxBoxItem aBox(sw::util::ItemGet<SvxBoxItem>(rFlySet, RES_BOX));
     // dashed oder solid wird zu solid
-    sal_Int32 nLineThick = 0, nOutside=0;
+    // WW-default: 0.75 pt = 15 twips
+    sal_Int32 nLineThick = 15, nOutside=0;
 
     // check if LineStyle is *really* set!
     const SfxPoolItem* pItem;
@@ -1640,7 +1641,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
         nLineThick = WW8ITEMVALUE(rOldSet, XATTR_LINEWIDTH, XLineWidthItem);
 
         if( !nLineThick )
-            nLineThick = 15; // WW-default: 0.75 pt
+            nLineThick = 1; // for Writer, zero is "no border", so set a minimal value
 
         nOutside = MatchSdrBoxIntoFlyBoxItem(aLineColor, eLineStyle,
             eDashing, eShapeType, nLineThick, aBox);


More information about the Libreoffice-commits mailing list