From 6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 2 May 2013 10:36:43 +0200 Subject: 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 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- framework/source/fwe/xml/menuconfiguration.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'framework/source/fwe/xml/menuconfiguration.cxx') diff --git a/framework/source/fwe/xml/menuconfiguration.cxx b/framework/source/fwe/xml/menuconfiguration.cxx index 0f0e894eb69d..3e3600128517 100644 --- a/framework/source/fwe/xml/menuconfiguration.cxx +++ b/framework/source/fwe/xml/menuconfiguration.cxx @@ -82,7 +82,7 @@ throw ( WrappedTargetException ) try { xParser->parseStream( aInputSource ); - return Reference< XIndexAccess >( xItemContainer, UNO_QUERY ); + return xItemContainer; } catch ( const RuntimeException& e ) { @@ -126,8 +126,7 @@ throw ( WrappedTargetException ) try { - Reference< XDocumentHandler > xHandler(xWriter, UNO_QUERY_THROW); - OWriteMenuDocumentHandler aWriteMenuDocumentHandler( rMenuBarConfiguration, xHandler ); + OWriteMenuDocumentHandler aWriteMenuDocumentHandler( rMenuBarConfiguration, xWriter ); aWriteMenuDocumentHandler.WriteMenuDocument(); } catch ( const RuntimeException& e ) -- cgit v1.2.3