summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-07-04 21:39:37 +0300
committerAndras Timar <andras.timar@collabora.com>2016-10-10 19:02:57 +0200
commit9fae9fd2e156dc1c2790dd402787e62d94b96d6e (patch)
tree0762a7cfdc189d1e4cbbc55a0b62e5c33173d80c /sw/qa/extras
parent4b2370b41b2e93979979be7f4d0b248174730982 (diff)
tdf#64372 docx import: don't ignore continuous section break
If the previous break was also a continuous section break, this break was simply ignored ever since commit 1fdd61db155cf63d5dd55cc2bfb45af33796e131. Thus, the default handler took over and assigned PROP_PAGE_DESC if there was some kind of page style known (either the first page/Standard defaults or any "converted" styles that had been created) which effectively became a new page break. Reviewed-on: https://gerrit.libreoffice.org/26567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit a60b2f7c227709d27d6294558fd396557a9ffd20) Change-Id: I839570b0330ba274552cc671014e997c42765f4b
Diffstat (limited to 'sw/qa/extras')
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/tdf64372_continuousBreaks.docxbin0 -> 11735 bytes
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/tdf92724_continuousBreaksComplex.docxbin0 -> 26913 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx10
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx7
4 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf64372_continuousBreaks.docx b/sw/qa/extras/ooxmlexport/data/tdf64372_continuousBreaks.docx
new file mode 100755
index 000000000000..20ad82bb5115
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf64372_continuousBreaks.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf92724_continuousBreaksComplex.docx b/sw/qa/extras/ooxmlexport/data/tdf92724_continuousBreaksComplex.docx
new file mode 100755
index 000000000000..808d05697bd0
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf92724_continuousBreaksComplex.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 9751b2a9c784..5dc2f6859f57 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -959,6 +959,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf96750_landscapeFollow, "tdf96750_landscapeFollow
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle, "IsLandscape"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf64372_continuousBreaks,"tdf64372_continuousBreaks.docx")
+{
+ //There are no page breaks, so everything should be on the first page.
+ 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());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf81345_045Original,"tdf81345.docx")
{
//Header wasn't replaced and columns were missing because no new style was created.
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index a9c346e217d0..281ae83f6da9 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -994,6 +994,13 @@ DECLARE_OOXMLIMPORT_TEST(testN780843, "n780843.docx")
uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(aStyleName), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xFooter = getProperty< uno::Reference<text::XTextRange> >(xPageStyle, "FooterText");
CPPUNIT_ASSERT_EQUAL(OUString("shown footer"), xFooter->getString());
+
+ //tdf64372 this document should only have one page break (2 pages, not 3)
+ 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(2), xCursor->getPage());
}
DECLARE_OOXMLIMPORT_TEST(testShadow, "imgshadow.docx")