vcl/source/gdi/mtfxmldump.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 497f8c831246653287bb2204c6532f8ce4820025
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Sep 15 20:27:16 2025 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Thu Sep 18 13:59:36 2025 +0200

    add italic to mtf xml dump
    
    Change-Id: I9c8ce33664b255624c4065e64a9d89bc6b366210
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190993
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/vcl/source/gdi/mtfxmldump.cxx b/vcl/source/gdi/mtfxmldump.cxx
index eb022fe17367..a32b79da96f3 100644
--- a/vcl/source/gdi/mtfxmldump.cxx
+++ b/vcl/source/gdi/mtfxmldump.cxx
@@ -226,6 +226,19 @@ OUString convertFontWeightToString(FontWeight eFontWeight)
     return OUString();
 }
 
+OUString convertFontItalicToString(FontItalic eFontItalic)
+{
+    switch (eFontItalic)
+    {
+        case ITALIC_DONTKNOW:  return u"unknown"_ustr;
+        case ITALIC_OBLIQUE:   return u"oblique"_ustr;
+        case ITALIC_NORMAL:    return u"normal"_ustr;
+        case ITALIC_NONE:      return u"none"_ustr;
+        case FontItalic_FORCE_EQUAL_SIZE: return u"equalsize"_ustr;
+    }
+    return OUString();
+}
+
 OUString convertFontStrikeoutToString(FontStrikeout eFontStrikeout)
 {
     switch (eFontStrikeout)
@@ -1332,6 +1345,7 @@ void MetafileXmlDump::writeXml(const GDIMetaFile& 
rMetaFile, tools::XmlWriter& r
                 rWriter.attribute("height", aFont.GetFontSize().Height());
                 rWriter.attribute("orientation", aFont.GetOrientation().get());
                 rWriter.attribute("weight", 
convertFontWeightToString(aFont.GetWeight()));
+                rWriter.attribute("italic", 
convertFontItalicToString(aFont.GetItalic()));
                 rWriter.attribute("vertical", aFont.IsVertical() ? "true" : 
"false");
                 rWriter.attribute("emphasis", aFont.GetEmphasisMark() != 
FontEmphasisMark::NONE ? "true" : "false");
                 rWriter.attribute("shadow", aFont.IsShadow() ? "true" : 
"false");

Reply via email to