summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-05-08 21:49:34 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-05-10 12:18:29 +0200
commitc86cf2aaa07538e8c37dc81729905a3bb9ecc1ff (patch)
treeccf989aacdbb0718784518e34a9c942d66b569f7 /sw/qa/extras
parent96dd1cd36c2f9446d3455a06b5f77a3954950c03 (diff)
SmartArt: support diagram background
Solved by adding additional shape filling whole diagram. MS PowerPoint does the same when converting SmartArt to shapes. Background shape is also copied when loading from drawingML fallback, appearently there is no background information. Corrected SmartArt import tests, so that they are aware of extra shape. Change-Id: I6154f8e1b34e5867ab582d6fc54459c7c93edbac Reviewed-on: https://gerrit.libreoffice.org/72012 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx8
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx4
2 files changed, 6 insertions, 6 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index ebf9577cb499..3b1250f11fd9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -109,14 +109,14 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); // One groupshape in the doc
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xGroup->getCount()); // 3 rectangles and an arrow in the group
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(5), xGroup->getCount()); // background, 3 rectangles and an arrow in the group
- uno::Reference<beans::XPropertySet> xPropertySet(xGroup->getByIndex(1), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xGroup->getByIndex(2), uno::UNO_QUERY);
sal_Int32 nValue(0);
xPropertySet->getPropertyValue("FillColor") >>= nValue;
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), nValue); // If fill color is right, theme import is OK
- uno::Reference<text::XTextRange> xTextRange(xGroup->getByIndex(1), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xTextRange(xGroup->getByIndex(2), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("Sample"), xTextRange->getString()); // Shape has text
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextRange->getText(), uno::UNO_QUERY);
@@ -479,7 +479,7 @@ DECLARE_OOXMLEXPORT_TEST(testSmartartStrict, "strict-smartart.docx")
{
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
// This was 0, SmartArt was visually missing.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xGroup->getCount()); // 3 ellipses + 3 arrows
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(7), xGroup->getCount()); // background, 3 ellipses + 3 arrows
}
DECLARE_OOXMLEXPORT_TEST(testLibreOfficeHang, "frame-wrap-auto.docx")
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 53deec97aae0..f40264586eae 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1041,11 +1041,11 @@ DECLARE_OOXMLIMPORT_TEST(testFdo87488, "fdo87488.docx")
// StarView MetaFile.
uno::Reference<container::XIndexAccess> group(getShape(1), uno::UNO_QUERY);
{
- uno::Reference<text::XTextRange> text(group->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> text(group->getByIndex(1), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("text2"), text->getString());
}
{
- uno::Reference<beans::XPropertySet> props(group->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> props(group->getByIndex(1), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(props->getPropertyValue("RotateAngle"),
uno::makeAny<sal_Int32>(270 * 100));
comphelper::SequenceAsHashMap geom(props->getPropertyValue("CustomShapeGeometry"));