summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-04-21 19:10:37 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-04-22 07:25:39 +0000
commitc04cf57bdb99f9aa961a739f5ab62e3ece83449f (patch)
tree963a8a0c2b53d40a7cca7c4ce848f87e6e15325d /sw
parentac66504fb119bfbbac3076d6e2fe875ec2e2ff89 (diff)
handle properly page breaks even if a page contains only a frame (fdo#55381)
The test document has 4 pages which only contain frames, first 3 pages (sections) have <p> block with <framePr> and another <p> with just <sectPr>, and the second paragraph would be removed, thus there would be no nodes on which to actually set the page style and they would be set on nodes for the previous page, overwriting its page style. The last page does not have its own <p> at all, so it needs to be faked. The changes in finishParagraph() are because of e.g. the comments-nested.odt sw test, which there causes exception because of unknown property ParaStyleName (comments do not use those it seems) and the code is skipped over (which is probably a bug on its own, but it's unrelated to this change otherwise). Change-Id: I9d37f992407a9b649c710d2a031ec4447fb11771 Reviewed-on: https://gerrit.libreoffice.org/9115 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/fdo55381.docxbin0 -> 4710 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx9
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo55381.docx b/sw/qa/extras/ooxmlimport/data/fdo55381.docx
new file mode 100644
index 000000000000..ffeae1f874eb
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/fdo55381.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 1c8665b7a480..6c2f3a725bca 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1645,6 +1645,15 @@ DECLARE_OOXMLIMPORT_TEST(testStrictLockedcanvas, "strict-lockedcanvas.docx")
getShape(1);
}
+DECLARE_OOXMLIMPORT_TEST(testFdo55381, "fdo55381.docx")
+{
+ 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(4), xCursor->getPage());
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();