diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-02-11 09:02:13 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-02-12 09:04:54 +0100 |
commit | cfbd830e9c4d1877989bc4ad93109551a0a4b0b7 (patch) | |
tree | a050319e1167c816ac284894de0c2d4a535ee23a /unoxml | |
parent | 294b9a415929f25982373e91cba9254686074b19 (diff) |
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 <mike.kaganski@collabora.com>
Diffstat (limited to 'unoxml')
-rw-r--r-- | unoxml/source/dom/document.cxx | 36 |
1 files changed, 12 insertions, 24 deletions
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<xmlEntityPtr>(pNode))); + pCNode = new CEntity(*this, m_Mutex, reinterpret_cast<xmlEntityPtr>(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<xmlDocPtr>(pNode))); + pCNode = new CDocument(reinterpret_cast<xmlDocPtr>(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<xmlDtdPtr>(pNode))); + pCNode = new CDocumentType(*this, m_Mutex, reinterpret_cast<xmlDtdPtr>(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<xmlNotationPtr>(pNode))); + pCNode = new CNotation(*this, m_Mutex, reinterpret_cast<xmlNotationPtr>(pNode)); break; case XML_ATTRIBUTE_NODE: // m_aNodeType = NodeType::ATTRIBUTE_NODE; - pCNode = static_cast< CNode* >(new CAttr(*this, m_Mutex, - reinterpret_cast<xmlAttrPtr>(pNode))); + pCNode = new CAttr(*this, m_Mutex, reinterpret_cast<xmlAttrPtr>(pNode)); break; // unsupported node types case XML_HTML_DOCUMENT_NODE: |