summaryrefslogtreecommitdiff
path: root/basic/source/basmgr
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 /basic/source/basmgr
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 'basic/source/basmgr')
-rw-r--r--basic/source/basmgr/basicmanagerrepository.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx
index 7b81631570a7..d7a7bf191d4d 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -381,10 +381,9 @@ namespace basic
//--------------------------------------------------------------------
BasicManagerPointer& ImplRepository::impl_getLocationForModel( const Reference< XModel >& _rxDocumentModel )
{
- Reference< XInterface > xNormalized( _rxDocumentModel, UNO_QUERY );
- DBG_ASSERT( xNormalized.is(), "ImplRepository::impl_getLocationForModel: invalid model!" );
+ DBG_ASSERT( _rxDocumentModel.is(), "ImplRepository::impl_getLocationForModel: invalid model!" );
- BasicManagerPointer& location = m_aStore[ xNormalized ];
+ BasicManagerPointer& location = m_aStore[ _rxDocumentModel ];
return location;
}
@@ -489,9 +488,8 @@ namespace basic
impl_notifyCreationListeners( _rxDocumentModel, *_out_rpBasicManager );
// register as listener for this model being disposed/closed
- Reference< XComponent > xDocumentComponent( _rxDocumentModel, UNO_QUERY );
- OSL_ENSURE( xDocumentComponent.is(), "ImplRepository::impl_createManagerForModel: the document must be an XComponent!" );
- startComponentListening( xDocumentComponent );
+ OSL_ENSURE( _rxDocumentModel.is(), "ImplRepository::impl_createManagerForModel: the document must be an XComponent!" );
+ startComponentListening( _rxDocumentModel );
// register as listener for the BasicManager being destroyed
StartListening( *_out_rpBasicManager );