[Libreoffice-commits] core.git: 2 commits - filter/source svl/qa
Fridrich Å trba
fridrich.strba at bluewin.ch
Tue Mar 19 02:25:37 PDT 2013
filter/source/config/fragments/types/writer_MacWrite.xcu | 2
svl/qa/unit/svl.cxx | 61 +++++++++++++++
2 files changed, 62 insertions(+), 1 deletion(-)
New commits:
commit 905db14dbc029519e674147e6a5a6f76fb81309e
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date: Tue Mar 19 10:23:35 2013 +0100
Typo
Change-Id: I436be96082fee3a65610f8100279c0abd09603bf
diff --git a/filter/source/config/fragments/types/writer_MacWrite.xcu b/filter/source/config/fragments/types/writer_MacWrite.xcu
index 8abbf16..fa1882b 100644
--- a/filter/source/config/fragments/types/writer_MacWrite.xcu
+++ b/filter/source/config/fragments/types/writer_MacWrite.xcu
@@ -18,7 +18,7 @@
<node oor:name="writer_MacWrite" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.Writer.MWAWImportFilter</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value></value>mw mcw</prop>
+ <prop oor:name="Extensions"><value>mw mcw</value></prop>
<prop oor:name="MediaType"><value>application/macwrite</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>MacWrite</value></prop>
commit 0c4a20ad9ce9b3b9db8f4ad458bd742f84e1b903
Author: Korrawit Pruegsanusak <detective.conan.1412 at gmail.com>
Date: Sun Mar 17 16:03:48 2013 +0700
unit test for fdo#60915
Change-Id: Ib7c1e87521fbbfd76b8eeead17c58915c5d71728
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 805992e..26a0b8d 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -86,13 +86,20 @@ public:
virtual void tearDown();
void testNumberFormat();
+ void testFdo60915();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testNumberFormat);
+ CPPUNIT_TEST(testFdo60915);
CPPUNIT_TEST_SUITE_END();
private:
uno::Reference< uno::XComponentContext > m_xContext;
+ void checkPreviewString(SvNumberFormatter& aFormatter,
+ const OUString& sCode,
+ double fPreviewNumber,
+ LanguageType eLang,
+ OUString& sExpected);
};
Test::Test()
@@ -300,6 +307,60 @@ void Test::testNumberFormat()
}
}
+void Test::checkPreviewString(SvNumberFormatter& aFormatter,
+ const OUString& sCode,
+ double fPreviewNumber,
+ LanguageType eLang,
+ OUString& sExpected)
+{
+ OUString sStr;
+ Color* pColor = 0;
+ Color** ppColor = &pColor;
+ if (!aFormatter.GetPreviewString(sCode, fPreviewNumber, sStr, ppColor, eLang))
+ CPPUNIT_FAIL("GetPreviewString() failed");
+ CPPUNIT_ASSERT_EQUAL(sExpected, sStr);
+}
+
+void Test::testFdo60915()
+{
+ LanguageType eLang = LANGUAGE_THAI;
+ OUString sCode, sExpected;
+ double fPreviewNumber = 1234; // equals 18/05/1903 (2446 B.E.)
+ SvNumberFormatter aFormatter(m_xContext, eLang);
+ {
+ sCode = "[~buddhist]D/MM/YYYY";
+ sExpected = "18/05/2446";
+ checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected);
+ }
+ {
+ sCode = "[~buddhist]D/MM/YY";
+ sExpected = "18/05/46";
+ checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected);
+ }
+ {
+ sCode = "[NatNum1][$-41E][~buddhist]D/MM/YYYY";
+ sal_Unicode sTemp[] =
+ {
+ 0x0E51, 0x0E58, 0x002F,
+ 0x0E50, 0x0E55, 0x002F,
+ 0x0E52, 0x0E54, 0x0E54, 0x0E56
+ };
+ sExpected = OUString(sTemp, SAL_N_ELEMENTS(sTemp));
+ checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected);
+ }
+ {
+ sCode = "[NatNum1][$-41E][~buddhist]D/MM/YY";
+ sal_Unicode sTemp[] =
+ {
+ 0x0E51, 0x0E58, 0x002F,
+ 0x0E50, 0x0E55, 0x002F,
+ 0x0E54, 0x0E56
+ };
+ sExpected = OUString(sTemp, SAL_N_ELEMENTS(sTemp));
+ checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected);
+ }
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
More information about the Libreoffice-commits
mailing list