diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-20 21:57:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-21 09:11:10 +0100 |
commit | b0a7f87a861c4ef9caab40b904f4d22d39496493 (patch) | |
tree | 0a45f2e6ccf44ebd98da1cf1f2aeb85379521d92 /chart2 | |
parent | 73de7fa2ccfab86a90130d8a571bdae861dab5bc (diff) |
catch by const reference
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | 35 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 2 | ||||
-rw-r--r-- | chart2/source/model/filter/XMLFilter.cxx | 28 | ||||
-rw-r--r-- | chart2/source/model/main/ChartModel.cxx | 16 | ||||
-rw-r--r-- | chart2/source/tools/ReferenceSizeProvider.cxx | 10 |
5 files changed, 45 insertions, 46 deletions
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index 75d232dcb36e..71a80b12e387 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -533,7 +533,7 @@ void WrappedHasLegendProperty::setPropertyValue( const Any& rOuterValue, const R xLegendProp->setPropertyValue( C2U("Show"), uno::makeAny( bNewValue )); } } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -552,7 +552,7 @@ Any WrappedHasLegendProperty::getPropertyValue( const Reference< beans::XPropert else aRet <<= sal_False; } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -614,7 +614,7 @@ void WrappedHasMainTitleProperty::setPropertyValue( const Any& rOuterValue, cons else TitleHelper::removeTitle( TitleHelper::MAIN_TITLE, m_spChart2ModelContact->getChartModel() ); } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -628,7 +628,7 @@ Any WrappedHasMainTitleProperty::getPropertyValue( const Reference< beans::XProp { aRet <<= sal_Bool( TitleHelper::getTitle( TitleHelper::MAIN_TITLE, m_spChart2ModelContact->getChartModel() ).is() ); } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -691,7 +691,7 @@ void WrappedHasSubTitleProperty::setPropertyValue( const Any& rOuterValue, const else TitleHelper::removeTitle( TitleHelper::SUB_TITLE, m_spChart2ModelContact->getChartModel() ); } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -705,7 +705,7 @@ Any WrappedHasSubTitleProperty::getPropertyValue( const Reference< beans::XPrope { aRet <<= sal_Bool( TitleHelper::getTitle( TitleHelper::SUB_TITLE, m_spChart2ModelContact->getChartModel() ).is() ); } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -802,7 +802,7 @@ Reference< XDiagram > SAL_CALL ChartDocumentWrapper::getDiagram() { m_xDiagram = new DiagramWrapper( m_spChart2ModelContact ); } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -837,7 +837,7 @@ void SAL_CALL ChartDocumentWrapper::setDiagram( const Reference< XDiagram >& xDi m_xDiagram = xDiagram; } } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -1004,12 +1004,12 @@ void SAL_CALL ChartDocumentWrapper::dispose() if( xFormerDelegator.is()) xFormerDelegator->dispose(); } - catch( lang::DisposedException ) + catch (const lang::DisposedException&) { // this is ok, don't panic } } - catch( uno::Exception &ex ) + catch (const uno::Exception &ex) { ASSERT_EXCEPTION( ex ); } @@ -1041,11 +1041,11 @@ void ChartDocumentWrapper::impl_resetAddIn() } } } - catch( const uno::RuntimeException& ex ) + catch (const uno::RuntimeException& ex) { ASSERT_EXCEPTION( ex ); } - catch( const uno::Exception& ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -1347,7 +1347,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance( xResult = static_cast< ::cppu::OWeakObject* >( new DiagramWrapper( m_spChart2ModelContact )); } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -1390,7 +1390,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance( aArguments[1]=uno::makeAny(bRefreshAddIn); xViewInit->initialize(aArguments); } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -1422,7 +1422,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance( bServiceFound = true; } } - catch( const uno::Exception ) + catch (const uno::Exception&) { // couldn't create shape } @@ -1446,9 +1446,8 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance( } } } - catch( const uno::Exception& ex ) + catch (const uno::Exception&) { - (void)ex; // couldn't create service } } @@ -1509,7 +1508,7 @@ void SAL_CALL ChartDocumentWrapper::setDelegator( { this->dispose(); } - catch( uno::Exception &ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index e95d50d0614a..af5f2cbe421f 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -241,7 +241,7 @@ void ChartController::TheModel::tryTermination() #if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( !m_bOwnership, - "INFO: a well known owner has catched a CloseVetoException after calling close(true)" ); + "INFO: a well known owner has caught a CloseVetoException after calling close(true)" ); #endif m_bOwnership = false; diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index 66ba3d77f8ec..ff77dea9991a 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -162,7 +162,7 @@ uno::Reference< embed::XStorage > lcl_getWriteStorage( xProp->setPropertyValue( C2U("MediaType"), uno::makeAny( _sMediaType )); } } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -226,7 +226,7 @@ uno::Reference< embed::XStorage > lcl_getReadStorage( OSL_ENSURE( xStorage.is(), "No Storage" ); } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -465,7 +465,7 @@ sal_Int32 XMLFilter::impl_Import( xStorage, xSaxParser, xFactory, xGraphicObjectResolver, xImportInfo ); } } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); @@ -549,7 +549,7 @@ sal_Int32 XMLFilter::impl_ImportStream( xDocHandler.set(xFactory->createInstanceWithArgumentsAndContext(m_sDocumentHandler,aArgs,m_xContext), uno::UNO_QUERY ); xImporter.set(xDocHandler,uno::UNO_QUERY); } - catch(uno::Exception&) + catch (const uno::Exception&) { OSL_FAIL("Exception caught!"); } @@ -561,24 +561,24 @@ sal_Int32 XMLFilter::impl_ImportStream( // load was successful nWarning = 0; } - catch( xml::sax::SAXParseException ) + catch (const xml::sax::SAXParseException&) { // todo: if encrypted: ERRCODE_SFX_WRONGPASSWORD } - catch( xml::sax::SAXException ) + catch (const xml::sax::SAXException&) { // todo: if encrypted: ERRCODE_SFX_WRONGPASSWORD } - catch( packages::zip::ZipIOException ) + catch (const packages::zip::ZipIOException&) { nWarning = ERRCODE_IO_BROKENPACKAGE; } - catch( io::IOException ) + catch (const io::IOException&) { } - catch( uno::Exception& aEx ) + catch (const uno::Exception& rEx) { - ASSERT_EXCEPTION( aEx ); + ASSERT_EXCEPTION(rEx); } } @@ -647,7 +647,7 @@ sal_Int32 XMLFilter::impl_Export( xDocHandler.set(xServiceFactory->createInstanceWithArguments(m_sDocumentHandler,aArgs), uno::UNO_QUERY ); xSaxWriter.set(xDocHandler,uno::UNO_QUERY); } - catch(uno::Exception&) + catch (const uno::Exception&) { OSL_FAIL("Exception caught!"); } @@ -727,7 +727,7 @@ sal_Int32 XMLFilter::impl_Export( if ( xTransact.is() ) xTransact->commit(); } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); @@ -772,7 +772,7 @@ sal_Int32 XMLFilter::impl_ExportStream( xStreamProp->setPropertyValue( C2U("Compressed"), uno::makeAny( sal_True ) );//@todo? xStreamProp->setPropertyValue( C2U("UseCommonStoragePasswordEncryption"), uno::makeAny( sal_True ) ); } - catch( uno::Exception& rEx ) + catch (const uno::Exception& rEx) { ASSERT_EXCEPTION( rEx ); } @@ -804,7 +804,7 @@ sal_Int32 XMLFilter::impl_ExportStream( //@todo? filter properties? ... url? ... xFilter->filter( aMediaDesc ); } - catch( uno::Exception& rEx ) + catch (const uno::Exception& rEx) { ASSERT_EXCEPTION( rEx ); } diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 9d88b849220b..67c9f1fbab79 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -235,7 +235,7 @@ sal_Bool ChartModel::impl_isControllerConnected( const uno::Reference< frame::XC return sal_True; } } - catch( uno::Exception ) + catch (const uno::Exception&) { } return sal_False; @@ -654,7 +654,7 @@ void SAL_CALL ChartModel::close( sal_Bool bDeliverOwnership ) //try to cancel running longlasting calls //// @todo } - catch( uno::Exception ) + catch (const uno::Exception&) { //// @todo //do not throw anything here!! (without endTryClose) @@ -837,7 +837,7 @@ void SAL_CALL ChartModel::attachDataProvider( const uno::Reference< chart2::data sal_Bool bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( Reference< frame::XModel >(this) ); xProp->setPropertyValue(C2U("IncludeHiddenCells"), uno::makeAny(bIncludeHiddenCells)); } - catch( const beans::UnknownPropertyException& ) + catch (const beans::UnknownPropertyException&) { } } @@ -906,11 +906,11 @@ void SAL_CALL ChartModel::setArguments( const Sequence< beans::PropertyValue >& xDia->setDiagramData( xDataSource, aArguments ); } } - catch( lang::IllegalArgumentException & ) + catch (const lang::IllegalArgumentException&) { throw; } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -1011,7 +1011,7 @@ uno::Any SAL_CALL ChartModel::queryInterface( const uno::Type& aType ) if( m_xOldModelAgg.is()) aResult = m_xOldModelAgg->queryAggregation( aType ); } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -1105,7 +1105,7 @@ embed::VisualRepresentation SAL_CALL ChartModel::getPreferredVisualRepresentatio aResult.Data <<= aMetafile; } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -1143,7 +1143,7 @@ uno::Any SAL_CALL ChartModel::getTransferData( const datatransfer::DataFlavor& a aResult = xTransferable->getTransferData( aFlavor ); } } - catch( uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx index 909eaf61942c..5826103b9fd1 100644 --- a/chart2/source/tools/ReferenceSizeProvider.cxx +++ b/chart2/source/tools/ReferenceSizeProvider.cxx @@ -109,7 +109,7 @@ void ReferenceSizeProvider::setValuesAtTitle( setValuesAtPropertySet( xTitleProp, /* bAdaptFontSizes = */ false ); } - catch( const uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -140,7 +140,7 @@ void ReferenceSizeProvider::setValuesAtAllDataSeries() (*aIt)->getDataPointByIndex( aPointIndexes[i] ) ); } } - catch( const uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -183,7 +183,7 @@ void ReferenceSizeProvider::setValuesAtPropertySet( } } } - catch( const uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } @@ -205,7 +205,7 @@ void ReferenceSizeProvider::getAutoResizeFromPropSet( else eSingleState = AUTO_RESIZE_NO; } - catch( uno::Exception ) + catch (const uno::Exception&) { // unknown property -> state stays unknown } @@ -320,7 +320,7 @@ ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState } } } - catch( const uno::Exception & ex ) + catch (const uno::Exception& ex) { ASSERT_EXCEPTION( ex ); } |