From a31fbb53dba76736b37213b98b64937f05929a67 Mon Sep 17 00:00:00 2001 From: Pallavi Jadhav Date: Thu, 6 Feb 2014 13:58:03 +0530 Subject: [PATCH] fdo#74566:DOCX: Preservation tag for Break to Next Page Issue : 'Break to Next Page' gets converted to 'Page Break Before' in RT. XML diffrenece : - LO exports as in document.xml - The page break is written into wrong paragraph. Implementation : 1] Removed implementation to export . 2] Added a check to write in correct paragraph. 3] Modified code to handle SectionBreak() even if Text node has no string. It is required when DOCX contains a PageBreak with footer. 4] Written Export Unit Test case. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/7891 Change-Id: I237b9c5fdd3083b441f6e81cd8442f458eccf1a0 --- sw/qa/extras/ooxmlexport/data/fdo74566.docx | Bin 0 -> 12675 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 20 +++++++++++++++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 5 +---- sw/source/filter/ww8/wrtww8.hxx | 2 +- sw/source/filter/ww8/ww8atr.cxx | 17 ++++++++-------- 5 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 sw/qa/extras/ooxmlexport/data/fdo74566.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo74566.docx b/sw/qa/extras/ooxmlexport/data/fdo74566.docx new file mode 100644 index 0000000000000000000000000000000000000000..b197b946a4a8fb53ae629d95ff8a74f2466035a0 GIT binary patch literal 12675 zcmeHtWmsI<(r)AK-nhHFLvV-S4#C~sH9>=g;7)LN5AGfa?j*Pdx7(R>=FCiH?sxD1 z?`$4=FP`ptsb0I}tyQHg2LXu*fCj(<002?|9L3wA7Ki*zEgr5;31#IUkLLQaOt72;SiUs-7G4z(u^UL`$|}kWIBitm{2kxY(M;YR{O; zx4TI{^uFXBuLc*FngDrWglH@^#FyW3#@72xoS>8*CyUN+jdL%%-ogO@FE0=P<-d3? zQ9Q8e5@e2wAjd=id9Ig>oTX;oe}`1a%bsM36TNctE4A_3?sW9_+|g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WU$y-djPX@}EXue--@e1mK?q z*Fd8$|I<9+uSmbndHsR)3N)Ylx2dmR#ebc)`9u5x;osuF&ffeA@oQJ}4~ThC)c;L` zKleC)75}x<@`rd3_P@n{>AU=j@N3`U4}=Ds-xc_$F2t`me?7?f0|nFtA_fi8{d%nN ztN5>_<|0mu59fy_Wpg?8@ R03d>X;6RpY%JlQE{{swOWIzA_ literal 0 HcmV?d00001 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 194b7c6d582b..73d3393d8f2d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3641,6 +3641,26 @@ DECLARE_OOXMLEXPORT_TEST(testFooterContainHyperlink,"footer-contain-hyperlink.do // Check the value of Target which is http://www.google.com/. assertXPath(pXmlRels,"/rels:Relationships/rels:Relationship","Target","http://www.google.com/"); } + +DECLARE_OOXMLEXPORT_TEST(testPageBreak,"fdo74566.docx") +{ + /* Break to next page was written into wrong paragraph as . + * LO was not preserving Page Break as . + * Now after fix , LO writes Page Break as the new paragraph and also + * preserves the xml tag . + */ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + + uno::Reference xParagraph2 = getParagraph(2); + uno::Reference xParagraph4 = getParagraph(4); + + getRun(xParagraph2, 1, "First Page Second Line"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:br","type","page"); + getRun(xParagraph4, 1, "Second Page First line after Page Break"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index b27aadc8c433..46258f94593e 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -399,10 +399,7 @@ void DocxAttributeOutput::SectionBreaks(const SwTxtNode& rNode) if ( aNextIndex.GetNode().IsTxtNode() ) { const SwTxtNode* pTxtNode = static_cast< SwTxtNode* >( &aNextIndex.GetNode() ); - // If next node has no string - it is an empty node, so no need to output the section break - - if (!pTxtNode->GetTxt().isEmpty()) - m_rExport.OutputSectionBreaks( pTxtNode->GetpSwAttrSet(), *pTxtNode, m_tableReference->m_bTableCellOpen ); + m_rExport.OutputSectionBreaks( pTxtNode->GetpSwAttrSet(), *pTxtNode, m_tableReference->m_bTableCellOpen, pTxtNode->GetTxt().isEmpty() ); } else if ( aNextIndex.GetNode().IsTableNode() ) { diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 755e36e5217f..fb63531bb2ee 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -699,7 +699,7 @@ public: sal_uLong GetSectionLineNo( const SfxItemSet* pSet, const SwNode& rNd ) const; /// Start new section. - void OutputSectionBreaks( const SfxItemSet *pSet, const SwNode& rNd, bool isCellOpen = false); + void OutputSectionBreaks( const SfxItemSet *pSet, const SwNode& rNd, bool isCellOpen = false, bool isTextNodeEmpty = false); /// Write section properties. /// diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 7f5f64e0359b..7178b96cd16d 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -398,7 +398,7 @@ bool MSWordExportBase::SetAktPageDescFromNode(const SwNode &rNd) // Es duerfen nur Funktionen gerufen werden, die nicht in den // Ausgabebereich pO schreiben, da dieser nur einmal fuer CHP und PAP existiert // und damit im falschen landen wuerden. -void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode& rNd, bool isCellOpen) +void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode& rNd, bool isCellOpen, bool isTextNodeEmpty) { if ( bStyDef || bOutKF || bInWriteEscher || bOutPageDescs ) return; @@ -419,9 +419,11 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode // Even if pAktPageDesc != pPageDesc ,it might be because of the different header & footer types. if (pAktPageDesc != pPageDesc) { - if (isCellOpen && (pAktPageDesc->GetName() != pPageDesc->GetName())) + if ( (isCellOpen && (pAktPageDesc->GetName() != pPageDesc->GetName())) || isTextNodeEmpty ) { - // Table cell is open and page header types are different,so do not output section break. + // Table cell is open and page header types are different,so do not output section break OR + // PageBreak is present but text node has no string - it is an empty node, do not prepare + // new page descriptor i.e. bNewPageDesc should be false. } else { @@ -486,6 +488,8 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode { bNewPageDesc |= SetAktPageDescFromNode( rNd ); } + if( isTextNodeEmpty ) + bNewPageDesc = false; } if ( !bNewPageDesc ) AttrOutput().OutputItem( *pItem ); @@ -3643,10 +3647,6 @@ void AttributeOutputBase::FormatBreak( const SvxFmtBreakItem& rBreak ) // From now on(fix for #i77900#) we prefer to save a page break as // paragraph attribute, this has to be done after the export of the // paragraph ( => !GetExport().bBreakBefore ) - if ( !GetExport().bBreakBefore ) - PageBreakBefore( true ); - break; - case SVX_BREAK_PAGE_AFTER: case SVX_BREAK_PAGE_BOTH: nC = msword::PageBreak; @@ -3663,7 +3663,8 @@ void AttributeOutputBase::FormatBreak( const SvxFmtBreakItem& rBreak ) break; } - if ( ( bBefore == GetExport().bBreakBefore ) && nC ) + if ( (( bBefore != GetExport().bBreakBefore ) && ( nC == msword::PageBreak)) || + (( bBefore == GetExport().bBreakBefore ) && ( nC == msword::ColumnBreak)) ) { // #i76300# bool bFollowPageDescWritten = false;