summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-04-15 08:19:25 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2024-04-17 06:40:40 +0200
commit96f62b48b4425f0bc2b6d8497782694078d968fc (patch)
tree5cc29d41f17d51b10af591922008b49acd265d70
parent0340a52ef0b9da9861f912c56550e685621a59f1 (diff)
Simplify a bit
Change-Id: Iadfa442f762aa3caf3a8de7f3633be4e73bfd91a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166091 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--include/tools/XmlWriter.hxx7
-rw-r--r--tools/source/xml/XmlWriter.cxx13
2 files changed, 5 insertions, 15 deletions
diff --git a/include/tools/XmlWriter.hxx b/include/tools/XmlWriter.hxx
index 03cc151b2624..9c8f82a86f42 100644
--- a/include/tools/XmlWriter.hxx
+++ b/include/tools/XmlWriter.hxx
@@ -48,12 +48,15 @@ public:
void endDocument();
void startElement(const char* sName);
- void startElement(const OString& sName);
+ void startElement(const OString& sName) { startElement(sName.getStr()); }
void startElement(const OString& sPrefix, const OString& sName, const OString& sNamespaceUri);
void endElement();
void attribute(const char* sTagName, const OString& aValue);
- void attribute(const OString& sTagName, const OString& aValue);
+ void attribute(const OString& sTagName, const OString& aValue)
+ {
+ attribute(sTagName.getStr(), aValue);
+ }
void attribute(const char* sTagName, std::u16string_view aValue);
void attribute(const char* sTagName, sal_Int64 aNumber);
template <typename T>
diff --git a/tools/source/xml/XmlWriter.cxx b/tools/source/xml/XmlWriter.cxx
index f49c312bd133..8bbd7951a3b8 100644
--- a/tools/source/xml/XmlWriter.cxx
+++ b/tools/source/xml/XmlWriter.cxx
@@ -99,12 +99,6 @@ void XmlWriter::startElement(const char* pName)
(void)xmlTextWriterStartElement(mpImpl->mpWriter, xmlName);
}
-void XmlWriter::startElement(const OString& rName)
-{
- xmlChar* xmlName = BAD_CAST(rName.getStr());
- (void)xmlTextWriterStartElement(mpImpl->mpWriter, xmlName);
-}
-
void XmlWriter::endElement() { (void)xmlTextWriterEndElement(mpImpl->mpWriter); }
void XmlWriter::attributeBase64(const char* pName, std::vector<sal_uInt8> const& rValueInBytes)
@@ -128,13 +122,6 @@ void XmlWriter::attribute(const char* name, const OString& value)
(void)xmlTextWriterWriteAttribute(mpImpl->mpWriter, xmlName, xmlValue);
}
-void XmlWriter::attribute(const OString& name, const OString& value)
-{
- xmlChar* xmlName = BAD_CAST(name.getStr());
- xmlChar* xmlValue = BAD_CAST(value.getStr());
- (void)xmlTextWriterWriteAttribute(mpImpl->mpWriter, xmlName, xmlValue);
-}
-
void XmlWriter::attribute(const char* name, std::u16string_view value)
{
attribute(name, OUStringToOString(value, RTL_TEXTENCODING_UTF8));