Kaydet (Commit) 7e50b807 authored tarafından Oliver Specht's avatar Oliver Specht Kaydeden (comit) Miklos Vajna

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/19228Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst a31f95b1
......@@ -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: */
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment