summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStephan van den Akker <stephanv778@gmail.com>2016-03-02 00:17:03 +0100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-03-06 13:28:04 +0000
commit185194a3d935cb92d4f1d50c8987d1e8d69c5041 (patch)
treef01ab4d287812209f46cfb977cadbacd9602428d /test
parent6b3dd63dea6861180f438db71ca3f73df2aef200 (diff)
Fix the import of line joins and caps from EMF files
Backported fix to 5.1 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/22946 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
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 f30e72729327..aa42a08faf43 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;