From 4d08aba74b572287a7a0b21a0d8895cad515470a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 25 Oct 2014 14:53:12 +0100 Subject: coverity#1249457 writeFastAttributeList never takes NULL and coverity#1249456 Change-Id: If1f6ef550290d3b6bb53ae87389b466c7d7a31f1 --- sax/source/tools/fastserializer.cxx | 10 +++++----- sax/source/tools/fastserializer.hxx | 2 +- sax/source/tools/fshelper.cxx | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'sax/source') diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index ac8376b3be84..9209bd803c39 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -202,7 +202,7 @@ namespace sax_fastparser { writeId(Element); if (pAttrList) - writeFastAttributeList(pAttrList); + writeFastAttributeList(*pAttrList); else writeTokenValueList(); @@ -237,7 +237,7 @@ namespace sax_fastparser { writeId(Element); if (pAttrList) - writeFastAttributeList(pAttrList); + writeFastAttributeList(*pAttrList); else writeTokenValueList(); @@ -277,12 +277,12 @@ namespace sax_fastparser { maTokenValues.clear(); } - void FastSaxSerializer::writeFastAttributeList( FastAttributeList* pAttrList ) + void FastSaxSerializer::writeFastAttributeList(FastAttributeList& rAttrList) { #ifdef DBG_UTIL ::std::set DebugAttributes; #endif - const std::vector< sal_Int32 >& Tokens = pAttrList->getFastAttributeTokens(); + const std::vector< sal_Int32 >& Tokens = rAttrList.getFastAttributeTokens(); for (size_t j = 0; j < Tokens.size(); j++) { writeBytes(sSpace, N_CHARS(sSpace)); @@ -299,7 +299,7 @@ namespace sax_fastparser { writeBytes(sEqualSignAndQuote, N_CHARS(sEqualSignAndQuote)); - write(pAttrList->getFastAttributeValue(j), pAttrList->AttributeValueLength(j), true); + write(rAttrList.getFastAttributeValue(j), rAttrList.AttributeValueLength(j), true); writeBytes(sQuote, N_CHARS(sQuote)); } diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx index 8500b680f65d..95e631c355d2 100644 --- a/sax/source/tools/fastserializer.hxx +++ b/sax/source/tools/fastserializer.hxx @@ -220,7 +220,7 @@ private: #endif void writeTokenValueList(); - void writeFastAttributeList( FastAttributeList* pAttrList ); + void writeFastAttributeList(FastAttributeList& rAttrList); /** Forward the call to the output stream, or write to the stack. diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx index 15a5efa0f518..438aef75c48a 100644 --- a/sax/source/tools/fshelper.cxx +++ b/sax/source/tools/fshelper.cxx @@ -92,7 +92,6 @@ void FastSerializerHelper::startElement(sal_Int32 elementTokenId, XFastAttribute mpSerializer->startFastElement(elementTokenId, pAttrList); } - void FastSerializerHelper::singleElement(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList) { FastAttributeList* pAttrList = dynamic_cast< FastAttributeList* >(xAttrList.get()); -- cgit