summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-12-21 14:44:06 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-12-21 14:56:48 +0100
commitb91fa392bc731376cff205d6d3e5cb245dc4179c (patch)
tree3570c3b703e4421a3ce2470c3716e75b9a2c3cd2
parentb2e5a39babba902707dab28d81b843d1aef055dc (diff)
fdo#53604 fix RTF export of empty footnotes
-rw-r--r--sw/qa/extras/rtfexport/data/fdo53604.odtbin0 -> 8808 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx11
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx3
3 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/fdo53604.odt b/sw/qa/extras/rtfexport/data/fdo53604.odt
new file mode 100644
index 000000000000..af090bb32593
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo53604.odt
Binary files differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index f79b13f5bd4e..150fc61ce306 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/text/XFootnotesSupplier.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
@@ -67,6 +68,7 @@ public:
void testFdo53113();
void testFdo55939();
void testTextFrames();
+ void testFdo53604();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -109,6 +111,7 @@ void Test::run()
{"fdo53113.odt", &Test::testFdo53113},
{"fdo55939.odt", &Test::testFdo55939},
{"textframes.odt", &Test::testTextFrames},
+ {"fdo53604.odt", &Test::testFdo53604},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -449,6 +452,14 @@ void Test::testTextFrames()
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xIndexAccess->getCount());
}
+void Test::testFdo53604()
+{
+ // Invalid output on empty footnote.
+ uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xFootnotes->getCount());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index e78f9e3e0322..36d1ceaa49ff 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2336,12 +2336,15 @@ void RtfAttributeOutput::TextFootnote_Impl( const SwFmtFtn& rFootnote )
m_aRun.clear();
bool bInRunOrig = m_bInRun;
m_bInRun = false;
+ bool bSingleEmptyRunOrig = m_bSingleEmptyRun;
+ m_bSingleEmptyRun = false;
m_bBufferSectionHeaders = true;
m_rExport.WriteSpecialText( pIndex->GetIndex() + 1,
pIndex->GetNode().EndOfSectionIndex(),
!rFootnote.IsEndNote() ? TXT_FTN : TXT_EDN);
m_bBufferSectionHeaders = false;
m_bInRun = bInRunOrig;
+ m_bSingleEmptyRun = bSingleEmptyRunOrig;
m_aRun = aRun;
m_aRun->append(m_aSectionHeaders.makeStringAndClear());