summaryrefslogtreecommitdiff
path: root/xmlscript
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2012-01-09 03:16:33 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2012-01-09 03:17:20 +0900
commitb35c0ae4ffce43b881d66efe74a19f1bf6299331 (patch)
tree7afefa031973519717e8cb9812ade85de444df02 /xmlscript
parentbc2a59e09d1a554b2d55412d1f10a3fa1fe86086 (diff)
catch exception by constant reference
Diffstat (limited to 'xmlscript')
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx2
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_import.cxx3
-rw-r--r--xmlscript/source/xmlflat_imexp/xmlbas_export.cxx8
-rw-r--r--xmlscript/source/xmlflat_imexp/xmlbas_import.cxx14
-rw-r--r--xmlscript/test/imexp.cxx6
5 files changed, 16 insertions, 17 deletions
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index fe348284909e..c59d630e46bc 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -718,7 +718,7 @@ void FormattedFieldElement::endElement()
ctx.getControlModel()->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("FormatKey") ), makeAny( nKey ) );
}
- catch (util::MalformedNumberFormatException & exc)
+ catch (const util::MalformedNumberFormatException & exc)
{
OSL_FAIL( "### util::MalformedNumberFormatException occurred!" );
// rethrow
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index b0717ef288b8..e0134088e7f1 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -1020,9 +1020,8 @@ bool ImportContext::importImageURLProperty(
if ( aTmp.getLength() )
sURL = aTmp;
}
- catch( uno::Exception& e )
+ catch( const uno::Exception& )
{
- (void)e;
return false;
}
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
index 5be275f663f6..2a1741afb2fc 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
@@ -420,25 +420,25 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& /
m_xHandler->endDocument();
}
}
- catch ( container::NoSuchElementException& e )
+ catch ( const container::NoSuchElementException& e )
{
OSL_TRACE( "XMLBasicExporterBase::filter: caught NoSuchElementException reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
bReturn = sal_False;
}
- catch ( lang::IllegalArgumentException& e )
+ catch ( const lang::IllegalArgumentException& e )
{
OSL_TRACE( "XMLBasicExporterBase::filter: caught IllegalArgumentException reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
bReturn = sal_False;
}
- catch ( lang::WrappedTargetException& e )
+ catch ( const lang::WrappedTargetException& e )
{
OSL_TRACE( "XMLBasicExporterBase::filter: caught WrappedTargetException reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
bReturn = sal_False;
}
- catch ( xml::sax::SAXException& e )
+ catch ( const xml::sax::SAXException& e )
{
OSL_TRACE( "XMLBasicExporterBase::filter: caught SAXException reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
index fdf0443e30b7..0f0af3b6295a 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
@@ -240,12 +240,12 @@ void BasicElementBase::processingInstruction( const ::rtl::OUString& /*rTarget*/
if ( xLib.is() )
xElement.set( new BasicElementBase( rLocalName, xAttributes, this, m_pImport ) );
}
- catch ( container::ElementExistException& e )
+ catch ( const container::ElementExistException& e )
{
OSL_TRACE( "BasicLibrariesElement::startChildElement: caught ElementExceptionExist reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
}
- catch ( lang::IllegalArgumentException& e )
+ catch ( const lang::IllegalArgumentException& e )
{
OSL_TRACE( "BasicLibrariesElement::startChildElement: caught IllegalArgumentException reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
@@ -286,7 +286,7 @@ void BasicElementBase::processingInstruction( const ::rtl::OUString& /*rTarget*/
if ( xLib.is() )
xElement.set( new BasicEmbeddedLibraryElement( rLocalName, xAttributes, this, m_pImport, m_xLibContainer, aName, bReadOnly ) );
}
- catch ( lang::IllegalArgumentException& e )
+ catch ( const lang::IllegalArgumentException& e )
{
OSL_TRACE( "BasicLibrariesElement::startChildElement: caught IllegalArgumentException reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
@@ -331,7 +331,7 @@ void BasicElementBase::processingInstruction( const ::rtl::OUString& /*rTarget*/
if ( m_xLibContainer.is() && m_xLibContainer->hasByName( m_aLibName ) )
m_xLibContainer->getByName( m_aLibName ) >>= m_xLib;
}
- catch ( lang::WrappedTargetException& e )
+ catch ( const lang::WrappedTargetException& e )
{
OSL_TRACE( "BasicEmbeddedLibraryElement CTOR: caught WrappedTargetException reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
@@ -486,17 +486,17 @@ void BasicElementBase::processingInstruction( const ::rtl::OUString& /*rTarget*/
m_xLib->insertByName( m_aName, aElement );
}
}
- catch ( container::ElementExistException& e )
+ catch ( const container::ElementExistException& e )
{
OSL_TRACE( "BasicSourceCodeElement::endElement: caught ElementExceptionExist reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
}
- catch ( lang::IllegalArgumentException& e )
+ catch ( const lang::IllegalArgumentException& e )
{
OSL_TRACE( "BasicSourceCodeElement::endElement: caught IllegalArgumentException reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
}
- catch ( lang::WrappedTargetException& e )
+ catch ( const lang::WrappedTargetException& e )
{
OSL_TRACE( "BasicSourceCodeElement::endElement: caught WrappedTargetException reason %s",
::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
diff --git a/xmlscript/test/imexp.cxx b/xmlscript/test/imexp.cxx
index af53c972364e..eadedce6b0ff 100644
--- a/xmlscript/test/imexp.cxx
+++ b/xmlscript/test/imexp.cxx
@@ -88,7 +88,7 @@ Reference< XComponentContext > createInitialComponentContext(
return defaultBootstrap_InitialComponentContext( unorc );
}
- catch( Exception& rExc )
+ catch( const Exception& rExc )
{
OString aStr( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_FAIL( aStr.getStr() );
@@ -213,7 +213,7 @@ void MyApp::Main()
exportToFile( aParam2.getStr(), xModel, xContext );
}
}
- catch (xml::sax::SAXException & rExc)
+ catch (const xml::sax::SAXException & rExc)
{
OString aStr( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
uno::Exception exc;
@@ -224,7 +224,7 @@ void MyApp::Main()
}
OSL_FAIL( aStr.getStr() );
}
- catch (uno::Exception & rExc)
+ catch (const uno::Exception & rExc)
{
OString aStr( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_FAIL( aStr.getStr() );