diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2011-12-10 22:14:57 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2011-12-10 22:16:07 +0900 |
commit | 93a9f170be76965ec004b200ac939e55e8382ca0 (patch) | |
tree | 2631f1e25117ae2bef93935fb3dab41d13c728db /extensions | |
parent | 1688a9d9235dd2ee4f3b9497308efd41f7a3fb6f (diff) |
catch exception by constant reference
Diffstat (limited to 'extensions')
27 files changed, 155 insertions, 157 deletions
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index c80c81e51aaa..3ae659d6de38 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -338,7 +338,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame, const rtl: Any a = xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); a >>= xLayoutManager; } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { } } diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index 744c57a414e0..c645c9af8718 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -406,7 +406,7 @@ sal_Bool BibFrameController_Impl::SaveModified(const Reference< form::runtime::X _xCursor->updateRow(); bResult = sal_True; } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("SaveModified: Exception occurred!"); } @@ -594,7 +594,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen Reference< XResultSetUpdate > xUpdateCursor( pDatMan->getForm(), UNO_QUERY ); xUpdateCursor->moveToInsertRow(); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("Exception in last() or moveToInsertRow()"); } @@ -634,7 +634,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen if (bSuccess) xUpdateCursor->deleteRow(); } - catch(Exception&) + catch(const Exception&) { bSuccess = sal_False; } @@ -654,7 +654,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen // Datensatz bewegen um Stati neu zu setzen xCursor->first(); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("DeleteRecord : exception caught !"); } diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index 658d68386916..16e2a13d2c24 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -155,7 +155,7 @@ void BibPosListener::cursorMoved(const lang::EventObject& /*aEvent*/) throw( uno uno::Any aVal = xValueAcc->getByName(uTypeMapping); uno::Reference< uno::XInterface > xInt = *(uno::Reference< uno::XInterface > *)aVal.getValue(); uno::Reference< sdb::XColumn > xCol(xInt, UNO_QUERY); - DBG_ASSERT(xCol.is(), "BibPosListener::positioned : invalid column (no sdb::XColumn) !"); + DBG_ASSERT(xCol.is(), "BibPosListener::cursorMoved : invalid column (no sdb::XColumn) !"); if (xCol.is()) { nTempVal = xCol->getShort(); @@ -179,10 +179,9 @@ void BibPosListener::cursorMoved(const lang::EventObject& /*aEvent*/) throw( uno } } } - catch(Exception& rEx) + catch(const Exception&) { - (void) rEx; // make compiler happy - OSL_FAIL("BibPosListener::positioned: something went wrong !"); + OSL_FAIL("BibPosListener::cursorMoved: something went wrong !"); } } diff --git a/extensions/source/config/ldap/ldapuserprofilebe.cxx b/extensions/source/config/ldap/ldapuserprofilebe.cxx index 981e7e2b338d..3f59431ab224 100644 --- a/extensions/source/config/ldap/ldapuserprofilebe.cxx +++ b/extensions/source/config/ldap/ldapuserprofilebe.cxx @@ -147,7 +147,7 @@ bool LdapUserProfileBe::readLdapConfiguration( getLdapStringParam(xAccess, kUser, definition->mAnonUser); getLdapStringParam(xAccess, kPassword, definition->mAnonCredentials); } - catch (uno::Exception & e) + catch (const uno::Exception & e) { OSL_TRACE("LdapUserProfileBackend: access to configuration data failed: %s", rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index ca7740c9fb89..eb455bc2a624 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -154,7 +154,7 @@ namespace dbp } } } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OTableSelectionPage::initializePage: caught an exception!"); } @@ -189,7 +189,7 @@ namespace dbp if (!updateContext()) return sal_False; } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OTableSelectionPage::commitPage: caught an exception!"); } @@ -311,10 +311,10 @@ namespace dbp } } } - catch(SQLContext& e) { aSQLException <<= e; } - catch(SQLWarning& e) { aSQLException <<= e; } - catch(SQLException& e) { aSQLException <<= e; } - catch (Exception&) + catch(const SQLContext& e) { aSQLException <<= e; } + catch(const SQLWarning& e) { aSQLException <<= e; } + catch(const SQLException& e) { aSQLException <<= e; } + catch (const Exception&) { OSL_FAIL("OTableSelectionPage::implFillTables: could not fill the table list!"); } @@ -343,10 +343,10 @@ namespace dbp aQueryNames = xQueries->getElementNames(); } } - catch(SQLContext& e) { aSQLException <<= e; } - catch(SQLWarning& e) { aSQLException <<= e; } - catch(SQLException& e) { aSQLException <<= e; } - catch (Exception&) + catch(const SQLContext& e) { aSQLException <<= e; } + catch(const SQLWarning& e) { aSQLException <<= e; } + catch(const SQLException& e) { aSQLException <<= e; } + catch (const Exception&) { OSL_FAIL("OTableSelectionPage::implFillTables: could not fill the table list!"); } @@ -363,7 +363,7 @@ namespace dbp if ( xHandler.is() ) xHandler->handle(xRequest); } - catch(Exception&) { } + catch(const Exception&) { } return; } @@ -387,7 +387,7 @@ namespace dbp if (m_xDSContext.is()) fillListBox(m_aDatasource, m_xDSContext->getElementNames()); } - catch (Exception&) + catch (const Exception&) { OSL_FAIL("OTableSelectionPage::implCollectDatasource: could not collect the data source names!"); } diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 899acca822a6..234c0fd0c088 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -306,7 +306,7 @@ namespace dbp { getContext().xObjectModel->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ClassId"))) >>= nClassId; } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OControlWizard::activate: could not obtain the class id!"); } @@ -430,7 +430,7 @@ namespace dbp } m_aContext.xDrawPage = xPage; } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OControlWizard::implDeterminePage: caught an exception!"); } @@ -452,7 +452,7 @@ namespace dbp m_aContext.xDatasourceContext = Reference< XNameAccess >(xContext, UNO_QUERY); DBG_ASSERT(m_aContext.xDatasourceContext.is() || !xContext.is(), "OControlWizard::implGetDSContext: invalid database context (missing the XNameAccess)!"); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OControlWizard::implGetDSContext: invalid database context!"); } @@ -524,7 +524,7 @@ namespace dbp if (getServiceFactory().is()) xHandler = Reference< XInteractionHandler >(getServiceFactory()->createInstance(sInteractionHandlerServiceName), UNO_QUERY); } - catch(Exception&) { } + catch(const Exception&) { } if (!xHandler.is()) ShowServiceNotAvailableError(_pWindow, sInteractionHandlerServiceName, sal_True); return xHandler; @@ -642,7 +642,7 @@ namespace dbp xColumns->getByName(*pBegin) >>= xColumn; xColumn->getPropertyValue(s_sFieldTypeProperty) >>= nFieldType; } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OControlWizard::initContext: unexpected exception while gathering column information!"); } @@ -650,10 +650,10 @@ namespace dbp } } } - catch(SQLContext& e) { aSQLException <<= e; } - catch(SQLWarning& e) { aSQLException <<= e; } - catch(SQLException& e) { aSQLException <<= e; } - catch(Exception&) + catch(const SQLContext& e) { aSQLException <<= e; } + catch(const SQLWarning& e) { aSQLException <<= e; } + catch(const SQLException& e) { aSQLException <<= e; } + catch(const Exception&) { OSL_FAIL("OControlWizard::initContext: could not retrieve the control context (caught an exception)!"); } @@ -678,7 +678,7 @@ namespace dbp { xHandler->handle(xRequest); } - catch(Exception&) { } + catch(const Exception&) { } return sal_False; } @@ -706,7 +706,7 @@ namespace dbp ); } } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OControlWizard::commitControlSettings: could not commit the basic control settings!"); } @@ -731,7 +731,7 @@ namespace dbp _pSettings->sControlLabel = sControlLabel; } } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OControlWizard::initControlSettings: could not retrieve the basic control settings!"); } diff --git a/extensions/source/dbpilots/dbptools.cxx b/extensions/source/dbpilots/dbptools.cxx index 970bb59d6b9a..8df666e8ec9b 100644 --- a/extensions/source/dbpilots/dbptools.cxx +++ b/extensions/source/dbpilots/dbptools.cxx @@ -57,7 +57,7 @@ namespace dbp // can't do anything ... no free names _rElementsName = sBase; } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("::dbp::disambiguateName: something went (strangely) wrong!"); } diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index f7f867eeac45..3f997295a816 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -223,7 +223,7 @@ namespace dbp // insert the column xColumnContainer->insertByName(sColumnName, makeAny(xColumn)); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL( ( ::rtl::OString("OGridWizard::implApplySettings: unexpected exception while creating the grid column for field ") += ::rtl::OString(pFormFieldName->getStr(), pFormFieldName->getLength(), osl_getThreadTextEncoding()) diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index 2e86570124ff..de3026902aca 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -173,7 +173,7 @@ namespace dbp OOptionGroupLayouter aLayouter(getServiceFactory()); aLayouter.doLayout(getContext(), getSettings()); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OGroupBoxWizard::createRadios: caught an exception while creating the radio shapes!"); } diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index 5f7b710173aa..674555fb07a8 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -218,7 +218,7 @@ namespace dbp // the bound field getContext().xObjectModel->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataField")), makeAny(::rtl::OUString(getSettings().sLinkedFormField))); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OListComboWizard::implApplySettings: could not set the property values for the listbox!"); } @@ -277,7 +277,7 @@ namespace dbp if (xColumns.is()) aColumnNames = xColumns->getElementNames(); } - catch(Exception&) + catch(const Exception&) { DBG_ASSERT(!_bNeedIt, "OLinkFieldsPage::initializePage: caught an exception while retrieving the columns!"); } @@ -349,7 +349,7 @@ namespace dbp aTableNames = xTables->getElementNames(); fillListBox(m_aSelectTable, aTableNames); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OContentTableSelection::initializePage: could not retrieve the table names!"); } diff --git a/extensions/source/nsplugin/source/so_instance.cxx b/extensions/source/nsplugin/source/so_instance.cxx index 776319b4e93a..273c3db220cc 100644 --- a/extensions/source/nsplugin/source/so_instance.cxx +++ b/extensions/source/nsplugin/source/so_instance.cxx @@ -207,7 +207,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) if ( xLMProps.is() ) xLMProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutomaticToolbars")), uno::makeAny( (sal_Bool)sal_False ) ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) {} // get frames supplier @@ -345,10 +345,10 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ), uno::makeAny( sal_False ) ); xPres->start(); } - catch( uno::Exception& ) + catch( const uno::Exception& ) {} } - catch( uno::Exception& e ) + catch( const uno::Exception& e ) { debug_fprintf(NSP_LOG_APPEND, "Unknown exception while loading document in netscape plugin windows\n"); OString o = OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ); @@ -424,7 +424,7 @@ sal_Bool SoPluginInstance::Destroy(void) xCloseable->removeCloseListener( m_xCloseListener ); } } - catch( uno::Exception& ) + catch( const uno::Exception& ) {} try @@ -439,7 +439,7 @@ sal_Bool SoPluginInstance::Destroy(void) xDocumentCloser->dispose(); // this call should close the document } - catch( uno::Exception& ) + catch( const uno::Exception& ) { debug_fprintf(NSP_LOG_APPEND, "print by Nsplugin.exe, could not close the document correctly!\n"); try diff --git a/extensions/source/nsplugin/source/so_main.cxx b/extensions/source/nsplugin/source/so_main.cxx index c450874191ce..127bedf70a76 100644 --- a/extensions/source/nsplugin/source/so_main.cxx +++ b/extensions/source/nsplugin/source/so_main.cxx @@ -347,7 +347,7 @@ Reference< lang::XMultiServiceFactory > SAL_CALL start_office(NSP_PIPE_FD read_f debug_fprintf(NSP_LOG_APPEND, "Staroffice already start\n"); return Reference< lang::XMultiServiceFactory >(xRemoteContext->getServiceManager(), UNO_QUERY); } - catch ( connection::NoConnectException & ) + catch ( const connection::NoConnectException & ) { } @@ -411,7 +411,7 @@ Reference< lang::XMultiServiceFactory > SAL_CALL start_office(NSP_PIPE_FD read_f xUrlResolver->resolve( sConnectString ), UNO_QUERY_THROW ); return Reference< lang::XMultiServiceFactory >(xRemoteContext->getServiceManager(), UNO_QUERY); } - catch ( connection::NoConnectException & ) + catch ( const connection::NoConnectException & ) { // wait 500 ms, then try to connect again TimeValue tv = { 0 /* secs */, 500000000 /* nanosecs */ }; @@ -421,7 +421,7 @@ Reference< lang::XMultiServiceFactory > SAL_CALL start_office(NSP_PIPE_FD read_f debug_fprintf(NSP_LOG_APPEND, "Failed to connect to Staroffice in 2 minutes\n"); return Reference< lang::XMultiServiceFactory >(NULL); } - catch ( Exception & e) + catch (const Exception & e) { debug_fprintf(NSP_LOG_APPEND, "unexpected UNO exception caught: "); debug_fprintf(NSP_LOG_APPEND, (sal_Char *)e.Message.getStr()); diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx index fbb93706f06a..77e45daf6891 100644 --- a/extensions/source/ole/oleobjw.cxx +++ b/extensions/source/ole/oleobjw.cxx @@ -195,7 +195,7 @@ Any SAL_CALL IUnknownWrapper_Impl::invokeGetProperty( const OUString& aPropertyN } aResult = invokeWithDispIdComTlb( aDescGet, aPropertyName, aParams, aOutParamIndex, aOutParam ); } - catch ( Exception& e ) + catch ( const Exception& e ) { throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " "IUnknownWrapper_Impl::invokeGetProperty ! Message : \n") + @@ -223,7 +223,7 @@ Any SAL_CALL IUnknownWrapper_Impl::invokePutProperty( const OUString& aPropertyN } aResult = invokeWithDispIdComTlb( aDescPut, aPropertyName, aParams, aOutParamIndex, aOutParam ); } - catch ( Exception& e ) + catch ( const Exception& e ) { throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " "IUnknownWrapper_Impl::invokePutProperty ! Message : \n") + @@ -269,23 +269,23 @@ Any SAL_CALL IUnknownWrapper_Impl::invoke( const OUString& aFunctionName, aOutParam); } } - catch (IllegalArgumentException &) + catch (const IllegalArgumentException &) { throw; } - catch (CannotConvertException &) + catch (const CannotConvertException &) { throw; } - catch (InvocationTargetException &) + catch (const InvocationTargetException &) { throw; } - catch (BridgeRuntimeError & e) + catch (const BridgeRuntimeError & e) { throw RuntimeException(e.message, Reference<XInterface>()); } - catch (Exception & e) + catch (const Exception & e) { throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " "IUnknownWrapper_Impl::invoke ! Message : \n") + @@ -447,20 +447,20 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName, break; } } - catch (CannotConvertException &) + catch (const CannotConvertException &) { throw; } - catch (UnknownPropertyException &) + catch (const UnknownPropertyException &) { throw; } - catch (BridgeRuntimeError& e) + catch (const BridgeRuntimeError& e) { throw RuntimeException( e.message, Reference<XInterface>()); } - catch (Exception & e) + catch (const Exception & e) { throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " "IUnknownWrapper_Impl::setValue ! Message : \n") + @@ -633,16 +633,16 @@ Any SAL_CALL IUnknownWrapper_Impl::getValue( const OUString& aPropertyName ) break; } } - catch (UnknownPropertyException& ) + catch ( const UnknownPropertyException& ) { throw; } - catch (BridgeRuntimeError& e) + catch (const BridgeRuntimeError& e) { throw RuntimeException( e.message, Reference<XInterface>()); } - catch (Exception & e) + catch (const Exception & e) { throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " "IUnknownWrapper_Impl::getValue ! Message : \n") + @@ -689,11 +689,11 @@ sal_Bool SAL_CALL IUnknownWrapper_Impl::hasMethod( const OUString& aName ) else ret = sal_True; } - catch (BridgeRuntimeError& e) + catch (const BridgeRuntimeError& e) { throw RuntimeException(e.message, Reference<XInterface>()); } - catch (Exception & e) + catch (const Exception & e) { throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " "IUnknownWrapper_Impl::hasMethod ! Message : \n") + @@ -739,11 +739,11 @@ sal_Bool SAL_CALL IUnknownWrapper_Impl::hasProperty( const OUString& aName ) ret = sal_True; } } - catch (BridgeRuntimeError& e) + catch (const BridgeRuntimeError& e) { throw RuntimeException(e.message, Reference<XInterface>()); } - catch (Exception & e) + catch (const Exception & e) { throw RuntimeException(OUSTR("[automation bridge] unexpected exception in " "IUnknownWrapper_Impl::hasProperty ! Message : \n") + @@ -1273,9 +1273,9 @@ void SAL_CALL IUnknownWrapper_Impl::initialize( const Sequence< Any >& aArgument // so we should allow to create wrappers for them as well pType = getTypeInfo(); } - catch( BridgeRuntimeError& ) + catch( const BridgeRuntimeError& ) {} - catch( Exception& ) + catch( const Exception& ) {} if ( pType ) @@ -1315,11 +1315,11 @@ void SAL_CALL IUnknownWrapper_Impl::initialize( const Sequence< Any >& aArgument m_sDefaultMember = usName; } } - catch ( BridgeRuntimeError & e ) + catch ( const BridgeRuntimeError & e ) { throw RuntimeException( e.message, Reference<XInterface>() ); } - catch( Exception& e ) + catch( const Exception& e ) { throw RuntimeException( OUSTR("[automation bridge] unexpected exception in IUnknownWrapper_Impl::initialiase() error message: \n") + e.Message, diff --git a/extensions/source/ole/servprov.cxx b/extensions/source/ole/servprov.cxx index 8204fe7e63a9..cdfb6aafb37b 100644 --- a/extensions/source/ole/servprov.cxx +++ b/extensions/source/ole/servprov.cxx @@ -452,7 +452,7 @@ Any SAL_CALL OleConverter_Impl2::createBridge(const Any& modelDepObject, { variantToAny(pVariant, ret); } - catch (CannotConvertException & e) + catch (const CannotConvertException & e) { throw IllegalArgumentException( e.Message, 0, -1); diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx index 359009e4d485..4827d690d0e3 100644 --- a/extensions/source/ole/unoconversionutilities.hxx +++ b/extensions/source/ole/unoconversionutilities.hxx @@ -392,14 +392,14 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANTARG* pArg, Any& rAny, Any convAny = conv->convertTo(anySeq, ptype); rAny = convAny; } - catch (IllegalArgumentException& e) + catch (const IllegalArgumentException& e) { throw BridgeRuntimeError( OUSTR("[automation bridge]com.sun.star.lang.IllegalArgumentException " "in UnoConversionUtilities<T>::variantToAny! Message: ") + e.Message); } - catch (CannotConvertException& e) + catch (const CannotConvertException& e) { throw BridgeRuntimeError( OUSTR("[automation bridge]com.sun.star.script.CannotConvertException " @@ -582,19 +582,19 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANTARG* pArg, Any& rAny, "The provided VARIANT of type\" ") + OUString::valueOf((sal_Int32) var.vt) + OUSTR("\" is unappropriate for conversion!"), Reference<XInterface>(), -1); } - catch (CannotConvertException &) + catch (const CannotConvertException &) { throw; } - catch (IllegalArgumentException &) + catch (const IllegalArgumentException &) { throw; } - catch (BridgeRuntimeError &) + catch (const BridgeRuntimeError &) { throw; } - catch (Exception & e) + catch (const Exception & e) { throw BridgeRuntimeError(OUSTR("[automation bridge] unexpected exception in " "UnoConversionUtilities<T>::variantToAny ! Message : \n") + @@ -666,19 +666,19 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny, } } } - catch (IllegalArgumentException &) + catch (const IllegalArgumentException &) { throw; } - catch (CannotConvertException & ) + catch (const CannotConvertException &) { throw; } - catch (BridgeRuntimeError&) + catch (const BridgeRuntimeError&) { throw; } - catch(Exception & e) + catch(const Exception & e) { throw BridgeRuntimeError( OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" @@ -998,19 +998,19 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny) } } - catch (CannotConvertException & ) + catch (const CannotConvertException &) { throw; } - catch (IllegalArgumentException & ) + catch (const IllegalArgumentException &) { throw; } - catch(BridgeRuntimeError&) + catch(const BridgeRuntimeError&) { throw; } - catch(Exception & e) + catch(const Exception & e) { throw BridgeRuntimeError( OUSTR("[automation bridge]UnoConversionUtilities<T>::anyToVariant \n" @@ -1633,19 +1633,19 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANT* pVariant, Any& rAny } } } - catch (IllegalArgumentException & ) + catch (const IllegalArgumentException &) { throw; } - catch (CannotConvertException &) + catch (const CannotConvertException &) { throw; } - catch (BridgeRuntimeError & ) + catch (const BridgeRuntimeError &) { throw; } - catch (Exception & e) + catch (const Exception & e) { throw BridgeRuntimeError(OUSTR("[automation bridge] unexpected exception in " "UnoConversionUtilities<T>::variantToAny ! Message : \n") + @@ -1979,11 +1979,11 @@ bool UnoConversionUtilities<T>::convertValueObject( const VARIANTARG *var, Any& throw BridgeRuntimeError( OUSTR("[automation bridge] Conversion of ValueObject failed ")); } - catch (BridgeRuntimeError &) + catch (const BridgeRuntimeError &) { throw; } - catch (Exception & e) + catch (const Exception & e) { throw BridgeRuntimeError(OUSTR("[automation bridge] unexpected exception in " "UnoConversionUtilities<T>::convertValueObject ! Message : \n") + @@ -2120,11 +2120,11 @@ void UnoConversionUtilities<T>::dispatchExObject2Sequence( const VARIANTARG* pva throw BridgeRuntimeError( OUSTR("[automation bridge] Conversion of ValueObject failed ")); } - catch (BridgeRuntimeError & ) + catch (const BridgeRuntimeError &) { throw; } - catch (Exception & e) + catch (const Exception & e) { throw BridgeRuntimeError(OUSTR("[automation bridge] unexpected exception in " "UnoConversionUtilities<T>::convertValueObject ! Message : \n") + diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index d87a0f67349f..4672696330d8 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -297,11 +297,11 @@ STDMETHODIMP InterfaceOleWrapper_Impl::GetIDsOfNames(REFIID /*riid*/, } } } - catch(BridgeRuntimeError& ) + catch(const BridgeRuntimeError&) { OSL_ASSERT(0); } - catch(Exception& ) + catch(const Exception&) { OSL_ASSERT(0); } @@ -470,7 +470,7 @@ sal_Bool InterfaceOleWrapper_Impl::getInvocationInfoForCall( DISPID id, Invocat try{ invInfo= inv2->getInfoForName( sMemberName, sal_False); } - catch( IllegalArgumentException ) + catch(const IllegalArgumentException&) { validInfo= sal_False; } @@ -880,12 +880,12 @@ STDMETHODIMP InterfaceOleWrapper_Impl::Invoke(DISPID dispidMember, else ret = DISP_E_MEMBERNOTFOUND; } - catch(BridgeRuntimeError& e) + catch(const BridgeRuntimeError& e) { writeExcepinfo(pexcepinfo, e.message); ret = DISP_E_EXCEPTION; } - catch(Exception& e) + catch(const Exception& e) { OUString message= OUSTR("InterfaceOleWrapper_Impl::Invoke : \n") + e.Message; @@ -948,17 +948,17 @@ HRESULT InterfaceOleWrapper_Impl::doInvoke( DISPPARAMS * pdispparams, VARIANT * if (pvarResult != NULL) anyToVariant(pvarResult, returnValue); } - catch(IllegalArgumentException & e) //XInvocation::invoke + catch(const IllegalArgumentException & e) //XInvocation::invoke { writeExcepinfo(pexcepinfo, e.Message); ret = DISP_E_TYPEMISMATCH; } - catch(CannotConvertException & e) //XInvocation::invoke + catch(const CannotConvertException & e) //XInvocation::invoke { writeExcepinfo(pexcepinfo, e.Message); ret = mapCannotConvertException( e, puArgErr); } - catch(InvocationTargetException & e) //XInvocation::invoke + catch(const InvocationTargetException & e) //XInvocation::invoke { const Any& org = e.TargetException; Exception excTarget; @@ -968,17 +968,17 @@ HRESULT InterfaceOleWrapper_Impl::doInvoke( DISPPARAMS * pdispparams, VARIANT * writeExcepinfo(pexcepinfo, message); ret = DISP_E_EXCEPTION; } - catch(NoSuchMethodException & e) //XInvocation::invoke + catch(const NoSuchMethodException & e) //XInvocation::invoke { writeExcepinfo(pexcepinfo, e.Message); ret = DISP_E_MEMBERNOTFOUND; } - catch(BridgeRuntimeError & e) + catch(const BridgeRuntimeError & e) { writeExcepinfo(pexcepinfo, e.message); ret = DISP_E_EXCEPTION; } - catch(Exception & e) + catch(const Exception & e) { OUString message= OUSTR("InterfaceOleWrapper_Impl::doInvoke : \n") + e.Message; @@ -1008,17 +1008,17 @@ HRESULT InterfaceOleWrapper_Impl::doGetProperty( DISPPARAMS * /*pdispparams*/, V if (pvarResult) anyToVariant(pvarResult, returnValue); } - catch(UnknownPropertyException e) //XInvocation::getValue + catch(const UnknownPropertyException e) //XInvocation::getValue { writeExcepinfo(pexcepinfo, e.Message); ret = DISP_E_MEMBERNOTFOUND; } - catch(BridgeRuntimeError& e) + catch(const BridgeRuntimeError& e) { writeExcepinfo(pexcepinfo, e.message); ret = DISP_E_EXCEPTION; } - catch(Exception& e) + catch(const Exception& e) { OUString message= OUSTR("InterfaceOleWrapper_Impl::doGetProperty : \n") + e.Message; @@ -1043,15 +1043,15 @@ HRESULT InterfaceOleWrapper_Impl::doSetProperty( DISPPARAMS * /*pdispparams*/, V { m_xInvocation->setValue( name, params.getConstArray()[0]); } - catch(UnknownPropertyException ) + catch(const UnknownPropertyException &) { ret = DISP_E_MEMBERNOTFOUND; } - catch(CannotConvertException e) + catch(const CannotConvertException &e) { ret= mapCannotConvertException( e, puArgErr); } - catch(InvocationTargetException e) + catch(const InvocationTargetException &e) { if (pexcepinfo != NULL) { @@ -1177,12 +1177,12 @@ HRESULT InterfaceOleWrapper_Impl::InvokeGeneral( DISPID dispidMember, unsigned s } } } - catch(BridgeRuntimeError & e) + catch(const BridgeRuntimeError & e) { writeExcepinfo(pexcepinfo, e.message); ret = DISP_E_EXCEPTION; } - catch(Exception & e) + catch(const Exception & e) { OUString message= OUSTR("InterfaceOleWrapper_Impl::InvokeGeneral : \n") + e.Message; @@ -1578,12 +1578,12 @@ STDMETHODIMP UnoObjectWrapperRemoteOpt::Invoke ( DISPID dispidMember, REFIID /* ret= DISP_E_MEMBERNOTFOUND; } } - catch(BridgeRuntimeError& e) + catch(const BridgeRuntimeError& e) { writeExcepinfo(pexcepinfo, e.message); ret = DISP_E_EXCEPTION; } - catch(Exception& e) + catch(const Exception& e) { OUString message= OUSTR("UnoObjectWrapperRemoteOpt::Invoke : \n") + e.Message; @@ -1609,7 +1609,7 @@ HRESULT UnoObjectWrapperRemoteOpt::methodInvoke( DISPID /*dispidMember*/, DISPPA // The returned HRESULT is only appropriate for IDispatch::Invoke -static HRESULT mapCannotConvertException( CannotConvertException e, unsigned int * puArgErr) +static HRESULT mapCannotConvertException(const CannotConvertException &e, unsigned int * puArgErr) { HRESULT ret; sal_Bool bWriteIndex= sal_True; diff --git a/extensions/source/plugin/base/multiplx.cxx b/extensions/source/plugin/base/multiplx.cxx index bb187bf4d90e..f5c1a8507b7d 100644 --- a/extensions/source/plugin/base/multiplx.cxx +++ b/extensions/source/plugin/base/multiplx.cxx @@ -190,7 +190,7 @@ if( pCont ) \ { \ pListener->MethodName( aEvt ); \ } \ - catch( RuntimeException& ) \ + catch(const RuntimeException&) \ { \ /* ignore all usr system exceptions from the listener */ \ } \ diff --git a/extensions/source/plugin/base/nfuncs.cxx b/extensions/source/plugin/base/nfuncs.cxx index 63dc29f3adb8..c14907b5083f 100644 --- a/extensions/source/plugin/base/nfuncs.cxx +++ b/extensions/source/plugin/base/nfuncs.cxx @@ -199,9 +199,8 @@ IMPL_LINK( AsynchronousGetURL, getURL, XPlugin_Impl*, pImpl ) aUrl, aTarget ); } - catch( ::com::sun::star::plugin::PluginException& e ) + catch(const ::com::sun::star::plugin::PluginException&) { - (void)e; } pImpl->leavePluginCallback(); delete this; @@ -323,7 +322,7 @@ extern "C" { ); pImpl->leavePluginCallback(); } - catch( ::com::sun::star::plugin::PluginException& e ) + catch( const ::com::sun::star::plugin::PluginException& e ) { pImpl->leavePluginCallback(); return e.ErrorCode; @@ -365,7 +364,7 @@ extern "C" { ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > ( pListener ) ); pImpl->leavePluginCallback(); } - catch( ::com::sun::star::plugin::PluginException& e ) + catch( const ::com::sun::star::plugin::PluginException& e ) { pImpl->leavePluginCallback(); return e.ErrorCode; @@ -394,7 +393,7 @@ extern "C" { file ); pImpl->leavePluginCallback(); } - catch( ::com::sun::star::plugin::PluginException& e ) + catch( const ::com::sun::star::plugin::PluginException& e ) { pImpl->leavePluginCallback(); return e.ErrorCode; @@ -479,7 +478,7 @@ extern "C" { displayStatusText( pImpl, ::rtl::OStringToOUString( message, pImpl->getTextEncoding() ) ); pImpl->leavePluginCallback(); } - catch( ::com::sun::star::plugin::PluginException& ) + catch( const ::com::sun::star::plugin::PluginException& ) { pImpl->leavePluginCallback(); return; @@ -504,7 +503,7 @@ extern "C" { free( pAgent ); pAgent = strdup( ::rtl::OUStringToOString( UserAgent, pImpl->getTextEncoding() ).getStr() ); } - catch( ::com::sun::star::plugin::PluginException& ) + catch( const ::com::sun::star::plugin::PluginException& ) { pImpl->leavePluginCallback(); } diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index d8acf40d4598..c15fb72b077b 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -328,7 +328,7 @@ void XPlugin_Impl::handleSpecialArgs() Any aProp = xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) ); aProp >>= aURL; } - catch( UnknownPropertyException ) + catch(const UnknownPropertyException &) { } } @@ -398,7 +398,7 @@ void XPlugin_Impl::handleSpecialArgs() Any aProp = xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) ); aProp >>= aURL; } - catch( UnknownPropertyException ) + catch(const UnknownPropertyException &) { } } @@ -1037,7 +1037,7 @@ void PluginInputStream::load() ); m_pContent->openStream( static_cast< XOutputStream* >( this ) ); } - catch( com::sun::star::uno::Exception ) + catch(const com::sun::star::uno::Exception &) { } } diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx index d57b2ea2251d..707e6d7e0ab2 100644 --- a/extensions/source/propctrlr/fontdialog.cxx +++ b/extensions/source/propctrlr/fontdialog.cxx @@ -277,7 +277,7 @@ namespace pcr aPropExtractor.invalidateItem(PROPERTY_FONT_RELIEF, CFID_RELIEF, *_pSet); aPropExtractor.invalidateItem(PROPERTY_FONT_EMPHASIS_MARK, CFID_EMPHASIS, *_pSet); } - catch (Exception&) + catch (const Exception&) { OSL_FAIL("ControlCharacterDialog::translatePropertiesToItems: caught an exception!"); } diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 62e7ded9e911..1712b7c4cd2b 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -241,7 +241,7 @@ namespace pcr xRet = xStringResourceResolver; } } - catch(UnknownPropertyException&) + catch(const UnknownPropertyException&) { // nii } @@ -301,7 +301,7 @@ namespace pcr pResolvedStrings[i] = aIdStr; } } - catch( resource::MissingResourceException & ) + catch( const resource::MissingResourceException & ) {} aPropertyValue <<= aResolvedStrings; } @@ -451,7 +451,7 @@ namespace pcr } } } - catch( resource::MissingResourceException & ) + catch( const resource::MissingResourceException & ) {} @@ -486,7 +486,7 @@ namespace pcr { xStringResourceManager->removeIdForLocale( aPureIdStr, aLocale ); } - catch( resource::MissingResourceException & ) + catch( const resource::MissingResourceException & ) {} } } @@ -1206,7 +1206,7 @@ namespace pcr pControl->SetDefaultValue( nDefault ); } } - catch (Exception&) + catch (const Exception&) { // just ignore it } @@ -1731,7 +1731,7 @@ namespace pcr { xControl = _rxInspectorUI->getPropertyControl( aAffectedProps[i] ); } - catch( const UnknownPropertyException& e ) { (void)e; } + catch( const UnknownPropertyException& ) {} if ( xControl.is() ) { OFormattedNumericControl* pControl = dynamic_cast< OFormattedNumericControl* >( xControl.get() ); @@ -1778,7 +1778,7 @@ namespace pcr { xControl = _rxInspectorUI->getPropertyControl( aFormattedPropertyControls[i] ); } - catch( const UnknownPropertyException& e ) { (void)e; } + catch( const UnknownPropertyException& ) {} if ( xControl.is() ) { OFormattedNumericControl* pControl = dynamic_cast< OFormattedNumericControl* >( xControl.get() ); @@ -2386,7 +2386,7 @@ namespace pcr _rFieldNames.push_back( *pFields ); } } - catch (Exception&) + catch (const Exception&) { OSL_FAIL( "FormComponentPropertyHandler::impl_initFieldList_nothrow: caught an exception!" ); } @@ -2500,7 +2500,7 @@ namespace pcr break; } } - catch (Exception&) + catch (const Exception&) { OSL_FAIL("FormComponentPropertyHandler::impl_describeCursorSource_nothrow: caught an exception !"); } @@ -2672,9 +2672,9 @@ namespace pcr if ( bSuccess ) _out_rSelectedClause = _bFilter ? xComposer->getFilter() : xComposer->getOrder(); } - catch (SQLContext& e) { aErrorInfo = e; } - catch (SQLWarning& e) { aErrorInfo = e; } - catch (SQLException& e) { aErrorInfo = e; } + catch (const SQLContext& e) { aErrorInfo = e; } + catch (const SQLWarning& e) { aErrorInfo = e; } + catch (const SQLException& e) { aErrorInfo = e; } catch( const Exception& ) { OSL_FAIL( "FormComponentPropertyHandler::impl_dialogFilterOrSort_nothrow: caught an exception!" ); diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index c67540bf73ea..63cb0e01053c 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -986,7 +986,7 @@ namespace pcr UpdateUI(); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OPropertyBrowserController::impl_rebindToInspectee_nothrow: caught an exception !"); } @@ -1117,7 +1117,7 @@ namespace pcr // be notified when one of our inspectees dies impl_toggleInspecteeListening_nothrow( true ); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OPropertyBrowserController::doInspection : caught an exception !"); } @@ -1367,7 +1367,7 @@ namespace pcr break; } } - catch (Exception&) + catch (const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -1430,14 +1430,14 @@ namespace pcr // and display it again. This ensures proper formatting getPropertyBox().SetPropertyValue( rName, aNormalizedValue, false ); } - catch(PropertyVetoException& eVetoException) + catch(const PropertyVetoException& eVetoException) { InfoBox(m_pView, eVetoException.Message).Execute(); PropertyHandlerRef handler = impl_getHandlerForProperty_throw( rName ); Any aNormalizedValue = handler->getPropertyValue( rName ); getPropertyBox().SetPropertyValue( rName, aNormalizedValue, false ); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OPropertyBrowserController::Commit : caught an exception !"); } diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx index cc9303875c9b..4cee79747872 100644 --- a/extensions/source/propctrlr/stringrepresentation.cxx +++ b/extensions/source/propctrlr/stringrepresentation.cxx @@ -288,8 +288,8 @@ void SAL_CALL StringRepresentation::initialize(const uno::Sequence< uno::Any > & if ( !sReturn.getLength() ) m_xTypeConverter->convertToSimpleType( _rValue, uno::TypeClass_STRING ) >>= sReturn; } - catch( script::CannotConvertException& ) { } - catch( lang::IllegalArgumentException& ) { } + catch( const script::CannotConvertException& ) { } + catch( const lang::IllegalArgumentException& ) { } } return sReturn; } @@ -486,8 +486,8 @@ uno::Any StringRepresentation::convertStringToSimple( const ::rtl::OUString& _rV if ( !aReturn.hasValue() ) aReturn = m_xTypeConverter->convertToSimpleType( makeAny( _rValue ), _ePropertyType ); } - catch( script::CannotConvertException& ) { } - catch( lang::IllegalArgumentException& ) { } + catch( const script::CannotConvertException& ) { } + catch( const lang::IllegalArgumentException& ) { } } return aReturn; } diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index c88ea8206190..66acb883033a 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -970,7 +970,7 @@ UpdateCheck::install() ShutdownThread *pShutdownThread = new ShutdownThread( m_xContext ); (void) pShutdownThread; } - } catch(uno::Exception&) { + } catch(const uno::Exception&) { m_aUpdateHandler->setErrorMessage( m_aUpdateHandler->getDefaultInstErrMsg() ); } } @@ -1513,7 +1513,7 @@ UpdateCheck::showReleaseNote(const rtl::OUString& rURL) const if( xShellExecute.is() ) xShellExecute->execute(rURL, rtl::OUString(), c3s::SystemShellExecuteFlags::DEFAULTS); - } catch(c3s::SystemShellExecuteException&) { + } catch(const c3s::SystemShellExecuteException&) { } } diff --git a/extensions/source/update/check/updateprotocol.cxx b/extensions/source/update/check/updateprotocol.cxx index bbe5494990fe..a20208d4a0a5 100644 --- a/extensions/source/update/check/updateprotocol.cxx +++ b/extensions/source/update/check/updateprotocol.cxx @@ -172,7 +172,7 @@ checkForUpdates( try { xNodeList = xXPath->selectNodeList(xNode, aXPathExpression + UNISTRING("/inst:update/attribute::src")); - } catch (css::xml::xpath::XPathException &) { + } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -200,7 +200,7 @@ checkForUpdates( try { xNode2 = xXPath->selectSingleNode(xNode, aXPathExpression + UNISTRING("/inst:version/text()")); - } catch (css::xml::xpath::XPathException &) { + } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -210,7 +210,7 @@ checkForUpdates( try { xNode2 = xXPath->selectSingleNode(xNode, aXPathExpression + UNISTRING("/inst:buildid/text()")); - } catch (css::xml::xpath::XPathException &) { + } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -223,7 +223,7 @@ checkForUpdates( try { xNodeList = xXPath->selectNodeList(xNode, aXPathExpression + UNISTRING("/inst:relnote")); - } catch (css::xml::xpath::XPathException &) { + } catch (const css::xml::xpath::XPathException &) { // ignore } imax = xNodeList->getLength(); diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index 42a73015d116..a7d70fdd8c83 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -573,7 +573,7 @@ UpdateInformationProvider::getChildNode(const uno::Reference< xml::dom::XNode >& OSL_ASSERT(m_xXPathAPI.is()); try { return m_xXPathAPI->selectSingleNode(rxNode, UNISTRING( "./atom:" ) + rName); - } catch (xml::xpath::XPathException &) { + } catch (const xml::xpath::XPathException &) { // ignore return 0; } @@ -617,7 +617,7 @@ UpdateInformationProvider::getUpdateInformationEnumeration( try { xNodeList = m_xXPathAPI->selectNodeList(xDocument.get(), aXPathExpression); - } catch (xml::xpath::XPathException &) { + } catch (const xml::xpath::XPathException &) { // ignore } diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index e2914346917d..09dacc5da8f7 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -349,7 +349,7 @@ Image UpdateCheckUI::GetBubbleImage( ::rtl::OUString &rURL ) } } } - catch( uno::Exception& ) + catch( const uno::Exception& ) { } } |