sw/qa/core/text/text.cxx                   |    7 ++++---
 sw/qa/core/unocore/unocore.cxx             |    4 ++--
 sw/qa/extras/layout/layout.cxx             |    8 ++++----
 sw/qa/extras/layout/layout2.cxx            |   21 ++++++++++++---------
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx   |    2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx |   16 ++++++++--------
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |    2 +-
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx  |    5 +++--
 sw/qa/extras/uiwriter/uiwriter2.cxx        |   21 ++++++++++++---------
 sw/qa/extras/ww8export/ww8export3.cxx      |    2 +-
 sw/qa/extras/ww8export/ww8export4.cxx      |    2 +-
 sw/source/core/text/porfld.cxx             |   10 +---------
 sw/source/core/text/xmldump.cxx            |    2 ++
 13 files changed, 52 insertions(+), 50 deletions(-)

New commits:
commit 12a5e9bd92c0969051e035a4f2b7c18f0e3e79b5
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu Jan 26 20:03:44 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Jan 27 07:26:53 2023 +0000

    sw: avoid copy&paste in SwFieldPortion::dumpAsXml()
    
    Improve SwFont::dumpAsXml() a little, then we can just call it.
    
    Change-Id: I581445230cd0732819e1bbb45727cf59231c5f47
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146191
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 0ddc9a0885d8..d16e7b324656 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -914,8 +914,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, 
testNumberPortionFormat)
     // - Actual  : 240
     // i.e. the numbering portion font size was 12pt, not 24pt (but only when 
the doc had a
     // bookmark).
-    assertXPath(pXmlDoc, 
"//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
-                "font-height", "480");
+    assertXPath(pXmlDoc,
+                
"//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont",
+                "height", "480");
 }
 
 CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testNumberPortionNoformat)
@@ -933,7 +934,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, 
testNumberPortionNoformat)
     // i.e. the run color affected the color of the number portion in Writer, 
but not in Word.
     CPPUNIT_ASSERT_EQUAL(
         OUString("ffffffff"),
-        getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion", 
"font-color"));
+        getXPath(pXmlDoc, 
"//SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx
index d17b1e19940a..342ca6c2eaab 100644
--- a/sw/qa/core/unocore/unocore.cxx
+++ b/sw/qa/core/unocore/unocore.cxx
@@ -881,7 +881,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, 
testParagraphMarkerODFExport)
     // i.e. the custom "red" color was lost as RES_PARATR_LIST_AUTOFMT was not 
serialized to ODT.
     CPPUNIT_ASSERT_EQUAL(
         OUString("00ff0000"),
-        getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion", 
"font-color"));
+        getXPath(pXmlDoc, 
"//SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
 }
 
 CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testParagraphMarkerFormattedRun)
@@ -900,7 +900,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, 
testParagraphMarkerFormattedRun)
     // i.e. the numbering portion was bold, while its weight should be normal.
     CPPUNIT_ASSERT_EQUAL(
         OUString("normal"),
-        getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion", 
"font-weight"));
+        getXPath(pXmlDoc, 
"//SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "weight"));
 }
 
 CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testFlySplit)
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 71cb32fd9fda..4b8236f51b72 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -4223,10 +4223,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf64222)
 {
     createSwDoc("tdf64222.docx");
     xmlDocUniquePtr pXmlDoc = parseLayoutDump();
-    assertXPath(
-        pXmlDoc,
-        
"/root/page/body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
-        "font-height", "560");
+    assertXPath(pXmlDoc,
+                "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/"
+                "child::*[@type='PortionType::Number']/SwFont",
+                "height", "560");
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf113014)
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 6ff56e5ac49c..5e2f134c8793 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -2247,9 +2247,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117923)
                 
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
                 "expand", "2.");
     // The numbering height was 960.
-    assertXPath(pXmlDoc,
-                
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
-                "font-height", "220");
+    assertXPath(
+        pXmlDoc,
+        
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
+        "height", "220");
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127606)
@@ -2274,9 +2275,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127606)
                 
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
                 "expand", "2.");
     // The numbering height was 960 in DOC format.
-    assertXPath(pXmlDoc,
-                
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
-                "font-height", "220");
+    assertXPath(
+        pXmlDoc,
+        
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
+        "height", "220");
 
     // tdf#127606: now it's possible to change formatting of numbering
     // increase font size (220 -> 260)
@@ -2285,9 +2287,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127606)
     pViewShell->Reformat();
     discardDumpedLayout();
     pXmlDoc = parseLayoutDump();
-    assertXPath(pXmlDoc,
-                
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
-                "font-height", "260");
+    assertXPath(
+        pXmlDoc,
+        
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
+        "height", "260");
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127118)
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 43c4c926ae50..04b7c3c5fd45 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -860,7 +860,7 @@ DECLARE_OOXMLEXPORT_TEST(testNumOverrideLvltext, 
"num-override-lvltext.docx")
     CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty<OUString>(xPara, 
"ListLabelString"));
 
     // The paragraph marker's red font color was inherited by the number 
portion, this was ff0000.
-    CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), 
parseDump("//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", 
"font-color"));
+    CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), 
parseDump("//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont",
 "color"));
 }
 
 DECLARE_OOXMLEXPORT_TEST(testNumOverrideStart, "num-override-start.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 302c7a5dd1cd..c6c01c680ffc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -55,28 +55,28 @@ DECLARE_OOXMLEXPORT_TEST(testTdf131801, "tdf131801.docx")
     xmlDocUniquePtr pDump = parseLayoutDump();
     // "1." is red
     CPPUNIT_ASSERT_EQUAL(OUString("1."), getXPath(pDump, 
"//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
-    CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, 
"//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion", 
"font-color"));
+    CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, 
"//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", 
"color"));
     // "2." is red
     CPPUNIT_ASSERT_EQUAL(OUString("2."), getXPath(pDump, 
"//page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
-    CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, 
"//page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion", 
"font-color"));
+    CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, 
"//page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", 
"color"));
     // "3." is black
     CPPUNIT_ASSERT_EQUAL(OUString("3."), getXPath(pDump, 
"//page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
-    CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, 
"//page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion", 
"font-color"));
+    CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, 
"//page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", 
"color"));
     // "4." is black
     CPPUNIT_ASSERT_EQUAL(OUString("4."), getXPath(pDump, 
"//page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
-    CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, 
"//page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwFieldPortion", 
"font-color"));
+    CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, 
"//page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", 
"color"));
     // "5." is red
     CPPUNIT_ASSERT_EQUAL(OUString("5."), getXPath(pDump, 
"//page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
-    CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, 
"//page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwFieldPortion", 
"font-color"));
+    CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, 
"//page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", 
"color"));
     // "6." is red
     CPPUNIT_ASSERT_EQUAL(OUString("6."), getXPath(pDump, 
"//page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
-    CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, 
"//page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion", 
"font-color"));
+    CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, 
"//page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", 
"color"));
     // "7." is black
     CPPUNIT_ASSERT_EQUAL(OUString("7."), getXPath(pDump, 
"//page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
-    CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, 
"//page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwFieldPortion", 
"font-color"));
+    CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, 
"//page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", 
"color"));
     // "8." is black
     CPPUNIT_ASSERT_EQUAL(OUString("8."), getXPath(pDump, 
"//page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", 
"expand"));
-    CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, 
"//page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", 
"font-color"));
+    CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, 
"//page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion[1]/SwFont", 
"color"));
 
     if (!isExported())
         return;
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 596067d61306..73ac05f6311e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -384,7 +384,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN758883)
      * to the numbering. This is easier to test using a layout dump.
      */
     xmlDocUniquePtr pXmlDoc = parseLayoutDump();
-    assertXPath(pXmlDoc, 
"/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[1]", 
"font-height", "220");
+    assertXPath(pXmlDoc, 
"/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[1]/SwFont", 
"height", "220");
 
     // hidden _Toc and _Ref bookmarks are not visible in Visible bookmarks mode
     // This was PortionType::Bookmark
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index a1110d0d287e..63f3475a7741 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -406,8 +406,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf120548)
     createSwDoc("tdf120548.docx");
     // Without the accompanying fix in place, this test would have failed with 
'Expected: 00ff0000;
     // Actual: ffffffff', i.e. the numbering portion was black, not red.
-    CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"),
-                         
parseDump("//SwFieldPortion[@type='PortionType::Number']", "font-color"));
+    CPPUNIT_ASSERT_EQUAL(
+        OUString("00ff0000"),
+        parseDump("//SwFieldPortion[@type='PortionType::Number']/SwFont", 
"color"));
 }
 
 CPPUNIT_TEST_FIXTURE(Test, test120551)
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 6e481fb770d8..763bfbb1e34d 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -106,9 +106,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, 
testTdfChangeNumberingListAutoFormat)
                 
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
                 "expand", "2.");
     // The numbering height was 960 in DOC format.
-    assertXPath(pXmlDoc,
-                
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
-                "font-height", "220");
+    assertXPath(
+        pXmlDoc,
+        
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
+        "height", "220");
 
     // tdf#127606: now it's possible to change formatting of numbering
     // increase font size (220 -> 260)
@@ -117,9 +118,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, 
testTdfChangeNumberingListAutoFormat)
     pViewShell->Reformat();
     discardDumpedLayout();
     pXmlDoc = parseLayoutDump();
-    assertXPath(pXmlDoc,
-                
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
-                "font-height", "260");
+    assertXPath(
+        pXmlDoc,
+        
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
+        "height", "260");
 
     // save it to DOCX
     reload("Office Open XML Text", "tdf117923.docx");
@@ -130,9 +132,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, 
testTdfChangeNumberingListAutoFormat)
     discardDumpedLayout();
     pXmlDoc = parseLayoutDump();
     // this was 220
-    assertXPath(pXmlDoc,
-                
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
-                "font-height", "260");
+    assertXPath(
+        pXmlDoc,
+        
"/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
+        "height", "260");
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf101534)
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx 
b/sw/qa/extras/ww8export/ww8export3.cxx
index 8f516e5b1984..ae83818c16e2 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -681,7 +681,7 @@ DECLARE_WW8EXPORT_TEST(testTdf108518_CRnumformatting, 
"tdf108518_CRnumformatting
 {
     CPPUNIT_ASSERT_EQUAL(OUString("6.2.3."), 
parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
 "expand"));
     //Without this fix in place, it would become 200 (and non-bold).
-    CPPUNIT_ASSERT_EQUAL(OUString("220"), 
parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
 "font-height"));
+    CPPUNIT_ASSERT_EQUAL(OUString("220"), 
parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont",
 "height"));
 }
 
 DECLARE_WW8EXPORT_TEST(testTdf120711_joinedParagraphWithChangeTracking, 
"tdf120711.doc")
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx 
b/sw/qa/extras/ww8export/ww8export4.cxx
index 6889b587ac6a..316e2e26de8f 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -63,7 +63,7 @@ DECLARE_WW8EXPORT_TEST(testTdf117994_CRnumformatting, 
"tdf117994_CRnumformatting
 {
     CPPUNIT_ASSERT_EQUAL(OUString("1."), 
parseDump("//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
 "expand"));
     //Without this fix in place, it would become 200 (and non-bold).
-    CPPUNIT_ASSERT_EQUAL(OUString("160"), 
parseDump("//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
 "font-height"));
+    CPPUNIT_ASSERT_EQUAL(OUString("160"), 
parseDump("//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont",
 "height"));
 }
 
 DECLARE_WW8EXPORT_TEST(testTdf151548_formFieldMacros, 
"tdf151548_formFieldMacros.doc")
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index a13781baadf4..795caed47d92 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -477,15 +477,7 @@ void SwFieldPortion::dumpAsXml(xmlTextWriterPtr pWriter, 
const OUString& rText,
 
     if (m_pFont)
     {
-        // do not use Color::AsRGBHexString() as that omits the transparency
-        (void)xmlTextWriterWriteFormatAttribute(pWriter, 
BAD_CAST("font-color"), "%08" SAL_PRIxUINT32, sal_uInt32(m_pFont->GetColor()));
-        (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("font-height"), 
BAD_CAST(OString::number(m_pFont->GetSize(m_pFont->GetActual()).Height()).getStr()));
-        (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("font-width"), 
BAD_CAST(OString::number(m_pFont->GetSize(m_pFont->GetActual()).Width()).getStr()));
-        {
-            std::stringstream ss;
-            ss << m_pFont->GetWeight();
-            (void)xmlTextWriterWriteAttribute(pWriter, 
BAD_CAST("font-weight"), BAD_CAST(ss.str().c_str()));
-        }
+        m_pFont->dumpAsXml(pWriter);
     }
 
     (void)xmlTextWriterEndElement(pWriter);
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 9e87d12c81d5..e81c77a9cefc 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -509,6 +509,8 @@ void SwFont::dumpAsXml(xmlTextWriterPtr writer) const
     (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("ptr"), "%p", 
this);
     // do not use Color::AsRGBHexString() as that omits the transparency
     (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("color"), "%08" 
SAL_PRIxUINT32, sal_uInt32(GetColor()));
+    (void)xmlTextWriterWriteAttribute(writer, BAD_CAST("height"), 
BAD_CAST(OString::number(GetSize(GetActual()).Height()).getStr()));
+    (void)xmlTextWriterWriteAttribute(writer, BAD_CAST("width"), 
BAD_CAST(OString::number(GetSize(GetActual()).Width()).getStr()));
     {
         std::stringstream ss;
         ss << GetWeight();

Reply via email to