[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Sun Apr 12 07:50:10 PDT 2015
sw/qa/extras/rtfimport/data/tdf75614.rtf | 18 ++++++++++++++++++
sw/qa/extras/rtfimport/rtfimport.cxx | 6 ++++++
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 6 +++++-
3 files changed, 29 insertions(+), 1 deletion(-)
New commits:
commit cec5f2eab25578a9859134d697c200089c597faa
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sun Apr 12 15:01:23 2015 +0200
tdf#75614 RTF import: fix missing text after footnote
Change-Id: I5901094cb603c35a1cd8ac718fd434a9dd55729b
Reviewed-on: https://gerrit.libreoffice.org/15266
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sw/qa/extras/rtfimport/data/tdf75614.rtf b/sw/qa/extras/rtfimport/data/tdf75614.rtf
new file mode 100644
index 0000000..1233801
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf75614.rtf
@@ -0,0 +1,18 @@
+{\rtf1\ansi\ansicpg0\uc1\deff0\deflang0\deflangfe0\fet2
+{\*\ftnsep\pard\plain\chftnsep }
+{\*\ftnsepc\pard\plain\chftnsepc}
+\paperw8391\paperh11906\margl567\margr567\margt567\margb567\headery567\footery6\viewscale150\viewzk0
+{\fonttbl
+{\f0\fnil Arial;}
+{\f1\fnil\fcharset204 times new roman;}
+{\f2\fnil\fcharset204 cambria;}
+{\f3\fnil\fcharset238 cambria;}
+{\f4\fnil\fcharset0 cambria;}
+{\f5\fnil\fcharset204 courier new;}
+{\f6\fnil\fcharset204 arial;}
+}
+{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
+\pard\plain Before\plain \super \chftn
+{\footnote
+\pard Footnote.}
+\plain after.\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 7be90d9..5262147 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2226,6 +2226,12 @@ DECLARE_RTFIMPORT_TEST(testFdo89496, "fdo89496.rtf")
CPPUNIT_ASSERT(xShape.is());
}
+DECLARE_RTFIMPORT_TEST(testFdo75614, "tdf75614.rtf")
+{
+ // Text after the footnote was missing, so this resulted in a css::container::NoSuchElementException.
+ CPPUNIT_ASSERT_EQUAL(OUString("after."), getRun(getParagraph(1), 3)->getString());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index d931d6d..2e1fd4e 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2326,8 +2326,12 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
}
break;
case RTF_CHFTN:
- // Nothing to do, dmapper assumes this is the default.
+ {
+ if (m_aStates.top().pCurrentBuffer == &m_aSuperBuffer)
+ // Stop buffering, there will be no custom mark for this footnote or endnote.
+ m_aStates.top().pCurrentBuffer = 0;
break;
+ }
case RTF_PAGE:
{
// Ignore page breaks inside tables.
More information about the Libreoffice-commits
mailing list