summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorAurimas Fišeras <aurimas@members.fsf.org>2012-04-21 23:01:09 +0300
committerMiklos Vajna <vmiklos@suse.cz>2012-04-25 15:04:23 +0200
commita8c05ae840f2673803d9784600be9a7b734076fc (patch)
treedacfc33bb4f73448d49e087fca926f719ba6cf14 /sw/qa
parent3cceb8a900cd1fe1ae9bdb0c2e532e82a1835861 (diff)
fdo#44211 (RTF) return default text encoding for Lithuanian
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtftok/data/fdo44211.rtf4
-rw-r--r--sw/qa/extras/rtftok/rtftok.cxx25
2 files changed, 28 insertions, 1 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo44211.rtf b/sw/qa/extras/rtftok/data/fdo44211.rtf
new file mode 100644
index 000000000000..699ce73e280f
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo44211.rtf
@@ -0,0 +1,4 @@
+{\rtf1\ansi\deff0{\fonttbl{\f0 Helvetica;}}
+\pard\f0\fs20\'e0\'e8\'e6
+\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 48e33e23a4b7..e4168891c491 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -87,6 +87,7 @@ public:
void testFdo48023();
void testFdo48876();
void testFdo48193();
+ void testFdo44211();
CPPUNIT_TEST_SUITE(RtfModelTest);
#if !defined(MACOSX) && !defined(WNT)
@@ -113,7 +114,7 @@ public:
CPPUNIT_TEST(testFdo48356);
CPPUNIT_TEST(testFdo48023);
CPPUNIT_TEST(testFdo48876);
- CPPUNIT_TEST(testFdo48193);
+ CPPUNIT_TEST(testFdo44211);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -624,6 +625,28 @@ void RtfModelTest::testFdo48193()
CPPUNIT_ASSERT_EQUAL(7, getLength());
}
+void RtfModelTest::testFdo44211()
+{
+ lang::Locale aLocale;
+ aLocale.Language = "lt";
+ AllSettings aSettings(Application::GetSettings());
+ AllSettings aSavedSettings(aSettings);
+ aSettings.SetLocale(aLocale);
+ Application::SetSettings(aSettings);
+ load("fdo44211.rtf");
+ Application::SetSettings(aSavedSettings);
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
+ uno::Reference<text::XTextRange> xTextRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
+
+ OUString aExpected("ąčę", 6, RTL_TEXTENCODING_UTF8);
+ CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
CPPUNIT_PLUGIN_IMPLEMENT();