From 7a5014b24e2755e56790dbfd56fea2c789aa792c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 19 Mar 2021 14:47:58 +0000 Subject: silence coverity unchecked return value from library on xmlText* functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I651abb00d8ae1bdbf758a6a0176fd8912531a585 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112753 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- tools/source/xml/XmlWriter.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tools/source/xml/XmlWriter.cxx') diff --git a/tools/source/xml/XmlWriter.cxx b/tools/source/xml/XmlWriter.cxx index d05ec2203bc6..93c4f0cdea96 100644 --- a/tools/source/xml/XmlWriter.cxx +++ b/tools/source/xml/XmlWriter.cxx @@ -66,14 +66,14 @@ bool XmlWriter::startDocument(sal_Int32 nIndent, bool bWriteXmlHeader) return false; xmlTextWriterSetIndent(mpImpl->mpWriter, nIndent); if (mpImpl->mbWriteXmlHeader) - xmlTextWriterStartDocument(mpImpl->mpWriter, nullptr, "UTF-8", nullptr); + (void)xmlTextWriterStartDocument(mpImpl->mpWriter, nullptr, "UTF-8", nullptr); return true; } void XmlWriter::endDocument() { if (mpImpl->mbWriteXmlHeader) - xmlTextWriterEndDocument(mpImpl->mpWriter); + (void)xmlTextWriterEndDocument(mpImpl->mpWriter); xmlFreeTextWriter(mpImpl->mpWriter); mpImpl->mpWriter = nullptr; } @@ -89,7 +89,7 @@ void XmlWriter::startElement(const OString& sPrefix, const OString& sName, if (!sNamespaceUri.isEmpty()) xmlNamespaceUri = xmlCharStrdup(sNamespaceUri.getStr()); - xmlTextWriterStartElementNS(mpImpl->mpWriter, xmlPrefix, xmlName, xmlNamespaceUri); + (void)xmlTextWriterStartElementNS(mpImpl->mpWriter, xmlPrefix, xmlName, xmlNamespaceUri); xmlFree(xmlName); if (!sPrefix.isEmpty()) @@ -101,11 +101,11 @@ void XmlWriter::startElement(const OString& sPrefix, const OString& sName, void XmlWriter::startElement(const OString& sName) { xmlChar* xmlName = xmlCharStrdup(sName.getStr()); - xmlTextWriterStartElement(mpImpl->mpWriter, xmlName); + (void)xmlTextWriterStartElement(mpImpl->mpWriter, xmlName); xmlFree(xmlName); } -void XmlWriter::endElement() { xmlTextWriterEndElement(mpImpl->mpWriter); } +void XmlWriter::endElement() { (void)xmlTextWriterEndElement(mpImpl->mpWriter); } void XmlWriter::attributeBase64(const OString& rsName, std::vector const& rValueInBytes) { @@ -116,9 +116,9 @@ void XmlWriter::attributeBase64(const OString& rsName, std::vector co void XmlWriter::attributeBase64(const OString& rsName, std::vector const& rValueInBytes) { xmlChar* xmlName = xmlCharStrdup(rsName.getStr()); - xmlTextWriterStartAttribute(mpImpl->mpWriter, xmlName); - xmlTextWriterWriteBase64(mpImpl->mpWriter, rValueInBytes.data(), 0, rValueInBytes.size()); - xmlTextWriterEndAttribute(mpImpl->mpWriter); + (void)xmlTextWriterStartAttribute(mpImpl->mpWriter, xmlName); + (void)xmlTextWriterWriteBase64(mpImpl->mpWriter, rValueInBytes.data(), 0, rValueInBytes.size()); + (void)xmlTextWriterEndAttribute(mpImpl->mpWriter); xmlFree(xmlName); } @@ -126,7 +126,7 @@ void XmlWriter::attribute(const OString& name, const OString& value) { xmlChar* xmlName = xmlCharStrdup(name.getStr()); xmlChar* xmlValue = xmlCharStrdup(value.getStr()); - xmlTextWriterWriteAttribute(mpImpl->mpWriter, xmlName, xmlValue); + (void)xmlTextWriterWriteAttribute(mpImpl->mpWriter, xmlName, xmlValue); xmlFree(xmlValue); xmlFree(xmlName); } @@ -149,7 +149,7 @@ void XmlWriter::attributeDouble(const OString& name, const double aNumber) void XmlWriter::content(const OString& sValue) { xmlChar* xmlValue = xmlCharStrdup(sValue.getStr()); - xmlTextWriterWriteString(mpImpl->mpWriter, xmlValue); + (void)xmlTextWriterWriteString(mpImpl->mpWriter, xmlValue); xmlFree(xmlValue); } -- cgit