summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-01-07 16:32:18 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-01-07 17:29:44 +0100
commit5dfd5755c709e91d2903bd7be4582f7832e89780 (patch)
tree8042e24eca1006518f9b312b09281f61f203ad0c /sd/qa
parentc5a7e5d9348d809a61449226ac4169619f89a904 (diff)
oox smartart, org chart: fix font color when defined with quick styles
createStyleMatrixContext() assumed that <dgm:style> contains <dgm:fontRef>, but it contains <a:fontRef> instead. This resulted in a 0 mnThemedIdx, which meant that since commit 89206c472ecf18bfde6824cea8004921cd404365 (bnc#862510: PPTX import: Wrong text color inside shape, 2014-12-21) we ignored the theme color in oox::drawingml::Shape::createAndInsert(). Change-Id: I81045fa58df5cb9e31a4ed3f1b1625224bcd06ad Reviewed-on: https://gerrit.libreoffice.org/65938 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 98df02de2fc9..1cde30c4e140 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -700,6 +700,17 @@ void SdImportTestSmartArt::testOrgChart()
CPPUNIT_ASSERT(xManager.is());
CPPUNIT_ASSERT_EQUAL(OUString("Manager"), xManager->getString());
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xManager, uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xPara, uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
+ uno::Reference<beans::XPropertySet> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
+ sal_Int32 nActualColor = xRun->getPropertyValue("CharColor").get<sal_Int32>();
+ // Without the accompanying fix in place, this test would have failed: the
+ // "Manager" font color was black, not white.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff), nActualColor);
+
uno::Reference<drawing::XShape> xManagerShape(xManager, uno::UNO_QUERY);
CPPUNIT_ASSERT(xManagerShape.is());