diff options
author | Tibor Nagy <nagy.tibor2@nisz.hu> | 2023-03-08 16:26:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-06-27 16:00:35 +0200 |
commit | a1acb19ec4c239a24b23ec9c03ad52465895606d (patch) | |
tree | 1a5994d95754c0ebaab126d62bd6f99209f6636c /sd | |
parent | d2d3d9e21630a7d063b45943ef5432943640ded2 (diff) |
tdf#153466 PPTX import: fix "Custom position/size" background image
Custom sized background with the value "tile" was imported as
"stretched", losing the preset size. Restore also the exported
preset positions, and map the other values to the preset positions
supported by OpenDocument/Impress.
Follow-up to commit 11451781d4c562f506a3aae3732e35b92387b4db
(tdf#153105 PPTX export: fix "Custom position/size" background image)
Change-Id: Ibf9b487ecd31b3ad7b06bda668c51e6b7a98c4af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148482
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153580
Reviewed-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf153466.pptx | bin | 0 -> 35419 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf153466.pptx b/sd/qa/unit/data/pptx/tdf153466.pptx Binary files differnew file mode 100644 index 000000000000..8900083ba7bf --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf153466.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 13353ad00986..706214950411 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -52,6 +52,7 @@ #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #include <com/sun/star/drawing/ConnectorType.hpp> +#include <com/sun/star/drawing/RectanglePoint.hpp> #include <stlpool.hxx> #include <unotools/syslocaleoptions.hxx> @@ -84,6 +85,7 @@ public: void testDocumentLayout(); void testTdf154363(); + void testTdf153466(); void testTdf152434(); void testStandardConnectors(); void testConnectors(); @@ -163,6 +165,7 @@ public: CPPUNIT_TEST(testDocumentLayout); CPPUNIT_TEST(testTdf154363); + CPPUNIT_TEST(testTdf153466); CPPUNIT_TEST(testTdf152434); CPPUNIT_TEST(testStandardConnectors); CPPUNIT_TEST(testConnectors); @@ -383,6 +386,25 @@ void SdImportTest::testTdf154363() } } +void SdImportTest::testTdf153466() +{ + createSdImpressDoc("pptx/tdf153466.pptx"); + + uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY_THROW); + uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPageSet(xPage, uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xBackground( + xPageSet->getPropertyValue("Background").get<uno::Reference<beans::XPropertySet>>()); + + com::sun::star::drawing::RectanglePoint aRectanglePoint; + xBackground->getPropertyValue("FillBitmapRectanglePoint") >>= aRectanglePoint; + CPPUNIT_ASSERT_EQUAL(drawing::RectanglePoint::RectanglePoint_RIGHT_BOTTOM, aRectanglePoint); + + uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0), uno::UNO_SET_THROW); + xShape->getPropertyValue("FillBitmapRectanglePoint") >>= aRectanglePoint; + CPPUNIT_ASSERT_EQUAL(drawing::RectanglePoint::RectanglePoint_LEFT_MIDDLE, aRectanglePoint); +} + void SdImportTest::testTdf152434() { createSdImpressDoc("pptx/tdf152434.pptx"); |