these can be const

This commit is contained in:
Caolán McNamara
2011-11-22 09:06:06 +00:00
parent 3679b76517
commit ed7c80d335
34 changed files with 91 additions and 81 deletions

View File

@@ -669,7 +669,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
if ( xSet.is() )
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny( ::rtl::OUString( SotExchange::GetFormatMimeType( nSaveClipId ) ) ) );
}
catch ( uno::Exception& )
catch (const uno::Exception&)
{
}
}

View File

@@ -835,7 +835,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
xFltMgr->setCurrentFilter( pOwnFlt->GetUIName() );
}
catch( const uno::Exception& )
catch (const uno::Exception&)
{
bError = true;
}
@@ -1250,7 +1250,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
xFltMgr->setCurrentFilter( pFlt->GetUIName() ) ;
}
catch( const uno::Exception& )
catch (const uno::Exception&)
{
bError = true;
}
@@ -1310,7 +1310,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
xCtrlAcc->setLabel( ExtendedFilePickerElementIds::LISTBOX_TEMPLATE,
String(SW_RES( STR_FDLG_TEMPLATE_NAME )));
}
catch(Exception& )
catch (const Exception&)
{
OSL_FAIL("control acces failed");
}
@@ -1730,7 +1730,7 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
xProps->getPropertyValue( aMediaTypePropName );
bImport = true;
}
catch( const uno::Exception& )
catch (const uno::Exception&)
{
bImport = false;
}

View File

@@ -326,7 +326,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
if ( aUIName.getLength() )
rReq.AppendItem( SfxStringItem( SID_STYLE_APPLY, aUIName ) );
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
}
}

View File

@@ -247,9 +247,8 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa
SWUnoHelper::UCB_DeleteFile( sURL );
}
}
catch( const uno::Exception& rEx )
catch (const uno::Exception&)
{
(void)rEx;
}
}
}
@@ -396,7 +395,7 @@ SwSendMailDialog::~SwSendMailDialog()
xMessage = m_pImpl->xMailDispatcher->dequeueMailMessage();
}
}
catch(const uno::Exception&)
catch (const uno::Exception&)
{
}
}

View File

@@ -674,8 +674,9 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
xWorkStore = uno::Reference < embed::XStorage >();
xStream->Commit();
}
catch ( uno::Exception& )
{}
catch (const uno::Exception&)
{
}
bRet = ( xStream->GetError() == ERRCODE_NONE );
}
@@ -1698,14 +1699,14 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
xComp->dispose();
xStore = 0;
}
catch ( uno::Exception& )
catch (const uno::Exception&)
{
}
break;
}
}
catch ( uno::Exception& )
catch (const uno::Exception&)
{
// it wasn't a storage, but maybe it's a useful stream
}
@@ -1764,8 +1765,9 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
// for example whether the object should be an iconified one
xObj = aInfo.Object;
}
catch( uno::Exception& )
{}
catch (const uno::Exception&)
{
}
}
}
}
@@ -1823,7 +1825,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
{
aSz = xObj->getVisualAreaSize( aObjDesc.mnViewAspect );
}
catch( embed::NoVisualAreaSizeException& )
catch (const embed::NoVisualAreaSizeException&)
{
// in this case the provided size is used
}
@@ -1844,7 +1846,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
{
xObj->getVisualAreaSize( aObjDesc.mnViewAspect );
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
}
}

View File

@@ -94,7 +94,7 @@ void SwVisitingCardPage::InitFrameControl()
aAutoTextGroupLB.SetEntryData(nEntry, new String(sGroup));
}
}
catch(Exception&)
catch (const Exception&)
{
}
}
@@ -117,7 +117,7 @@ void SwVisitingCardPage::InitFrameControl()
SetUserData( aBlockNames.getLength(), aTitles.getConstArray(),
aBlockNames.getConstArray() );
}
catch( uno::RuntimeException& )
catch (const uno::RuntimeException&)
{
// we'll be her if path settings were wrong
}
@@ -258,7 +258,7 @@ void SwLabDlg::UpdateFieldInformation(uno::Reference< frame::XModel > & xModel,
}
}
}
catch( uno::RuntimeException&)
catch (const uno::RuntimeException&)
{
//
}

View File

@@ -292,7 +292,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
xFrame->initialize( VCLUnoHelper::GetInterface ( pBeamerWin ) );
}
}
catch (Exception&)
catch (const Exception&)
{
xFrame.clear();
}
@@ -464,7 +464,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
}
aFilterLB.SelectEntryPos( nODT );
}
catch( const uno::Exception& )
catch (const uno::Exception&)
{
}
}

View File

@@ -97,7 +97,9 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName
aTable >>= xPropSet;
xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY);
}
catch(Exception&){}
catch (const Exception&)
{
}
}
}
else
@@ -114,7 +116,9 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName
aQuery >>= xPropSet;
xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY);
}
catch(Exception&){}
catch (const Exception&)
{
}
}
}
@@ -125,7 +129,7 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName
{
xCols = xColsSupplier->getColumns();
}
catch(Exception& )
catch (const Exception&)
{
OSL_FAIL("Exception in getColumns()");
}

View File

@@ -176,7 +176,7 @@ IMPL_LINK( SwMultiTOXTabDialog, CreateExample_Hdl, void*, EMPTYARG )
}
CreateOrUpdateExample(eCurrentTOXType.eType);
}
catch(Exception&)
catch (const Exception&)
{
OSL_FAIL("::CreateExample() - exception caught");
}
@@ -470,7 +470,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
pxIndexSectionsArr[nTOXIndex]->xDocumentIndex->update();
}
catch(Exception&)
catch (const Exception&)
{
OSL_FAIL("::CreateExample() - exception caught");
}

View File

@@ -373,7 +373,7 @@ OUString RetrieveLabelFromCommand( const OUString& aCmdURL )
aLabel = aStr;
}
}
catch ( uno::Exception& )
catch (const uno::Exception&)
{
}
}
@@ -853,7 +853,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
xSystemShellExecute->execute( sExplanationLink, rtl::OUString(),
com::sun::star::system::SystemShellExecuteFlags::DEFAULTS );
}
catch ( uno::Exception& )
catch (const uno::Exception&)
{
uno::Any exc( ::cppu::getCaughtException() );
rtl::OUString msg( ::comphelper::anyToString( exc ) );

View File

@@ -687,8 +687,9 @@ IMPL_LINK( SwGlossaryDlg, BibHdl, Button *, EMPTYARG )
bIsWritable = !*(sal_Bool*)aAny.getValue();
}
}
catch(Exception&)
{}
catch (const Exception&)
{
}
if(bIsWritable)
break;
}

View File

@@ -272,8 +272,9 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
uno::Reference< frame::XTitle > xTitle( xDocSh->GetModel(), uno::UNO_QUERY_THROW );
xTitle->setTitle( aDocTitle );
}
catch( uno::Exception& )
{}
catch (const uno::Exception&)
{
}
xDocSh->GetDoc()->GetIDocumentUndoRedo().DoUndo( bDoesUndo );
xDocSh->GetDoc()->ResetModified();

View File

@@ -404,7 +404,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
xDialog->execute();
}
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
}
rReq.Ignore ();
@@ -1178,7 +1178,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq)
xProp->getPropertyValue( C2U("IsUseCharacterVariants") ) >>= bUseVariants;
xProp->getPropertyValue( C2U("IsTranslateCommonTerms") ) >>= bCommonTerms;
}
catch( Exception& )
catch (const Exception&)
{
}
}

View File

@@ -225,7 +225,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
xDialog->execute();
}
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
}
rReq.Ignore ();

View File

@@ -339,7 +339,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
xDialog->execute();
}
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
}
rReq.Ignore ();

View File

@@ -371,7 +371,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
xProp->getPropertyValue( C2U("IsUseCharacterVariants") ) >>= bUseVariants;
xProp->getPropertyValue( C2U("IsTranslateCommonTerms") ) >>= bCommonTerms;
}
catch( Exception& )
catch (const Exception&)
{
}
}

View File

@@ -412,7 +412,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
xDialog->execute();
}
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
}
rReq.Ignore ();

View File

@@ -317,7 +317,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginCommands")), uno::makeAny( aSeq ) );
}
}
catch ( uno::Exception& )
catch (const uno::Exception&)
{
}
}
@@ -388,7 +388,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
uno::makeAny( sal_Int32( aMargin.Height() ) ) );
}
}
catch ( uno::Exception& )
catch (const uno::Exception&)
{
}
}

View File

@@ -1260,7 +1260,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
xDialog->execute();
}
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
}
rReq.Ignore ();

View File

@@ -240,7 +240,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
}
}
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
OSL_FAIL("Chart wizard couldn't be positioned automatically\n" );
}

View File

@@ -130,11 +130,11 @@ void SwOleClient::ViewChanged()
{
aSz = GetObject()->getVisualAreaSize( GetAspect() );
}
catch( embed::NoVisualAreaSizeException& )
catch (const embed::NoVisualAreaSizeException&)
{
// Nothing will be done
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
// this is an error
OSL_FAIL( "Something goes wrong on requesting object size!\n" );

View File

@@ -318,7 +318,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
xCtrlAcc->setValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
ListboxControlActions::SET_SELECT_ITEM, aSelectPos );
}
catch(Exception& )
catch (const Exception&)
{
OSL_FAIL("control acces failed");
}
@@ -360,7 +360,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
aTemplateValue >>= sTmpl;
rReq.AppendItem( SfxStringItem( FN_PARAM_2, sTmpl) );
}
catch(Exception& )
catch (const Exception&)
{
OSL_FAIL("control access failed");
}

View File

@@ -171,7 +171,7 @@ void SwView::ExecLingu(SfxRequest &rReq)
xProp->getPropertyValue( C2U("IsUseCharacterVariants") ) >>= bUseVariants;
xProp->getPropertyValue( C2U("IsTranslateCommonTerms") ) >>= bCommonTerms;
}
catch( Exception& )
catch (const Exception&)
{
}
}
@@ -654,7 +654,7 @@ IMPL_STATIC_LINK_NOINSTANCE( AsyncExecute, ExecuteHdl_Impl, ExecuteInfo*, pExecu
// elements if a component gets detached from its frame!
pExecuteInfo->xDispatch->dispatch( pExecuteInfo->aTargetURL, pExecuteInfo->aArgs );
}
catch ( Exception& )
catch (const Exception&)
{
}
@@ -790,7 +790,7 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt)
Application::PostUserEvent( STATIC_LINK(0, AsyncExecute , ExecuteHdl_Impl), pExecuteInfo );
}
}
catch (Exception &)
catch (const Exception&)
{
}
}

View File

@@ -83,7 +83,7 @@ SwLinguServiceEventListener::SwLinguServiceEventListener()
xBC->addLinguServiceEventListener( (XLinguServiceEventListener *) this );
}
}
catch (uno::Exception &)
catch (const uno::Exception&)
{
OSL_FAIL("exception caught in SwLinguServiceEventListener c-tor" );
}

View File

@@ -224,7 +224,9 @@ SwFilterDetect::~SwFilterDetect()
ucbhelper::CONTINUATION_APPROVE ) );
xInteraction->handle( xRequest );
}
catch ( Exception & ) {};
catch (const Exception&)
{
}
}
}
else
@@ -247,7 +249,7 @@ SwFilterDetect::~SwFilterDetect()
aTypeName = SfxFilter::GetTypeFromStorage( xStorage, pPreFilter ? pPreFilter->IsOwnTemplateFormat() : sal_False, &aFilterName );
}
catch( lang::WrappedTargetException& aWrap )
catch (const lang::WrappedTargetException& aWrap)
{
packages::zip::ZipIOException aZipException;
@@ -297,11 +299,11 @@ SwFilterDetect::~SwFilterDetect()
}
}
}
catch( uno::RuntimeException& )
catch (const uno::RuntimeException&)
{
throw;
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
aTypeName.Erase();
aPreselectedFilterName.Erase();

View File

@@ -134,13 +134,13 @@ static CloseResult CloseModelAndDocSh(
//! I.e. now that object is responsible for closing the model and doc shell.
xClose->close( sal_True );
}
catch (util::CloseVetoException &)
catch (const util::CloseVetoException&)
{
//! here we have the problem that the temporary file that is
//! currently being printed will never be deleted. :-(
eResult = eVetoed;
}
catch ( const uno::RuntimeException& )
catch (const uno::RuntimeException&)
{
eResult = eFailed;
}
@@ -170,7 +170,7 @@ static sal_Bool LoadFromURL_impl(
xTmpModel = Reference < XModel >( xDesktop->loadComponentFromURL(
rURL, C2U("_blank"), 0, aArgs ), UNO_QUERY );
}
catch( Exception & )
catch (const Exception&)
{
return sal_False;
}
@@ -260,7 +260,7 @@ namespace
OSL_FAIL("DelayedFileDeletion::DelayedFileDeletion: model is no component!" );
}
}
catch( const Exception& )
catch (const Exception&)
{
OSL_FAIL("DelayedFileDeletion::DelayedFileDeletion: could not register as event listener at the model!" );
}
@@ -281,7 +281,7 @@ namespace
m_xDocument->close( bDeliverOwnership );
bSuccess = sal_True;
}
catch( const util::CloseVetoException& )
catch (const util::CloseVetoException&)
{
// somebody vetoed -> next try
if ( m_nPendingDeleteAttempts )
@@ -293,7 +293,7 @@ namespace
else
bSuccess = sal_True; // can't do anything here ...
}
catch( const Exception& )
catch (const Exception&)
{
OSL_FAIL("DelayedFileDeletion::OnTryDeleteFile: caught a strange exception!" );
bSuccess = sal_True;
@@ -317,7 +317,7 @@ namespace
{
m_xDocument->removeCloseListener( this );
}
catch( const Exception & )
catch (const Exception&)
{
OSL_FAIL("DelayedFileDeletion::implTakeOwnership: could not revoke the listener!" );
}
@@ -599,7 +599,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
if ( bEverythingsFine )
bValid = sal_True;
}
catch( const Exception& )
catch (const Exception&)
{
bValid = sal_False;
}
@@ -805,7 +805,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
xStorable->storeAsURL( aTmpFileName, Sequence< PropertyValue >() );
bStoredAsTemporary = sal_True;
}
catch( const Exception& )
catch (const Exception&)
{
}
}

View File

@@ -103,7 +103,7 @@ IMPL_LINK(SwRenameXNamedDlg, OkHdl, OKButton*, EMPTYARG)
{
xNamed->setName(aNewNameED.GetText());
}
catch(uno::RuntimeException&)
catch (const uno::RuntimeException&)
{
OSL_FAIL("name wasn't changed");
}

View File

@@ -206,7 +206,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
if ( xLayoutManager.is() )
xLayoutManager->setVisible( sal_False );
}
catch ( uno::Exception& )
catch (const uno::Exception&)
{
}
}

View File

@@ -138,7 +138,7 @@ public:
// the model ( and addtionally these also update the statics object )
return mxModelProps->getPropertyValue( rPropName );
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
OSL_TRACE("Got exception");
}

View File

@@ -87,7 +87,7 @@ sal_Bool HeaderFooterHelper::isHeader( const uno::Reference< frame::XModel >& xM
if( xTRC->compareRegionStarts( xTR1, xTR2 ) == 0 )
return sal_True;
}
catch( lang::IllegalArgumentException& )
catch (const lang::IllegalArgumentException&)
{
return sal_False;
}
@@ -153,7 +153,7 @@ sal_Bool HeaderFooterHelper::isFooter( const uno::Reference< frame::XModel >& xM
if( xTRC->compareRegionStarts( xTR1, xTR2 ) == 0 )
return sal_True;
}
catch( lang::IllegalArgumentException& )
catch (const lang::IllegalArgumentException&)
{
return sal_False;
}

View File

@@ -147,7 +147,7 @@ SwVbaRange::setText( const rtl::OUString& rText ) throw ( uno::RuntimeException
sName = xNamed->getName();
}
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
// do nothing
}

View File

@@ -108,7 +108,7 @@ uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const uno::Ref
xTextCursor = rText->createTextCursorByRange( rTextRange );
bGotTextCursor = sal_True;
}
catch (uno::Exception& e)
catch (const uno::Exception& e)
{
DebugHelper::exception(e);
}
@@ -121,7 +121,7 @@ uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const uno::Ref
xTextCursor = xText->createTextCursor();
bGotTextCursor = sal_True;
}
catch( uno::Exception& e )
catch (const uno::Exception& e)
{
DebugHelper::exception(e);
}
@@ -134,7 +134,7 @@ uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const uno::Ref
xTextCursor = rText->createTextCursor();
bGotTextCursor = sal_True;
}
catch( uno::Exception& e )
catch (const uno::Exception& e)
{
DebugHelper::exception(e);
}
@@ -188,7 +188,7 @@ uno::Reference< text::XTextContent > SwVbaRangeHelper::findBookmarkByPosition( c
if( xCompare->compareRegionStarts( xTextRange, xBkAnchor->getStart() ) == 0 )
return xBookmark;
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
continue;
}

View File

@@ -155,7 +155,7 @@ uno::Reference< text::XText > getCurrentXText( const uno::Reference< frame::XMod
{
xText.set( xTextRange->getText(), uno::UNO_QUERY );
}
catch( uno::RuntimeException& )
catch (const uno::RuntimeException&)
{
//catch exception "no text selection"
}

View File

@@ -517,7 +517,7 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Formula")), uno::makeAny( ::rtl::OUString( aMathData ) ) );
bActivate = sal_False;
}
catch ( uno::Exception& )
catch (const uno::Exception&)
{
}
}
@@ -648,8 +648,9 @@ void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point&
}
}
}
catch( uno::Exception& )
{}
catch (const uno::Exception&)
{
}
}
@@ -728,7 +729,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
bLinkingChart = ( xChartDocument.is() && !xChartDocument->hasInternalDataProvider() );
}
}
catch ( uno::Exception& )
catch (const uno::Exception&)
{
// TODO/LATER: handle the error
return;
@@ -759,12 +760,12 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
{
aSize = xObj->getVisualAreaSize( nAspect );
}
catch( embed::NoVisualAreaSizeException& )
catch (const embed::NoVisualAreaSizeException&)
{
OSL_FAIL("Can't get visual area size!\n" );
// the scaling will not be done
}
catch( uno::Exception& )
catch (const uno::Exception&)
{
// TODO/LATER: handle the error
OSL_FAIL("Can't get visual area size!\n" );