From 254c08bf5096e341a395ed55945fc1009b78e878 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 26 Jul 2011 23:49:42 +0100 Subject: catch by const reference --- sw/source/ui/dbui/addresslistdialog.cxx | 8 ++++---- sw/source/ui/dbui/dbinsdlg.cxx | 16 +++++++--------- sw/source/ui/dbui/dbtree.cxx | 14 ++++++++------ sw/source/ui/dbui/maildispatcher.cxx | 4 ++-- sw/source/ui/dbui/mailmergehelper.cxx | 4 ++-- sw/source/ui/dbui/mmaddressblockpage.cxx | 6 ++++-- sw/source/ui/dbui/mmconfigitem.cxx | 10 +++++----- sw/source/ui/dbui/mmgreetingspage.cxx | 2 +- sw/source/ui/dbui/mmoutputpage.cxx | 14 +++++++------- 9 files changed, 40 insertions(+), 38 deletions(-) diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index fc018d5414..fe8262adb3 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -263,7 +263,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) : SWUnoHelper::UCB_IsFile( pUserData->sURL ) && //#i97577# !SWUnoHelper::UCB_IsReadOnlyFileName( pUserData->sURL ); } - catch(const uno::Exception& ) + catch (const uno::Exception&) { bEnableOK = sal_False; } @@ -345,7 +345,7 @@ IMPL_LINK(SwAddressListDialog, FilterHdl_Impl, PushButton*, EMPTYARG) } ::comphelper::disposeComponent(xRowSet); } - catch(Exception& ) + catch (const Exception&) { OSL_FAIL("exception caught in SwAddressListDialog::FilterHdl_Impl"); } @@ -448,7 +448,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton) m_aCreateListPB.Enable(sal_False); } - catch(Exception& ) + catch (const Exception&) { } } @@ -645,7 +645,7 @@ void SwAddressListDialog::DetectTablesAndQueries( m_aFilterPB.Enable( pUserData->xConnection.is() && sCommand.Len() ); m_aTablePB.Enable( pUserData->nTableAndQueryCount > 1 ); } - catch(Exception& ) + catch (const Exception&) { OSL_FAIL("exception caught in SwAddressListDialog::DetectTablesAndQueries"); m_aOK.Enable( sal_False ); diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 2616491893..991f196770 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -352,7 +352,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, } pNew->nDBNumFmt = nKey; } - catch(const Exception& ) + catch (const Exception&) { OSL_FAIL("illegal number format key"); } @@ -1097,7 +1097,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence& rSelection, else if(!i) bBreak = !xResultSet->first(); } - catch(const Exception& ) + catch (const Exception&) { bBreak = sal_True; } @@ -1177,14 +1177,12 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence& rSelection, } } } - catch(Exception& -#if OSL_DEBUG_LEVEL > 1 - aExcept -#endif - ) + catch (const Exception& rExcept) { #if OSL_DEBUG_LEVEL > 1 - OSL_FAIL(ByteString(String(aExcept.Message), gsl_getSystemTextEncoding()).GetBuffer()); + OSL_FAIL(ByteString(String(rExcept.Message), gsl_getSystemTextEncoding()).GetBuffer()); +#else + (void)rExcept; #endif } } @@ -1299,7 +1297,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence& rSelection, else if(!i) bBreak = !xResultSet->first(); } - catch(Exception&) + catch (const Exception&) { bBreak = sal_True; } diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx index 3595e44fc5..0f27ba6415 100644 --- a/sw/source/ui/dbui/dbtree.cxx +++ b/sw/source/ui/dbui/dbtree.cxx @@ -314,8 +314,9 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) aTable >>= xPropSet; xColsSupplier = Reference(xPropSet, UNO_QUERY); } - catch(Exception&) - {} + catch (const Exception&) + { + } } } else @@ -332,8 +333,9 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) aQuery >>= xPropSet; xColsSupplier = Reference(xPropSet, UNO_QUERY); } - catch(Exception&) - {} + catch (const Exception&) + { + } } } @@ -353,7 +355,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) } } } - catch(const Exception&) + catch (const Exception&) { } } @@ -403,7 +405,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) } } } - catch(const Exception&) + catch (const Exception&) { } } diff --git a/sw/source/ui/dbui/maildispatcher.cxx b/sw/source/ui/dbui/maildispatcher.cxx index d2c9e28fbf..8a1e5b549d 100644 --- a/sw/source/ui/dbui/maildispatcher.cxx +++ b/sw/source/ui/dbui/maildispatcher.cxx @@ -232,12 +232,12 @@ void MailDispatcher::sendMailMessageNotifyListener(uno::Reference ConnectToSmtpServer( xSmtpServer->connect(xConnectionContext, xAuthenticator); rxInMailService = uno::Reference< mail::XMailService >( xSmtpServer, uno::UNO_QUERY ); } - catch(uno::Exception& ) + catch (const uno::Exception&) { OSL_FAIL("exception caught"); } @@ -539,7 +539,7 @@ String SwAddressPreview::FillData( aItem.sText = sReplace; } } - catch( sdbc::SQLException& ) + catch (const sdbc::SQLException&) { OSL_FAIL("SQLException caught"); } diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index ee2dc55d14..c785c96b04 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -1057,13 +1057,15 @@ SwAssignFieldsControl::SwAssignFieldsControl( uno::Reference< XColumn > xColumn; aCol >>= xColumn; if(xColumn.is()) + { try { pNewPreview->SetText(xColumn->getString()); } - catch(SQLException& ) + catch (const SQLException&) { } + } } if(!i) { @@ -1198,7 +1200,7 @@ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox) { sPreview = xColumn->getString(); } - catch( sdbc::SQLException& ) + catch (const sdbc::SQLException&) { } } diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx index 13cba5f734..3937f15770 100644 --- a/sw/source/ui/dbui/mmconfigitem.cxx +++ b/sw/source/ui/dbui/mmconfigitem.cxx @@ -928,7 +928,7 @@ Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const xRowProperties->setPropertyValue(C2U("ApplyFilter"), makeAny(m_pImpl->sFilter.getLength()>0)); xRowProperties->setPropertyValue(C2U("Filter"), makeAny(m_pImpl->sFilter)); } - catch(Exception&) + catch (const Exception&) { OSL_FAIL("exception caught in xResultSet->SetFilter()"); } @@ -938,7 +938,7 @@ Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const m_pImpl->nResultSetCursorPos = 1; } } - catch(Exception& ) + catch (const Exception&) { OSL_FAIL("exception caught in: SwMailMergeConfigItem::GetResultSet() "); } @@ -976,7 +976,7 @@ void SwMailMergeConfigItem::SetFilter(::rtl::OUString& rFilter) uno::Reference xRowSet( m_pImpl->xResultSet, UNO_QUERY_THROW ); xRowSet->execute(); } - catch(Exception&) + catch (const Exception&) { OSL_FAIL("exception caught in SwMailMergeConfigItem::SetFilter()"); } @@ -1011,7 +1011,7 @@ sal_Int32 SwMailMergeConfigItem::MoveResultSet(sal_Int32 nTarget) m_pImpl->nResultSetCursorPos = m_pImpl->xResultSet->getRow(); } } - catch(Exception&) + catch (const Exception&) { } } @@ -1031,7 +1031,7 @@ bool SwMailMergeConfigItem::IsResultSetFirstLast(bool& bIsFirst, bool& bIsLast) bIsLast = m_pImpl->xResultSet->isLast(); bRet = true; } - catch(Exception&) + catch (const Exception&) { } } diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index 165dfecd15..8820e81ea4 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -208,7 +208,7 @@ void SwMailMergeGreetingsPage::UpdatePreview() } } } - catch( sdbc::SQLException& ) + catch (const sdbc::SQLException&) { OSL_FAIL("SQLException caught"); } diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 28c3f7be24..7b82c00bbb 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -693,11 +693,11 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) { xStore->storeToURL( sPath, aValues ); } - catch( task::ErrorCodeIOException& aErrorEx ) + catch (const task::ErrorCodeIOException& rErrorEx) { - nErrorCode = (sal_uInt32)aErrorEx.ErrCode; + nErrorCode = (sal_uInt32)rErrorEx.ErrCode; } - catch( Exception& ) + catch (const Exception&) { nErrorCode = ERRCODE_IO_GENERAL; } @@ -745,11 +745,11 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) { xStore->storeToURL( sTargetTempURL, aValues ); } - catch( task::ErrorCodeIOException& aErrorEx ) + catch (const task::ErrorCodeIOException& rErrorEx) { - nErrorCode = (sal_uInt32)aErrorEx.ErrCode; + nErrorCode = (sal_uInt32)rErrorEx.ErrCode; } - catch( Exception& ) + catch (const Exception&) { nErrorCode = ERRCODE_IO_GENERAL; } @@ -824,7 +824,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) uno::Reference< frame::XStorable > xTempStore( xTempDocShell->GetModel(), uno::UNO_QUERY); xTempStore->storeToURL( sOutPath, aValues ); } - catch( const uno::Exception& ) + catch (const uno::Exception&) { bFailed = true; } -- cgit v1.2.3