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

Vinaya Mandke vinaya.mandke at synerzip.com
Fri Nov 8 00:38:23 PST 2013


 sw/qa/extras/ooxmlexport/data/testPgMargin.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx        |    6 ++++++
 sw/source/filter/ww8/wrtw8sty.cxx               |    6 ++++--
 3 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit e3d3b7bb0c6c8bbe87b3ce4b7c74f2d50fc1a78b
Author: Vinaya Mandke <vinaya.mandke at synerzip.com>
Date:   Thu Nov 7 18:49:10 2013 +0530

    Fix for multipe occurrences of attibute in <w:pgMar>
    
    After round trip multiple occurrences of w:left,  w:right etc
    were exported.
    Also added UT for the test file.
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    
    Change-Id: I6a503cf609f627b8f8eb9d33691e51582c15b459
    Reviewed-on: https://gerrit.libreoffice.org/6608

diff --git a/sw/qa/extras/ooxmlexport/data/testPgMargin.docx b/sw/qa/extras/ooxmlexport/data/testPgMargin.docx
new file mode 100644
index 0000000..aa54f6a
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/testPgMargin.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index cb379bb..d431a60 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1568,6 +1568,12 @@ DECLARE_OOXML_TEST(testFdo70812, "fdo70812.docx")
     getParagraph(1, "Sample pages document.");
 }
 
+DECLARE_OOXML_TEST(testPgMargin, "testPgMargin.docx")
+{
+    xmlDocPtr pXmlDoc = parseExport();
+    assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar", "left", "1440");
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index ede643b..8f1c980 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1642,7 +1642,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
         2 New page, 3 Even page, 4 Odd page
         */
     sal_uInt8 nBreakCode = 2;            // default neue Seite beginnen
-    bool bOutPgDscSet = true, bLeftRightPgChain = false;
+    bool bOutPgDscSet = true, bLeftRightPgChain = false, bOutputStyleItemSet = false;
     const SwFrmFmt* pPdFmt = &pPd->GetMaster();
     if ( rSepInfo.pSectionFmt )
     {
@@ -1703,6 +1703,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
             // Switch off test on default item values, if page description
             // set (value of <bOutPgDscSet>) isn't written.
             AttrOutput().OutputStyleItemSet( aSet, true, bOutPgDscSet );
+            bOutputStyleItemSet = true;
 
             //Cannot export as normal page framedir, as continous sections
             //cannot contain any grid settings like proper sections
@@ -1789,7 +1790,8 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
         }
 
         pISet = &pPdFmt->GetAttrSet();
-        AttrOutput().OutputStyleItemSet( pPdFmt->GetAttrSet(), true, false );
+        if (!bOutputStyleItemSet)
+            AttrOutput().OutputStyleItemSet( pPdFmt->GetAttrSet(), true, false );
         AttrOutput().SectionPageBorders( pPdFmt, pPdFirstPgFmt );
         pISet = pOldI;
 


More information about the Libreoffice-commits mailing list