diff options
author | Oliver Specht <oliver.specht@cib.de> | 2015-10-07 14:34:02 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-07 15:24:36 +0000 |
commit | 7e50b8073ef40d1bbe79c1c4d6c967d760283b5a (patch) | |
tree | 09f611dbb52c4031c828fb040e6c5e4ba225b92a | |
parent | a31f95b180728c1c671930913b4b4ad96ebcda5f (diff) |
tdf#90810: skip breaks outside of the requested footnote
the footnote stream is parsed completely at each footnote insertion
(line) breaks outside of the requested footnote need to be skipped
test include
Change-Id: I78de7774b7daf44c2b8980115870082fc56924bd
Reviewed-on: https://gerrit.libreoffice.org/19228
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rwxr-xr-x | sw/qa/extras/ooxmlimport/data/tdf90810short.docx | bin | 0 -> 22286 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 7 |
3 files changed, 17 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf90810short.docx b/sw/qa/extras/ooxmlimport/data/tdf90810short.docx Binary files differnew file mode 100755 index 000000000000..85b6369fbf29 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/tdf90810short.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 3b1024ea2eb2..21f3034de471 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/text/XBookmarksSupplier.hpp> #include <com/sun/star/text/XDependentTextField.hpp> +#include <com/sun/star/text/XFootnote.hpp> #include <com/sun/star/text/XFormField.hpp> #include <com/sun/star/text/XPageCursor.hpp> #include <com/sun/star/text/XTextColumns.hpp> @@ -2862,6 +2863,17 @@ DECLARE_OOXMLIMPORT_TEST(testTdf91417, "tdf91417.docx") CPPUNIT_ASSERT_EQUAL(OUString("http://www.google.com/"), aValue); } +DECLARE_OOXMLIMPORT_TEST(testTdf90810, "tdf90810short.docx") +{ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XFootnotesSupplier> xFtnSupp(xTextDocument, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFtnIdxAcc(xFtnSupp->getFootnotes(), uno::UNO_QUERY); + uno::Reference<text::XFootnote> xFtn(xFtnIdxAcc->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XText> xFtnText(xFtn, uno::UNO_QUERY); + rtl::OUString sFtnText = xFtnText->getString(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(90), static_cast<sal_Int32>(sFtnText.getLength())); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index 898dacdce600..d43c88da46e4 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -1031,8 +1031,11 @@ void OOXMLFastContextHandlerProperties::handlePicture() void OOXMLFastContextHandlerProperties::handleBreak() { - OOXMLBreakHandler aBreakHandler(*mpStream); - getPropertySet()->resolve(aBreakHandler); + if(isForwardEvents()) + { + OOXMLBreakHandler aBreakHandler(*mpStream); + getPropertySet()->resolve(aBreakHandler); + } } void OOXMLFastContextHandlerProperties::handleOLE() |