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

RTF export: handle \sautoupd

Change-Id: Ifddb3fda827aef0a95649bf074dad7d9cc797edb
üst fb83e8a5
{\rtf1
{\stylesheet
{\s1\sautoupd heading 1;}
{\s2 heading 2;}
}
\pard\plain hello\par
}
......@@ -867,6 +867,15 @@ DECLARE_RTFEXPORT_TEST(testMargmirror, "margmirror.rtf")
CPPUNIT_ASSERT_EQUAL(style::PageStyleLayout_MIRRORED, getProperty<style::PageStyleLayout>(xPageStyle, "PageStyleLayout"));
}
DECLARE_RTFEXPORT_TEST(testSautoupd, "sautoupd.rtf")
{
// \sautoupd was ignored during import and export.
uno::Reference<beans::XPropertySet> xHeading1(getStyles("ParagraphStyles")->getByName("Heading 1"), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xHeading1, "IsAutoUpdate"));
uno::Reference<beans::XPropertySet> xHeading2(getStyles("ParagraphStyles")->getByName("Heading 2"), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xHeading2, "IsAutoUpdate"));
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1016,7 +1016,7 @@ void RtfAttributeOutput::DefaultStyle(sal_uInt16 /*nStyle*/)
void RtfAttributeOutput::StartStyle(const OUString& rName, StyleType eType,
sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId,
bool /* bAutoUpdate */)
bool bAutoUpdate)
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", rName = '" << rName << "'");
......@@ -1036,6 +1036,9 @@ void RtfAttributeOutput::StartStyle(const OUString& rName, StyleType eType,
m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_SNEXT);
m_aStylesheet.append((sal_Int32)nNext);
if (bAutoUpdate)
m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_SAUTOUPD);
m_rStyleName = rName;
m_nStyleId = nId;
}
......
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