summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-22 20:08:42 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-22 20:58:03 +0100
commit85086306939b6bebb8cf549966942f2e5a244388 (patch)
treeea1ccbec08dd24ff55b6be240e123a929d361845
parentd1c8f2a1228e187a4c353c1f414667be0248dfd8 (diff)
fdo#82006 RTF filter: import \sbauto and \saauto
Change-Id: Iabff543c8191fc86dceb9274ea1552f60d73dabd (cherry picked from commit bb77fd64f9219f1b8f990f5041d81cfddd021213)
-rw-r--r--sw/qa/extras/rtfexport/data/fdo82006.rtf4
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx8
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx8
3 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/fdo82006.rtf b/sw/qa/extras/rtfexport/data/fdo82006.rtf
new file mode 100644
index 000000000000..0f5ee43ad2d5
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo82006.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\pard\plain
+\ql \sb100\sa100\sbauto1\saauto1 hello\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index c4118c6ddf2e..221618d56ad7 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -843,6 +843,14 @@ DECLARE_RTFEXPORT_TEST(testNumOverrideStart, "num-override-start.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), comphelper::SequenceAsHashMap(xRules->getByIndex(0))["StartWith"].get<sal_Int16>());
CPPUNIT_ASSERT_EQUAL(sal_Int16(3), comphelper::SequenceAsHashMap(xRules->getByIndex(1))["StartWith"].get<sal_Int16>());
}
+
+DECLARE_RTFEXPORT_TEST(testFdo82006, "fdo82006.rtf")
+{
+ // These were 176 (100 twips), as \sbauto and \sbbefore were ignored.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), getProperty<sal_Int32>(getParagraph(0), "ParaTopMargin"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), getProperty<sal_Int32>(getParagraph(0), "ParaBottomMargin"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 84b689f40e85..5e690093ddea 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4881,6 +4881,14 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
NS_ooxml::LN_trackchange, NS_ooxml::LN_token, pValue);
}
break;
+ case RTF_SBAUTO:
+ lcl_putNestedAttribute(m_aStates.top().aParagraphSprms,
+ NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_beforeAutospacing, pBoolValue, OVERWRITE_YES);
+ break;
+ case RTF_SAAUTO:
+ lcl_putNestedAttribute(m_aStates.top().aParagraphSprms,
+ NS_ooxml::LN_CT_PPrBase_spacing, NS_ooxml::LN_CT_Spacing_afterAutospacing, pBoolValue, OVERWRITE_YES);
+ break;
default:
{
SAL_INFO("writerfilter", "TODO handle toggle '" << lcl_RtfToString(nKeyword) << "'");