From 175ab303958809391bfd985729f177d26ba35cbb Mon Sep 17 00:00:00 2001 From: Mark Hung Date: Tue, 1 Oct 2019 21:46:15 +0800 Subject: 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 --- sd/qa/unit/data/pptx/tdf98603.pptx | Bin 0 -> 46390 bytes sd/qa/unit/export-tests-ooxml2.cxx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 sd/qa/unit/data/pptx/tdf98603.pptx (limited to 'sd/qa') 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 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf98603.pptx 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 xShape(getShapeFromPage(0, 0, xDocShRef)); + uno::Reference const xParagraph(getParagraphFromShape(0, xShape)); + uno::Reference 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(); -- cgit