diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2016-11-15 23:18:03 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2016-11-17 18:01:13 +0000 |
commit | 5c7f3e4a7190bf9821bed102f96a926c9a894e59 (patch) | |
tree | 47427568c32998a130c012870f14be00591c828d /sd | |
parent | 6b35e804198ac45386805e80a3d413ed3405c3b4 (diff) |
tdf#103876: PPTX import: Title shape's character properties are wrong
Text properties are applied on a shape during text insertion,
but if a placeholder shape has no text, then it has a placehodler
text which should have the right text properties.
Change-Id: I54175d52dd25915ee4d7153298e01ec07c6be1f6
Reviewed-on: https://gerrit.libreoffice.org/30881
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/qa/unit/data/pptx/tdf103876.pptx | bin | 0 -> 29585 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 21 |
2 files changed, 21 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf103876.pptx b/sd/qa/unit/data/pptx/tdf103876.pptx Binary files differnew file mode 100755 index 000000000000..5eb7e869e2c8 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf103876.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index a4d6dbe7bf9e..f9f40cc198e5 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -128,6 +128,7 @@ public: void testTdf49561(); void testTdf103473(); void testTdf103792(); + void testTdf103876(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -181,6 +182,7 @@ public: CPPUNIT_TEST(testTdf49561); CPPUNIT_TEST(testTdf103473); CPPUNIT_TEST(testTdf103792); + CPPUNIT_TEST(testTdf103876); CPPUNIT_TEST_SUITE_END(); }; @@ -1524,6 +1526,25 @@ void SdImportTest::testTdf103792() xDocShRef->DoClose(); } +void SdImportTest::testTdf103876() +{ + // Title text shape's placeholder text did not inherit the corresponding text properties + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf103876.pptx"), PPTX); + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); + + // Check paragraph alignment + sal_Int16 nParaAdjust = 0; + xShape->getPropertyValue( "ParaAdjust" ) >>= nParaAdjust; + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(nParaAdjust)); + + // Check character color + sal_Int32 nCharColor; + xShape->getPropertyValue( "CharColor" ) >>= nCharColor; + CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF0000), nCharColor ); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |