From cfbd830e9c4d1877989bc4ad93109551a0a4b0b7 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 11 Feb 2019 09:02:13 +0300 Subject: tdf#120703 PVS: remove redundant static casts V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I5fee1c4bebd1972fbb5e43da37149d4e2ff6ce0d Reviewed-on: https://gerrit.libreoffice.org/67664 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- unoxml/source/dom/document.cxx | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'unoxml/source/dom') diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 7380bcdc4a9b..94dce24255ac 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -187,66 +187,54 @@ namespace DOM { case XML_ELEMENT_NODE: // m_aNodeType = NodeType::ELEMENT_NODE; - pCNode = static_cast< CNode* >( - new CElement(*this, m_Mutex, pNode)); + pCNode = new CElement(*this, m_Mutex, pNode); break; case XML_TEXT_NODE: // m_aNodeType = NodeType::TEXT_NODE; - pCNode = static_cast< CNode* >( - new CText(*this, m_Mutex, pNode)); + pCNode = new CText(*this, m_Mutex, pNode); break; case XML_CDATA_SECTION_NODE: // m_aNodeType = NodeType::CDATA_SECTION_NODE; - pCNode = static_cast< CNode* >( - new CCDATASection(*this, m_Mutex, pNode)); + pCNode = new CCDATASection(*this, m_Mutex, pNode); break; case XML_ENTITY_REF_NODE: // m_aNodeType = NodeType::ENTITY_REFERENCE_NODE; - pCNode = static_cast< CNode* >( - new CEntityReference(*this, m_Mutex, pNode)); + pCNode = new CEntityReference(*this, m_Mutex, pNode); break; case XML_ENTITY_NODE: // m_aNodeType = NodeType::ENTITY_NODE; - pCNode = static_cast< CNode* >(new CEntity(*this, m_Mutex, - reinterpret_cast(pNode))); + pCNode = new CEntity(*this, m_Mutex, reinterpret_cast(pNode)); break; case XML_PI_NODE: // m_aNodeType = NodeType::PROCESSING_INSTRUCTION_NODE; - pCNode = static_cast< CNode* >( - new CProcessingInstruction(*this, m_Mutex, pNode)); + pCNode = new CProcessingInstruction(*this, m_Mutex, pNode); break; case XML_COMMENT_NODE: // m_aNodeType = NodeType::COMMENT_NODE; - pCNode = static_cast< CNode* >( - new CComment(*this, m_Mutex, pNode)); + pCNode = new CComment(*this, m_Mutex, pNode); break; case XML_DOCUMENT_NODE: // m_aNodeType = NodeType::DOCUMENT_NODE; OSL_ENSURE(false, "CDocument::GetCNode is not supposed to" " create a CDocument!!!"); - pCNode = static_cast< CNode* >(new CDocument( - reinterpret_cast(pNode))); + pCNode = new CDocument(reinterpret_cast(pNode)); break; case XML_DOCUMENT_TYPE_NODE: case XML_DTD_NODE: // m_aNodeType = NodeType::DOCUMENT_TYPE_NODE; - pCNode = static_cast< CNode* >(new CDocumentType(*this, m_Mutex, - reinterpret_cast(pNode))); + pCNode = new CDocumentType(*this, m_Mutex, reinterpret_cast(pNode)); break; case XML_DOCUMENT_FRAG_NODE: // m_aNodeType = NodeType::DOCUMENT_FRAGMENT_NODE; - pCNode = static_cast< CNode* >( - new CDocumentFragment(*this, m_Mutex, pNode)); + pCNode = new CDocumentFragment(*this, m_Mutex, pNode); break; case XML_NOTATION_NODE: // m_aNodeType = NodeType::NOTATION_NODE; - pCNode = static_cast< CNode* >(new CNotation(*this, m_Mutex, - reinterpret_cast(pNode))); + pCNode = new CNotation(*this, m_Mutex, reinterpret_cast(pNode)); break; case XML_ATTRIBUTE_NODE: // m_aNodeType = NodeType::ATTRIBUTE_NODE; - pCNode = static_cast< CNode* >(new CAttr(*this, m_Mutex, - reinterpret_cast(pNode))); + pCNode = new CAttr(*this, m_Mutex, reinterpret_cast(pNode)); break; // unsupported node types case XML_HTML_DOCUMENT_NODE: -- cgit