RTF export: write RTF_FTNSEP and RTF_CHFTNSEP if necessary
Change-Id: Ie680436df68ea6287437f792d97259ee0a840ee1
This commit is contained in:
parent
0282ab3c3a
commit
f4db3ac593
@ -579,6 +579,13 @@ DECLARE_RTFEXPORT_TEST(testFdo66743, "fdo66743.rtf")
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xd8d8d8), getProperty<sal_Int32>(xCell, "BackColor"));
|
||||
}
|
||||
|
||||
DECLARE_RTFEXPORT_TEST(testFdo68787, "fdo68787.rtf")
|
||||
{
|
||||
uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
|
||||
// This was 0, the 'lack of \chftnsep' <-> '0 line width' mapping was missing in the RTF tokenizer / exporter.
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth"));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||
|
@ -1405,13 +1405,6 @@ DECLARE_RTFIMPORT_TEST(testBackground, "background.rtf")
|
||||
CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(getShape(2), "Opaque")));
|
||||
}
|
||||
|
||||
DECLARE_RTFIMPORT_TEST(testFdo68787, "fdo68787.rtf")
|
||||
{
|
||||
uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
|
||||
// This was 0, the 'lack of \chftnsep' <-> '0 line width' mapping was missing in the RTF tokenizer.
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth"));
|
||||
}
|
||||
|
||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@ -382,6 +382,18 @@ void RtfExport::WriteStyles()
|
||||
SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
|
||||
}
|
||||
|
||||
void RtfExport::WriteFootnoteSettings()
|
||||
{
|
||||
const SwPageFtnInfo& rFtnInfo = pDoc->GetPageDesc(0).GetFtnInfo();
|
||||
// Request a separator only in case the width is larger than zero.
|
||||
bool bSeparator = double(rFtnInfo.GetWidth()) > 0;
|
||||
|
||||
Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_FTNSEP;
|
||||
if (bSeparator)
|
||||
Strm() << OOO_STRING_SVTOOLS_RTF_CHFTNSEP;
|
||||
Strm() << '}';
|
||||
}
|
||||
|
||||
void RtfExport::WriteMainText()
|
||||
{
|
||||
SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
|
||||
@ -696,6 +708,8 @@ void RtfExport::ExportDocument_Impl()
|
||||
|
||||
Strm() << SAL_NEWLINE_STRING;
|
||||
|
||||
WriteFootnoteSettings();
|
||||
|
||||
WriteMainText();
|
||||
|
||||
Strm() << '}';
|
||||
|
@ -173,6 +173,7 @@ private:
|
||||
|
||||
void WriteFonts();
|
||||
void WriteStyles();
|
||||
void WriteFootnoteSettings();
|
||||
void WriteMainText();
|
||||
void WriteInfo();
|
||||
/// Writes the writer-specific \pgdsctbl group.
|
||||
|
Loading…
x
Reference in New Issue
Block a user