[Libreoffice-commits] .: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 29 09:47:49 PDT 2012


 sw/source/filter/ww8/docxattributeoutput.cxx |   41 ++++++++++++---------------
 1 file changed, 19 insertions(+), 22 deletions(-)

New commits:
commit 78a5ce35db4cc762bbbc68e39dba1f73367ec520
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date:   Thu Oct 25 14:47:30 2012 +0200

    docx export: explicitely use 'none' type for disabled cell borders
    
    Otherwise, the table default borders will be used.
    
    Change-Id: Iebab1204dc40f79e10164e4815bbdbbe054ef144
    Reviewed-on: https://gerrit.libreoffice.org/909
    Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
    Tested-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5ccf51d..5a91c43 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1349,7 +1349,7 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
     //      thickThinMediumGap, thickThinLargeGap, thickThinSmallGap
     //      thinThickLargeGap, thinThickMediumGap, thinThickSmallGap
     const char* pVal = "none";
-    if ( !pBorderLine->isEmpty( ) )
+    if ( pBorderLine && !pBorderLine->isEmpty( ) )
     {
         switch (pBorderLine->GetBorderLineStyle())
         {
@@ -1403,7 +1403,7 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
 
     pAttr->add( FSNS( XML_w, XML_val ), OString( pVal ) );
 
-    if ( !pBorderLine->isEmpty() )
+    if ( pBorderLine && !pBorderLine->isEmpty() )
     {
         // Compute the sz attribute
 
@@ -1452,32 +1452,29 @@ static void impl_pageBorders( FSHelperPtr pSerializer, const SvxBoxItem& rBox, s
     for( int i = 0; i < 4; ++i, ++pBrd )
     {
         const SvxBorderLine* pLn = rBox.GetLine( *pBrd );
-        if ( pLn )
+        if ( pDefaultBorders && pLn )
         {
-            if ( pDefaultBorders )
-            {
-                const SvxBorderLine* pRefLn = pDefaultBorders->GetLine( *pBrd );
+            const SvxBorderLine* pRefLn = pDefaultBorders->GetLine( *pBrd );
 
-                // If border is equal to default border: do not output
-                if ( pRefLn && *pLn == *pRefLn) {
-                    continue;
-                }
+            // If border is equal to default border: do not output
+            if ( pRefLn && *pLn == *pRefLn) {
+                continue;
             }
+        }
 
-            if (!tagWritten && bWriteTag) {
-                pSerializer->startElementNS( XML_w, tag, FSEND );
-                tagWritten = true;
-            }
+        if (!tagWritten && bWriteTag) {
+            pSerializer->startElementNS( XML_w, tag, FSEND );
+            tagWritten = true;
+        }
 
-            impl_borderLine( pSerializer, aXmlElements[i], pLn, 0 );
+        impl_borderLine( pSerializer, aXmlElements[i], pLn, 0 );
 
-            // When exporting default borders, we need to export these 2 attr
-            if ( pDefaultBorders == 0 ) {
-                if ( i == 2 )
-                    impl_borderLine( pSerializer, XML_insideH, pLn, 0 );
-                else if ( i == 3 )
-                    impl_borderLine( pSerializer, XML_insideV, pLn, 0 );
-            }
+        // When exporting default borders, we need to export these 2 attr
+        if ( pDefaultBorders == 0 ) {
+            if ( i == 2 )
+                impl_borderLine( pSerializer, XML_insideH, pLn, 0 );
+            else if ( i == 3 )
+                impl_borderLine( pSerializer, XML_insideV, pLn, 0 );
         }
     }
     if (tagWritten && bWriteTag) {


More information about the Libreoffice-commits mailing list