From f63ecb5cd6d60fd8f2c096b4dbf04511590c1870 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 21 Nov 2017 09:09:48 +0100 Subject: 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 Tested-by: Jenkins --- sw/qa/extras/rtfimport/data/sbkeven.rtf | 10 ++++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 12 ++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 sw/qa/extras/rtfimport/data/sbkeven.rtf (limited to 'sw/qa') 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(3), xCursor->getPage()); } +DECLARE_RTFIMPORT_TEST(testSbkeven, "sbkeven.rtf") +{ + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast(1), xCursor->getPage()); + xCursor->jumpToNextPage(); + CPPUNIT_ASSERT_EQUAL(static_cast(2), xCursor->getPage()); + xCursor->jumpToNextPage(); + CPPUNIT_ASSERT_EQUAL(static_cast(4), xCursor->getPage()); +} + DECLARE_RTFIMPORT_TEST(testPoshPosv, "posh-posv.rtf") { CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty(getShape(1), "HoriOrient")); -- cgit