sw/qa/extras/rtfexport/data/fdo82006.rtf | 4 ++++ sw/qa/extras/rtfexport/rtfexport.cxx | 8 ++++++++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 8 ++++++++ 3 files changed, 20 insertions(+)
New commits: commit bb77fd64f9219f1b8f990f5041d81cfddd021213 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Sat Nov 22 20:08:42 2014 +0100 fdo#82006 RTF filter: import \sbauto and \saauto Change-Id: Iabff543c8191fc86dceb9274ea1552f60d73dabd diff --git a/sw/qa/extras/rtfexport/data/fdo82006.rtf b/sw/qa/extras/rtfexport/data/fdo82006.rtf new file mode 100644 index 0000000..0f5ee43 --- /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 c4118c6..221618d 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 246cb4f..a998351 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -4880,6 +4880,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) << "'"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits