diff options
author | gulsahkose <gulsah.kose@collabora.com> | 2021-12-01 10:46:41 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-12-01 14:11:36 +0100 |
commit | 7b3be7f6f3d800e2ad86f5a043e6e9b21ed4409f (patch) | |
tree | 7336b84c56e0c23edb0fec0d733fc2b2386c50cc /sd | |
parent | c28a13b9e2bd864e8c574d604bcd6da9e93fb476 (diff) |
tdf#140912 Better handling of the picture placeholders.
To see icon and placeholder text at the center of picture
placeholder shape, we set the TextContourFrame and GraphicCrop
properties.
Change-Id: I49e3d08c9020e593232c60c97af3f45fb620075e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126165
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdfpictureplaceholder.pptx | bin | 0 -> 28072 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml3.cxx | 20 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdfpictureplaceholder.pptx b/sd/qa/unit/data/pptx/tdfpictureplaceholder.pptx Binary files differnew file mode 100644 index 000000000000..d681c749cab0 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdfpictureplaceholder.pptx diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index a9a740eb4588..900716e20093 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/style/LineSpacing.hpp> #include <com/sun/star/style/LineSpacingMode.hpp> #include <com/sun/star/frame/XLoadable.hpp> +#include <com/sun/star/text/GraphicCrop.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> @@ -120,6 +121,7 @@ public: void testTdf143222_embeddedWorksheet(); void testTdf142235_TestPlaceholderTextAlignment(); void testTdf143315(); + void testTdf140912_PicturePlaceholder(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest3); @@ -191,6 +193,7 @@ public: CPPUNIT_TEST(testTdf143222_embeddedWorksheet); CPPUNIT_TEST(testTdf142235_TestPlaceholderTextAlignment); CPPUNIT_TEST(testTdf143315); + CPPUNIT_TEST(testTdf140912_PicturePlaceholder); CPPUNIT_TEST_SUITE_END(); virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override @@ -1813,6 +1816,23 @@ void SdOOXMLExportTest3::testTdf143315() assertXPath(pXml, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr/a:buChar", 0); } +void SdOOXMLExportTest3::testTdf140912_PicturePlaceholder() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL( + m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdfpictureplaceholder.pptx"), PPTX); + + uno::Reference<beans::XPropertySet> xShapeProps(getShapeFromPage(0, 0, xDocShRef)); + bool bTextContourFrame = true; + xShapeProps->getPropertyValue("TextContourFrame") >>= bTextContourFrame; + CPPUNIT_ASSERT_EQUAL(false, bTextContourFrame); + + text::GraphicCrop aGraphicCrop; + xShapeProps->getPropertyValue("GraphicCrop") >>= aGraphicCrop; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-8490), aGraphicCrop.Top); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest3); CPPUNIT_PLUGIN_IMPLEMENT(); |