summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2018-12-14 16:01:27 +0100
committerMiklos Vajna <vmiklos@collabora.com>2018-12-17 15:40:14 +0100
commit9fb15b5bcde121f1aeedc1843a9a055479530753 (patch)
tree243f7c71186316430fa9c658e70c7b37b7d077cb /oox
parent6f2b06a279ecfeeeb7948a6373dd85bc7b4041e3 (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 (cherry picked from commit 6277a767f33bb5327408dafff2fed199087e938d) Reviewed-on: https://gerrit.libreoffice.org/65254
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 15a064f2d66b..7a71ec106db9 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -853,13 +853,27 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
}
ParamMap::const_iterator aBulletLvl = maMap.find(XML_stBulletLvl);
+ int nStartBulletsAtLevel = 0;
if (aBulletLvl != maMap.end())
+ {
nBaseLevel -= aBulletLvl->second;
+ nStartBulletsAtLevel = aBulletLvl->second;
+ }
for (auto & aParagraph : pTextBody->getParagraphs())
{
sal_Int32 nLevel = aParagraph->getProperties().getLevel();
aParagraph->getProperties().setLevel(nLevel - nBaseLevel);
+ if (nStartBulletsAtLevel > 0 && nLevel >= nStartBulletsAtLevel)
+ {
+ // It is not possible to change the bullet style for text.
+ sal_Int32 nLeftMargin = 285750 * (nLevel - nStartBulletsAtLevel) / EMU_PER_HMM;
+ aParagraph->getProperties().getParaLeftMargin() = nLeftMargin;
+ aParagraph->getProperties().getFirstLineIndentation() = -285750 / EMU_PER_HMM;
+ OUString aBulletChar = OUString::fromUtf8(u8"•");
+ aParagraph->getProperties().getBulletList().setBulletChar(aBulletChar);
+ aParagraph->getProperties().getBulletList().setSuffixNone();
+ }
}
// explicit alignment