summaryrefslogtreecommitdiff
path: root/basic/source/uno
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2011-08-24 11:22:56 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2011-08-24 11:30:17 +0900
commite1a1091d0ae61ba46c6d063a92db0b7d1ce65942 (patch)
tree5cd7f5ba6ad9fc1e859263332b4f96167ac927ce /basic/source/uno
parent8dfa38c418125ad880e9d4b2a968f0f1778d6de4 (diff)
catch ignored exceptions by const reference
Diffstat (limited to 'basic/source/uno')
-rw-r--r--basic/source/uno/dlgcont.cxx10
-rw-r--r--basic/source/uno/namecont.cxx80
-rw-r--r--basic/source/uno/scriptcont.cxx40
3 files changed, 65 insertions, 65 deletions
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index 6378a9532823..7df1dd0e2727 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -247,7 +247,7 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e
mbOasis2OOoFormat = sal_True;
}
}
- catch ( Exception& )
+ catch (const Exception& )
{
// if we cannot get the version then the
// Oasis2OOoTransformer will not be used
@@ -354,7 +354,7 @@ Any SAL_CALL SfxDialogLibraryContainer::importLibraryElement
{
xInput = mxSFI->openFileRead( aFile );
}
- catch( Exception& )
+ catch(const Exception& )
//catch( Exception& e )
{
// TODO:
@@ -378,7 +378,7 @@ Any SAL_CALL SfxDialogLibraryContainer::importLibraryElement
xParser->setDocumentHandler( ::xmlscript::importDialogModel( xDialogModel, xContext, mxOwnerDocument ) );
xParser->parseStream( source );
}
- catch( Exception& )
+ catch(const Exception& )
{
OSL_FAIL( "Parsing error\n" );
SfxErrorContext aEc( ERRCTX_SFX_LOADBASIC, aFile );
@@ -450,7 +450,7 @@ Reference< ::com::sun::star::resource::XStringResourcePersistence >
aArgs[0] <<= xLibraryStor;
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
// TODO: Error handling?
return xRet;
@@ -529,7 +529,7 @@ void SfxDialogLibraryContainer::onNewRootStorage()
if( xStringResourceWithStorage.is() )
xStringResourceWithStorage->setStorage( xLibraryStor );
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
// TODO: Error handling?
}
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index f4823c7fc735..d14ca988babc 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -656,7 +656,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
{
xStorage = ::comphelper::OStorageHelper::GetStorageFromURL( aInitFileName, embed::ElementModes::READ );
}
- catch ( uno::Exception& )
+ catch (const uno::Exception& )
{
// TODO: error handling
}
@@ -713,7 +713,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
{
xStream = xLibrariesStor->openStreamElement( aFileName, embed::ElementModes::READ );
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{}
if( !xStream.is() )
@@ -728,7 +728,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
{
xStream = xLibrariesStor->openStreamElement( aFileName, embed::ElementModes::READ );
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{}
if( !xStream.is() )
@@ -744,7 +744,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
if ( xStream.is() )
xInput = xStream->getInputStream();
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
// TODO: error handling?
}
@@ -771,7 +771,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
{
xInput = mxSFI->openFileRead( aFileName );
}
- catch( Exception& )
+ catch(const Exception& )
{
xInput.clear();
if( nPass == 0 )
@@ -795,7 +795,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
xInput = mxSFI->openFileRead( aFileName );
mbOldInfoFormat = true;
}
- catch( Exception& )
+ catch(const Exception& )
{
xInput.clear();
SfxErrorContext aEc( ERRCTX_SFX_LOADBASIC, aFileName );
@@ -914,7 +914,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
xLibraryStor = xLibrariesStor->openStorageElement( rLib.aName,
embed::ElementModes::READ );
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
#if OSL_DEBUG_LEVEL > 0
Any aError( ::cppu::getCaughtException() );
@@ -982,7 +982,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
{
implScanExtensions();
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
// TODO: error handling?
OSL_FAIL( "Cannot access extensions!" );
@@ -1087,14 +1087,14 @@ sal_Bool SfxLibraryContainer::init_Impl(
{
mxSFI->move( aPrevFolder, aFolderUserBasic );
}
- catch( Exception& )
+ catch(const Exception& )
{
// Move back user/basic folder
try
{
mxSFI->kill( aFolderUserBasic );
}
- catch( Exception& )
+ catch(const Exception& )
{}
mxSFI->move( aFolderTmp, aFolderUserBasic );
throw;
@@ -1192,7 +1192,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
mxSFI->kill( aPrevFolder );
}
}
- catch( Exception& )
+ catch(const Exception& )
{
bCleanUp = true;
}
@@ -1218,7 +1218,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
bSaved = true;
}
}
- catch( Exception& )
+ catch(const Exception& )
{}
try
{
@@ -1228,7 +1228,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
else
mxSFI->kill( aPrevFolder_2 );
}
- catch( Exception& )
+ catch(const Exception& )
{}
}
}
@@ -1369,7 +1369,7 @@ OUString SfxLibraryContainer::createAppLibraryFolder
{
mxSFI->createFolder( aLibDirPath );
}
- catch( Exception& )
+ catch(const Exception& )
{}
}
@@ -1445,7 +1445,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
writeLibraryElement( xLib, aElementName, xOutput );
}
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
OSL_FAIL( "Problem during storing of library!\n" );
// TODO: error handling?
@@ -1514,7 +1514,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
writeLibraryElement( xLib, aElementName, xOutput );
xOutput->closeOutput();
}
- catch( Exception& )
+ catch(const Exception& )
{
if( bExport )
throw;
@@ -1525,7 +1525,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
}
}
}
- catch( Exception& )
+ catch(const Exception& )
{
if( bExport )
throw;
@@ -1586,7 +1586,7 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib,
xOut = xInfoStream->getOutputStream();
}
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
OSL_FAIL( "Problem during storing of library index file!\n" );
// TODO: error handling?
@@ -1625,7 +1625,7 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib,
xSFI->kill( aLibInfoPath );
xOut = xSFI->openFileWrite( aLibInfoPath );
}
- catch( Exception& )
+ catch(const Exception& )
{
if( bExport )
throw;
@@ -1680,7 +1680,7 @@ sal_Bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib,
xStorage->openStreamElement( aLibInfoPath, embed::ElementModes::READ );
xInput = xInfoStream->getInputStream();
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{}
}
else
@@ -1700,7 +1700,7 @@ sal_Bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib,
{
xInput = mxSFI->openFileRead( aLibInfoPath );
}
- catch( Exception& )
+ catch(const Exception& )
{
xInput.clear();
if( !GbMigrationSuppressErrors )
@@ -1725,7 +1725,7 @@ sal_Bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib,
xParser->setDocumentHandler( ::xmlscript::importLibrary( rLib ) );
xParser->parseStream( source );
}
- catch( Exception& )
+ catch(const Exception& )
{
OSL_FAIL( "Parsing error\n" );
SfxErrorContext aEc( ERRCTX_SFX_LOADBASIC, aLibInfoPath );
@@ -1911,7 +1911,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
rLib.aName,
embed::ElementModes::READWRITE );
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
#if OSL_DEBUG_LEVEL > 0
Any aError( ::cppu::getCaughtException() );
@@ -1944,7 +1944,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
uno::Reference< embed::XTransactedObject > xTransact( xLibraryStor, uno::UNO_QUERY_THROW );
xTransact->commit();
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
DBG_UNHANDLED_EXCEPTION();
// TODO: error handling
@@ -2054,7 +2054,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
xOut = xInfoStream->getOutputStream();
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL;
ErrorHandler::HandleError( nErrorCode );
@@ -2074,7 +2074,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
mxSFI->kill( aLibInfoPath );
xOut = mxSFI->openFileWrite( aLibInfoPath );
}
- catch( Exception& )
+ catch(const Exception& )
{
xOut.clear();
SfxErrorContext aEc( ERRCTX_SFX_SAVEDOC, aLibInfoPath );
@@ -2105,7 +2105,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
xTransact->commit();
}
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
OSL_FAIL( "Problem during storing of libraries!\n" );
sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL;
@@ -2261,7 +2261,7 @@ void SAL_CALL SfxLibraryContainer::removeLibrary( const OUString& Name )
if( mxSFI->exists( aLibInfoPath ) )
mxSFI->kill( aLibInfoPath );
}
- catch( Exception& ) {}
+ catch(const Exception& ) {}
// Delete folder if empty
INetURLObject aInetObj( String(maLibraryPath).GetToken(1) );
@@ -2279,7 +2279,7 @@ void SAL_CALL SfxLibraryContainer::removeLibrary( const OUString& Name )
mxSFI->kill( aLibDirPath );
}
}
- catch( Exception& )
+ catch(const Exception& )
{
}
}
@@ -2332,7 +2332,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
if ( !xLibrariesStor.is() )
throw uno::RuntimeException();
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
#if OSL_DEBUG_LEVEL > 0
Any aError( ::cppu::getCaughtException() );
@@ -2366,7 +2366,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
try {
xElementStream = xLibraryStor->openStreamElement( aFile, embed::ElementModes::READ );
- } catch( uno::Exception& )
+ } catch(const uno::Exception& )
{}
if( !xElementStream.is() )
@@ -2377,7 +2377,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
aFile += maLibElementFileExtension;
try {
xElementStream = xLibraryStor->openStreamElement( aFile, embed::ElementModes::READ );
- } catch( uno::Exception& )
+ } catch(const uno::Exception& )
{}
}
@@ -2536,7 +2536,7 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU
mxSFI->kill( pImplLib->maLibInfoFileURL );
mxSFI->move( aLibInfoFileURL, pImplLib->maLibInfoFileURL );
}
- catch( Exception& )
+ catch(const Exception& )
{
}
@@ -2565,7 +2565,7 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU
mxSFI->kill( aDestElementPath );
mxSFI->move( aElementPath, aDestElementPath );
}
- catch( Exception& )
+ catch(const Exception& )
{
}
}
@@ -2583,7 +2583,7 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU
pImplLib->implSetModified( sal_True );
}
}
- catch( Exception& )
+ catch(const Exception& )
{
// Restore old library
maNameContainer.insertByName( Name, aLibAny ) ;
@@ -2865,7 +2865,7 @@ void SAL_CALL SfxLibraryContainer::setVBACompatibilityMode( ::sal_Bool _vbacompa
Reference< XMultiServiceFactory > xFactory( xModel, UNO_QUERY_THROW );
xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) );
}
- catch( Exception& )
+ catch(const Exception& )
{
}
}
@@ -3119,7 +3119,7 @@ void SfxLibrary::impl_removeWithoutChecks( const ::rtl::OUString& _rElementName
if( mxSFI->exists( aFile ) )
mxSFI->kill( aFile );
}
- catch( Exception& )
+ catch(const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
@@ -3452,7 +3452,7 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextUserScript
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")),
Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
}
- catch( com::sun::star::uno::DeploymentException& )
+ catch(const com::sun::star::uno::DeploymentException& )
{
// Special Office installations may not contain deployment code
m_eState = END_REACHED;
@@ -3506,7 +3506,7 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextSharedScri
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("shared")),
Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
}
- catch( com::sun::star::uno::DeploymentException& )
+ catch(const com::sun::star::uno::DeploymentException& )
{
// Special Office installations may not contain deployment code
return xScriptPackage;
@@ -3559,7 +3559,7 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextBundledScr
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bundled")),
Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
}
- catch( com::sun::star::uno::DeploymentException& )
+ catch(const com::sun::star::uno::DeploymentException& )
{
// Special Office installations may not contain deployment code
return xScriptPackage;
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 6f6785082c3c..44a26c852a7d 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -108,7 +108,7 @@ void SfxScriptLibraryContainer::setLibraryPassword
pImplLib->maPassword = rPassword;
}
}
- catch( NoSuchElementException& ) {}
+ catch(const NoSuchElementException& ) {}
}
String SfxScriptLibraryContainer::getLibraryPassword( const String& rLibraryName )
@@ -129,7 +129,7 @@ void SfxScriptLibraryContainer::clearLibraryPassword( const String& rLibraryName
pImplLib->mbPasswordProtected = sal_False;
pImplLib->maPassword = OUString();
}
- catch( NoSuchElementException& ) {}
+ catch(const NoSuchElementException& ) {}
}
sal_Bool SfxScriptLibraryContainer::hasLibraryPassword( const String& rLibraryName )
@@ -274,7 +274,7 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
{
xInput = mxSFI->openFileRead( aFile );
}
- catch( Exception& )
+ catch(const Exception& )
//catch( Exception& e )
{
// TODO:
@@ -297,7 +297,7 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
xParser->setDocumentHandler( ::xmlscript::importScriptModule( aMod ) );
xParser->parseStream( source );
}
- catch( Exception& )
+ catch(const Exception& )
{
SfxErrorContext aEc( ERRCTX_SFX_LOADBASIC, aFile );
sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL;
@@ -324,7 +324,7 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
Reference< XMultiServiceFactory > xFactory( xModel, UNO_QUERY_THROW );
xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) );
}
- catch( Exception& )
+ catch(const Exception& )
{
}
@@ -358,7 +358,7 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
Reference< XMultiServiceFactory> xSF( xModel, UNO_QUERY_THROW );
mxCodeNameAccess.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAObjectModuleObjectProvider" ) ) ), UNO_QUERY );
}
- catch( Exception& ) {}
+ catch(const Exception& ) {}
if( mxCodeNameAccess.is() )
{
@@ -366,7 +366,7 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
{
aModInfo.ModuleObject.set( mxCodeNameAccess->getByName( aElementName), uno::UNO_QUERY );
}
- catch(uno::Exception&)
+ catch(const uno::Exception&)
{
OSL_TRACE("Failed to get documument object for %s", rtl::OUStringToOString( aElementName, RTL_TEXTENCODING_UTF8 ).getStr() );
}
@@ -570,7 +570,7 @@ void SAL_CALL SfxScriptLibraryContainer::changeLibraryPassword( const OUString&
mxSFI->kill( aElementPath );
}
}
- catch( Exception& ) {}
+ catch(const Exception& ) {}
}
}
@@ -665,7 +665,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
xOut->writeBytes( aBinSeq );
xOut->closeOutput();
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
// TODO: handle error
}
@@ -707,7 +707,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
Reference< XNameContainer > xLib( pLib );
writeLibraryElement( xLib, aElementName, xOutput );
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
OSL_FAIL( "Problem on storing of password library!\n" );
// TODO: error handling
@@ -821,7 +821,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
throw uno::RuntimeException();
xEncr->setEncryptionPassword( pLib->maPassword );
}
- catch( ::com::sun::star::packages::WrongPasswordException& )
+ catch(const ::com::sun::star::packages::WrongPasswordException& )
{
xSourceStream = xElementRootStorage->openEncryptedStreamElement(
aSourceStreamName,
@@ -849,14 +849,14 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
xTransact->commit();
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
// TODO: handle error
}
}
}
- catch( Exception& )
+ catch(const Exception& )
{
}
}
@@ -924,7 +924,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
if ( !xLibraryStor.is() )
throw uno::RuntimeException();
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
OSL_FAIL( "### couldn't open sub storage for library\n" );
return sal_False;
@@ -968,7 +968,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
delete pStream;
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
// TODO: error handling
}
@@ -1011,7 +1011,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
}
}
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
bRet = sal_False;
}
@@ -1039,7 +1039,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
xElementRootStorage = ::comphelper::OStorageHelper::GetStorageFromURL(
aElementPath,
embed::ElementModes::READ );
- } catch( uno::Exception& )
+ } catch(const uno::Exception& )
{
// TODO: error handling
}
@@ -1077,7 +1077,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
delete pStream;
}
- catch( uno::Exception& )
+ catch(const uno::Exception& )
{
// TODO: error handling
}
@@ -1118,7 +1118,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
}
}
}
- catch ( uno::Exception& )
+ catch (const uno::Exception& )
{
bRet = sal_False;
}
@@ -1127,7 +1127,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
}
}
- catch( Exception& )
+ catch(const Exception& )
{
// TODO
//throw e;