[Libreoffice-commits] core.git: sw/source

Pierre-Eric Pelloux-Prayer pierre-eric at lanedo.com
Sun Sep 1 06:46:29 PDT 2013


 sw/source/filter/ww8/docxattributeoutput.cxx |   32 ++++++++++++---------------
 sw/source/filter/ww8/wrtw8sty.cxx            |    3 --
 2 files changed, 16 insertions(+), 19 deletions(-)

New commits:
commit 35657f636580227e364ccf089ef434d3dbeee6ba
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date:   Wed Aug 28 15:28:38 2013 +0200

    docx export: simplify pgBorders handling, and fix pgSz bug
    
    If a document had page borders, pgSz was wrongly exported as a
    child of pgBorders.
    
    Change-Id: Ibd47d3efd387f942274c0162fd0cbc46662348d5
    Reviewed-on: https://gerrit.libreoffice.org/5664
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 2cf7058..342bd75 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3230,10 +3230,22 @@ void DocxAttributeOutput::SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmF
                FSNS( XML_w, XML_offsetFrom ), bExportDistanceFromPageEdge ? "page" : "text",
                FSEND );
 
-        m_pSerializer->mark();
+        OutputBorderOptions aOutputBorderOptions = lcl_getBoxBorderOptions();
+
+        // Check if the distance is larger than 31 points
+        aOutputBorderOptions.bCheckDistanceSize = true;
+
+        // Check if there is a shadow item
+        const SfxPoolItem* pItem = GetExport().HasItem( RES_SHADOW );
+        if ( pItem )
+        {
+            const SvxShadowItem* pShadowItem = (const SvxShadowItem*)pItem;
+            aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation();
+        }
+
+        impl_borders( m_pSerializer, rBox, aOutputBorderOptions, &m_pageMargins );
 
         m_pSerializer->endElementNS( XML_w, XML_pgBorders );
-        m_pSerializer->mark();
     }
 }
 
@@ -5177,21 +5189,7 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox )
         aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation();
     }
 
-
-    if ( m_bOpenedSectPr && GetWritingHeaderFooter() == false)
-    {
-        // Inside a section
-
-        // Check if the distance is larger than 31 points
-        aOutputBorderOptions.bCheckDistanceSize = true;
-
-        impl_borders( m_pSerializer, rBox, aOutputBorderOptions, &m_pageMargins );
-
-        // Special handling for pgBorder
-        m_pSerializer->mergeTopMarks( sax_fastparser::MERGE_MARKS_PREPEND );
-        m_pSerializer->mergeTopMarks( );
-    }
-    else
+    if ( !m_bOpenedSectPr || GetWritingHeaderFooter())
     {
         // Not inside a section
 
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 9f29d91..573e98a 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1664,8 +1664,6 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
 
         const SfxItemSet* pOldI = pISet;
 
-        AttrOutput().SectionPageBorders( pPdFmt, pPdFirstPgFmt );
-
         const SfxPoolItem* pItem;
         if ( titlePage && SFX_ITEM_SET ==
                 pPdFirstPgFmt->GetItemState( RES_PAPER_BIN, true, &pItem ) )
@@ -1700,6 +1698,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
 
         pISet = &pPdFmt->GetAttrSet();
         AttrOutput().OutputStyleItemSet( pPdFmt->GetAttrSet(), true, false );
+        AttrOutput().SectionPageBorders( pPdFmt, pPdFirstPgFmt );
         pISet = pOldI;
 
         // then the rest of the settings from PageDesc


More information about the Libreoffice-commits mailing list