diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-09-28 20:21:00 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-09-29 08:03:48 +0200 |
commit | f3aca194d3c1b52387a53e12b3c26b9bfd86ae21 (patch) | |
tree | 7d0afcdd68bed125ca68ee84631412cd4a7c5da3 /sw | |
parent | ed774e9fb5fe33ac93699e6f1f6773f7c63deef5 (diff) |
sw layout xml dump: move SwFont dumper next to the rest of the font code
So it's more likely that it gets updated as SwFont changes.
Change-Id: Ia202ba05d00a2adde7dcf8d8f2ba9e91527cc35b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157384
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/xmldump.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/txtnode/swfont.cxx | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index e3b333b602a0..345740858783 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -278,20 +278,4 @@ void SwAnchoredObject::dumpAsXml( xmlTextWriterPtr writer ) const (void)xmlTextWriterEndElement( writer ); } -void SwFont::dumpAsXml(xmlTextWriterPtr writer) const -{ - (void)xmlTextWriterStartElement(writer, BAD_CAST("SwFont")); - (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(); - (void)xmlTextWriterWriteAttribute(writer, BAD_CAST("weight"), BAD_CAST(ss.str().c_str())); - } - (void)xmlTextWriterEndElement(writer); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index c6d9c3ace26e..98fec0f153e2 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -339,6 +339,22 @@ sal_uInt16 SwFont::CalcShadowSpace(const SvxShadowItemSide nShadow, const bool b return nSpace; } +void SwFont::dumpAsXml(xmlTextWriterPtr writer) const +{ + (void)xmlTextWriterStartElement(writer, BAD_CAST("SwFont")); + (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(); + (void)xmlTextWriterWriteAttribute(writer, BAD_CAST("weight"), BAD_CAST(ss.str().c_str())); + } + (void)xmlTextWriterEndElement(writer); +} + // maps directions for vertical layout static Degree10 MapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT) { |