sw/qa/extras/ww8import/data/tdf74328.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 14 ++++++++++++++ sw/source/filter/ww8/ww8par6.cxx | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-)
New commits: commit 5f63e19ddffdf3eaa2351968550498fdae35475d Author: Oliver Specht <oliver.spe...@cib.de> Date: Wed Apr 27 16:37:48 2016 +0200 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 <c...@libreoffice.org> Reviewed-by: Oliver Specht <oliver.spe...@cib.de> diff --git a/sw/qa/extras/ww8import/data/tdf74328.doc b/sw/qa/extras/ww8import/data/tdf74328.doc new file mode 100755 index 0000000..a829785 Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf74328.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 8727a00..b2e0f0d 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 c271da4..4b24086 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) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits