summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2019-10-01 21:46:15 +0800
committerMark Hung <marklh9@gmail.com>2019-10-10 13:25:32 +0200
commit175ab303958809391bfd985729f177d26ba35cbb (patch)
treeef07c6b578fb9eaf15cf8bcc66cd0d5473c90edf /sd/qa
parent70ae1da67310a596e5bc49f1053c7ff72c84f539 (diff)
tdf#98603 export runs with correct lang attribute (2/2).
Obtain lang attribute of rPr element from CharLocale, CharLocaleAsian, or CharLocaleComplex based on the script type of exported text. There are several other call sites of WriteRunProperties, like those in chartexport, and those for text fields, Here I leave the default to CharLocale so it fallback to western locale as it did before. Change-Id: I33679517dd88f9e415933decc02f10afc807ad3b Reviewed-on: https://gerrit.libreoffice.org/79973 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/data/pptx/tdf98603.pptxbin0 -> 46390 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx16
2 files changed, 16 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf98603.pptx b/sd/qa/unit/data/pptx/tdf98603.pptx
new file mode 100644
index 000000000000..92c717721595
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf98603.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 698982cddcb1..bdfae4ab25ec 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -180,6 +180,7 @@ public:
void testTdf126741();
void testTdf127372();
void testTdf127379();
+ void testTdf98603();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -278,6 +279,7 @@ public:
CPPUNIT_TEST(testTdf126741);
CPPUNIT_TEST(testTdf127372);
CPPUNIT_TEST(testTdf127379);
+ CPPUNIT_TEST(testTdf98603);
CPPUNIT_TEST_SUITE_END();
@@ -2601,6 +2603,20 @@ void SdOOXMLExportTest2::testTdf127379()
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2A6099), aGradient.EndColor);
}
+void SdOOXMLExportTest2::testTdf98603()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf98603.pptx"), PPTX);
+ xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
+ uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape));
+ uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph));
+ uno::Reference< beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY_THROW);
+ css::lang::Locale aLocale;
+ xPropSet->getPropertyValue("CharLocaleComplex") >>= aLocale;
+ CPPUNIT_ASSERT_EQUAL(OUString("he"), aLocale.Language);
+ CPPUNIT_ASSERT_EQUAL(OUString("IL"), aLocale.Country);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();