sw/qa/extras/ooxmlimport/data/tdf90810short.docx      |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx              |   12 ++++++++++++
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |    7 +++++--
 3 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit 7e50b8073ef40d1bbe79c1c4d6c967d760283b5a
Author: Oliver Specht <oliver.spe...@cib.de>
Date:   Wed Oct 7 14:34:02 2015 +0200

    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 <vmik...@collabora.co.uk>
    Tested-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/qa/extras/ooxmlimport/data/tdf90810short.docx 
b/sw/qa/extras/ooxmlimport/data/tdf90810short.docx
new file mode 100755
index 0000000..85b6369
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf90810short.docx 
differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 3b1024e..21f3034 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 898dacd..d43c88d 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()
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to