From 9a37ce189881f12d678fdb054219b13c3e4c7e40 Mon Sep 17 00:00:00 2001 From: Tushar Bende Date: Tue, 26 Nov 2013 16:38:31 +0530 Subject: fdo#71784: Invalid Sections getting added to the document after RT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Caolán McNamara --- sw/qa/extras/ooxmlexport/data/1_page.docx | Bin 0 -> 20552 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/1_page.docx (limited to 'sw/qa') 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 000000000000..9b8638dd3fda 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 c4d6e44e304c..aea310f8ba63 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 xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage()); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit