[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Fri Dec 9 18:41:14 UTC 2016
sw/qa/extras/rtfexport/data/tdf103925.rtf | 1 +
sw/qa/extras/rtfexport/rtfexport.cxx | 6 ++++++
writerfilter/source/rtftok/rtfdispatchvalue.cxx | 20 +++++++++++++++++---
3 files changed, 24 insertions(+), 3 deletions(-)
New commits:
commit c260580daa4fe78093265c1359c4d54677d76470
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Dec 9 16:27:30 2016 +0100
tdf#103925 RTF import: fix handling of \animtext0
Since commit ac6bfd85df271b650dbd24b45391dac346ecd72c (tdf#92045 DOCX
import: <w:effect w:val="none"/> doesn't mean blinking, 2016-01-06) the
"no blink" blink type is not 0, but
NS_ooxml::LN_Value_ST_TextEffect_none.
Change-Id: If854e57d125a365f829797f027ca5e131705e137
Reviewed-on: https://gerrit.libreoffice.org/31797
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sw/qa/extras/rtfexport/data/tdf103925.rtf b/sw/qa/extras/rtfexport/data/tdf103925.rtf
new file mode 100644
index 0000000..91183fa
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf103925.rtf
@@ -0,0 +1 @@
+{\rtf1 \animtext0 This is not blinking.\par }
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index ce74f91..9ed2f52 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1126,6 +1126,12 @@ DECLARE_RTFEXPORT_TEST(testTdf61901, "tdf61901.rtf")
}
}
+DECLARE_RTFEXPORT_TEST(testTdf103925, "tdf103925.rtf")
+{
+ // This was true, \animtext0 resulted in setting the blinking font effect.
+ CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getRun(getParagraph(1), 1), "CharFlash"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
index 8c6075e..8caa35b 100644
--- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
@@ -154,9 +154,6 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
nSprm = (m_aStates.top().isRightToLeft || m_aStates.top().eRunType == RTFParserState::RunType::HICH)
? NS_ooxml::LN_EG_RPrBase_szCs : NS_ooxml::LN_EG_RPrBase_sz;
break;
- case RTF_ANIMTEXT:
- nSprm = NS_ooxml::LN_EG_RPrBase_effect;
- break;
case RTF_EXPNDTW:
nSprm = NS_ooxml::LN_EG_RPrBase_spacing;
break;
@@ -1418,6 +1415,23 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_TRWWIDTHA:
m_aStates.top().nTableRowWidthAfter = nParam;
break;
+ case RTF_ANIMTEXT:
+ {
+ nId = 0;
+ switch (nParam)
+ {
+ case 0:
+ nId = NS_ooxml::LN_Value_ST_TextEffect_none;
+ break;
+ case 2:
+ nId = NS_ooxml::LN_Value_ST_TextEffect_blinkBackground;
+ break;
+ }
+
+ if (nId > 0)
+ m_aStates.top().aCharacterSprms.set(NS_ooxml::LN_EG_RPrBase_effect, std::make_shared<RTFValue>(nId));
+ break;
+ }
default:
{
SAL_INFO("writerfilter", "TODO handle value '" << keywordToString(nKeyword) << "'");
More information about the Libreoffice-commits
mailing list