summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-06-07 15:48:25 +0200
committerGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-06-07 23:12:45 +0200
commit8aae7e4bc8dee27bc9dce3f1478777beeeb76e2f (patch)
treefdbce7d1138f9920bc81dc2f37a5316d3afb6483 /sd
parent42223dc7577e18f085592ae2cc06fa4bf3362631 (diff)
tdf#125551 PPTX export: correct position and size of diagrams
Save position and size of diagram background instead of whole group shape. Some diagrams contain shapes that are outside these boundaries. That caused diagram to grow and move. Change-Id: I909c13a5dc268f77832234b3884b91292922823c Reviewed-on: https://gerrit.libreoffice.org/73663 Tested-by: Jenkins Reviewed-by: Grzegorz Araminowicz <grzegorz.araminowicz@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf125551.pptxbin0 -> 131374 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf125551.pptx b/sd/qa/unit/data/pptx/tdf125551.pptx
new file mode 100644
index 000000000000..fb7c106d20e2
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf125551.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index bc987a018af2..9c6cc27aa804 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -205,6 +205,7 @@ public:
void testTdf125360();
void testTdf125360_1();
void testTdf125360_2();
+ void testTdf125551();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -292,6 +293,7 @@ public:
CPPUNIT_TEST(testTdf125360);
CPPUNIT_TEST(testTdf125360_1);
CPPUNIT_TEST(testTdf125360_2);
+ CPPUNIT_TEST(testTdf125551);
CPPUNIT_TEST_SUITE_END();
@@ -2318,6 +2320,21 @@ void SdOOXMLExportTest2::testTdf125360_2()
xDocShRef->DoClose();
}
+void SdOOXMLExportTest2::testTdf125551()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125551.pptx"), PPTX);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ uno::Reference<drawing::XShapes> xGroupShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+ uno::Reference<drawing::XShape> xShapeBg(xGroupShape->getByIndex(0), uno::UNO_QUERY);
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1024), xShapeBg->getPosition().X);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(576), xShapeBg->getPosition().Y);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10815), xShapeBg->getSize().Width);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8587), xShapeBg->getSize().Height);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();