diff options
author | Stephan van den Akker <stephanv778@gmail.com> | 2016-03-02 00:17:03 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2016-03-02 12:20:05 +0000 |
commit | fe3ac0788666294eff66bb999f68e9cce9c3169e (patch) | |
tree | 51d706715f639db4abdbe01661be82a3bc7c6752 /test | |
parent | 3a4b68260bc6c1e8bcb694f640c70652b830c621 (diff) |
Fix the import of line joins and caps from EMF files
Change-Id: I976336d35366b661e402db484820b4dd9a7b0228
Reviewed-on: https://gerrit.libreoffice.org/22821
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/source/mtfxmldump.cxx | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx index 51264b9e4c38..2aab2fa03726 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; |