[Libreoffice-commits] .: sw/qa sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Dec 21 05:54:09 PST 2012
sw/qa/extras/rtfexport/data/fdo53604.odt |binary
sw/qa/extras/rtfexport/rtfexport.cxx | 11 +++++++++++
sw/source/filter/ww8/rtfattributeoutput.cxx | 3 +++
3 files changed, 14 insertions(+)
New commits:
commit b91fa392bc731376cff205d6d3e5cb245dc4179c
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Fri Dec 21 14:44:06 2012 +0100
fdo#53604 fix RTF export of empty footnotes
Regression from d4069372484f18b242a42a1996767f57b031fff6
diff --git a/sw/qa/extras/rtfexport/data/fdo53604.odt b/sw/qa/extras/rtfexport/data/fdo53604.odt
new file mode 100644
index 0000000..af090bb
Binary files /dev/null and b/sw/qa/extras/rtfexport/data/fdo53604.odt differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index f79b13f..150fc61 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 e78f9e3..36d1cea 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());
More information about the Libreoffice-commits
mailing list