diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-10 10:13:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-13 08:15:27 +0200 |
commit | a361231b1363d072d737e9b1d411b71aa9550d84 (patch) | |
tree | 08641fe2af10c1f22c7fd58e62f99b6dbe301c62 /vbahelper | |
parent | ce76026231d9536d2025a1e69f435bcbf39fe4f8 (diff) |
fix wrong SET/QUERY flags passed to uno::Reference
By creating deleted methods for the wrong calls.
Avoids the compiler needing to construct a temporary
Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a
Reviewed-on: https://gerrit.libreoffice.org/72103
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/source/msforms/vbacontrol.cxx | 10 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbaapplicationbase.cxx | 24 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbarhelper.cxx | 4 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbars.cxx | 2 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbadocumentbase.cxx | 2 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbashaperange.cxx | 2 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbashapes.cxx | 8 |
7 files changed, 26 insertions, 26 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx index d33916f8d5af..5d32f2d9af72 100644 --- a/vbahelper/source/msforms/vbacontrol.cxx +++ b/vbahelper/source/msforms/vbacontrol.cxx @@ -82,7 +82,7 @@ ScVbaControl::getWindowPeer() return xWinPeer; } // form control - xControlModel.set( xControlShape->getControl(), uno::UNO_QUERY_THROW ); + xControlModel.set( xControlShape->getControl(), uno::UNO_SET_THROW ); uno::Reference< view::XControlAccess > xControlAccess( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); try @@ -141,7 +141,7 @@ ScVbaControl::ScVbaControl( const uno::Reference< XHelperInterface >& xParent, c m_xProps.set( xControlShape->getControl(), uno::UNO_QUERY_THROW ); OUString sDefaultControl; m_xProps->getPropertyValue( "DefaultControl" ) >>= sDefaultControl; - uno::Reference< lang::XMultiComponentFactory > xMFac( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); + uno::Reference< lang::XMultiComponentFactory > xMFac( mxContext->getServiceManager(), uno::UNO_SET_THROW ); m_xEmptyFormControl.set( xMFac->createInstanceWithContext( sDefaultControl, mxContext ), uno::UNO_QUERY_THROW ); } else if ( xUserFormControl.is() ) // userform control @@ -512,7 +512,7 @@ ScVbaControl::setMousePointer( ::sal_Int32 _mousepointer ) void SAL_CALL ScVbaControl::fireEvent( const script::ScriptEvent& rEvt ) { script::ScriptEvent evt( rEvt ); - uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); + uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); uno::Reference< script::XScriptListener > xScriptListener( xServiceManager->createInstanceWithContext( "ooo.vba.EventListener" , mxContext ), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xProps( xScriptListener, uno::UNO_QUERY_THROW ); @@ -731,7 +731,7 @@ void ScVbaControl::setBackColor( sal_Int32 nBackColor ) bool ScVbaControl::getAutoSize() { bool bIsResizeEnabled = false; - uno::Reference< uno::XInterface > xIf( m_xControl, uno::UNO_QUERY_THROW ); + uno::Reference< uno::XInterface > xIf( m_xControl, uno::UNO_SET_THROW ); SdrObject* pObj = SdrObject::getSdrObjectFromXShape( xIf ); if ( pObj ) bIsResizeEnabled = !pObj->IsResizeProtect(); @@ -741,7 +741,7 @@ bool ScVbaControl::getAutoSize() // currently no implementation for this void ScVbaControl::setAutoSize( bool bAutoSize ) { - uno::Reference< uno::XInterface > xIf( m_xControl, uno::UNO_QUERY_THROW ); + uno::Reference< uno::XInterface > xIf( m_xControl, uno::UNO_SET_THROW ); SdrObject* pObj = SdrObject::getSdrObjectFromXShape( xIf ); if ( pObj ) pObj->SetResizeProtect( !bAutoSize ); diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index 0ea9d721157a..6b647e26db1c 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -181,7 +181,7 @@ VbaApplicationBase::getScreenUpdating() void SAL_CALL VbaApplicationBase::setScreenUpdating(sal_Bool bUpdate) { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); // #163808# use helper from module "basic" to lock all documents of this application ::basic::vba::lockControllersOfAllDocuments( xModel, !bUpdate ); } @@ -189,8 +189,8 @@ VbaApplicationBase::setScreenUpdating(sal_Bool bUpdate) sal_Bool SAL_CALL VbaApplicationBase::getDisplayStatusBar() { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); + uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_SET_THROW ); uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager"), uno::UNO_QUERY_THROW ); @@ -203,8 +203,8 @@ VbaApplicationBase::getDisplayStatusBar() void SAL_CALL VbaApplicationBase::setDisplayStatusBar(sal_Bool bDisplayStatusBar) { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); + uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_SET_THROW ); uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager" ), uno::UNO_QUERY_THROW ); @@ -225,7 +225,7 @@ sal_Bool SAL_CALL VbaApplicationBase::getInteractive() uno::Reference< frame::XModel > xModel = getCurrentDocument(); if (!xModel.is()) return true; - uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_SET_THROW ); uno::Reference< awt::XWindow2 > xWindow( xFrame->getContainerWindow(), uno::UNO_QUERY_THROW ); return xWindow->isEnabled(); @@ -233,7 +233,7 @@ sal_Bool SAL_CALL VbaApplicationBase::getInteractive() void SAL_CALL VbaApplicationBase::setInteractive( sal_Bool bInteractive ) { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); // #163808# use helper from module "basic" to enable/disable all container windows of all documents of this application ::basic::vba::enableContainerWindowsOfAllDocuments( xModel, bInteractive ); } @@ -261,8 +261,8 @@ OUString SAL_CALL VbaApplicationBase::getCaption() // No idea if this code, which uses APIs that apparently are related to StarBasic (check // getCurrentDoc() in vbahelper.cxx), actually works any better. - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); + uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_SET_THROW ); return xFrame->getName(); } @@ -277,8 +277,8 @@ void SAL_CALL VbaApplicationBase::setCaption( const OUString& sCaption ) return; } - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); + uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_SET_THROW ); xFrame->setName( sCaption ); } @@ -440,7 +440,7 @@ VbaApplicationBase::getServiceNames() void SAL_CALL VbaApplicationBase::Undo() { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); dispatchRequests( xModel, ".uno:Undo" ); } diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx index 612c32c810ea..e4237d356660 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx @@ -114,7 +114,7 @@ void VbaCommandBarHelper::Init( ) css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUICfgMgrSupp( css::ui::theModuleUIConfigurationManagerSupplier::get(mxContext) ); - m_xAppCfgMgr.set( xUICfgMgrSupp->getUIConfigurationManager( maModuleId ), uno::UNO_QUERY_THROW ); + m_xAppCfgMgr.set( xUICfgMgrSupp->getUIConfigurationManager( maModuleId ), uno::UNO_SET_THROW ); css::uno::Reference< css::container::XNameAccess > xNameAccess = css::ui::theWindowStateConfiguration::get( mxContext ); @@ -158,7 +158,7 @@ void VbaCommandBarHelper::ApplyTempChange( const OUString& sResourceUrl, const c uno::Reference< frame::XLayoutManager > VbaCommandBarHelper::getLayoutManager() { - uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_SET_THROW ); uno::Reference< beans::XPropertySet > xPropertySet( xFrame, uno::UNO_QUERY_THROW ); uno::Reference< frame::XLayoutManager > xLayoutManager( xPropertySet->getPropertyValue( "LayoutManager" ), uno::UNO_QUERY_THROW ); return xLayoutManager; diff --git a/vbahelper/source/vbahelper/vbacommandbars.cxx b/vbahelper/source/vbahelper/vbacommandbars.cxx index b31ce704709d..70772852f584 100644 --- a/vbahelper/source/vbahelper/vbacommandbars.cxx +++ b/vbahelper/source/vbahelper/vbacommandbars.cxx @@ -177,7 +177,7 @@ ScVbaCommandBars::Add( const css::uno::Any& Name, const css::uno::Any& /*Positio } sResourceUrl = VbaCommandBarHelper::generateCustomURL(); - uno::Reference< container::XIndexAccess > xBarSettings( m_pCBarHelper->getSettings( sResourceUrl ), uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xBarSettings( m_pCBarHelper->getSettings( sResourceUrl ), uno::UNO_SET_THROW ); uno::Reference< XCommandBar > xCBar( new ScVbaCommandBar( this, mxContext, m_pCBarHelper, xBarSettings, sResourceUrl, false ) ); xCBar->setName( sName ); return xCBar; diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx index b5979cc035b1..e8686824dc6c 100644 --- a/vbahelper/source/vbahelper/vbadocumentbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx @@ -269,7 +269,7 @@ VbaDocumentBase::Save() void VbaDocumentBase::Activate() { - uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_SET_THROW ); xFrame->activate(); } diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx index 6cb5fdbf621e..e75aff14b0ff 100644 --- a/vbahelper/source/vbahelper/vbashaperange.cxx +++ b/vbahelper/source/vbahelper/vbashaperange.cxx @@ -66,7 +66,7 @@ uno::Reference< msforms::XShape > SAL_CALL ScVbaShapeRange::Group() { uno::Reference< drawing::XShapeGrouper > xShapeGrouper( m_xDrawPage, uno::UNO_QUERY_THROW ); - uno::Reference< drawing::XShapeGroup > xShapeGroup( xShapeGrouper->group( getShapes() ), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XShapeGroup > xShapeGroup( xShapeGrouper->group( getShapes() ), uno::UNO_SET_THROW ); uno::Reference< drawing::XShape > xShape( xShapeGroup, uno::UNO_QUERY_THROW ); return uno::Reference< msforms::XShape >( new ScVbaShape( getParent(), mxContext, xShape, getShapes(), m_xModel, office::MsoShapeType::msoGroup ) ); } diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx index 873f01a2ea03..c3eeeaaa7f99 100644 --- a/vbahelper/source/vbahelper/vbashapes.cxx +++ b/vbahelper/source/vbahelper/vbashapes.cxx @@ -221,7 +221,7 @@ ScVbaShapes::AddRectangle(sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWid sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth ); sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight ); - uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.RectangleShape" ), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.RectangleShape" ), uno::UNO_SET_THROW ); m_xShapes->add( xShape ); OUString sName(createName( "Rectangle" )); @@ -251,7 +251,7 @@ ScVbaShapes::AddEllipse(sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth ); sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight ); - uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.EllipseShape" ), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.EllipseShape" ), uno::UNO_SET_THROW ); m_xShapes->add( xShape ); awt::Point aMovePositionIfRange( 0, 0 ); @@ -297,7 +297,7 @@ ScVbaShapes::AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_In sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( StartX ); sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( StartY ); - uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.LineShape" ), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.LineShape" ), uno::UNO_SET_THROW ); m_xShapes->add( xShape ); awt::Point aMovePositionIfRange( 0, 0 ); @@ -353,7 +353,7 @@ ScVbaShapes::AddTextboxInWriter( sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _n sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( _nWidth ); sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( _nHeight ); - uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.TextShape" ), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.TextShape" ), uno::UNO_SET_THROW ); m_xShapes->add( xShape ); setDefaultShapeProperties(xShape); |