summaryrefslogtreecommitdiff
path: root/include/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-02-27 17:04:02 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-02-27 20:24:54 +0100
commit279c7f83a57c4d3991930ee80e9d9c287c21270a (patch)
tree8f03db9ed59c3f09750a2bcb4247fbf0d2d46b68 /include/oox
parentb436b039b9b8eb0d289a2d7648d97f4a6b91df35 (diff)
oox smartart, picture strip: fix lack of margin in text shapes
Shape text has two kind of spacing inside the shape's bounding box: the shape-level margin and the paragraph-level one. Only the second was handled in the tx algorithm so far, add support for the first. The margins taken from constraints were way large by default: the only explanation I found for that is that SmartArt layout sometimes calculates in MMs, sometimes in Points, and the ratio between the two is exactly the Impress / PowerPoint margin. So assume that indeed that unit difference is the reason for the smaller in-PowerPoint margin values and do the same on our side. Change-Id: I6f1e54301e2e9b33a7e721be34244d968cccf42d Reviewed-on: https://gerrit.libreoffice.org/68453 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'include/oox')
-rw-r--r--include/oox/drawingml/drawingmltypes.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/oox/drawingml/drawingmltypes.hxx b/include/oox/drawingml/drawingmltypes.hxx
index c4f05fcdd84e..2abe05767d6a 100644
--- a/include/oox/drawingml/drawingmltypes.hxx
+++ b/include/oox/drawingml/drawingmltypes.hxx
@@ -190,6 +190,13 @@ inline float convertEmuToPoints( sal_Int64 nValue )
return static_cast<float>(nValue) / EMU_PER_PT;
}
+/** Converts the passed double value from points to mm. */
+inline double convertPointToMms(double fValue)
+{
+ constexpr double fFactor = static_cast<double>(EMU_PER_PT) / (EMU_PER_HMM * 100);
+ return fValue * fFactor;
+}
+
/** A structure for a point with 64-bit integer components. */
struct EmuPoint
{