summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2016-04-27 16:37:48 +0200
committerOliver Specht <oliver.specht@cib.de>2016-04-28 09:40:02 +0000
commit5f63e19ddffdf3eaa2351968550498fdae35475d (patch)
tree0b2271b737233fe75acce652fef1a1cbaf163363 /sw/qa
parent376c337d46acf8819bf032251bfc7d5eb31db198 (diff)
tdf#74328: loading section page no. as 16 bit unsigned
The sprm sprmSPgnStart97 contains a 16 bit unsigned value. Test included. Change-Id: I300e9a94c13666cf8e71d3613b8f1171c7314cdd Reviewed-on: https://gerrit.libreoffice.org/24431 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'sw/qa')
-rwxr-xr-xsw/qa/extras/ww8import/data/tdf74328.docbin0 -> 44032 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx14
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/tdf74328.doc b/sw/qa/extras/ww8import/data/tdf74328.doc
new file mode 100755
index 000000000000..a82978547b5d
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/tdf74328.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 8727a00d201f..b2e0f0d15447 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -553,6 +553,20 @@ DECLARE_WW8IMPORT_TEST(testTdf99120, "tdf99120.doc")
CPPUNIT_ASSERT_EQUAL(OUString("Section 2, even."), parseDump("/root/page[4]/header/txt/text()"));
}
+DECLARE_WW8IMPORT_TEST(testTdf74328, "tdf74328.doc")
+{
+/*
+reading page numbers at sections > 255, in this case 256
+*/
+ uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextCursor> xTextCursor(textDocument->getText()->createTextCursor( ), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xProps(xTextCursor, uno::UNO_QUERY);
+ uno::Any aOffset = xProps->getPropertyValue("PageNumberOffset");
+ sal_Int16 nOffset = 0;
+ aOffset >>= nOffset;
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(256), nOffset);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */