diff options
author | Oliver Specht <oliver.specht@cib.de> | 2025-02-19 14:18:39 +0100 |
---|---|---|
committer | Gabor Kelemen <gabor.kelemen.extern@allotropia.de> | 2025-02-21 19:42:00 +0100 |
commit | 330efa9db365fbc28d825de2fe14162a692ffb2f (patch) | |
tree | cc4a1e64562872c5d024c43ac27ba4b5b35eee25 /sw/qa | |
parent | f70f5fad59e55abd15209128d7f14b3015e2958b (diff) |
tdf#165333 RTF: import SYMBOL fields correctly
Ú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 <gabor.kelemen.extern@allotropia.de>
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/rtfimport/data/165333.rtf | 12 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 11 |
2 files changed, 23 insertions, 0 deletions
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<sal_Int32>(xTable, u"HeaderRowCount"_ustr)); } +CPPUNIT_TEST_FIXTURE(Test, test165333Tdf) +{ + createSwDoc("165333.rtf"); + uno::Reference<text::XTextRange> const xRun1( + getRun(uno::Reference<text::XTextRange>(getParagraphOrTable(1), uno::UNO_QUERY), 1)); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xRun1, u"CharHidden"_ustr)); + uno::Reference<text::XTextRange> const xRun2( + getRun(uno::Reference<text::XTextRange>(getParagraphOrTable(1), uno::UNO_QUERY), 2)); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(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(); |