loplugin:refcounting in unoxml
Change-Id: I979b309271809b64d6f04cbccd14e0ee3b09ec81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111198 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -937,7 +937,7 @@ namespace DOM
|
||||
Reference< XEvent > SAL_CALL CDocument::createEvent(const OUString& aType)
|
||||
{
|
||||
// does not need mutex currently
|
||||
events::CEvent *pEvent = nullptr;
|
||||
rtl::Reference<events::CEvent> pEvent;
|
||||
if ( aType == "DOMSubtreeModified" || aType == "DOMNodeInserted" || aType == "DOMNodeRemoved"
|
||||
|| aType == "DOMNodeRemovedFromDocument" || aType == "DOMNodeInsertedIntoDocument" || aType == "DOMAttrModified"
|
||||
|| aType == "DOMCharacterDataModified")
|
||||
@@ -956,7 +956,7 @@ namespace DOM
|
||||
{
|
||||
pEvent = new events::CEvent;
|
||||
}
|
||||
return Reference< XEvent >(pEvent);
|
||||
return pEvent;
|
||||
}
|
||||
|
||||
// css::xml::sax::XSAXSerializable
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace DOM
|
||||
void CElement::saxify(const Reference< XDocumentHandler >& i_xHandler)
|
||||
{
|
||||
if (!i_xHandler.is()) throw RuntimeException();
|
||||
comphelper::AttributeList *pAttrs =
|
||||
rtl::Reference<comphelper::AttributeList> pAttrs =
|
||||
new comphelper::AttributeList();
|
||||
OUString type = "";
|
||||
// add namespace definitions to attributes
|
||||
@@ -90,8 +90,7 @@ namespace DOM
|
||||
OUString name = (prefix.isEmpty())
|
||||
? getLocalName()
|
||||
: prefix + ":" + getLocalName();
|
||||
Reference< XAttributeList > xAttrList(pAttrs);
|
||||
i_xHandler->startElement(name, xAttrList);
|
||||
i_xHandler->startElement(name, pAttrs);
|
||||
// recurse
|
||||
for (xmlNodePtr pChild = m_aNodePtr->children;
|
||||
pChild != nullptr; pChild = pChild->next) {
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace DOM::events {
|
||||
if (captureListeners.empty() && targetListeners.empty())
|
||||
return;
|
||||
|
||||
CEvent *pEvent = nullptr; // pointer to internal event representation
|
||||
rtl::Reference<CEvent> pEvent; // pointer to internal event representation
|
||||
|
||||
OUString const aType = i_xEvent->getType();
|
||||
if (aType == "DOMSubtreeModified" ||
|
||||
@@ -133,7 +133,7 @@ namespace DOM::events {
|
||||
// dispatch a mutation event
|
||||
// we need to clone the event in order to have complete control
|
||||
// over the implementation
|
||||
CMutationEvent* pMEvent = new CMutationEvent;
|
||||
rtl::Reference<CMutationEvent> pMEvent = new CMutationEvent;
|
||||
pMEvent->initMutationEvent(
|
||||
aType, aMEvent->getBubbles(), aMEvent->getCancelable(),
|
||||
aMEvent->getRelatedNode(), aMEvent->getPrevValue(),
|
||||
@@ -146,7 +146,7 @@ namespace DOM::events {
|
||||
aType == "DOMActivate" )
|
||||
{
|
||||
Reference< XUIEvent > const aUIEvent(i_xEvent, UNO_QUERY_THROW);
|
||||
CUIEvent* pUIEvent = new CUIEvent;
|
||||
rtl::Reference<CUIEvent> pUIEvent = new CUIEvent;
|
||||
pUIEvent->initUIEvent(aType,
|
||||
aUIEvent->getBubbles(), aUIEvent->getCancelable(),
|
||||
aUIEvent->getView(), aUIEvent->getDetail());
|
||||
@@ -161,7 +161,7 @@ namespace DOM::events {
|
||||
{
|
||||
Reference< XMouseEvent > const aMouseEvent(i_xEvent,
|
||||
UNO_QUERY_THROW);
|
||||
CMouseEvent *pMouseEvent = new CMouseEvent;
|
||||
rtl::Reference<CMouseEvent> pMouseEvent = new CMouseEvent;
|
||||
pMouseEvent->initMouseEvent(aType,
|
||||
aMouseEvent->getBubbles(), aMouseEvent->getCancelable(),
|
||||
aMouseEvent->getView(), aMouseEvent->getDetail(),
|
||||
|
||||
Reference in New Issue
Block a user