diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-11-22 20:08:42 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-11-23 12:58:53 +0000 |
commit | 1a7de2e1f14bd4be68d1ccee24249427fa98781a (patch) | |
tree | 5ed4942e1d81f4de4ec495f663a07abac765bba4 | |
parent | cfa2d77698ea4c76b624fa04280fe638d1f50eb1 (diff) |
fdo#82006 RTF filter: import \sbauto and \saauto
(cherry picked from commit bb77fd64f9219f1b8f990f5041d81cfddd021213)
Conflicts:
sw/qa/extras/rtfexport/rtfexport.cxx
Change-Id: Iabff543c8191fc86dceb9274ea1552f60d73dabd
Reviewed-on: https://gerrit.libreoffice.org/13054
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo82006.rtf | 4 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 7 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 8 |
3 files changed, 19 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 0bcf1a836794..83b9aba2ab6e 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -665,6 +665,13 @@ DECLARE_RTFEXPORT_TEST(testFdo82858, "fdo82858.docx") CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::NONE, getProperty<table::BorderLine2>(getShape(1), "TopBorder").LineStyle); } +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")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 7c5cbf173f69..a8d88f3119db 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -4757,6 +4757,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) << "'"); |