summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-17 21:49:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-20 11:01:54 +0100
commitc4ed8d454818971d959af7a80a986b7691bf43fb (patch)
treec68945eec35c8e8eed648f04ad141026685cb535 /ucb
parent051e6eea5a9363309883c6a92b77210e4284c316 (diff)
catch by const reference
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/cacher/cachedcontentresultset.cxx14
-rw-r--r--ucb/source/sorter/sortdynres.cxx4
-rw-r--r--ucb/source/sorter/sortresult.cxx19
-rw-r--r--ucb/source/ucp/file/bc.cxx10
-rw-r--r--ucb/source/ucp/file/filrow.cxx4
-rw-r--r--ucb/source/ucp/file/filstr.cxx6
-rw-r--r--ucb/source/ucp/file/shell.cxx14
7 files changed, 40 insertions, 31 deletions
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index f927c658d426..c6005bb3b32c 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -112,10 +112,10 @@ if ( m_bLastCachedReadWasNull && rValue.hasValue() ) \
const Type * >( 0 ) ) ); \
m_bLastCachedReadWasNull = !( aConvAny >>= aRet ); \
} \
- catch ( IllegalArgumentException ) \
+ catch (const IllegalArgumentException&) \
{ \
} \
- catch ( CannotConvertException ) \
+ catch (const CannotConvertException&) \
{ \
} \
} \
@@ -327,7 +327,7 @@ const OUString& SAL_CALL CachedContentResultSet::CCRS_Cache
return (* reinterpret_cast< const OUString * >
(getRowAny( nRow ).getValue() ));
}
- catch( SQLException )
+ catch(const SQLException&)
{
throw RuntimeException();
}
@@ -350,7 +350,7 @@ const Reference< XContentIdentifier >& SAL_CALL CachedContentResultSet::CCRS_Cac
return (* reinterpret_cast< const Reference< XContentIdentifier > * >
(getRowAny( nRow ).getValue() ));
}
- catch( SQLException )
+ catch(const SQLException&)
{
throw RuntimeException();
}
@@ -373,7 +373,7 @@ const Reference< XContent >& SAL_CALL CachedContentResultSet::CCRS_Cache
return (* reinterpret_cast< const Reference< XContent > * >
(getRowAny( nRow ).getValue() ));
}
- catch( SQLException )
+ catch (const SQLException&)
{
throw RuntimeException();
}
@@ -792,7 +792,7 @@ sal_Bool SAL_CALL CachedContentResultSet
return bValid;
}
}
- catch( SQLException& rEx )
+ catch (const SQLException& rEx)
{
if( !bAfterLastApplied && !bAfterLast && nRow > nLastAppliedPos && impl_isForwardOnly() )
{
@@ -1452,7 +1452,7 @@ sal_Bool SAL_CALL CachedContentResultSet
{
bValid = m_xResultSetOrigin->absolute( row );
}
- catch (ResultSetException &)
+ catch (const ResultSetException&)
{
throw;
}
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index c1da9c32159c..63e73d61d460 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -344,8 +344,8 @@ SortedDynamicResultSet::impl_notify( const ListEvent& Changes )
try {
aRet = pCurSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsRowCountFinal")) );
}
- catch ( UnknownPropertyException ) {}
- catch ( WrappedTargetException ) {}
+ catch (const UnknownPropertyException&) {}
+ catch (const WrappedTargetException&) {}
long nOldCount = pCurSet->GetCount();
sal_Bool bWasFinal = false;
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index f68ac8037e20..dba7c7d46bf2 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -1461,7 +1461,10 @@ void SortedResultSet::Initialize(
nIndex++;
}
}
- catch ( SQLException ) { OSL_FAIL( "SortedResultSet::Initialize() : Got unexpected SQLException" ); }
+ catch (const SQLException&)
+ {
+ OSL_FAIL( "SortedResultSet::Initialize() : Got unexpected SQLException" );
+ }
// when we have fetched all the elements, we can create the
// original to sorted mapping list from the s2o list
@@ -1516,8 +1519,8 @@ void SortedResultSet::CheckProperties( long nOldCount, sal_Bool bWasFinal )
}
}
}
- catch ( UnknownPropertyException ) {}
- catch ( WrappedTargetException ) {}
+ catch (const UnknownPropertyException&) {}
+ catch (const WrappedTargetException&) {}
}
//-------------------------------------------------------------------------
@@ -1816,7 +1819,10 @@ void SortedResultSet::ResortModified( EventList* pList )
}
}
}
- catch ( SQLException ) { OSL_FAIL( "SortedResultSet::ResortModified() : Got unexpected SQLException" ); }
+ catch (const SQLException&)
+ {
+ OSL_FAIL( "SortedResultSet::ResortModified() : Got unexpected SQLException" );
+ }
maModList.Clear();
}
@@ -1849,7 +1855,10 @@ void SortedResultSet::ResortNew( EventList* pList )
pList->AddEvent( ListActionType::INSERTED, nNewPos, 1 );
}
}
- catch ( SQLException ) { OSL_FAIL( "SortedResultSet::ResortNew() : Got unexpected SQLException" ); }
+ catch (const SQLException&)
+ {
+ OSL_FAIL( "SortedResultSet::ResortNew() : Got unexpected SQLException" );
+ }
}
//-------------------------------------------------------------------------
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index 8242276ad604..c6d1191c525d 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -549,7 +549,7 @@ BaseContent::getContentType()
OSL_FAIL( "BaseContent::getContentType - Property value was null!" );
}
}
- catch ( sdbc::SQLException const & )
+ catch (const sdbc::SQLException&)
{
OSL_FAIL( "BaseContent::getContentType - Caught SQLException!" );
}
@@ -681,7 +681,7 @@ BaseContent::createNewContent(
// return Reference< XContent >();
}
}
- catch ( sdbc::SQLException const & )
+ catch (const sdbc::SQLException&)
{
OSL_FAIL( "BaseContent::createNewContent - Caught SQLException!" );
return Reference< XContent >();
@@ -757,7 +757,7 @@ BaseContent::getParent(
Reference< XContent > content = m_pMyShell->m_pProvider->queryContent( Identifier );
return Reference<XInterface>(content,UNO_QUERY);
}
- catch( IllegalIdentifierException )
+ catch (const IllegalIdentifierException&)
{
return Reference< XInterface >();
}
@@ -979,7 +979,7 @@ BaseContent::setPropertyValues(
{
endTask( nMyCommandIdentifier );
}
- catch( const Exception& e )
+ catch(const Exception& e)
{
ret[i] <<= e;
}
@@ -1209,7 +1209,7 @@ void SAL_CALL BaseContent::insert( sal_Int32 nMyCommandIdentifier,
contentTypeSet = false;
}
- catch ( sdbc::SQLException const & )
+ catch (const sdbc::SQLException&)
{
OSL_FAIL( "BaseContent::insert - Caught SQLException!" );
contentTypeSet = false;
diff --git a/ucb/source/ucp/file/filrow.cxx b/ucb/source/ucp/file/filrow.cxx
index 5a49ed16dd0d..7dbdcf863f87 100644
--- a/ucb/source/ucp/file/filrow.cxx
+++ b/ucb/source/ucp/file/filrow.cxx
@@ -68,11 +68,11 @@ sal_Bool convert( shell* pShell,
else
no_success = sal_True;
}
- catch ( lang::IllegalArgumentException )
+ catch (const lang::IllegalArgumentException&)
{
no_success = sal_True;
}
- catch ( script::CannotConvertException )
+ catch (const script::CannotConvertException&)
{
no_success = sal_True;
}
diff --git a/ucb/source/ucp/file/filstr.cxx b/ucb/source/ucp/file/filstr.cxx
index 93cff9c667fd..c9157d13f2af 100644
--- a/ucb/source/ucp/file/filstr.cxx
+++ b/ucb/source/ucp/file/filstr.cxx
@@ -134,11 +134,11 @@ XStream_impl::~XStream_impl()
{
closeStream();
}
- catch (io::IOException const &)
+ catch (const io::IOException&)
{
OSL_FAIL("unexpected situation");
}
- catch (uno::RuntimeException const &)
+ catch (const uno::RuntimeException&)
{
OSL_FAIL("unexpected situation");
}
@@ -216,7 +216,7 @@ XStream_impl::readBytes(
{
buffer = new sal_Int8[nBytesToRead];
}
- catch( std::bad_alloc )
+ catch (const std::bad_alloc&)
{
if( m_nIsOpen ) m_aFile.close();
throw io::BufferSizeExceededException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index 0c7c0f30953f..3531740ed850 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -619,19 +619,19 @@ void SAL_CALL shell::page( sal_Int32 CommandId,
{
xOutputStream->writeBytes( seq );
}
- catch( io::NotConnectedException )
+ catch (const io::NotConnectedException&)
{
installError( CommandId,
TASKHANDLING_NOTCONNECTED_FOR_PAGING );
break;
}
- catch( io::BufferSizeExceededException )
+ catch (const io::BufferSizeExceededException&)
{
installError( CommandId,
TASKHANDLING_BUFFERSIZEEXCEEDED_FOR_PAGING );
break;
}
- catch( io::IOException )
+ catch (const io::IOException&)
{
installError( CommandId,
TASKHANDLING_IOEXCEPTION_FOR_PAGING );
@@ -655,13 +655,13 @@ void SAL_CALL shell::page( sal_Int32 CommandId,
{
xOutputStream->closeOutput();
}
- catch( io::NotConnectedException )
+ catch (const io::NotConnectedException&)
{
}
- catch( io::BufferSizeExceededException )
+ catch (const io::BufferSizeExceededException&)
{
}
- catch( io::IOException )
+ catch (const io::IOException&)
{
}
}
@@ -888,7 +888,7 @@ shell::setv( const rtl::OUString& aUnqPath,
{
it->second.xS->setPropertyValue( values[i].Name,values[i].Value );
}
- catch( const uno::Exception& e )
+ catch (const uno::Exception&e)
{
--propChanged; // unsuccessful setting
ret[i] <<= e;