diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-19 14:47:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-19 21:07:04 +0100 |
commit | 7a5014b24e2755e56790dbfd56fea2c789aa792c (patch) | |
tree | 2d9616b4eff5f11c790f774f5b293ff1801886c9 /svl | |
parent | bd7e258bac69f3b9f9e87128aacb989d23e24d4f (diff) |
silence coverity unchecked return value from library on xmlText* functions
Change-Id: I651abb00d8ae1bdbf758a6a0176fd8912531a585
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112753
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/cenumitm.cxx | 8 | ||||
-rw-r--r-- | svl/source/items/intitem.cxx | 24 | ||||
-rw-r--r-- | svl/source/items/itempool.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/itemset.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/poolitem.cxx | 23 | ||||
-rw-r--r-- | svl/source/items/stritem.cxx | 8 | ||||
-rw-r--r-- | svl/source/undo/undo.cxx | 40 |
7 files changed, 56 insertions, 55 deletions
diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx index a2b62d132c23..5b3c57ed2272 100644 --- a/svl/source/items/cenumitm.cxx +++ b/svl/source/items/cenumitm.cxx @@ -107,10 +107,10 @@ bool SfxBoolItem::GetPresentation(SfxItemPresentation, void SfxBoolItem::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxBoolItem")); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(GetValueTextByVal(m_bValue).toUtf8().getStr())); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxBoolItem")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(GetValueTextByVal(m_bValue).toUtf8().getStr())); + (void)xmlTextWriterEndElement(pWriter); } // virtual diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx index e3850c8bf5a1..7535e665f795 100644 --- a/svl/source/items/intitem.cxx +++ b/svl/source/items/intitem.cxx @@ -100,10 +100,10 @@ SfxPoolItem* SfxUInt16Item::CreateDefault() void SfxUInt16Item::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxUInt16Item")); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr())); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxUInt16Item")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr())); + (void)xmlTextWriterEndElement(pWriter); } boost::property_tree::ptree SfxUInt16Item::dumpAsJSON() const @@ -123,10 +123,10 @@ SfxPoolItem* SfxInt32Item::CreateDefault() void SfxInt32Item::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxInt32Item")); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr())); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxInt32Item")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr())); + (void)xmlTextWriterEndElement(pWriter); } boost::property_tree::ptree SfxInt32Item::dumpAsJSON() const @@ -146,10 +146,10 @@ SfxPoolItem* SfxUInt32Item::CreateDefault() void SfxUInt32Item::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxUInt32Item")); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr())); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxUInt32Item")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr())); + (void)xmlTextWriterEndElement(pWriter); } boost::property_tree::ptree SfxUInt32Item::dumpAsJSON() const diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index 44c0cf534b5d..15f92acfcfd4 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -937,11 +937,11 @@ sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich ) const void SfxItemPool::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxItemPool")); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxItemPool")); for (auto const & rArray : pImpl->maPoolItemArrays) for (auto const & rItem : rArray) rItem->dumpAsXml(pWriter); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterEndElement(pWriter); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 8d7b1e463911..883caf50d9d9 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -1503,11 +1503,11 @@ void SfxItemSet::PutDirect(const SfxPoolItem &rItem) void SfxItemSet::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxItemSet")); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxItemSet")); SfxItemIter aIter(*this); for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem()) pItem->dumpAsXml(pWriter); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterEndElement(pWriter); } diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index c6e3ad6c77d8..835bb911a930 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -539,17 +539,18 @@ bool SfxPoolItem::GetPresentation( void SfxPoolItem::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxPoolItem")); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), - BAD_CAST(OString::number(Which()).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("typeName"), BAD_CAST(typeid(*this).name())); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxPoolItem")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), + BAD_CAST(OString::number(Which()).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("typeName"), + BAD_CAST(typeid(*this).name())); OUString rText; IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag()); if (GetPresentation(SfxItemPresentation::Complete, MapUnit::Map100thMM, MapUnit::Map100thMM, rText, aIntlWrapper)) - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), - BAD_CAST(rText.toUtf8().getStr())); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), + BAD_CAST(rText.toUtf8().getStr())); + (void)xmlTextWriterEndElement(pWriter); } boost::property_tree::ptree SfxPoolItem::dumpAsJSON() const @@ -591,10 +592,10 @@ bool SfxVoidItem::GetPresentation(SfxItemPresentation /*ePresentation*/, MapUnit void SfxVoidItem::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxVoidItem")); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), - BAD_CAST(OString::number(Which()).getStr())); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxVoidItem")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), + BAD_CAST(OString::number(Which()).getStr())); + (void)xmlTextWriterEndElement(pWriter); } SfxVoidItem* SfxVoidItem::Clone(SfxItemPool*) const { return new SfxVoidItem(*this); } diff --git a/svl/source/items/stritem.cxx b/svl/source/items/stritem.cxx index 86e2087cd503..c0ec01a9aba4 100644 --- a/svl/source/items/stritem.cxx +++ b/svl/source/items/stritem.cxx @@ -28,10 +28,10 @@ SfxStringItem* SfxStringItem::Clone(SfxItemPool *) const void SfxStringItem::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxStringItem")); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(GetValue().toUtf8().getStr())); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxStringItem")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(GetValue().toUtf8().getStr())); + (void)xmlTextWriterEndElement(pWriter); } SfxPoolItem* SfxStringItem::CreateDefault() diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index 8d27145af335..71d7b6f254a7 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -124,13 +124,13 @@ bool SfxUndoAction::CanRepeat(SfxRepeatTarget&) const void SfxUndoAction::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxUndoAction")); - xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("symbol"), BAD_CAST(typeid(*this).name())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("comment"), BAD_CAST(GetComment().toUtf8().getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("viewShellId"), BAD_CAST(OString::number(static_cast<sal_Int32>(GetViewShellId())).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("dateTime"), BAD_CAST(utl::toISO8601(m_aDateTime.GetUNODateTime()).toUtf8().getStr())); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxUndoAction")); + (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("symbol"), BAD_CAST(typeid(*this).name())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("comment"), BAD_CAST(GetComment().toUtf8().getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("viewShellId"), BAD_CAST(OString::number(static_cast<sal_Int32>(GetViewShellId())).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("dateTime"), BAD_CAST(utl::toISO8601(m_aDateTime.GetUNODateTime()).toUtf8().getStr())); + (void)xmlTextWriterEndElement(pWriter); } std::unique_ptr<SfxUndoAction> SfxUndoArray::Remove(int idx) @@ -1147,34 +1147,34 @@ void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) const pWriter = xmlNewTextWriterFilename("undo.xml", 0); xmlTextWriterSetIndent(pWriter,1); xmlTextWriterSetIndentString(pWriter, BAD_CAST(" ")); - xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr); + (void)xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr); bOwns = true; } - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxUndoManager")); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nUndoActionCount"), BAD_CAST(OString::number(GetUndoActionCount()).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nRedoActionCount"), BAD_CAST(OString::number(GetRedoActionCount()).getStr())); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxUndoManager")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nUndoActionCount"), BAD_CAST(OString::number(GetUndoActionCount()).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nRedoActionCount"), BAD_CAST(OString::number(GetRedoActionCount()).getStr())); - xmlTextWriterStartElement(pWriter, BAD_CAST("undoActions")); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("undoActions")); for (size_t i = 0; i < GetUndoActionCount(); ++i) { const SfxUndoArray* pUndoArray = m_xData->pActUndoArray; pUndoArray->maUndoActions[pUndoArray->nCurUndoAction - 1 - i].pAction->dumpAsXml(pWriter); } - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterEndElement(pWriter); - xmlTextWriterStartElement(pWriter, BAD_CAST("redoActions")); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("redoActions")); for (size_t i = 0; i < GetRedoActionCount(); ++i) { const SfxUndoArray* pUndoArray = m_xData->pActUndoArray; pUndoArray->maUndoActions[pUndoArray->nCurUndoAction + i].pAction->dumpAsXml(pWriter); } - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterEndElement(pWriter); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterEndElement(pWriter); if (bOwns) { - xmlTextWriterEndDocument(pWriter); + (void)xmlTextWriterEndDocument(pWriter); xmlFreeTextWriter(pWriter); } } @@ -1363,14 +1363,14 @@ bool SfxListUndoAction::Merge( SfxUndoAction *pNextAction ) void SfxListUndoAction::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("SfxListUndoAction")); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("size"), BAD_CAST(OString::number(maUndoActions.size()).getStr())); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SfxListUndoAction")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("size"), BAD_CAST(OString::number(maUndoActions.size()).getStr())); SfxUndoAction::dumpAsXml(pWriter); for (size_t i = 0; i < maUndoActions.size(); ++i) maUndoActions[i].pAction->dumpAsXml(pWriter); - xmlTextWriterEndElement(pWriter); + (void)xmlTextWriterEndElement(pWriter); } SfxUndoArray::~SfxUndoArray() |