summaryrefslogtreecommitdiff
path: root/unoxml/source/dom/saxbuilder.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-02 10:36:43 +0200
committerNoel Grandin <noelgrandin@gmail.com>2013-05-22 10:44:29 +0000
commit6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 (patch)
tree2746468845d6f1159e3759ee2cf7a620fca15b6e /unoxml/source/dom/saxbuilder.cxx
parent697a007c61b9cabceb9767fad87cd5822b300452 (diff)
Use the new type-checking Reference constructor to reduce code noise
Also create a Clang compiler plugin to detect such cases. Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752 Reviewed-on: https://gerrit.libreoffice.org/4001 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'unoxml/source/dom/saxbuilder.cxx')
-rw-r--r--unoxml/source/dom/saxbuilder.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx
index 459cd6bb9ee9..4568e745e008 100644
--- a/unoxml/source/dom/saxbuilder.cxx
+++ b/unoxml/source/dom/saxbuilder.cxx
@@ -135,7 +135,7 @@ namespace DOM
m_aDocument = ownerDoc;
Reference< XDocumentFragment > aFragment = m_aDocument->createDocumentFragment();
- m_aNodeStack.push(Reference< XNode >(aFragment, UNO_QUERY));
+ m_aNodeStack.push(aFragment);
m_aFragment = aFragment;
m_aState = SAXDocumentBuilderState_BUILDING_FRAGMENT;
}
@@ -169,7 +169,7 @@ namespace DOM
Reference< XDocumentBuilder > aBuilder(DocumentBuilder::create(comphelper::getComponentContext(m_aServiceManager)));
Reference< XDocument > aDocument = aBuilder->newDocument();
- m_aNodeStack.push(Reference< XNode >(aDocument, UNO_QUERY));
+ m_aNodeStack.push(aDocument);
m_aDocument = aDocument;
m_aState = SAXDocumentBuilderState_BUILDING_DOCUMENT;
}
@@ -258,9 +258,9 @@ namespace DOM
aElement = m_aDocument->createElement(aName);
}
aElement = Reference< XElement > (
- m_aNodeStack.top()->appendChild(Reference< XNode >(aElement, UNO_QUERY)),
+ m_aNodeStack.top()->appendChild(aElement),
UNO_QUERY);
- m_aNodeStack.push(Reference< XNode >(aElement, UNO_QUERY));
+ m_aNodeStack.push(aElement);
// set non xmlns attributes
aPrefix = OUString();
@@ -332,7 +332,7 @@ namespace DOM
throw SAXException();
Reference< XText > aText = m_aDocument->createTextNode(aChars);
- m_aNodeStack.top()->appendChild(Reference< XNode >(aText, UNO_QUERY));
+ m_aNodeStack.top()->appendChild(aText);
}
void SAL_CALL CSAXDocumentBuilder::ignorableWhitespace(const OUString& )
@@ -358,7 +358,7 @@ namespace DOM
Reference< XProcessingInstruction > aInstruction = m_aDocument->createProcessingInstruction(
aTarget, aData);
- m_aNodeStack.top()->appendChild(Reference< XNode >(aInstruction, UNO_QUERY));
+ m_aNodeStack.top()->appendChild(aInstruction);
}
void SAL_CALL CSAXDocumentBuilder::setDocumentLocator(const Reference< XLocator >& aLocator)