summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Bende <tushar.bende@synerzip.com>2013-11-26 16:38:31 +0530
committerMichael Stahl <mstahl@redhat.com>2014-03-10 21:25:32 +0100
commit1b2cf579105d8a1e44b5e2a8aafb79c274fc8455 (patch)
tree2917278fe8357218862c2e739d9bb288174a0f88
parent4f53e684ab1d44f67b544f5dc3c30e148a82007e (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 Reviewed-on: https://gerrit.libreoffice.org/6813 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> This fixes crash on export to DOCX too for the bugdoc on rhbz#1074205 (cherry picked from commit 9a37ce189881f12d678fdb054219b13c3e4c7e40) Signed-off-by: Miklos Vajna <vmiklos@collabora.co.uk> Change-Id: I0700c735545614730d26be187d9047fd20ebf134
-rw-r--r--sw/qa/extras/ooxmlexport/data/1_page.docxbin0 -> 20552 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx12
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx2
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
new file mode 100644
index 000000000000..9b8638dd3fda
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/1_page.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 88e681105db8..b8b104b5f540 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2030,6 +2030,18 @@ DECLARE_OOXMLEXPORT_TEST(testFileOpenInputOutputError,"floatingtbl_with_formula.
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal");
}
+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 2716a79b3431..7530668a0926 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2511,7 +2511,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;