diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:30:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:33:36 +0100 |
commit | 98ce4ac4017ac04d7cde9c94273a558c969586b9 (patch) | |
tree | e895588b75f11c19bb758dafa0e7949f84543f43 /sfx2 | |
parent | f474984cd7b8a29f410a686d540859226039bfe0 (diff) |
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I59526bea5104def80e98902e4cf16e7bcfaa250c
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/fileobj.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/fltfnc.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/sfxhtml.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/msg.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/objface.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/request.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/objembed.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 2 |
12 files changed, 17 insertions, 17 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 40e8a9533ac0..4c4db65e1c7c 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -480,7 +480,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) // Evaluate Parameter SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPTIPS, false); bool bOn = pOnItem - ? ((SfxBoolItem*)pOnItem)->GetValue() + ? pOnItem->GetValue() : !Help::IsQuickHelpEnabled(); if ( bOn ) @@ -507,7 +507,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) // Evaluate Parameter SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPBALLOONS, false); bool bOn = pOnItem - ? ((SfxBoolItem*)pOnItem)->GetValue() + ? pOnItem->GetValue() : !Help::IsBalloonHelpEnabled(); if ( bOn ) diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index b6733e79bdc9..307dc70881f5 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -547,7 +547,7 @@ bool SvFileObject::IsDataComplete() const bRet = true; else if( !bLoadError && !bWaitForData ) { - SvFileObject* pThis = (SvFileObject*)this; + SvFileObject* pThis = const_cast<SvFileObject*>(this); if( bDataReady || ( bSynchron && pThis->LoadFile_Impl() && xMed.Is() ) ) bRet = true; diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index ee4a7fb15cec..4baecd5b403a 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -1101,7 +1101,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( sFilterName = sFilterName.copy( nStartRealName+2 ); } - SfxFilter* pFilter = bUpdate ? (SfxFilter*) SfxFilter::GetFilterByName( sFilterName ) : 0; + SfxFilter* pFilter = bUpdate ? const_cast<SfxFilter*>(SfxFilter::GetFilterByName( sFilterName )) : 0; bool bNew = false; if (!pFilter) { diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 9c5eee8d0d69..5335eca582f7 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -311,7 +311,7 @@ void SfxHTMLParser::GetScriptType_Impl( SvKeyValueIterator *pHTTPHeader ) ScriptType SfxHTMLParser::GetScriptType( SvKeyValueIterator *pHTTPHeader ) const { if( aScriptType.isEmpty() ) - ((SfxHTMLParser *)this)->GetScriptType_Impl( pHTTPHeader ); + const_cast<SfxHTMLParser *>(this)->GetScriptType_Impl( pHTTPHeader ); return eScriptType; } @@ -320,7 +320,7 @@ const OUString& SfxHTMLParser::GetScriptTypeString( SvKeyValueIterator *pHTTPHeader ) const { if( aScriptType.isEmpty() ) - ((SfxHTMLParser *)this)->GetScriptType_Impl( pHTTPHeader ); + const_cast<SfxHTMLParser *>(this)->GetScriptType_Impl( pHTTPHeader ); return aScriptType; } diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx index 2326a2747ae2..5e0672dda805 100644 --- a/sfx2/source/control/msg.cxx +++ b/sfx2/source/control/msg.cxx @@ -46,7 +46,7 @@ SfxSlotKind SfxSlot::GetKind() const sal_uInt16 SfxSlot::GetWhich( const SfxItemPool &rPool ) const { if ( !nMasterSlotId || nMasterSlotId == USHRT_MAX ) - ((SfxSlot*) this) -> nMasterSlotId = rPool.GetWhich(nSlotId); + const_cast<SfxSlot*>(this) -> nMasterSlotId = rPool.GetWhich(nSlotId); return nMasterSlotId; } diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index 315b7b0a450d..a9256120f8e6 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -157,7 +157,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) pIter->pLinkedSlot = GetSlot( pIter->nMasterSlotId ); assert( pIter->pLinkedSlot ); if ( !pIter->pLinkedSlot->pLinkedSlot ) - ( (SfxSlot*) pIter->pLinkedSlot)->pLinkedSlot = pIter; + const_cast<SfxSlot*>(pIter->pLinkedSlot)->pLinkedSlot = pIter; if ( 0 == pIter->GetNextSlot() ) { diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 1ef8e2956de2..140db1bcd919 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -742,7 +742,7 @@ void SfxRequest::Done_Impl { // play it safe; repair the wrong flags OSL_FAIL( "recursion RecordPerItem - use RecordPerSet!" ); - SfxSlot *pSlot = (SfxSlot*) pImp->pSlot; + SfxSlot *pSlot = const_cast<SfxSlot*>(pImp->pSlot); pSlot->nFlags &= ~(SfxSlotMode::RECORDPERITEM); pSlot->nFlags &= SfxSlotMode::RECORDPERSET; } diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 4cea4514f32d..55c0556231aa 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -390,7 +390,7 @@ SfxTabDialog::~SfxTabDialog() } if ( pDataObject->bOnDemand ) - delete (SfxItemSet*)&pDataObject->pTabPage->GetItemSet(); + delete &pDataObject->pTabPage->GetItemSet(); delete pDataObject->pTabPage; } delete pDataObject; @@ -689,7 +689,7 @@ void SfxTabDialog::RemoveTabPage( sal_uInt16 nId ) } if ( pDataObject->bOnDemand ) - delete (SfxItemSet*)&pDataObject->pTabPage->GetItemSet(); + delete &pDataObject->pTabPage->GetItemSet(); delete pDataObject->pTabPage; } diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index cd5e90c7d622..93808e693e85 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -630,7 +630,7 @@ bool SfxMedium::CloseOutStream_Impl() const OUString& SfxMedium::GetPhysicalName() const { if ( pImp->m_aName.isEmpty() && !pImp->m_aLogicName.isEmpty() ) - (( SfxMedium*)this)->CreateFileStream(); + const_cast<SfxMedium*>(this)->CreateFileStream(); // return the name then return pImp->m_aName; diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index f3bd0d362f6e..2bd83c3e93f4 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -130,7 +130,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const VirtualDevice aDevice; aDevice.EnableOutput( false ); - MapMode aMode( ((SfxObjectShell*)this)->GetMapUnit() ); + MapMode aMode( this->GetMapUnit() ); aDevice.SetMapMode( aMode ); xFile->SetPrefMapMode( aMode ); @@ -144,7 +144,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const else { nAspect = ASPECT_THUMBNAIL; - aTmpSize = ((SfxObjectShell*)this)->GetFirstPageSize(); + aTmpSize = const_cast<SfxObjectShell*>(this)->GetFirstPageSize(); } xFile->SetPrefSize( aTmpSize ); @@ -166,7 +166,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const { SAL_INFO( "sfx.doc", "PERFORMANCE SfxObjectShell::CreatePreviewMetaFile_Impl" ); - ((SfxObjectShell*)this)->DoDraw( &aDevice, Point(0,0), aTmpSize, JobSetup(), nAspect ); + const_cast<SfxObjectShell*>(this)->DoDraw( &aDevice, Point(0,0), aTmpSize, JobSetup(), nAspect ); } xFile->Stop(); diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx index c21bdc735466..8acc580b8bce 100644 --- a/sfx2/source/doc/objembed.cxx +++ b/sfx2/source/doc/objembed.cxx @@ -247,7 +247,7 @@ void SfxObjectShell::DoDraw_Impl( OutputDevice* pDev, comphelper::EmbeddedObjectContainer& SfxObjectShell::GetEmbeddedObjectContainer() const { if ( !pImp->mpObjectContainer ) - pImp->mpObjectContainer = new comphelper::EmbeddedObjectContainer( ((SfxObjectShell*)this)->GetStorage(), GetModel() ); + pImp->mpObjectContainer = new comphelper::EmbeddedObjectContainer( const_cast<SfxObjectShell*>(this)->GetStorage(), GetModel() ); return *pImp->mpObjectContainer; } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index aaf412f90944..563c88c220e7 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -831,7 +831,7 @@ OUString SfxObjectShell::GetTitle bRecur = true; OUString aTitle; - SfxObjectShell *pThis = (SfxObjectShell*) this; + SfxObjectShell *pThis = const_cast<SfxObjectShell*>(this); if ( pMed ) { |