[Libreoffice-commits] .: Branch 'libreoffice-3-4' - 2 commits - sw/source

Noel Power noelp at kemper.freedesktop.org
Mon Jan 30 03:36:25 PST 2012


 sw/source/filter/xml/xmlithlp.cxx |   35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

New commits:
commit fcdf6cde90c7f9f941a5664d4b0866adcfab5db9
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 25 17:56:08 2012 +0100

    fdo#38542: sw: ODF import: prevent border width overriding:
    
    If there is a width in fo:border{,-left,-right,-top,-bottom}, then
    it should not override the values from
    style:border-line-width{,-left,-right,-top,-bottom}, which are more
    specific in case of "double" borders.
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
    Signed-off-by: Noel Power <noel.power at novell.com>

diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 7946b81..6fe9072 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -198,23 +198,28 @@ sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
        sal_Bool bDouble = (bHasWidth && API_LINE_DOUBLE == nStyle ) ||
            rpLine->GetDistance();
 
-       // The width has to be changed
-       if( bHasWidth && USHRT_MAX != nNamedWidth )
+       // fdo#38542: for double borders, do not override the width
+       // set via style:border-line-width{,-left,-right,-top,-bottom}
+       if (!bDouble || !rpLine->GetWidth())
        {
-           if ( bDouble )
-               rpLine->SetStyle( ::editeng::DOUBLE );
-           rpLine->SetWidth( aBorderWidths[nNamedWidth] );
-       }
-       else
-       {
-           if( !bHasWidth )
-               nWidth = rpLine->GetInWidth() + rpLine->GetDistance() +
-                   rpLine->GetOutWidth();
-
-           rpLine->SetWidth( nWidth );
-           if (bDouble)
-           {   // fdo#38542: divide width by 3 for outer line, gap, inner line
-               rpLine->ScaleMetrics(1, 3);
+           // The width has to be changed
+           if (bHasWidth && USHRT_MAX != nNamedWidth)
+           {
+               if (bDouble)
+                   rpLine->SetStyle( ::editeng::DOUBLE );
+               rpLine->SetWidth( aBorderWidths[nNamedWidth] );
+           }
+           else
+           {
+               if (!bHasWidth)
+                   nWidth = rpLine->GetInWidth() + rpLine->GetDistance() +
+                       rpLine->GetOutWidth();
+
+               rpLine->SetWidth( nWidth );
+               if (bDouble)
+               { // fdo#38542: divide width by 3 for outer line, gap, inner line
+                   rpLine->ScaleMetrics(1, 3);
+               }
            }
        }
        lcl_frmitems_setXMLBorderStyle( *rpLine, nStyle );
commit 8e184c376ce77b3c27d7a2722b15b8f36de71ea5
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 25 17:44:36 2012 +0100

    fdo#38542: sw: ODF import: divide width by 3 for "double" borders
    
    The problem is that the width from the fo:border{,-left,-right,-top,-bottom}
    attributes is effectively tripled for "double" borders.
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
    Signed-off-by: Noel Power <noel.power at novell.com>

diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 6a50937..7946b81 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -212,6 +212,10 @@ sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
                    rpLine->GetOutWidth();
 
            rpLine->SetWidth( nWidth );
+           if (bDouble)
+           {   // fdo#38542: divide width by 3 for outer line, gap, inner line
+               rpLine->ScaleMetrics(1, 3);
+           }
        }
        lcl_frmitems_setXMLBorderStyle( *rpLine, nStyle );
    }


More information about the Libreoffice-commits mailing list