[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Sun Nov 23 04:59:13 PST 2014
sw/qa/extras/rtfexport/data/fdo82006.rtf | 4 ++++
sw/qa/extras/rtfexport/rtfexport.cxx | 7 +++++++
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 8 ++++++++
3 files changed, 19 insertions(+)
New commits:
commit 1a7de2e1f14bd4be68d1ccee24249427fa98781a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Nov 22 20:08:42 2014 +0100
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 at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
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 0bcf1a8..83b9aba 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 7c5cbf1..a8d88f3 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) << "'");
More information about the Libreoffice-commits
mailing list