summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-04-03 16:49:41 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-04-03 17:56:44 +0200
commitf4e0cbaa15c2861e87149a62c9c80a9e9b4094b3 (patch)
tree340671f6eefc01d0e581310e716ffe3a5279ec12 /sw/qa
parent97bcf0b645fa5ce14cfd806548c6805952fd3e76 (diff)
fdo#45182 fix RTF import of character encoding in footnotes
There were two problems here: 1) \plain reset the character properties, but did not touch the current encoding 2) the default properties were not passed to substreams
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtftok/data/fdo45182.rtf11
-rw-r--r--sw/qa/extras/rtftok/rtftok.cxx15
2 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo45182.rtf b/sw/qa/extras/rtftok/data/fdo45182.rtf
new file mode 100644
index 000000000000..b076106162b7
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo45182.rtf
@@ -0,0 +1,11 @@
+{\rtf1\deff0
+{\fonttbl
+{\f0\fcharset238
+Times New Roman;}
+}
+a\chftn
+{\footnote
+\ltrpar \pard\plain\'9eivnost\'ed
+\par
+}
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 45eabbf62e0d..926796799f82 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/SizeType.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/text/XFootnotesSupplier.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
@@ -77,6 +78,7 @@ public:
void testFdo45394();
void testFdo48104();
void testFdo47107();
+ void testFdo45182();
CPPUNIT_TEST_SUITE(RtfModelTest);
#if !defined(MACOSX) && !defined(WNT)
@@ -97,6 +99,7 @@ public:
CPPUNIT_TEST(testFdo45394);
CPPUNIT_TEST(testFdo48104);
CPPUNIT_TEST(testFdo47107);
+ CPPUNIT_TEST(testFdo45182);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -500,6 +503,18 @@ void RtfModelTest::testFdo47107()
xNumberingStyles->getByName("WWNum2");
}
+void RtfModelTest::testFdo45182()
+{
+ load("fdo45182.rtf");
+
+ uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY);
+ // Encoding in the footnote was wrong.
+ OUString aExpected("živností", 10, RTL_TEXTENCODING_UTF8);
+ CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
CPPUNIT_PLUGIN_IMPLEMENT();