[Libreoffice-commits] core.git: sw/qa

Mike Kaganski mike.kaganski at collabora.com
Wed Jan 25 11:59:04 UTC 2017


 sw/qa/extras/rtfimport/data/tdf105511.rtf |    4 ++++
 sw/qa/extras/rtfimport/rtfimport.cxx      |   27 +++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

New commits:
commit ff4f48892aca8de695709132fdeb099809db8b55
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Wed Jan 25 10:37:40 2017 +0300

    tdf#105511: Unit test
    
    Change-Id: I1b988ca629bc93ff7d29c396d463f2967ed99b54
    Reviewed-on: https://gerrit.libreoffice.org/33512
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/qa/extras/rtfimport/data/tdf105511.rtf b/sw/qa/extras/rtfimport/data/tdf105511.rtf
new file mode 100644
index 0000000..bae99d6
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf105511.rtf
@@ -0,0 +1,4 @@
+{\rtf\ansicpg0
+Èìÿ
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index c860f3d..e71be6a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -58,6 +58,7 @@
 #include <unotools/ucbstreamhelper.hxx>
 #include <unotools/streamwrap.hxx>
 #include <comphelper/sequenceashashmap.hxx>
+#include "comphelper/configuration.hxx"
 
 #include <bordertest.hxx>
 
@@ -1615,6 +1616,32 @@ DECLARE_RTFIMPORT_TEST(testCp1000018, "cp1000018.rtf")
     CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString());
 }
 
+class testTdf105511 : public Test {
+protected:
+    virtual OUString getTestName() override { return OUString("testTdf105511"); }
+public:
+    CPPUNIT_TEST_SUITE(testTdf105511);
+    CPPUNIT_TEST(Import);
+    CPPUNIT_TEST_SUITE_END();
+
+    void Import() {
+        struct DefaultLocale : public comphelper::ConfigurationProperty<DefaultLocale, rtl::OUString> {
+            static OUString path() { return OUString("/org.openoffice.Office.Linguistic/General/DefaultLocale"); }
+            ~DefaultLocale() = delete;
+        };
+        auto batch = comphelper::ConfigurationChanges::create();
+        DefaultLocale::set("ru-RU", batch);
+        batch->commit();
+        executeImportTest("tdf105511.rtf", nullptr);
+    }
+    virtual void verify() override
+    {
+        OUString aExpected("\xd0\x98\xd0\xbc\xd1\x8f", 6, RTL_TEXTENCODING_UTF8);
+        getParagraph(1, aExpected);
+    }
+};
+CPPUNIT_TEST_SUITE_REGISTRATION(testTdf105511);
+
 #endif
 DECLARE_RTFIMPORT_TEST(testFdo94835, "fdo94835.rtf")
 {


More information about the Libreoffice-commits mailing list