From 330efa9db365fbc28d825de2fe14162a692ffb2f Mon Sep 17 00:00:00 2001 From: Oliver Specht Date: Wed, 19 Feb 2025 14:18:39 +0100 Subject: tdf#165333 RTF: import SYMBOL fields correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Úsing XTextAppend to insert SYMBOL fields fixes wrongly extended character properties. Change-Id: I14f187e63e2c72d3c2cf27ab99cdced108797057 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181892 Tested-by: Jenkins Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen --- sw/qa/extras/rtfimport/data/165333.rtf | 12 ++++++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 sw/qa/extras/rtfimport/data/165333.rtf (limited to 'sw/qa') diff --git a/sw/qa/extras/rtfimport/data/165333.rtf b/sw/qa/extras/rtfimport/data/165333.rtf new file mode 100644 index 000000000000..7834bfd178ef --- /dev/null +++ b/sw/qa/extras/rtfimport/data/165333.rtf @@ -0,0 +1,12 @@ +{\rtf1 + +{\stylesheet +{\ql\fs72 Normal;} +} + +\pard{\rtlch\fcs1 \ab\af40\afs12 \ltrch\fcs0 +\v\f40\fs12\cf1\insrsid12669988\charrsid9449667 \line } +{\rtlch\fcs1 \af40\afs10 \ltrch\fcs0 \f40\fs10\insrsid12669988\charrsid11105138 +{\field{\*\fldinst SYMBOL 253 \\f "Wingdings" \\s 5}{\fldrslt\f10\fs10}}}\par + +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 7a83bffe7b35..6b854306dbe3 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1984,6 +1984,17 @@ CPPUNIT_TEST_FIXTURE(Test, test118465Tdf) CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty(xTable, u"HeaderRowCount"_ustr)); } +CPPUNIT_TEST_FIXTURE(Test, test165333Tdf) +{ + createSwDoc("165333.rtf"); + uno::Reference const xRun1( + getRun(uno::Reference(getParagraphOrTable(1), uno::UNO_QUERY), 1)); + CPPUNIT_ASSERT_EQUAL(true, getProperty(xRun1, u"CharHidden"_ustr)); + uno::Reference const xRun2( + getRun(uno::Reference(getParagraphOrTable(1), uno::UNO_QUERY), 2)); + CPPUNIT_ASSERT_EQUAL(false, getProperty(xRun2, u"CharHidden"_ustr)); +} + // tests should only be added to rtfIMPORT *if* they fail round-tripping in rtfEXPORT } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit