[Libreoffice-commits] core.git: sw/qa

Miklos Vajna vmiklos at collabora.co.uk
Tue Nov 14 09:38:40 UTC 2017


 sw/qa/extras/rtfimport/data/sbkodd.rtf |   10 ++++++++++
 sw/qa/extras/rtfimport/rtfimport.cxx   |   10 ++++++++++
 2 files changed, 20 insertions(+)

New commits:
commit 348d8af8a7f8073eb50d364696bf6a311080c8c1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Nov 14 08:28:16 2017 +0100

    RTF import: add odd section break testcase
    
    lcov points out this was not covered so far.
    
    Change-Id: I7c5047b75f6548e7738e6118f8d3c0eb9ed76045
    Reviewed-on: https://gerrit.libreoffice.org/44702
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sw/qa/extras/rtfimport/data/sbkodd.rtf b/sw/qa/extras/rtfimport/data/sbkodd.rtf
new file mode 100644
index 000000000000..3450afa78633
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/sbkodd.rtf
@@ -0,0 +1,10 @@
+{\rtf1
+\pard\plain
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid12023156 Page 1\sect }
+\sectd \ltrsect
+\sbkodd\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 3}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid14181417
+\par }
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 50c39d5eb1ce..424ade30cacd 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -459,6 +459,16 @@ DECLARE_RTFIMPORT_TEST(testFdo81944, "fdo81944.rtf")
     CPPUNIT_ASSERT_EQUAL(11.0f, getProperty<float>(xStyle, "CharHeightComplex"));
 }
 
+DECLARE_RTFIMPORT_TEST(testSbkodd, "sbkodd.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>(3), xCursor->getPage());
+}
+
 DECLARE_RTFIMPORT_TEST(testPoshPosv, "posh-posv.rtf")
 {
     CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(getShape(1), "HoriOrient"));


More information about the Libreoffice-commits mailing list