summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2018-12-14 16:01:27 +0100
committerMiklos Vajna <vmiklos@collabora.com>2018-12-14 17:59:20 +0100
commit6277a767f33bb5327408dafff2fed199087e938d (patch)
treedc7d37526c431f29114c501da769a675b810b657 /sd
parentf0851f982230d3fa19e0647ea18214b2c7b9fb90 (diff)
oox smartart, accent process: fix missing bullets and large para indent
Bulleted paragraphs had a large left indent because we assumed the bullet levels are inherited from the normal master page styles. But that's not true, as <https://support.office.com/en-us/article/add-bullets-to-a-shape-in-a-smartart-graphic-47edc03d-a2f8-4b54-acfd-ca103c515ab4> points out: "It is not possible to change the bullet style for text in a SmartArt graphic." This explains why the margin and bullet char info is missing from the file format, and hints that just hardcoding these to the importer is correct. The result is less linebreaks in the shape text and the lost bullets are also fixed. Change-Id: I60bbee75f3e834551ebb1963a2f42101f3bd91d4 Reviewed-on: https://gerrit.libreoffice.org/65168 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 5eda257f6bf0..c54fdb873036 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -576,6 +576,23 @@ void SdImportTestSmartArt::testAccentProcess()
CPPUNIT_ASSERT_EQUAL(OUString("b"), xFirstChildText->getString());
uno::Reference<drawing::XShape> xFirstChild(xFirstChildText, uno::UNO_QUERY);
CPPUNIT_ASSERT(xFirstChildText.is());
+
+ {
+ uno::Reference<container::XEnumerationAccess> xParasAccess(xFirstChildText, uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParas = xParasAccess->createEnumeration();
+ uno::Reference<beans::XPropertySet> xPara(xParas->nextElement(), uno::UNO_QUERY);
+ // Without the accompanying fix in place, this test would have failed
+ // with 'Expected: 0; Actual : 1270', i.e. there was a large
+ // unexpected left margin.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0),
+ xPara->getPropertyValue("ParaLeftMargin").get<sal_Int32>());
+
+ uno::Reference<container::XIndexAccess> xRules(xPara->getPropertyValue("NumberingRules"),
+ uno::UNO_QUERY);
+ comphelper::SequenceAsHashMap aRule(xRules->getByIndex(1));
+ CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8(u8"•"), aRule["BulletChar"].get<OUString>());
+ }
+
int nFirstChildTop = xFirstChild->getPosition().Y;
int nFirstChildRight = xFirstChild->getPosition().X + xFirstChild->getSize().Width;