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 /sc/source | |
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 'sc/source')
27 files changed, 91 insertions, 91 deletions
diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx index d8c1dc900814..ff71859ebb6d 100644 --- a/sc/source/filter/excel/xltoolbar.cxx +++ b/sc/source/filter/excel/xltoolbar.cxx @@ -144,7 +144,7 @@ bool ScCTB::ImportCustomToolBar( ScCTBWrapper& rWrapper, CustomToolBarImportHelp return true; // didn't fail, just ignoring // Create default setting - uno::Reference< container::XIndexContainer > xIndexContainer( helper.getCfgManager()->createSettings(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexContainer > xIndexContainer( helper.getCfgManager()->createSettings(), uno::UNO_SET_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xIndexContainer, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xProps( xIndexContainer, uno::UNO_QUERY_THROW ); WString& name = tb.getName(); diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 49f62d6dc9a5..be05789251e3 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -324,7 +324,7 @@ Reference< XNameContainer > WorkbookGlobals::getStyleFamily( bool bPageStyles ) try { Reference< XStyleFamiliesSupplier > xFamiliesSup( mxDoc, UNO_QUERY_THROW ); - Reference< XNameAccess > xFamiliesNA( xFamiliesSup->getStyleFamilies(), UNO_QUERY_THROW ); + Reference< XNameAccess > xFamiliesNA( xFamiliesSup->getStyleFamilies(), UNO_SET_THROW ); xStylesNC.set( xFamiliesNA->getByName( bPageStyles ? maPageStyles : maCellStyles ), UNO_QUERY ); } catch( Exception& ) diff --git a/sc/source/filter/oox/worksheetbuffer.cxx b/sc/source/filter/oox/worksheetbuffer.cxx index 97a5db246107..59872603cb7f 100644 --- a/sc/source/filter/oox/worksheetbuffer.cxx +++ b/sc/source/filter/oox/worksheetbuffer.cxx @@ -184,7 +184,7 @@ WorksheetBuffer::IndexNamePair WorksheetBuffer::createSheet( const OUString& rPr //FIXME: Rewrite this block using ScDocument[Import] instead of UNO try { - Reference< XSpreadsheets > xSheets( getDocument()->getSheets(), UNO_QUERY_THROW ); + Reference< XSpreadsheets > xSheets( getDocument()->getSheets(), UNO_SET_THROW ); Reference< XIndexAccess > xSheetsIA( xSheets, UNO_QUERY_THROW ); sal_Int16 nCalcSheet = -1; OUString aSheetName = rPreferredName.isEmpty() ? "Sheet" : rPreferredName; diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index fb6c5aeb044c..ba67f06b2f75 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2007,7 +2007,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportFODS(SvStream &rStream) uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(comphelper::getProcessServiceFactory()); uno::Reference<io::XInputStream> xStream(new ::utl::OSeekableInputStreamWrapper(rStream)); - uno::Reference<uno::XInterface> xInterface(xMultiServiceFactory->createInstance("com.sun.star.comp.Writer.XmlFilterAdaptor"), uno::UNO_QUERY_THROW); + uno::Reference<uno::XInterface> xInterface(xMultiServiceFactory->createInstance("com.sun.star.comp.Writer.XmlFilterAdaptor"), uno::UNO_SET_THROW); css::uno::Sequence<OUString> aUserData(7); aUserData[0] = "com.sun.star.comp.filter.OdfFlatXml"; diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 460629541de4..ba0b52a120b7 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -794,7 +794,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) try { // load shared file - xModel.set( LoadSharedDocument(), uno::UNO_QUERY_THROW ); + xModel.set( LoadSharedDocument(), uno::UNO_SET_THROW ); uno::Reference< util::XCloseable > xCloseable( xModel, uno::UNO_QUERY_THROW ); // check if shared flag is set in shared file @@ -2598,7 +2598,7 @@ bool ScDocShell::QuerySlotExecutable( sal_uInt16 nSlotId ) bool bSlotExecutable = true; if( nVbaEventId != VBAEventId::NO_EVENT ) try { - uno::Reference< XVBAEventProcessor > xEventProcessor( m_aDocument.GetVbaEventProcessor(), uno::UNO_QUERY_THROW ); + uno::Reference< XVBAEventProcessor > xEventProcessor( m_aDocument.GetVbaEventProcessor(), uno::UNO_SET_THROW ); xEventProcessor->processVbaEvent( nVbaEventId, aArgs ); } catch( util::VetoException& ) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 945e98092521..e2d14daf4220 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1012,7 +1012,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) try { // load shared file - xModel.set( LoadSharedDocument(), uno::UNO_QUERY_THROW ); + xModel.set( LoadSharedDocument(), uno::UNO_SET_THROW ); uno::Reference< util::XCloseable > xCloseable( xModel, uno::UNO_QUERY_THROW ); // check if shared flag is set in shared file diff --git a/sc/source/ui/docshell/macromgr.cxx b/sc/source/ui/docshell/macromgr.cxx index 40b9e61ecef2..6f262bc5b35b 100644 --- a/sc/source/ui/docshell/macromgr.cxx +++ b/sc/source/ui/docshell/macromgr.cxx @@ -139,7 +139,7 @@ void ScMacroManager::InitUserFuncData() } try { - Reference< script::XLibraryContainer > xLibraries( pShell->GetBasicContainer(), uno::UNO_QUERY_THROW ); + Reference< script::XLibraryContainer > xLibraries( pShell->GetBasicContainer(), uno::UNO_SET_THROW ); xModuleContainer.set( xLibraries->getByName( sProjectName ), uno::UNO_QUERY_THROW ); // remove old listener ( if there was one ) diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index a066d65eed72..05d3cb8a286b 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -126,7 +126,7 @@ public: { uno::Reference< frame::XModel > xModel( mpDocShell->GetModel() ); uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xModel, uno::UNO_QUERY_THROW ); - uno::Reference<sheet::XSpreadsheets > xSheets( xSpreadDoc->getSheets(), uno::UNO_QUERY_THROW ); + uno::Reference<sheet::XSpreadsheets > xSheets( xSpreadDoc->getSheets(), uno::UNO_SET_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xSheets, uno::UNO_QUERY_THROW ); uno::Reference< sheet::XSpreadsheet > xSheet( xIndexAccess->getByIndex( i ), uno::UNO_QUERY_THROW ); uno::Sequence< uno::Any > aArgs(3); diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index 6b79eff7d549..ebfda3fc7942 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -56,7 +56,7 @@ GetUnnamedDataBaseRanges( const ScDocShell* pShell ) { uno::Reference< frame::XModel > xModel; if ( pShell ) - xModel.set( pShell->GetModel(), uno::UNO_QUERY_THROW ); + xModel.set( pShell->GetModel(), uno::UNO_SET_THROW ); uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW ); uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( xModelProps->getPropertyValue("UnnamedDatabaseRanges"), uno::UNO_QUERY_THROW ); return xUnnamedDBRanges; @@ -67,7 +67,7 @@ GetUnnamedDataBaseRanges( const ScDocShell* pShell ) uno::Reference< sheet::XDatabaseRange > GetAutoFiltRange( const ScDocShell* pShell, sal_Int16 nSheet ) { - uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( GetUnnamedDataBaseRanges( pShell ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( GetUnnamedDataBaseRanges( pShell ), uno::UNO_SET_THROW ); uno::Reference< sheet::XDatabaseRange > xDataBaseRange; if (xUnnamedDBRanges->hasByTable( nSheet ) ) { diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 422b22c72777..ba821eb5d131 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -463,9 +463,9 @@ ScVbaApplication::setStatusBar( const uno::Any& _statusbar ) { OUString sText; bool bDefault = false; - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); uno::Reference< task::XStatusIndicatorSupplier > xStatusIndicatorSupplier( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - uno::Reference< task::XStatusIndicator > xStatusIndicator( xStatusIndicatorSupplier->getStatusIndicator(), uno::UNO_QUERY_THROW ); + uno::Reference< task::XStatusIndicator > xStatusIndicator( xStatusIndicatorSupplier->getStatusIndicator(), uno::UNO_SET_THROW ); if( _statusbar >>= sText ) { setDisplayStatusBar( true ); @@ -551,7 +551,7 @@ ScVbaApplication::Range( const uno::Any& Cell1, const uno::Any& Cell2 ) uno::Any SAL_CALL ScVbaApplication::Names( const css::uno::Any& aIndex ) { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW ); uno::Reference< sheet::XNamedRanges > xNamedRanges( xPropertySet->getPropertyValue( "NamedRanges" ), uno::UNO_QUERY_THROW ); @@ -618,7 +618,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) OUString sRangeName; if( Reference >>= sRangeName ) { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); uno::Reference< sheet::XSpreadsheetView > xSpreadsheet( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); @@ -718,7 +718,7 @@ ScVbaApplication::setCursor( sal_Int32 _cursor ) { try { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); switch( _cursor ) { case excel::XlMousePointer::xlNorthwestArrow: @@ -888,7 +888,7 @@ void SAL_CALL ScVbaApplication::setIteration( sal_Bool bSet ) { uno::Reference< lang::XMultiComponentFactory > xSMgr( - mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); + mxContext->getServiceManager(), uno::UNO_SET_THROW ); uno::Reference< frame::XDesktop > xDesktop (xSMgr->createInstanceWithContext( "com.sun.star.frame.Desktop" , mxContext), uno::UNO_QUERY_THROW ); @@ -911,7 +911,7 @@ ScVbaApplication::setIteration( sal_Bool bSet ) void SAL_CALL ScVbaApplication::Calculate() { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); uno::Reference< sheet::XCalculatable > xCalculatable( getCurrentDocument(), uno::UNO_QUERY_THROW ); xCalculatable->calculateAll(); } diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx index 7a1a7ad643fe..754aca9a027f 100644 --- a/sc/source/ui/vba/vbaaxes.cxx +++ b/sc/source/ui/vba/vbaaxes.cxx @@ -74,7 +74,7 @@ ScVbaAxes::createAxis( const uno::Reference< excel::XChart >& xChart, const uno: { if ((nAxisGroup != xlPrimary) && (nAxisGroup != xlSecondary)) DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED); - xAxisPropertySet.set( pChart->getAxisPropertySet(nType, nAxisGroup), uno::UNO_QUERY_THROW ); + xAxisPropertySet.set( pChart->getAxisPropertySet(nType, nAxisGroup), uno::UNO_SET_THROW ); } else DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED); diff --git a/sc/source/ui/vba/vbacharacters.cxx b/sc/source/ui/vba/vbacharacters.cxx index dc94a0371c8d..3281eff63a34 100644 --- a/sc/source/ui/vba/vbacharacters.cxx +++ b/sc/source/ui/vba/vbacharacters.cxx @@ -43,7 +43,7 @@ ScVbaCharacters::ScVbaCharacters( const uno::Reference< XHelperInterface >& xPar nStart = 1; // silently correct user error ( as ms ) nStart--; // OOo is 0 based Length >>=nLength; - uno::Reference< text::XTextCursor > xTextCursor( m_xSimpleText->createTextCursor(), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextCursor > xTextCursor( m_xSimpleText->createTextCursor(), uno::UNO_SET_THROW ); xTextCursor->collapseToStart(); if ( nStart ) { diff --git a/sc/source/ui/vba/vbacomment.cxx b/sc/source/ui/vba/vbacomment.cxx index 57b67993abc2..b22cc8210350 100644 --- a/sc/source/ui/vba/vbacomment.cxx +++ b/sc/source/ui/vba/vbacomment.cxx @@ -59,9 +59,9 @@ ScVbaComment::ScVbaComment( uno::Reference< sheet::XSheetAnnotation > ScVbaComment::getAnnotation() { - uno::Reference< table::XCell > xCell( mxRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW ); + uno::Reference< table::XCell > xCell( mxRange->getCellByPosition(0, 0), uno::UNO_SET_THROW ); uno::Reference< sheet::XSheetAnnotationAnchor > xAnnoAnchor( xCell, uno::UNO_QUERY_THROW ); - return uno::Reference< sheet::XSheetAnnotation > ( xAnnoAnchor->getAnnotation(), uno::UNO_QUERY_THROW ); + return uno::Reference< sheet::XSheetAnnotation > ( xAnnoAnchor->getAnnotation(), uno::UNO_SET_THROW ); } uno::Reference< sheet::XSheetAnnotations > @@ -71,7 +71,7 @@ ScVbaComment::getAnnotations() uno::Reference< sheet::XSpreadsheet > xSheet = xSheetCellRange->getSpreadsheet(); uno::Reference< sheet::XSheetAnnotationsSupplier > xAnnosSupp( xSheet, uno::UNO_QUERY_THROW ); - return uno::Reference< sheet::XSheetAnnotations > ( xAnnosSupp->getAnnotations(), uno::UNO_QUERY_THROW ); + return uno::Reference< sheet::XSheetAnnotations > ( xAnnosSupp->getAnnotations(), uno::UNO_SET_THROW ); } sal_Int32 @@ -183,7 +183,7 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An if ( aStart >>= nStart ) { - uno::Reference< text::XTextCursor > xTextCursor( xAnnoText->createTextCursor(), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextCursor > xTextCursor( xAnnoText->createTextCursor(), uno::UNO_SET_THROW ); if ( bOverwrite ) { diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx index 8dec1896e6a6..2b48c47b3c10 100644 --- a/sc/source/ui/vba/vbaeventshelper.cxx +++ b/sc/source/ui/vba/vbaeventshelper.cxx @@ -200,7 +200,7 @@ ScVbaEventListener::ScVbaEventListener( ScVbaEventsHelper& rVbaEvents, const uno startModelListening(); try { - uno::Reference< frame::XController > xController( mxModel->getCurrentController(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XController > xController( mxModel->getCurrentController(), uno::UNO_SET_THROW ); startControllerListening( xController ); } catch( uno::Exception& ) diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx index 62ac352756c6..d2872fdfed5a 100644 --- a/sc/source/ui/vba/vbaglobals.cxx +++ b/sc/source/ui/vba/vbaglobals.cxx @@ -75,7 +75,7 @@ ScVbaGlobals::getExcel() uno::Reference< excel::XWorkbook > SAL_CALL ScVbaGlobals::getActiveWorkbook() { - uno::Reference< excel::XWorkbook > xWorkbook( getApplication()->getActiveWorkbook(), uno::UNO_QUERY_THROW); + uno::Reference< excel::XWorkbook > xWorkbook( getApplication()->getActiveWorkbook(), uno::UNO_SET_THROW); return xWorkbook; } diff --git a/sc/source/ui/vba/vbahyperlinks.cxx b/sc/source/ui/vba/vbahyperlinks.cxx index a1b613442b20..f6cec8345710 100644 --- a/sc/source/ui/vba/vbahyperlinks.cxx +++ b/sc/source/ui/vba/vbahyperlinks.cxx @@ -65,11 +65,11 @@ EqualAnchorFunctor::EqualAnchorFunctor( const uno::Reference< excel::XHyperlink switch( mnType ) { case office::MsoHyperlinkType::msoHyperlinkRange: - mxAnchorRange.set( rxHlink->getRange(), uno::UNO_QUERY_THROW ); + mxAnchorRange.set( rxHlink->getRange(), uno::UNO_SET_THROW ); break; case office::MsoHyperlinkType::msoHyperlinkShape: case office::MsoHyperlinkType::msoHyperlinkInlineShape: - mxAnchorShape.set( rxHlink->getShape(), uno::UNO_QUERY_THROW ); + mxAnchorShape.set( rxHlink->getShape(), uno::UNO_SET_THROW ); break; default: throw uno::RuntimeException(); @@ -86,7 +86,7 @@ bool EqualAnchorFunctor::operator()( const uno::Reference< excel::XHyperlink >& { case office::MsoHyperlinkType::msoHyperlinkRange: { - uno::Reference< excel::XRange > xAnchorRange( rxHlink->getRange(), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xAnchorRange( rxHlink->getRange(), uno::UNO_SET_THROW ); const ScRangeList& rScRanges1 = ScVbaRange::getScRangeList( xAnchorRange ); const ScRangeList& rScRanges2 = ScVbaRange::getScRangeList( mxAnchorRange ); return (rScRanges1.size() == 1) && (rScRanges2.size() == 1) && (rScRanges1[ 0 ] == rScRanges2[ 0 ]); @@ -94,7 +94,7 @@ bool EqualAnchorFunctor::operator()( const uno::Reference< excel::XHyperlink >& case office::MsoHyperlinkType::msoHyperlinkShape: case office::MsoHyperlinkType::msoHyperlinkInlineShape: { - uno::Reference< msforms::XShape > xAnchorShape( rxHlink->getShape(), uno::UNO_QUERY_THROW ); + uno::Reference< msforms::XShape > xAnchorShape( rxHlink->getShape(), uno::UNO_SET_THROW ); return xAnchorShape.get() == mxAnchorShape.get(); } default: @@ -145,7 +145,7 @@ ScVbaHlinkContainer::ScVbaHlinkContainer( const ScVbaHlinkContainerRef& rxSheetC for( sal_Int32 nIndex = 0, nCount = rxSheetContainer->getCount(); nIndex < nCount; ++nIndex ) { uno::Reference< excel::XHyperlink > xHlink( rxSheetContainer->getByIndex( nIndex ), uno::UNO_QUERY_THROW ); - uno::Reference< excel::XRange > xHlinkRange( xHlink->getRange(), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xHlinkRange( xHlink->getRange(), uno::UNO_SET_THROW ); if( lclContains( rScRanges, xHlinkRange ) ) maHlinks.push_back( xHlink ); } diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx index ad7f0e290b1a..76556ff25610 100644 --- a/sc/source/ui/vba/vbainterior.cxx +++ b/sc/source/ui/vba/vbainterior.cxx @@ -269,7 +269,7 @@ ScVbaInterior::SetAttributeData( sal_Int32 nValue ) uno::Any ScVbaInterior::GetUserDefinedAttributes( const OUString& sName ) { - uno::Reference< container::XNameContainer > xNameContainer( GetAttributeContainer(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameContainer > xNameContainer( GetAttributeContainer(), uno::UNO_SET_THROW ); if( xNameContainer->hasByName( sName ) ) { return xNameContainer->getByName( sName ); @@ -281,7 +281,7 @@ ScVbaInterior::SetUserDefinedAttributes( const OUString& sName, const uno::Any& { if( aValue.hasValue() ) { - uno::Reference< container::XNameContainer > xNameContainer( GetAttributeContainer(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameContainer > xNameContainer( GetAttributeContainer(), uno::UNO_SET_THROW ); if( xNameContainer->hasByName( sName ) ) xNameContainer->removeByName( sName ); xNameContainer->insertByName( sName, aValue ); diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx index 4f2f774b1172..254b7cd5ec36 100644 --- a/sc/source/ui/vba/vbanames.cxx +++ b/sc/source/ui/vba/vbanames.cxx @@ -74,7 +74,7 @@ ScVbaNames::~ScVbaNames() ScDocument * ScVbaNames::getScDocument() { - uno::Reference< frame::XModel > xModel( getModel() , uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel() , uno::UNO_SET_THROW ); ScTabViewShell * pTabViewShell = excel::getBestViewShell( xModel ); if ( !pTabViewShell ) throw uno::RuntimeException( "No ViewShell available" ); diff --git a/sc/source/ui/vba/vbaoleobject.cxx b/sc/source/ui/vba/vbaoleobject.cxx index 9510d6b0485c..18e0e78ae195 100644 --- a/sc/source/ui/vba/vbaoleobject.cxx +++ b/sc/source/ui/vba/vbaoleobject.cxx @@ -38,12 +38,12 @@ ScVbaOLEObject::ScVbaOLEObject( const uno::Reference< XHelperInterface >& xParen : OLEObjectImpl_BASE( xParent, xContext ) { //init m_xWindowPeer - uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl(), css::uno::UNO_QUERY_THROW ); + uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl(), css::uno::UNO_SET_THROW ); uno::Reference< container::XChild > xChild( xControlModel, uno::UNO_QUERY_THROW ); xChild.set( xChild->getParent(), uno::UNO_QUERY_THROW ); xChild.set( xChild->getParent(), uno::UNO_QUERY_THROW ); uno::Reference<frame::XModel> xModel( xChild->getParent(), uno::UNO_QUERY_THROW ); - uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); + uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext("ooo.vba.ControlProvider", mxContext ), uno::UNO_QUERY_THROW ); m_xControl.set( xControlProvider->createControl( xControlShape, xModel ) ); } diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx index b01cab778d5f..373cfda51501 100644 --- a/sc/source/ui/vba/vbaoleobjects.cxx +++ b/sc/source/ui/vba/vbaoleobjects.cxx @@ -142,7 +142,7 @@ ScVbaOLEObjects::getItemByStringIndex( const OUString& sIndex ) } catch (const uno::RuntimeException&) { - uno::Reference< container::XIndexAccess > xIndexAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xIndexAccess( m_xIndexAccess, uno::UNO_SET_THROW ); sal_Int32 nCount = xIndexAccess->getCount(); for( int index = 0; index < nCount; index++ ) { diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx index 8105a4359715..b7b13b19bcce 100644 --- a/sc/source/ui/vba/vbapagesetup.cxx +++ b/sc/source/ui/vba/vbapagesetup.cxx @@ -51,7 +51,7 @@ ScVbaPageSetup::ScVbaPageSetup(const uno::Reference< XHelperInterface >& xParent ScVbaPageSetup_BASE( xParent, xContext ), mxSheet( xSheet ), mbIsLandscape( false ) { // query for current page style - mxModel.set( xModel, uno::UNO_QUERY_THROW ); + mxModel.set( xModel, uno::UNO_SET_THROW ); uno::Reference< beans::XPropertySet > xSheetProps( mxSheet, uno::UNO_QUERY_THROW ); uno::Any aValue = xSheetProps->getPropertyValue("PageStyle"); OUString aStyleName; diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index dbcc2a2f1a7a..42b3ea9300d6 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -547,7 +547,7 @@ public: return OUString(); } - uno::Reference< beans::XPropertySet > xNumberProps( getNumberProps(), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xNumberProps( getNumberProps(), uno::UNO_SET_THROW ); OUString aFormatString; uno::Any aString = xNumberProps->getPropertyValue( "FormatString" ); aString >>= aFormatString; @@ -1126,7 +1126,7 @@ public: /// @throws uno::RuntimeException uno::Reference< sheet::XSheetCellCursor > getSheetCellCursor() { - return uno::Reference< sheet::XSheetCellCursor >( getSpreadSheet()->createCursorByRange( getSheetCellRange() ), uno::UNO_QUERY_THROW ); + return uno::Reference< sheet::XSheetCellCursor >( getSpreadSheet()->createCursorByRange( getSheetCellRange() ), uno::UNO_SET_THROW ); } static uno::Reference< excel::XRange > createRangeFromRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference<uno::XComponentContext >& xContext, @@ -1482,7 +1482,7 @@ ScVbaRange::visitArray( ArrayVisitor& visitor ) { for ( sal_Int32 j=0; j<nColCount; ++j ) { - uno::Reference< table::XCell > xCell( mxRange->getCellByPosition( j, i ), uno::UNO_QUERY_THROW ); + uno::Reference< table::XCell > xCell( mxRange->getCellByPosition( j, i ), uno::UNO_SET_THROW ); visitor.visitNode( i, j, xCell ); } @@ -1516,7 +1516,7 @@ ScVbaRange::getValue() // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->getValue(); } @@ -1660,7 +1660,7 @@ ScVbaRange::getFormulaValue( formula::FormulaGrammar::Grammar eGram ) // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->getFormula(); } CellFormulaValueGetter valueGetter( &getScDocument(), eGram ); @@ -1726,7 +1726,7 @@ ScVbaRange::getRow() // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->getRow(); } uno::Reference< sheet::XCellAddressable > xCellAddressable(mxRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW ); @@ -1742,7 +1742,7 @@ ScVbaRange::getColumn() // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->getColumn(); } uno::Reference< sheet::XCellAddressable > xCellAddressable(mxRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW ); @@ -1797,7 +1797,7 @@ ScVbaRange::fillSeries( sheet::FillDirection nFillDirection, sheet::FillMode nFi if ( m_Areas->getCount() > 1 ) { // Multi-Area Range - uno::Reference< XCollection > xCollection( m_Areas, uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCollection( m_Areas, uno::UNO_SET_THROW ); for ( sal_Int32 index = 1; index <= xCollection->getCount(); ++index ) { uno::Reference< excel::XRange > xRange( xCollection->Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW ); @@ -1850,7 +1850,7 @@ ScVbaRange::getText() // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->getText(); } uno::Reference< text::XTextRange > xTextRange(mxRange->getCellByPosition(0,0), uno::UNO_QUERY_THROW ); @@ -1902,7 +1902,7 @@ ScVbaRange::CurrentRegion() // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->CurrentRegion(); } @@ -1923,7 +1923,7 @@ ScVbaRange::CurrentArray() // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->CurrentArray(); } RangeHelper helper( mxRange ); @@ -1943,7 +1943,7 @@ ScVbaRange::getFormulaArray() // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->getFormulaArray(); } @@ -1981,7 +1981,7 @@ ScVbaRange::setFormulaArray(const uno::Any& rFormula) // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->setFormulaArray( rFormula ); } // #TODO need to distinguish between getFormula and getFormulaArray e.g. (R1C1) @@ -2017,7 +2017,7 @@ ScVbaRange::Characters(const uno::Any& Start, const uno::Any& Length) // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->Characters( Start, Length ); } @@ -2041,7 +2041,7 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut { // Multi-Area Range OUStringBuffer sAddress; - uno::Reference< XCollection > xCollection( m_Areas, uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCollection( m_Areas, uno::UNO_SET_THROW ); uno::Any aExternalCopy = External; for ( sal_Int32 index = 1; index <= xCollection->getCount(); ++index ) { @@ -2140,7 +2140,7 @@ ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) // the implementations for each method are being updated ) if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->Cells( nRowIndex, nColumnIndex ); } @@ -2240,7 +2240,7 @@ ScVbaRange::Select() ScDocShell* pShell = pUnoRangesBase->GetDocShell(); if ( pShell ) { - uno::Reference< frame::XModel > xModel( pShell->GetModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( pShell->GetModel(), uno::UNO_SET_THROW ); uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); if ( mxRanges.is() ) xSelection->select( uno::Any( lclExpandToMerged( mxRanges ) ) ); @@ -2250,9 +2250,9 @@ ScVbaRange::Select() // ThisComponent.CurrentController.Frame.getContainerWindow.SetFocus try { - uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_QUERY_THROW ); - uno::Reference< awt::XWindow > xWin( xFrame->getContainerWindow(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW ); + uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW ); + uno::Reference< awt::XWindow > xWin( xFrame->getContainerWindow(), uno::UNO_SET_THROW ); xWin->setFocus(); } catch( uno::Exception& ) @@ -2290,7 +2290,7 @@ ScVbaRange::Activate() xCellRange.set( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW ); } else - xCellRange.set( mxRange, uno::UNO_QUERY_THROW ); + xCellRange.set( mxRange, uno::UNO_SET_THROW ); RangeHelper thisRange( xCellRange ); uno::Reference< sheet::XCellRangeAddressable > xThisRangeAddress = thisRange.getCellRangeAddressable(); @@ -2596,7 +2596,7 @@ ScVbaRange::Resize( const uno::Any &RowSize, const uno::Any &ColumnSize ) bool bIsRowChanged = ( RowSize >>= nRowSize ), bIsColumnChanged = ( ColumnSize >>= nColumnSize ); uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, ::uno::UNO_QUERY_THROW); uno::Reference< sheet::XSheetCellRange > xSheetRange(mxRange, ::uno::UNO_QUERY_THROW); - uno::Reference< sheet::XSheetCellCursor > xCursor( xSheetRange->getSpreadsheet()->createCursorByRange(xSheetRange), ::uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSheetCellCursor > xCursor( xSheetRange->getSpreadsheet()->createCursorByRange(xSheetRange), ::uno::UNO_SET_THROW ); if( !bIsRowChanged ) nRowSize = xColumnRowRange->getRows()->getCount(); @@ -2848,7 +2848,7 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons if (!pShell) throw uno::RuntimeException("That command cannot be used with no ScDocShell" ); - uno::Reference< frame::XModel > xModel(pShell->GetModel(), uno::UNO_QUERY_THROW); + uno::Reference< frame::XModel > xModel(pShell->GetModel(), uno::UNO_SET_THROW); uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); // select this range xSelection->select( uno::makeAny( mxRange ) ); @@ -3161,7 +3161,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L // After must be a single cell in the range if( xAfterRange->getCount() > 1 ) throw uno::RuntimeException("After must be a single cell." ); - uno::Reference< excel::XRange > xCell( Cells( uno::makeAny( xAfterRange->getRow() ), uno::makeAny( xAfterRange->getColumn() ) ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xCell( Cells( uno::makeAny( xAfterRange->getRow() ), uno::makeAny( xAfterRange->getColumn() ) ), uno::UNO_SET_THROW ); xStartCell.set( xAfterRange->getCellRange(), uno::UNO_QUERY_THROW ); } @@ -3538,7 +3538,7 @@ ScVbaRange::End( ::sal_Int32 Direction ) { if ( m_Areas->getCount() > 1 ) { - uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_SET_THROW ); return xRange->End( Direction ); } @@ -3601,10 +3601,10 @@ ScVbaRange::End( ::sal_Int32 Direction ) uno::Any aVoid; uno::Reference< excel::XRange > resultCell; - resultCell.set( xApplication->getActiveSheet()->Range( uno::makeAny( sMoved ), aVoid ), uno::UNO_QUERY_THROW ); + resultCell.set( xApplication->getActiveSheet()->Range( uno::makeAny( sMoved ), aVoid ), uno::UNO_SET_THROW ); // restore old ActiveCell - uno::Reference< excel::XRange > xOldActiveCell( sActiveSheet->Range( uno::makeAny( sActiveCell ), aVoid ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xOldActiveCell( sActiveSheet->Range( uno::makeAny( sActiveCell ), aVoid ), uno::UNO_SET_THROW ); xOldActiveCell->Select(); @@ -4932,7 +4932,7 @@ uno::Reference< excel::XRange > SAL_CALL ScVbaRange::MergeArea() { uno::Reference< sheet::XSheetCellRange > xMergeShellCellRange(mxRange->getCellRangeByPosition(0,0,0,0), uno::UNO_QUERY_THROW); - uno::Reference< sheet::XSheetCellCursor > xMergeSheetCursor(xMergeShellCellRange->getSpreadsheet()->createCursorByRange( xMergeShellCellRange ), uno::UNO_QUERY_THROW); + uno::Reference< sheet::XSheetCellCursor > xMergeSheetCursor(xMergeShellCellRange->getSpreadsheet()->createCursorByRange( xMergeShellCellRange ), uno::UNO_SET_THROW); if( xMergeSheetCursor.is() ) { xMergeSheetCursor->collapseToMergedArea(); @@ -4988,7 +4988,7 @@ ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any& void SAL_CALL ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const uno::Any& Type ) { - uno::Reference< excel::XRange > xDest( Destination, uno::UNO_QUERY_THROW ); + uno::Reference< excel::XRange > xDest( Destination, uno::UNO_SET_THROW ); ScVbaRange* pRange = getImplementation( xDest ); RangeHelper destRangeHelper( pRange->mxRange ); table::CellRangeAddress destAddress = destRangeHelper.getCellRangeAddressable()->getRangeAddress(); diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx index 1e155a7d47d6..35818b1bac0c 100644 --- a/sc/source/ui/vba/vbawindow.cxx +++ b/sc/source/ui/vba/vbawindow.cxx @@ -715,7 +715,7 @@ void ScVbaWindow::SplitAtDefinedPosition( sal_Int32 nColumns, sal_Int32 nRows ) xViewSplitable->splitAtPosition(0,0); uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); - uno::Reference< excel::XWorksheet > xSheet( xApplication->getActiveSheet(), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XWorksheet > xSheet( xApplication->getActiveSheet(), uno::UNO_SET_THROW ); xSheet->Cells(uno::makeAny(cellRow), uno::makeAny(cellColumn))->Select(); //pViewShell->FreezeSplitters( FALSE ); diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx index cbb78bb0d2bd..8f33e00c4c37 100644 --- a/sc/source/ui/vba/vbaworkbook.cxx +++ b/sc/source/ui/vba/vbaworkbook.cxx @@ -66,7 +66,7 @@ void ScVbaWorkbook::initColorData( const uno::Sequence< sal_Int32 >& sColors ) void SAL_CALL ScVbaWorkbook::ResetColors( ) { - uno::Reference< container::XIndexAccess > xIndexAccess( ScVbaPalette::getDefaultPalette(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xIndexAccess( ScVbaPalette::getDefaultPalette(), uno::UNO_SET_THROW ); sal_Int32 nLen = xIndexAccess->getCount(); ColorData.realloc( nLen ); @@ -280,14 +280,14 @@ ScVbaWorkbook::getProtectStructure() sal_Bool SAL_CALL ScVbaWorkbook::getPrecisionAsDisplayed() { - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW ); ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument(); return rDoc.GetDocOptions().IsCalcAsShown(); } void SAL_CALL ScVbaWorkbook::setPrecisionAsDisplayed( sal_Bool _precisionAsDisplayed ) { - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW ); ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument(); ScDocOptions aOpt = rDoc.GetDocOptions(); aOpt.SetCalcAsShown( _precisionAsDisplayed ); diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 4b222edc8f52..83cddb7c6246 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -215,7 +215,7 @@ ScVbaWorksheet::createSheetCopyInNewDoc(const OUString& aCurrSheetName) } uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xModel, uno::UNO_QUERY_THROW ); excel::setUpDocumentModules(xSpreadDoc); - uno::Reference <sheet::XSpreadsheets> xSheets( xSpreadDoc->getSheets(), uno::UNO_QUERY_THROW ); + uno::Reference <sheet::XSpreadsheets> xSheets( xSpreadDoc->getSheets(), uno::UNO_SET_THROW ); uno::Reference <container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY_THROW ); uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW); @@ -331,7 +331,7 @@ ScVbaWorksheet::getEnableSelection() if ( !ScVbaWorksheets::nameExists(xSpreadDoc, getName(), nTab) ) throw uno::RuntimeException("Sheet Name does not exist." ); - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW ); ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument(); ScTableProtection* pProtect = rDoc.GetTabProtection(nTab); bool bLockedCells = false; @@ -364,7 +364,7 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection ) if ( !ScVbaWorksheets::nameExists(xSpreadDoc, getName(), nTab) ) throw uno::RuntimeException("Sheet Name does not exist." ); - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW ); ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument(); ScTableProtection* pProtect = rDoc.GetTabProtection(nTab); // default is xlNoSelection @@ -390,7 +390,7 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection ) sal_Bool SAL_CALL ScVbaWorksheet::getAutoFilterMode() { - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW ); ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument(); ScDBData* pDBData = rDoc.GetAnonymousDBData(getSheetID()); if (pDBData) @@ -400,7 +400,7 @@ sal_Bool SAL_CALL ScVbaWorksheet::getAutoFilterMode() void SAL_CALL ScVbaWorksheet::setAutoFilterMode( sal_Bool bAutoFilterMode ) { - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW ); ScDocShell* pDocShell = excel::getDocShell( xModel ); ScDocument& rDoc = pDocShell->GetDocument(); ScDBData* pDBData = rDoc.GetAnonymousDBData(getSheetID()); @@ -427,7 +427,7 @@ uno::Reference< excel::XRange > ScVbaWorksheet::getUsedRange() { uno::Reference< sheet::XSheetCellRange > xSheetCellRange(getSheet(), uno::UNO_QUERY_THROW ); - uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor( getSheet()->createCursorByRange( xSheetCellRange ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor( getSheet()->createCursorByRange( xSheetCellRange ), uno::UNO_SET_THROW ); uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW); xUsedCursor->gotoStartOfUsedArea( false ); xUsedCursor->gotoEndOfUsedArea( true ); @@ -502,7 +502,7 @@ ScVbaWorksheet::getProtectDrawingObjects() bool bSheetExists = ScVbaWorksheets::nameExists (xSpreadDoc, aSheetName, nTab); if ( bSheetExists ) { - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW ); ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument(); ScTableProtection* pProtect = rDoc.GetTabProtection(nTab); if ( pProtect ) @@ -612,7 +612,7 @@ uno::Reference< excel::XWorksheet > ScVbaWorksheet::getSheetAtOffset(SCTAB offset) { uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY_THROW ); - uno::Reference <sheet::XSpreadsheets> xSheets( xSpreadDoc->getSheets(), uno::UNO_QUERY_THROW ); + uno::Reference <sheet::XSpreadsheets> xSheets( xSpreadDoc->getSheets(), uno::UNO_SET_THROW ); uno::Reference <container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY_THROW ); SCTAB nIdx = 0; @@ -749,7 +749,7 @@ ScVbaWorksheet::Comments( const uno::Any& Index ) { uno::Reference< css::sheet::XSpreadsheet > xSheet = getSheet(); uno::Reference< sheet::XSheetAnnotationsSupplier > xAnnosSupp( xSheet, uno::UNO_QUERY_THROW ); - uno::Reference< sheet::XSheetAnnotations > xAnnos( xAnnosSupp->getAnnotations(), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSheetAnnotations > xAnnos( xAnnosSupp->getAnnotations(), uno::UNO_SET_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xAnnos, uno::UNO_QUERY_THROW ); uno::Reference< XCollection > xColl( new ScVbaComments( this, mxContext, mxModel, xIndexAccess ) ); if ( Index.hasValue() ) @@ -786,9 +786,9 @@ ScVbaWorksheet::Names( const css::uno::Any& aIndex ) uno::Any SAL_CALL ScVbaWorksheet::OLEObjects( const uno::Any& Index ) { - uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_SET_THROW ); uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW ); - uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPageSupplier->getDrawPage(), uno::UNO_SET_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPage, uno::UNO_QUERY_THROW ); uno::Reference< excel::XOLEObjects >xOleObjects( new ScVbaOLEObjects( this, mxContext, xIndexAccess ) ); @@ -800,7 +800,7 @@ ScVbaWorksheet::OLEObjects( const uno::Any& Index ) uno::Any SAL_CALL ScVbaWorksheet::Shapes( const uno::Any& aIndex ) { - uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_SET_THROW ); uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW ); uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW ); @@ -882,7 +882,7 @@ ScVbaWorksheet::Spinners( const uno::Any& /*rIndex*/ ) void SAL_CALL ScVbaWorksheet::ShowDataForm( ) { - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW ); ScTabViewShell* pTabViewShell = excel::getBestViewShell( xModel ); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); @@ -925,7 +925,7 @@ ScVbaWorksheet::getValue( const OUString& aPropertyName ) { uno::Reference< drawing::XControlShape > xControlShape( getControlShape( aPropertyName ), uno::UNO_QUERY_THROW ); - uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); + uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext("ooo.vba.ControlProvider", mxContext ), uno::UNO_QUERY_THROW ); uno::Reference< msforms::XControl > xControl( xControlProvider->createControl( xControlShape, getModel() ) ); return uno::makeAny( xControl ); @@ -943,7 +943,7 @@ ScVbaWorksheet::getFormControls() uno::Reference< container::XNameAccess > xFormControls; try { - uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_SET_THROW ); uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW ); uno::Reference< form::XFormsSupplier > xFormSupplier( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xFormSupplier->getForms(), uno::UNO_QUERY_THROW ); @@ -1057,7 +1057,7 @@ ScVbaWorksheet::PrintOut( const uno::Any& From, const uno::Any& To, const uno::A if ( !( nFrom || nTo ) ) bSelection = true; - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW ); PrintOutHelper( excel::getBestViewShell( xModel ), From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, bSelection ); } diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 0aaa5f55e252..b017fba4663e 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -326,7 +326,7 @@ uno::Any SAL_CALL ScVbaWorksheets::getVisible() { bool bVisible = true; - uno::Reference< container::XEnumeration > xEnum( createEnumeration(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XEnumeration > xEnum( createEnumeration(), uno::UNO_SET_THROW ); while ( xEnum->hasMoreElements() ) { uno::Reference< excel::XWorksheet > xSheet( xEnum->nextElement(), uno::UNO_QUERY_THROW ); @@ -346,7 +346,7 @@ ScVbaWorksheets::setVisible( const uno::Any& _visible ) if ( !(_visible >>= bState) ) throw uno::RuntimeException("Visible property doesn't support non boolean #FIXME" ); - uno::Reference< container::XEnumeration > xEnum( createEnumeration(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XEnumeration > xEnum( createEnumeration(), uno::UNO_SET_THROW ); while ( xEnum->hasMoreElements() ) { uno::Reference< excel::XWorksheet > xSheet( xEnum->nextElement(), uno::UNO_QUERY_THROW ); @@ -442,7 +442,7 @@ ScVbaWorksheets::Item(const uno::Any& Index, const uno::Any& Index2) { uno::Reference< excel::XWorksheet > xWorkSheet( ScVbaWorksheets_BASE::Item( sIndices[ index ], Index2 ), uno::UNO_QUERY_THROW ); ScVbaWorksheet* pWorkSheet = excel::getImplFromDocModuleWrapper<ScVbaWorksheet>( xWorkSheet ); - uno::Reference< sheet::XSpreadsheet > xSheet( pWorkSheet->getSheet() , uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSpreadsheet > xSheet( pWorkSheet->getSheet() , uno::UNO_SET_THROW ); uno::Reference< container::XNamed > xName( xSheet, uno::UNO_QUERY_THROW ); aSheets.push_back( xSheet ); } diff --git a/sc/source/ui/vba/vbawsfunction.cxx b/sc/source/ui/vba/vbawsfunction.cxx index a7fbd65c16da..8f6b3ffe824b 100644 --- a/sc/source/ui/vba/vbawsfunction.cxx +++ b/sc/source/ui/vba/vbawsfunction.cxx @@ -173,7 +173,7 @@ ScVbaWSFunction::invoke(const OUString& FunctionName, const uno::Sequence< uno:: if( !aRet.hasValue() ) { - uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); + uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_SET_THROW ); uno::Reference< sheet::XFunctionAccess > xFunctionAccess( xSMgr->createInstanceWithContext( "com.sun.star.sheet.FunctionAccess", mxContext ), uno::UNO_QUERY_THROW ); |