diff options
author | Tushar Bende <tushar.bende@synerzip.com> | 2013-11-26 16:38:31 +0530 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-06 05:25:44 -0600 |
commit | 9a37ce189881f12d678fdb054219b13c3e4c7e40 (patch) | |
tree | 0ff42c081ad2676d418db6e6bea2705f6ff7599a | |
parent | 0336363993c6355598c7c4d0e1d7ac05e25f2de9 (diff) |
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 <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/1_page.docx | bin | 0 -> 20552 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/1_page.docx b/sw/qa/extras/ooxmlexport/data/1_page.docx Binary files differnew file mode 100644 index 000000000000..9b8638dd3fda --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/1_page.docx 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<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 1a4e65841d7a..6fca2d93c431 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; |