sw/qa/extras/ooxmlexport/data/1_page.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 12 ++++++++++++ sw/source/filter/ww8/wrtww8.cxx | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-)
New commits: commit 9a37ce189881f12d678fdb054219b13c3e4c7e40 Author: Tushar Bende <tushar.be...@synerzip.com> Date: Tue Nov 26 16:38:31 2013 +0530 fdo#71784: Invalid Sections getting added to the document after RT Description: There was a problem for some documents, during export Invalid sectPr were getting added. The root cause was faulty calculation of PageDesc value. This was the reason for increasing number of pages in RT doc. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I0700c735545614730d26be187d9047fd20ebf134 Reviewed-on: https://gerrit.libreoffice.org/6813 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/extras/ooxmlexport/data/1_page.docx b/sw/qa/extras/ooxmlexport/data/1_page.docx new file mode 100644 index 0000000..9b8638d Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/1_page.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index c4d6e44..aea310f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2072,6 +2072,18 @@ DECLARE_OOXMLEXPORT_TEST(testcantSplit, "2_table_doc.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:cantSplit","val","true"); } +DECLARE_OOXMLEXPORT_TEST(testExtraSectionBreak, "1_page.docx") +{ + // There was a problem for some documents during export.Invalid sectPr getting added + // because of faulty calculation of PageDesc value + // This was the reason for increasing number of pages after RT + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage()); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 1a4e658..6fca2d93 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2510,7 +2510,7 @@ void MSWordExportBase::WriteText() { SwCntntNode* pCNd = (SwCntntNode*)pNd; - const SwPageDesc* pTemp = pCNd->GetSwAttrSet().GetPageDesc().GetPageDesc(); + const SwPageDesc* pTemp = pNd->FindPageDesc(sal_False); if ( pTemp ) pAktPageDesc = pTemp;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits