diff options
author | Vinaya Mandke <vinaya.mandke@synerzip.com> | 2013-11-07 18:49:10 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-08 09:38:01 +0100 |
commit | e3d3b7bb0c6c8bbe87b3ce4b7c74f2d50fc1a78b (patch) | |
tree | d5f4114dd33aa4777dee5b1278d55692c6b2dd4f | |
parent | 458ff29ac36b4a99b14fab99ddc14090cbbfb199 (diff) |
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
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/testPgMargin.docx | bin | 0 -> 10448 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 6 |
3 files changed, 10 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/testPgMargin.docx b/sw/qa/extras/ooxmlexport/data/testPgMargin.docx Binary files differnew file mode 100644 index 000000000000..aa54f6ad709a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testPgMargin.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index cb379bbd8c32..d431a60d901f 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 ede643bd7c0d..8f1c98054123 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; |