summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-11-21 09:09:48 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-11-21 11:16:42 +0100
commitf63ecb5cd6d60fd8f2c096b4dbf04511590c1870 (patch)
tree638151837d595329db509dd6791aa1eba20e6215 /sw/qa
parentb3f766154c0fbf2fbddd815c969e3f24925cf31e (diff)
RTF import: add even section break testcase
lcov points out this was not covered so far. Change-Id: I11ff9eb8a819268382e6564be873403c47ec2176 Reviewed-on: https://gerrit.libreoffice.org/45018 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfimport/data/sbkeven.rtf10
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx12
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/sbkeven.rtf b/sw/qa/extras/rtfimport/data/sbkeven.rtf
new file mode 100644
index 000000000000..2ac0c8147f63
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/sbkeven.rtf
@@ -0,0 +1,10 @@
+{\rtf1
+\pard\plain
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid12023156 Page 1\sect }
+\sectd \ltrsect
+\sbkeven\linex0\endnhere\sectlinegrid360\sectdefaultcl\sectrsid12023156\sftnbj \pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12023156 \rtlch\fcs1
+\af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid12023156 Page 2\sect Page 4}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid14181417
+\par }
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 14af78e2f5dd..d3157b96c92b 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -469,6 +469,18 @@ DECLARE_RTFIMPORT_TEST(testSbkodd, "sbkodd.rtf")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(3), xCursor->getPage());
}
+DECLARE_RTFIMPORT_TEST(testSbkeven, "sbkeven.rtf")
+{
+ 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);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), xCursor->getPage());
+ xCursor->jumpToNextPage();
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), xCursor->getPage());
+ xCursor->jumpToNextPage();
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(4), xCursor->getPage());
+}
+
DECLARE_RTFIMPORT_TEST(testPoshPosv, "posh-posv.rtf")
{
CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(getShape(1), "HoriOrient"));