summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-03-15 13:56:35 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-15 14:22:09 +0100
commita936658e6cd92d8f073227cd5c586bcecc7124e0 (patch)
tree6a3a364bb7105011553e0ffec38a7451027d8fd1
parentfb83e8a5a421f751b06faf991177ad3b2100976c (diff)
RTF export: handle \sautoupd
Change-Id: Ifddb3fda827aef0a95649bf074dad7d9cc797edb
-rw-r--r--sw/qa/extras/rtfexport/data/sautoupd.rtf7
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx9
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx5
3 files changed, 20 insertions, 1 deletions
diff --git a/sw/qa/extras/rtfexport/data/sautoupd.rtf b/sw/qa/extras/rtfexport/data/sautoupd.rtf
new file mode 100644
index 000000000000..960855d1b4e4
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/sautoupd.rtf
@@ -0,0 +1,7 @@
+{\rtf1
+{\stylesheet
+{\s1\sautoupd heading 1;}
+{\s2 heading 2;}
+}
+\pard\plain hello\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index f056208d1513..de571a2eda7e 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -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: */
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 191bff0f2421..83ef2bad3444 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -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;
}