summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStephan van den Akker <stephanv778@gmail.com>2016-03-02 00:17:03 +0100
committerAndras Timar <andras.timar@collabora.com>2016-03-10 19:36:54 +0100
commit52865f5e0e63814ad47dc377b807e17e7cd997ee (patch)
tree28267bec634c3e3e7d45f76efa749991f3b1fe86 /test
parent1a1d704004858edef3a9ac84f2b8f4bc9107b545 (diff)
Fix the import of line joins and caps from EMF files
Backported fix to 5.0. Note that commit 42f771d6e changed from constant values for line joins to an enum, but that only got into the 5.1 branch so have had to use the old constants. Change-Id: I976336d35366b661e402db484820b4dd9a7b0228 Reviewed-on: https://gerrit.libreoffice.org/22821 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/22947 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com> (cherry picked from commit 4a17335d608c2954c482734ce4912100cb0e7aff)
Diffstat (limited to 'test')
-rw-r--r--test/source/mtfxmldump.cxx28
1 files changed, 27 insertions, 1 deletions
diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx
index 3df33b956820..9ca06033b976 100644
--- a/test/source/mtfxmldump.cxx
+++ b/test/source/mtfxmldump.cxx
@@ -124,6 +124,29 @@ OUString convertLineStyleToString(LineStyle eAlign)
return OUString();
}
+OUString convertLineJoinToString(basegfx::B2DLineJoin eJoin)
+{
+ switch (eJoin)
+ {
+ default:
+ case basegfx::B2DLINEJOIN_NONE: return OUString("none");
+ case basegfx::B2DLINEJOIN_BEVEL: return OUString("bevel");
+ case basegfx::B2DLINEJOIN_MITER: return OUString("miter");
+ case basegfx::B2DLINEJOIN_ROUND: return OUString("round");
+ }
+}
+
+OUString convertLineCapToString(css::drawing::LineCap eCap)
+{
+ switch (eCap)
+ {
+ default:
+ case css::drawing::LineCap_BUTT: return OUString("butt");
+ case css::drawing::LineCap_ROUND: return OUString("round");
+ case css::drawing::LineCap_SQUARE: return OUString("square");
+ }
+}
+
OUString convertFontWeigthToString(FontWeight eFontWeight)
{
enum FontWeight { WEIGHT_DONTKNOW, WEIGHT_THIN, WEIGHT_ULTRALIGHT,
@@ -282,9 +305,12 @@ void MetafileXmlDump::writeXml(const GDIMetaFile& rMetaFile, XmlWriter& rWriter)
rWriter.attribute("style", convertLineStyleToString(aLineInfo.GetStyle()));
rWriter.attribute("width", aLineInfo.GetWidth());
rWriter.attribute("dashlen", aLineInfo.GetDashLen());
+ rWriter.attribute("dashcount", aLineInfo.GetDashCount());
rWriter.attribute("dotlen", aLineInfo.GetDotLen());
+ rWriter.attribute("dotcount", aLineInfo.GetDotCount());
rWriter.attribute("distance", aLineInfo.GetDistance());
-
+ rWriter.attribute("join", convertLineJoinToString(aLineInfo.GetLineJoin()));
+ rWriter.attribute("cap", convertLineCapToString(aLineInfo.GetLineCap()));
rWriter.endElement();
}
break;