Kaydet (Commit) b91fa392 authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#53604 fix RTF export of empty footnotes

Regression from d4069372
üst b2e5a39b
......@@ -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();
......
......@@ -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());
......
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