catch by const ref

This commit is contained in:
Caolán McNamara
2011-11-11 09:12:59 +00:00
parent 328e09955a
commit e3457b637a

View File

@@ -218,7 +218,7 @@ SvXMLImportContext *SvxXMLTableImportContext::CreateChildContext( sal_uInt16 nPr
} }
} }
} }
catch( uno::Exception& ) catch (const uno::Exception&)
{ {
} }
} }
@@ -266,7 +266,7 @@ void SvxXMLTableImportContext::importMarker( sal_uInt16 nPrfx, const OUString& r
XMLMarkerStyleImport aMarkerStyle( GetImport() ); XMLMarkerStyleImport aMarkerStyle( GetImport() );
aMarkerStyle.importXML( xAttrList, rAny, rName ); aMarkerStyle.importXML( xAttrList, rAny, rName );
} }
catch( Exception& ) catch (const Exception&)
{ {
OSL_FAIL("SvxXMLTableImportContext::importMarker(), exception caught!"); OSL_FAIL("SvxXMLTableImportContext::importMarker(), exception caught!");
} }
@@ -282,7 +282,7 @@ void SvxXMLTableImportContext::importDash( sal_uInt16 nPrfx, const OUString& rLo
XMLDashStyleImport aDashStyle( GetImport() ); XMLDashStyleImport aDashStyle( GetImport() );
aDashStyle.importXML( xAttrList, rAny, rName ); aDashStyle.importXML( xAttrList, rAny, rName );
} }
catch( Exception& ) catch (const Exception&)
{ {
OSL_FAIL("SvxXMLTableImportContext::importDash(), exception caught!"); OSL_FAIL("SvxXMLTableImportContext::importDash(), exception caught!");
} }
@@ -298,7 +298,7 @@ void SvxXMLTableImportContext::importHatch( sal_uInt16 nPrfx, const OUString& rL
XMLHatchStyleImport aHatchStyle( GetImport() ); XMLHatchStyleImport aHatchStyle( GetImport() );
aHatchStyle.importXML( xAttrList, rAny, rName ); aHatchStyle.importXML( xAttrList, rAny, rName );
} }
catch( Exception& ) catch (const Exception&)
{ {
OSL_FAIL("SvxXMLTableImportContext::importHatch(), exception caught!"); OSL_FAIL("SvxXMLTableImportContext::importHatch(), exception caught!");
} }
@@ -314,7 +314,7 @@ void SvxXMLTableImportContext::importGradient( sal_uInt16 nPrfx, const OUString&
XMLGradientStyleImport aGradientStyle( GetImport() ); XMLGradientStyleImport aGradientStyle( GetImport() );
aGradientStyle.importXML( xAttrList, rAny, rName ); aGradientStyle.importXML( xAttrList, rAny, rName );
} }
catch( Exception& ) catch (const Exception&)
{ {
OSL_FAIL("SvxXMLTableImportContext::importGradient(), exception caught!"); OSL_FAIL("SvxXMLTableImportContext::importGradient(), exception caught!");
} }
@@ -330,7 +330,7 @@ void SvxXMLTableImportContext::importBitmap( sal_uInt16 nPrfx, const OUString& r
XMLImageStyle aImageStyle; XMLImageStyle aImageStyle;
aImageStyle.importXML( xAttrList, rAny, rName, GetImport() ); aImageStyle.importXML( xAttrList, rAny, rName, GetImport() );
} }
catch( Exception& ) catch (const Exception&)
{ {
OSL_FAIL("SvxXMLTableImportContext::importBitmap(), exception caught!"); OSL_FAIL("SvxXMLTableImportContext::importBitmap(), exception caught!");
} }
@@ -423,10 +423,13 @@ bool SvxXMLXTableImport::load( const rtl::OUString &rPath,
else // relative URL into a storage else // relative URL into a storage
{ {
uno::Reference< embed::XStorage > xSubStorage; uno::Reference< embed::XStorage > xSubStorage;
try { try
{
xSubStorage = comphelper::OStorageHelper::GetStorageAtPath( xSubStorage = comphelper::OStorageHelper::GetStorageAtPath(
xStorage, rPath, embed::ElementModes::READ, aNasty ); xStorage, rPath, embed::ElementModes::READ, aNasty );
} catch (uno::Exception &) { }
catch (const uno::Exception&)
{
} }
if( xSubStorage.is() ) if( xSubStorage.is() )
openStorageStream( &aParserInput, &pGraphicHelper, xSubStorage ); openStorageStream( &aParserInput, &pGraphicHelper, xSubStorage );
@@ -447,10 +450,14 @@ bool SvxXMLXTableImport::load( const rtl::OUString &rPath,
if (pGraphicHelper) if (pGraphicHelper)
xGrfResolver = pGraphicHelper; xGrfResolver = pGraphicHelper;
try { try
{
uno::Reference< io::XSeekable > xSeek( aParserInput.aInputStream, uno::UNO_QUERY_THROW ); uno::Reference< io::XSeekable > xSeek( aParserInput.aInputStream, uno::UNO_QUERY_THROW );
xSeek->seek( 0 ); xSeek->seek( 0 );
} catch( uno::Exception &) {} }
catch (const uno::Exception&)
{
}
uno::Reference< XDocumentHandler > xHandler( new SvxXMLXTableImport( xServiceFactory, xTable, xGrfResolver ) ); uno::Reference< XDocumentHandler > xHandler( new SvxXMLXTableImport( xServiceFactory, xTable, xGrfResolver ) );
xParser->setDocumentHandler( xHandler ); xParser->setDocumentHandler( xHandler );
@@ -459,9 +466,8 @@ bool SvxXMLXTableImport::load( const rtl::OUString &rPath,
if( pGraphicHelper ) if( pGraphicHelper )
SvXMLGraphicHelper::Destroy( pGraphicHelper ); SvXMLGraphicHelper::Destroy( pGraphicHelper );
} }
catch( uno::Exception& e ) catch (const uno::Exception&)
{ {
(void)e;
// thrown each time you load a document with property tables that are not // thrown each time you load a document with property tables that are not
// on the current machine. FIXME: would be better to check a file exists // on the current machine. FIXME: would be better to check a file exists
// before importing ... // before importing ...