summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-16 09:06:05 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-16 09:06:41 +0100
commitd54e21eaa2d4baf85484063476d0aa1769b50583 (patch)
tree1e7f5e9b1f9fe42c19774c20448885e032481456
parentab431b632e1e329372b8058bebdb69e1815840c2 (diff)
Factor out SvxFontItem::dumpAsXml() from sw
Change-Id: I8283ddd868639e6535e27798d91a7273d77f048c
-rw-r--r--editeng/source/items/textitem.cxx12
-rw-r--r--include/editeng/fontitem.hxx1
-rw-r--r--sw/source/core/docnode/nodedump.cxx4
3 files changed, 16 insertions, 1 deletions
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 4d75b47a382a..3ea6bb73f029 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -457,6 +457,18 @@ void SvxFontItem::EnableStoreUnicodeNames( bool bEnable )
bEnableStoreUnicodeNames = bEnable;
}
+void SvxFontItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("svxFontItem"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("familyName"), BAD_CAST(aFamilyName.toUtf8().getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("styleName"), BAD_CAST(aStyleName.toUtf8().getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("family"), BAD_CAST(OString::number(eFamily).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("pitch"), BAD_CAST(OString::number(ePitch).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("textEncoding"), BAD_CAST(OString::number(eTextEncoding).getStr()));
+ xmlTextWriterEndElement(pWriter);
+}
+
// class SvxPostureItem --------------------------------------------------
SvxPostureItem::SvxPostureItem( const FontItalic ePosture, const sal_uInt16 nId ) :
diff --git a/include/editeng/fontitem.hxx b/include/editeng/fontitem.hxx
index 3b9fbb2bd141..6a2cb8a5dba1 100644
--- a/include/editeng/fontitem.hxx
+++ b/include/editeng/fontitem.hxx
@@ -87,6 +87,7 @@ public:
static void EnableStoreUnicodeNames( bool bEnable );
+ void dumpAsXml(struct _xmlTextWriter* pWriter) const;
};
EDITENG_DLLPUBLIC void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian,
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 877a41f2e98f..17540bca3647 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -413,6 +413,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case RES_PARATR_NUMRULE:
static_cast<const SwNumRuleItem*>(pItem)->dumpAsXml(writer);
break;
+ case RES_CHRATR_FONT:
+ static_cast<const SvxFontItem*>(pItem)->dumpAsXml(writer);
+ break;
default: bDone = false; break;
}
if (bDone)
@@ -427,7 +430,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
boost::optional<OString> oValue;
switch (pItem->Which())
{
- case RES_CHRATR_FONT: pWhich = "character font"; oValue = OUStringToOString(static_cast<const SvxFontItem*>(pItem)->GetFamilyName(), RTL_TEXTENCODING_UTF8); break;
case RES_CHRATR_BACKGROUND: pWhich = "character background"; break;
case RES_CHRATR_CTL_FONT: pWhich = "character ctl font"; break;
case RES_CHRATR_FONTSIZE: