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 --- sfx2/source/view/frame2.cxx | 2 +- sfx2/source/view/viewfrm.cxx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'sfx2/source/view') diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index c3a2a50cdd4d..f35000f9cb08 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -250,7 +250,7 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, sal_uInt16 nV Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY_THROW ); xFrame->initialize( xWin.get() ); - xDesktop->getFrames()->append( Reference(xFrame, uno::UNO_QUERY_THROW) ); + xDesktop->getFrames()->append( xFrame ); if ( xWin->isActive() ) xFrame->activate(); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index e857318c0e8b..95f35531d6f4 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1888,8 +1888,7 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell try { // if there is a backing component, use it - Reference< XFramesSupplier > xTaskSupplier( xDesktop , css::uno::UNO_QUERY_THROW ); - ::framework::FrameListAnalyzer aAnalyzer( xTaskSupplier, Reference< XFrame >(), ::framework::FrameListAnalyzer::E_BACKINGCOMPONENT ); + ::framework::FrameListAnalyzer aAnalyzer( xDesktop, Reference< XFrame >(), ::framework::FrameListAnalyzer::E_BACKINGCOMPONENT ); if ( aAnalyzer.m_xBackingComponent.is() ) xFrame = aAnalyzer.m_xBackingComponent; -- cgit