diff options
author | Oliver Specht <oliver.specht@cib.de> | 2016-04-27 16:37:48 +0200 |
---|---|---|
committer | Oliver Specht <oliver.specht@cib.de> | 2016-04-28 09:40:02 +0000 |
commit | 5f63e19ddffdf3eaa2351968550498fdae35475d (patch) | |
tree | 0b2271b737233fe75acce652fef1a1cbaf163363 /sw | |
parent | 376c337d46acf8819bf032251bfc7d5eb31db198 (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')
-rwxr-xr-x | sw/qa/extras/ww8import/data/tdf74328.doc | bin | 0 -> 44032 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8import/ww8import.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 4 |
3 files changed, 16 insertions, 2 deletions
diff --git a/sw/qa/extras/ww8import/data/tdf74328.doc b/sw/qa/extras/ww8import/data/tdf74328.doc Binary files differnew file mode 100755 index 000000000000..a82978547b5d --- /dev/null +++ b/sw/qa/extras/ww8import/data/tdf74328.doc 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: */ diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index c271da497b7f..4b240867a2e5 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -997,7 +997,7 @@ void wwSectionManager::CreateSep(const long nTextPos, bool /*bMustHaveBreak*/) /*sprmSDxaRight*/ 0xB022, /*sprmSDzaGutter*/ 0xB025, /*sprmSFPgnRestart*/ 0x3011, - /*sprmSPgnStart*/ 0x501C, + /*sprmSPgnStart97*/ 0x501C, /*sprmSDmBinFirst*/ 0x5007, /*sprmSDmBinOther*/ 0x5008 }; @@ -1035,7 +1035,7 @@ void wwSectionManager::CreateSep(const long nTextPos, bool /*bMustHaveBreak*/) // Page Number Restarts - sprmSFPgnRestart aNewSection.maSep.fPgnRestart = ReadBSprm(pSep, pIds[6], 0); - aNewSection.maSep.pgnStart = ReadBSprm( pSep, pIds[7], 0 ); + aNewSection.maSep.pgnStart = ReadUSprm( pSep, pIds[7], 0 ); if (eVer >= ww::eWW6) { |