diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-02 07:36:46 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-02 07:37:20 +0200 |
commit | 039b887c54fd7e8cd8a4964d1633fdfc300e938e (patch) | |
tree | f65f1ea0296ea30bccb1dc79bf1066e718bc517e /sfx2/source | |
parent | 059f5a95b245252d72ea0930668bb222103dbd14 (diff) |
loplugin: cstylecast
Change-Id: I4a230f45e91773fca7d537e91c9e9fb54773cf10
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/appcfg.cxx | 50 | ||||
-rw-r--r-- | sfx2/source/appl/appchild.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 104 | ||||
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 20 | ||||
-rw-r--r-- | sfx2/source/appl/impldde.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/module.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 30 | ||||
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/workwin.cxx | 30 | ||||
-rw-r--r-- | sfx2/source/config/evntconf.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/bindings.cxx | 20 | ||||
-rw-r--r-- | sfx2/source/control/dispatch.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/minfitem.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/control/sorgitm.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/statcach.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/backingcomp.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 54 |
21 files changed, 181 insertions, 180 deletions
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index a88ae482b2d0..f956a4885723 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -511,14 +511,14 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); sal_uInt16 nOutStyle = - ( (const SfxBoolItem *)pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT; + static_cast<const SfxBoolItem *>(pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT; aMiscOptions.SetToolboxStyle( nOutStyle ); } if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), true, &pItem) ) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - bool bBigSize = ( (const SfxBoolItem*)pItem )->GetValue(); + bool bBigSize = static_cast<const SfxBoolItem*>(pItem)->GetValue(); aMiscOptions.SetSymbolsSize( sal::static_int_cast< sal_Int16 >( bBigSize ? SFX_SYMBOLS_SIZE_LARGE : SFX_SYMBOLS_SIZE_SMALL ) ); @@ -536,7 +536,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BACKUP), true, &pItem) ) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetBackup( ( (const SfxBoolItem*)pItem )->GetValue() ); + aSaveOptions.SetBackup( static_cast<const SfxBoolItem*>(pItem)->GetValue() ); } // PrettyPrinting @@ -557,49 +557,49 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVE), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetAutoSave( ( (const SfxBoolItem*)pItem )->GetValue() ); + aSaveOptions.SetAutoSave( static_cast<const SfxBoolItem*>(pItem)->GetValue() ); } // AutoSave-Propt if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetAutoSavePrompt(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetAutoSavePrompt(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // AutoSave-Time if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEMINUTE), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected"); - aSaveOptions.SetAutoSaveTime(((const SfxUInt16Item *)pItem)->GetValue()); + aSaveOptions.SetAutoSaveTime(static_cast<const SfxUInt16Item *>(pItem)->GetValue()); } // UserAutoSave if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_USERAUTOSAVE), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetUserAutoSave( ( (const SfxBoolItem*)pItem )->GetValue() ); + aSaveOptions.SetUserAutoSave( static_cast<const SfxBoolItem*>(pItem)->GetValue() ); } // DocInfo if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_DOCINFO), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetDocInfoSave(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetDocInfoSave(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // Mark open Documents if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetSaveWorkingSet(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // Save window settings if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetSaveDocView(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetSaveDocView(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // Metric @@ -612,28 +612,28 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aHelpOptions.SetExtendedHelp(((const SfxBoolItem *)pItem)->GetValue()); + aHelpOptions.SetExtendedHelp(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // HelpTips if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aHelpOptions.SetHelpTips(((const SfxBoolItem *)pItem)->GetValue()); + aHelpOptions.SetHelpTips( static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // WelcomeScreen if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WELCOMESCREEN ), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aHelpOptions.SetWelcomeScreen( ((const SfxBoolItem *)pItem)->GetValue() ); + aHelpOptions.SetWelcomeScreen( static_cast<const SfxBoolItem *>(pItem)->GetValue() ); } // WelcomeScreen if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_WELCOMESCREEN_RESET ), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - bool bReset = ((const SfxBoolItem *)pItem)->GetValue(); + bool bReset = static_cast<const SfxBoolItem *>(pItem)->GetValue(); if ( bReset ) { OSL_FAIL( "Not implemented, may be EOL!" ); @@ -642,28 +642,28 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected"); - aHelpOptions.SetHelpStyleSheet( ((const SfxStringItem *)pItem)->GetValue() ); + aHelpOptions.SetHelpStyleSheet( static_cast<const SfxStringItem *>(pItem)->GetValue() ); } // SaveRelINet if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetSaveRelINet(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetSaveRelINet(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // SaveRelFSys if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_FSYS), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetSaveRelFSys(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetSaveRelFSys(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // Undo-Count if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_UNDO_COUNT), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected"); - sal_uInt16 nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue(); + sal_uInt16 nUndoCount = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); officecfg::Office::Common::Undo::Steps::set(nUndoCount, batch); // To catch all Undo-Managers: Iterate over all Frames @@ -692,21 +692,21 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_QUICKLAUNCHER), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - ShutdownIcon::SetAutostart( ( (const SfxBoolItem*)pItem )->GetValue() ); + ShutdownIcon::SetAutostart( static_cast<const SfxBoolItem*>( pItem )->GetValue() ); } // StarBasic Enable if ( SfxItemState::SET == rSet.GetItemState(SID_BASIC_ENABLED, true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "SfxInt16Item expected"); - aSecurityOptions.SetBasicMode( (EBasicSecurityMode)( (const SfxUInt16Item*)pItem )->GetValue() ); + aSecurityOptions.SetBasicMode( (EBasicSecurityMode)static_cast<const SfxUInt16Item*>( pItem )->GetValue() ); } // Execute PlugIns if ( SfxItemState::SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected"); - aSecurityOptions.SetExecutePlugins( ( (const SfxBoolItem *)pItem )->GetValue() ); + aSecurityOptions.SetExecutePlugins( static_cast<const SfxBoolItem *>( pItem )->GetValue() ); } if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), true, &pItem)) @@ -752,19 +752,19 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) { DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected"); ::com::sun::star::uno::Sequence< OUString > seqURLs; - ((SfxStringListItem*)pItem)->GetStringList(seqURLs); + static_cast<const SfxStringListItem*>(pItem)->GetStringList(seqURLs); aSecurityOptions.SetSecureURLs( seqURLs ); } if ( SfxItemState::SET == rSet.GetItemState(SID_MACRO_WARNING, true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected"); - aSecurityOptions.SetWarningEnabled( ( (const SfxBoolItem *)pItem )->GetValue() ); + aSecurityOptions.SetWarningEnabled( static_cast<const SfxBoolItem *>(pItem)->GetValue() ); } if ( SfxItemState::SET == rSet.GetItemState(SID_MACRO_CONFIRMATION, true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected"); - aSecurityOptions.SetConfirmationEnabled( ( (const SfxBoolItem *)pItem )->GetValue() ); + aSecurityOptions.SetConfirmationEnabled( static_cast<const SfxBoolItem *>(pItem)->GetValue() ); } // Store changed data @@ -786,7 +786,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_PATHNAME), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxAllEnumItem), "AllEnumItem expected"); - const SfxAllEnumItem* pEnumItem = (const SfxAllEnumItem *)pItem; + const SfxAllEnumItem* pEnumItem = static_cast<const SfxAllEnumItem *>(pItem); sal_uInt32 nCount = pEnumItem->GetValueCount(); OUString aNoChangeStr( ' ' ); for( sal_uInt32 nPath=0; nPath<nCount; ++nPath ) diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx index 43ff5f1fbe9d..b2cbe576ea04 100644 --- a/sfx2/source/appl/appchild.cxx +++ b/sfx2/source/appl/appchild.cxx @@ -138,7 +138,7 @@ SfxTemplateDialog* SfxApplication::GetTemplateDialog() if ( pAppData_Impl->pViewFrame ) { SfxChildWindow *pChild = pAppData_Impl->pViewFrame->GetChildWindow(SfxTemplateDialogWrapper::GetChildWindowId()); - return pChild ? (SfxTemplateDialog*) pChild->GetWindow() : 0; + return pChild ? static_cast<SfxTemplateDialog*>(pChild->GetWindow()) : 0; } return NULL; diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index e675f38ce478..2b8c1ae5e0a8 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -649,7 +649,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) return; } - rReq.SetArgs( *(SfxAllItemSet*)pSet ); + rReq.SetArgs( *static_cast<SfxAllItemSet*>(pSet) ); if ( !aFilter.isEmpty() ) rReq.AppendItem( SfxStringItem( SID_FILTER_NAME, aFilter ) ); rReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString("_default") ) ); @@ -959,7 +959,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) // remove from Itemset, because it confuses the parameter transformation if ( pLinkItem ) - pLinkItem = (SfxLinkItem*) pLinkItem->Clone(); + pLinkItem = static_cast<SfxLinkItem*>( pLinkItem->Clone() ); rReq.RemoveItem( SID_DONELINK ); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index f5624bc3e643..274ce9897be6 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1108,7 +1108,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) Reference< XModel > xLimitToModel; if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_RECORDMACRO, false, &pItem) ) { - bool bRecord = ((SfxBoolItem*)pItem)->GetValue(); + bool bRecord = static_cast<const SfxBoolItem*>(pItem)->GetValue(); if ( bRecord ) { // !Hack @@ -1133,7 +1133,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) sal_Int16 nTabId = 0; if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_MACROORGANIZER, false, &pItem) ) { - nTabId = ((SfxUInt16Item*)pItem)->GetValue(); + nTabId = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } SfxApplication::MacroOrganizer( nTabId ); @@ -1203,7 +1203,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) OUString aLanguage; if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_SCRIPTORGANIZER, false, &pItem) ) { - aLanguage = ((SfxScriptOrganizerItem*)pItem)->getLanguage(); + aLanguage = static_cast<const SfxScriptOrganizerItem*>(pItem)->getLanguage(); } OUString aLang( aLanguage ); diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 6cb532108eee..4e53652fbb21 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -1380,62 +1380,62 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b if ( rSet.GetItemState( SID_COMPONENTDATA, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sComponentData); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_COMPONENTCONTEXT, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sComponentContext); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sStatusInd); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_INTERACTIONHANDLER, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sInteractionHdl); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_VIEW_DATA, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sViewData); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_FILTER_DATA, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sFilterData); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOCUMENT, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sModel); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_CONTENT, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sUCBContent); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_INPUTSTREAM, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sInputStream); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_STREAM, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sStream); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_OUTPUTSTREAM, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sOutputStream); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_POSTDATA, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sPostData); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_FILLFRAME, false, &pItem ) == SfxItemState::SET ) { @@ -1453,206 +1453,206 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b if ( rSet.GetItemState( SID_TEMPLATE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sAsTemplate); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_OPEN_NEW_VIEW, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sOpenNewView); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_FAIL_ON_WARNING, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sFailOnWarning); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_VIEW_ID, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sViewId); - pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= (sal_Int16) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_PLUGIN_MODE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sPluginMode); - pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= (sal_Int16) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOC_READONLY, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sReadOnly); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sDdeReconnect); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sStartPresentation); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_SELECTION, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sSelectionOnly); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_HIDDEN, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sHidden); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_MINIMIZED, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sMinimized); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_SILENT, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sSilent); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_PREVIEW, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sPreview); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_VIEWONLY, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sViewOnly); - pValue[nActProp++].Value <<= ((SfxBoolItem*)pItem)->GetValue() ; + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_EDITDOC, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sDontEdit); - pValue[nActProp++].Value <<= !( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= !static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_FILE_DIALOG, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sUseSystemDialog); - pValue[nActProp++].Value <<= ((SfxBoolItem*)pItem)->GetValue(); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_STANDARD_DIR, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sStandardDir); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= OUString( static_cast<const SfxStringItem*>(pItem)->GetValue()); } if ( rSet.GetItemState( SID_BLACK_LIST, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sBlackList); com::sun::star::uno::Sequence< OUString > aList; - ((SfxStringListItem*)pItem)->GetStringList( aList ); + static_cast<const SfxStringListItem*>(pItem)->GetStringList( aList ); pValue[nActProp++].Value <<= aList ; } if ( rSet.GetItemState( SID_TARGETNAME, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sFrameName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= OUString( static_cast<const SfxStringItem*>(pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DOC_SALVAGE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sSalvagedFile); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_PATH, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sFolderName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_CONTENTTYPE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sMediaType); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_TEMPLATE_NAME, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sTemplateName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_TEMPLATE_REGIONNAME, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sTemplateRegionName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_JUMPMARK, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sJumpMark); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_CHARSET, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sCharacterSet); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_MACROEXECMODE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sMacroExecMode); - pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= (sal_Int16) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_UPDATEDOCMODE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sUpdateDocMode); - pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= (sal_Int16) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_REPAIRPACKAGE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sRepairPackage); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue() ; } if ( rSet.GetItemState( SID_DOCINFO_TITLE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sDocumentTitle); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOC_BASEURL, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sDocumentBaseURL); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOC_HIERARCHICALNAME, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sHierarchicalDocumentName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_COPY_STREAM_IF_POSSIBLE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sCopyStreamIfPossible); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_NOAUTOSAVE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sNoAutoSave); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue() ; } if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sModifyPasswordInfo); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_ENCRYPTIONDATA, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sEncryptionData); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sSuggestedSaveAsDir); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sSuggestedSaveAsName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOC_SERVICE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sDocumentService); - pValue[nActProp++].Value <<= OUString(static_cast<const SfxStringItem*>(pItem)->GetValue()); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if (rSet.HasItem(SID_FILTER_PROVIDER, &pItem)) { pValue[nActProp].Name = sFilterProvider; - pValue[nActProp++].Value <<= OUString(static_cast<const SfxStringItem*>(pItem)->GetValue()); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } } diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 65d887456b0c..e2cb96804f0d 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -322,16 +322,16 @@ SfxChildWinInfo SfxChildWindow::GetInfo() const sal_uIntPtr nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; if ( pWindow->GetStyle() & WB_SIZEABLE ) nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); - aInfo.aWinState = ((SystemWindow*)pWindow)->GetWindowState( nMask ); + aInfo.aWinState = static_cast<SystemWindow*>(pWindow)->GetWindowState( nMask ); } else if ( pWindow->GetType() == RSC_DOCKINGWINDOW ) { - if (((DockingWindow*)pWindow)->GetFloatingWindow() ) - aInfo.aWinState = ((DockingWindow*)pWindow)->GetFloatingWindow()->GetWindowState(); + if (static_cast<DockingWindow*>(pWindow)->GetFloatingWindow() ) + aInfo.aWinState = static_cast<DockingWindow*>(pWindow)->GetFloatingWindow()->GetWindowState(); else { SfxChildWinInfo aTmpInfo; - ((SfxDockingWindow*)pWindow)->FillInfo( aTmpInfo ); + static_cast<SfxDockingWindow*>(pWindow)->FillInfo( aTmpInfo ); aInfo.aExtraString = aTmpInfo.aExtraString; } } @@ -513,11 +513,11 @@ FloatingWindow* SfxChildWindowContext::GetFloatingWindow() const vcl::Window *pParent = pWindow->GetParent(); if (pParent->GetType() == WINDOW_DOCKINGWINDOW || pParent->GetType() == WINDOW_TOOLBOX) { - return ((DockingWindow*)pParent)->GetFloatingWindow(); + return static_cast<DockingWindow*>(pParent)->GetFloatingWindow(); } else if (pParent->GetType() == WINDOW_FLOATINGWINDOW) { - return (FloatingWindow*) pParent; + return static_cast<FloatingWindow*>(pParent); } else { @@ -646,10 +646,10 @@ void SfxChildWindow::Hide() switch ( pWindow->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pWindow)->Hide(); + static_cast<DockingWindow*>(pWindow)->Hide(); break; case RSC_TOOLBOX : - ((ToolBox*)pWindow)->Hide(); + static_cast<ToolBox*>(pWindow)->Hide(); break; default: pWindow->Hide(); @@ -662,10 +662,10 @@ void SfxChildWindow::Show( sal_uInt16 nFlags ) switch ( pWindow->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pWindow)->Show( true, nFlags ); + static_cast<DockingWindow*>(pWindow)->Show( true, nFlags ); break; case RSC_TOOLBOX : - ((ToolBox*)pWindow)->Show( true, nFlags ); + static_cast<ToolBox*>(pWindow)->Show( true, nFlags ); break; default: pWindow->Show( true, nFlags ); diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 8da693405450..526a83932207 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -349,7 +349,7 @@ IMPL_LINK( SvDDEObject, ImplGetDDEData, DdeData*, pData ) IMPL_LINK( SvDDEObject, ImplDoneDDEData, void*, pData ) { - bool bValid = (bool)(sal_uIntPtr)pData; + bool bValid = (bool)reinterpret_cast<sal_uIntPtr>(pData); if( !bValid && ( pRequest || pLink )) { DdeTransaction* pReq = 0; diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 43673a0c5746..314cd813fcc8 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -493,7 +493,7 @@ void LinkManager::CancelTransfers() for( size_t n = rLnks.size(); n; ) if( 0 != ( pLnk = &(*rLnks[ --n ])) && OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & pLnk->GetObjType()) && - 0 != ( pFileObj = (SvFileObject*)pLnk->GetObj() ) ) + 0 != ( pFileObj = static_cast<SvFileObject*>(pLnk->GetObj()) ) ) pFileObj->CancelTransfers(); } // For the purpose of sending Status information from the file object to diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index e1c4382e4eac..5d4fdbcc9e68 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -381,7 +381,7 @@ FieldUnit SfxModule::GetCurrentFieldUnit() { const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC ); if ( pItem ) - eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); + eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } else SAL_WARN( "sfx.appl", "GetModuleFieldUnit(): no module found" ); @@ -393,7 +393,7 @@ FieldUnit SfxModule::GetFieldUnit() const FieldUnit eUnit = FUNIT_INCH; const SfxPoolItem* pItem = GetItem( SID_ATTR_METRIC ); if ( pItem ) - eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); + eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); return eUnit; } diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 7df7d962b770..66555ec8aa1a 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -471,7 +471,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeIndexBox(vcl::Window * void IndexBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) { - IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)GetEntryData( rUDEvt.GetItemId() ); + IndexEntry_Impl* pEntry = reinterpret_cast<IndexEntry_Impl*>(GetEntryData( rUDEvt.GetItemId() )); if ( pEntry && pEntry->m_bSubEntry ) { // indent sub entries @@ -510,11 +510,11 @@ void IndexBox_Impl::SelectExecutableEntry() { sal_Int32 nOldPos = nPos; OUString aEntryText; - IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)GetEntryData( nPos ); + IndexEntry_Impl* pEntry = reinterpret_cast<IndexEntry_Impl*>(GetEntryData( nPos )); sal_Int32 nCount = GetEntryCount(); while ( nPos < nCount && ( !pEntry || pEntry->m_aURL.isEmpty() ) ) { - pEntry = (IndexEntry_Impl*)(sal_uIntPtr)GetEntryData( ++nPos ); + pEntry = reinterpret_cast<IndexEntry_Impl*>(GetEntryData( ++nPos )); aEntryText = GetEntry( nPos ); } @@ -557,7 +557,7 @@ namespace sfx2 { } #define NEW_ENTRY( url, bool ) \ - (void*)(sal_uIntPtr)( new IndexEntry_Impl( url, bool ) ) + reinterpret_cast<void*>( new IndexEntry_Impl( url, bool ) ) #define UNIFY_AND_INSERT_TOKEN( aToken ) \ it = aInfo.insert( sfx2::KeywordInfo::value_type( aToken, 0 ) ).first; \ @@ -699,7 +699,7 @@ void IndexTabPage_Impl::ClearIndex() { sal_uInt16 nCount = m_pIndexCB->GetEntryCount(); for ( sal_uInt16 i = 0; i < nCount; ++i ) - delete (IndexEntry_Impl*)(sal_uIntPtr)m_pIndexCB->GetEntryData(i); + delete reinterpret_cast<IndexEntry_Impl*>(m_pIndexCB->GetEntryData(i)); m_pIndexCB->Clear(); } @@ -766,7 +766,7 @@ void IndexTabPage_Impl::SetFactory( const OUString& rFactory ) OUString IndexTabPage_Impl::GetSelectEntry() const { OUString aRet; - IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)m_pIndexCB->GetEntryData( m_pIndexCB->GetEntryPos( m_pIndexCB->GetText() ) ); + IndexEntry_Impl* pEntry = reinterpret_cast<IndexEntry_Impl*>(m_pIndexCB->GetEntryData( m_pIndexCB->GetEntryPos( m_pIndexCB->GetText() ) )); if ( pEntry ) aRet = pEntry->m_aURL; return aRet; @@ -972,7 +972,7 @@ void SearchTabPage_Impl::ClearSearchResults() { sal_uInt16 nCount = m_pResultsLB->GetEntryCount(); for ( sal_uInt16 i = 0; i < nCount; ++i ) - delete (OUString*)(sal_uIntPtr)m_pResultsLB->GetEntryData(i); + delete reinterpret_cast<OUString*>(m_pResultsLB->GetEntryData(i)); m_pResultsLB->Clear(); m_pResultsLB->Update(); } @@ -1068,7 +1068,7 @@ void SearchTabPage_Impl::SetDoubleClickHdl( const Link& rLink ) OUString SearchTabPage_Impl::GetSelectEntry() const { OUString aRet; - OUString* pData = (OUString*)(sal_uIntPtr)m_pResultsLB->GetEntryData( m_pResultsLB->GetSelectEntryPos() ); + OUString* pData = reinterpret_cast<OUString*>(m_pResultsLB->GetEntryData( m_pResultsLB->GetSelectEntryPos() )); if ( pData ) aRet = *pData; return aRet; @@ -1146,7 +1146,7 @@ BookmarksBox_Impl::~BookmarksBox_Impl() for ( sal_uInt16 i = 0; i < nCount; ++i ) { OUString aTitle = GetEntry(i); - OUString* pURL = (OUString*)(sal_uIntPtr)GetEntryData(i); + OUString* pURL = reinterpret_cast<OUString*>(GetEntryData(i)); aHistOpt.AppendItem(eHELPBOOKMARKS, *pURL, sEmpty, aTitle, sEmpty, sEmpty); delete pURL; } @@ -1171,7 +1171,7 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 nAction ) aDlg.SetTitle( GetEntry( nPos ) ); if ( aDlg.Execute() == RET_OK ) { - OUString* pURL = (OUString*)(sal_uIntPtr)GetEntryData( nPos ); + OUString* pURL = reinterpret_cast<OUString*>(GetEntryData( nPos )); RemoveEntry( nPos ); OUString aImageURL = IMAGE_URL; aImageURL += INetURLObject( *pURL ).GetHost(); @@ -1295,7 +1295,7 @@ void BookmarksTabPage_Impl::SetDoubleClickHdl( const Link& rLink ) OUString BookmarksTabPage_Impl::GetSelectEntry() const { OUString aRet; - OUString* pData = (OUString*)(sal_uIntPtr)m_pBookmarksBox->GetEntryData(m_pBookmarksBox->GetSelectEntryPos()); + OUString* pData = reinterpret_cast<OUString*>(m_pBookmarksBox->GetEntryData(m_pBookmarksBox->GetSelectEntryPos())); if ( pData ) aRet = *pData; return aRet; @@ -1421,7 +1421,7 @@ SfxHelpIndexWindow_Impl::~SfxHelpIndexWindow_Impl() DELETEZ( pBPage ); for ( sal_uInt16 i = 0; i < m_pActiveLB->GetEntryCount(); ++i ) - delete (OUString*)(sal_uIntPtr)m_pActiveLB->GetEntryData(i); + delete reinterpret_cast<OUString*>(m_pActiveLB->GetEntryData(i)); SvtViewOptions aViewOpt( E_TABDIALOG, CONFIGNAME_INDEXWIN ); aViewOpt.SetPageID( (sal_Int32)m_pTabCtrl->GetCurPageId() ); @@ -1464,7 +1464,7 @@ void SfxHelpIndexWindow_Impl::SetActiveFactory() for ( sal_uInt16 i = 0; i < m_pActiveLB->GetEntryCount(); ++i ) { - OUString* pFactory = (OUString*)(sal_uIntPtr)m_pActiveLB->GetEntryData(i); + OUString* pFactory = reinterpret_cast<OUString*>(m_pActiveLB->GetEntryData(i)); *pFactory = pFactory->toAsciiLowerCase(); if ( *pFactory == pIPage->GetFactory() ) { @@ -1537,7 +1537,7 @@ IMPL_LINK_NOARG(SfxHelpIndexWindow_Impl, InitHdl) IMPL_LINK_NOARG(SfxHelpIndexWindow_Impl, SelectFactoryHdl) { - OUString* pFactory = (OUString*)(sal_uIntPtr)m_pActiveLB->GetEntryData( m_pActiveLB->GetSelectEntryPos() ); + OUString* pFactory = reinterpret_cast<OUString*>(m_pActiveLB->GetEntryData( m_pActiveLB->GetSelectEntryPos() )); if ( pFactory ) { SetFactory( OUString( *pFactory ).toAsciiLowerCase(), false ); @@ -1720,7 +1720,7 @@ bool SfxHelpIndexWindow_Impl::IsValidFactory( const OUString& _rFactory ) bool bValid = false; for ( sal_uInt16 i = 0; i < m_pActiveLB->GetEntryCount(); ++i ) { - OUString* pFactory = (OUString*)(sal_uIntPtr)m_pActiveLB->GetEntryData(i); + OUString* pFactory = reinterpret_cast<OUString*>(m_pActiveLB->GetEntryData(i)); if ( *pFactory == _rFactory ) { bValid = true; diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index fa14e7dd5f1f..e9cab42faad7 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -587,7 +587,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const //see if it has a TabControl and ask the active tab of //that for help bTriedTabPage = true; - Dialog *pDialog = ((Dialog*)pParent); + Dialog *pDialog = static_cast<Dialog*>(pParent); TabControl *pCtrl = pDialog->hasBuilder() ? pDialog->get<TabControl>("tabcontrol") : NULL; TabPage* pTabPage = pCtrl ? pCtrl->GetTabPage(pCtrl->GetCurPageId()) : NULL; vcl::Window *pTabChild = pTabPage ? pTabPage->GetWindow(WINDOW_FIRSTCHILD) : NULL; @@ -627,7 +627,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const if (!xHelp.is()) pHelpWindow = impl_createHelp(xHelp, xHelpContent); else - pHelpWindow = (SfxHelpWindow_Impl*)VCLUnoHelper::GetWindow(xHelp->getComponentWindow()); + pHelpWindow = static_cast<SfxHelpWindow_Impl*>(VCLUnoHelper::GetWindow(xHelp->getComponentWindow())); if (!xHelp.is() || !xHelpContent.is() || !pHelpWindow) return false; diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 332c32b7c3bd..69b5f8eb41c2 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -852,7 +852,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() case SFX_ALIGN_LOWESTTOP: aSize.Width() = aTmp.GetWidth(); if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW ) - aSize = ((SplitWindow *)(pCli->pWin))->CalcLayoutSizePixel( aSize ); + aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize ); bAllowHiding = false; aBorder.Top() += aSize.Height(); aPos = aTmp.TopLeft(); @@ -867,7 +867,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() case SFX_ALIGN_HIGHESTBOTTOM: aSize.Width() = aTmp.GetWidth(); if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW ) - aSize = ((SplitWindow *)(pCli->pWin))->CalcLayoutSizePixel( aSize ); + aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize ); aBorder.Bottom() += aSize.Height(); aPos = aTmp.BottomLeft(); aPos.Y() -= (aSize.Height()-1); @@ -882,7 +882,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() case SFX_ALIGN_TOOLBOXLEFT: aSize.Height() = aTmp.GetHeight(); if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW ) - aSize = ((SplitWindow *)(pCli->pWin))->CalcLayoutSizePixel( aSize ); + aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize ); bAllowHiding = false; aBorder.Left() += aSize.Width(); aPos = aTmp.TopLeft(); @@ -897,7 +897,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() case SFX_ALIGN_TOOLBOXRIGHT: aSize.Height() = aTmp.GetHeight(); if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW ) - aSize = ((SplitWindow *)(pCli->pWin))->CalcLayoutSizePixel( aSize ); + aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize ); aBorder.Right() += aSize.Width(); aPos = aTmp.TopRight(); aPos.X() -= (aSize.Width()-1); @@ -1071,10 +1071,10 @@ void SfxWorkWindow::ShowChildren_Impl() switch ( pCli->pWin->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pCli->pWin)->Show( true, nFlags ); + static_cast<DockingWindow*>(pCli->pWin)->Show( true, nFlags ); break; case RSC_SPLITWINDOW : - ((SplitWindow*)pCli->pWin)->Show( true, nFlags ); + static_cast<SplitWindow*>(pCli->pWin)->Show( true, nFlags ); break; default: pCli->pWin->Show( true, nFlags ); @@ -1088,7 +1088,7 @@ void SfxWorkWindow::ShowChildren_Impl() switch ( pCli->pWin->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pCli->pWin)->Hide(); + static_cast<DockingWindow*>(pCli->pWin)->Hide(); break; default: pCli->pWin->Hide(); @@ -1111,7 +1111,7 @@ void SfxWorkWindow::HideChildren_Impl() switch ( pChild->pWin->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pChild->pWin)->Hide(); + static_cast<DockingWindow*>(pChild->pWin)->Hide(); break; default: pChild->pWin->Hide(); @@ -1485,7 +1485,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl() { if ( pCW->bCreate && IsDockingAllowed() && bInternalDockingAllowed ) // The window ia within a SplitWindow - ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl(); + static_cast<SfxDockingWindow*>(pChildWin->GetWindow())->Reappear_Impl(); } if ( pCW->nInterfaceId != pChildWin->GetContextId() ) @@ -1505,7 +1505,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl() pCW->pCli->nVisible ^= CHILD_NOT_HIDDEN; } else - ((SfxDockingWindow*)pChildWin->GetWindow())->Disappear_Impl(); + static_cast<SfxDockingWindow*>(pChildWin->GetWindow())->Disappear_Impl(); } else RemoveChildWin_Impl( pCW ); @@ -1715,7 +1715,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, { if ( pChild->GetWindow()->GetType() == RSC_DOCKINGWINDOW ) // it's a DockingWindow - pDockWin = (SfxDockingWindow*) pChild->GetWindow(); + pDockWin = static_cast<SfxDockingWindow*>( pChild->GetWindow() ); else // FloatingWindow or ModelessDialog pWin = pChild->GetWindow(); @@ -1751,7 +1751,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, pWin = pSplitWin->GetSplitWindow(); if ( pSplitWin->GetWindowCount() == 1 ) - ((SplitWindow*)pWin)->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + static_cast<SplitWindow*>(pWin)->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } } @@ -2063,7 +2063,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, bool bSetFocus) if ( !pCW->pCli ) { SfxDockingWindow *pDock = - (SfxDockingWindow*) pCW->pWin->GetWindow(); + static_cast<SfxDockingWindow*>( pCW->pWin->GetWindow() ); if ( pDock->IsAutoHide_Impl() ) pDock->AutoShow_Impl(); } @@ -2279,7 +2279,7 @@ void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16 nId, bool bVisible, bool bSe pChildWin->Show( bSetFocus && pChildWin->WantsFocus() ? 0 : SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } else - ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl(); + static_cast<SfxDockingWindow*>(pChildWin->GetWindow())->Reappear_Impl(); } else @@ -2290,7 +2290,7 @@ void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16 nId, bool bVisible, bool bSe pCW->pWin->Hide(); } else - ((SfxDockingWindow*)pChildWin->GetWindow())->Disappear_Impl(); + static_cast<SfxDockingWindow*>(pChildWin->GetWindow())->Disappear_Impl(); } diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx index 33dfd04b1c73..e84f772c943e 100644 --- a/sfx2/source/config/evntconf.cxx +++ b/sfx2/source/config/evntconf.cxx @@ -77,7 +77,7 @@ bool SfxEventNamesItem::operator==( const SfxPoolItem& rAttr ) const DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); const SfxEventNamesList& rOwn = aEventsList; - const SfxEventNamesList& rOther = ( (SfxEventNamesItem&) rAttr ).aEventsList; + const SfxEventNamesList& rOther = static_cast<const SfxEventNamesItem&>( rAttr ).aEventsList; if ( rOwn.size() != rOther.size() ) return false; diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index ea6a3299a768..33e49cd4056e 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -1151,19 +1151,19 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell if ( pOldItem->ISA(SfxBoolItem) ) { // we can toggle Bools - bool bOldValue = ((const SfxBoolItem *)pOldItem)->GetValue(); - SfxBoolItem *pNewItem = (SfxBoolItem*) (pOldItem->Clone()); + bool bOldValue = static_cast<const SfxBoolItem *>(pOldItem)->GetValue(); + SfxBoolItem *pNewItem = static_cast<SfxBoolItem*>(pOldItem->Clone()); pNewItem->SetValue( !bOldValue ); aReq.AppendItem( *pNewItem ); delete pNewItem; } else if ( pOldItem->ISA(SfxEnumItemInterface) && - ((SfxEnumItemInterface *)pOldItem)->HasBoolValue()) + static_cast<const SfxEnumItemInterface *>(pOldItem)->HasBoolValue()) { // and Enums with Bool-Interface SfxEnumItemInterface *pNewItem = - (SfxEnumItemInterface*) (pOldItem->Clone()); - pNewItem->SetBoolValue(!((SfxEnumItemInterface *)pOldItem)->GetBoolValue()); + static_cast<SfxEnumItemInterface*>(pOldItem->Clone()); + pNewItem->SetBoolValue(!static_cast<const SfxEnumItemInterface *>(pOldItem)->GetBoolValue()); aReq.AppendItem( *pNewItem ); delete pNewItem; } @@ -1181,14 +1181,14 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell if ( pNewItem->ISA(SfxBoolItem) ) { // we can toggle Bools - ((SfxBoolItem*)pNewItem)->SetValue( true ); + static_cast<SfxBoolItem*>(pNewItem)->SetValue( true ); aReq.AppendItem( *pNewItem ); } else if ( pNewItem->ISA(SfxEnumItemInterface) && - ((SfxEnumItemInterface *)pNewItem)->HasBoolValue()) + static_cast<SfxEnumItemInterface *>(pNewItem)->HasBoolValue()) { // and Enums with Bool-Interface - ((SfxEnumItemInterface*)pNewItem)->SetBoolValue(true); + static_cast<SfxEnumItemInterface*>(pNewItem)->SetBoolValue(true); aReq.AppendItem( *pNewItem ); } else { @@ -1395,7 +1395,7 @@ void SfxBindings::UpdateControllers_Impl if ( SfxItemState::DONTCARE == eState ) { // ambiguous - pCache->SetState( SfxItemState::DONTCARE, (SfxPoolItem *)-1 ); + pCache->SetState( SfxItemState::DONTCARE, reinterpret_cast<SfxPoolItem *>(-1) ); } else if ( SfxItemState::DEFAULT == eState && rFound.nWhichId > SFX_WHICH_MAX ) @@ -1466,7 +1466,7 @@ void SfxBindings::UpdateControllers_Impl else { // ambiguous - pEnumCache->SetState( SfxItemState::DONTCARE, (SfxPoolItem *)-1 ); + pEnumCache->SetState( SfxItemState::DONTCARE, reinterpret_cast<SfxPoolItem *>(-1) ); } } diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index f7da5d24b08b..a1b2ea02f3ca 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -2188,7 +2188,7 @@ SfxModule* SfxDispatcher::GetModule() const if ( pSh == NULL ) return 0; if ( pSh->ISA(SfxModule) ) - return (SfxModule*) pSh; + return static_cast<SfxModule*>(pSh); } } diff --git a/sfx2/source/control/minfitem.cxx b/sfx2/source/control/minfitem.cxx index be60afb26602..8fd65376b8da 100644 --- a/sfx2/source/control/minfitem.cxx +++ b/sfx2/source/control/minfitem.cxx @@ -61,12 +61,13 @@ SfxMacroInfoItem::SfxMacroInfoItem(const SfxMacroInfoItem& rCopy): bool SfxMacroInfoItem::operator==( const SfxPoolItem& rCmp) const { + const SfxMacroInfoItem rItem = static_cast<const SfxMacroInfoItem&>(rCmp); return SfxPoolItem::operator==(rCmp) && - pBasicManager == ((const SfxMacroInfoItem&)rCmp).pBasicManager && - aLibName == ((const SfxMacroInfoItem&)rCmp).aLibName && - aModuleName == ((const SfxMacroInfoItem&)rCmp).aModuleName && - aMethodName == ((const SfxMacroInfoItem&)rCmp).aMethodName && - aCommentText == ((const SfxMacroInfoItem&)rCmp).aCommentText; + pBasicManager == rItem.pBasicManager && + aLibName == rItem.aLibName && + aModuleName == rItem.aModuleName && + aMethodName == rItem.aMethodName && + aCommentText == rItem.aCommentText; } diff --git a/sfx2/source/control/sorgitm.cxx b/sfx2/source/control/sorgitm.cxx index 0a4b83efd90d..0782951986a3 100644 --- a/sfx2/source/control/sorgitm.cxx +++ b/sfx2/source/control/sorgitm.cxx @@ -63,7 +63,7 @@ bool SfxScriptOrganizerItem::operator==( const SfxPoolItem& rItem) const { return rItem.Type() == Type() && SfxStringItem::operator==(rItem) && - aLanguage == ((const SfxScriptOrganizerItem &)rItem).aLanguage; + aLanguage == static_cast<const SfxScriptOrganizerItem &>(rItem).aLanguage; } diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index 61d65b499d6b..b74442221884 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -430,7 +430,7 @@ void SfxStateCache::SetState_Impl } if ( pInternalController ) - ((SfxDispatchController_Impl *)pInternalController)->StateChanged( nId, eState, pState, &aSlotServ ); + static_cast<SfxDispatchController_Impl *>(pInternalController)->StateChanged( nId, eState, pState, &aSlotServ ); // Remember new value if ( !IsInvalidItem(pLastItem) ) @@ -469,7 +469,7 @@ void SfxStateCache::SetCachedState( bool bAlways ) } if ( pInternalController ) - ((SfxDispatchController_Impl *)pInternalController)->StateChanged( nId, eLastState, pLastItem, &aSlotServ ); + static_cast<SfxDispatchController_Impl *>(pInternalController)->StateChanged( nId, eLastState, pLastItem, &aSlotServ ); // Controller is now ok bCtrlDirty = true; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 9086313fd26a..57416d7525a5 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -863,7 +863,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt bVisible = true; } else - bVisible = ((SfxVisibilityItem *)pState)->GetValue(); + bVisible = static_cast<const SfxVisibilityItem *>(pState)->GetValue(); } else { @@ -919,7 +919,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt { try { - ((::com::sun::star::frame::XStatusListener *)aIt.next())->statusChanged( aEvent ); + static_cast<::com::sun::star::frame::XStatusListener *>(aIt.next())->statusChanged( aEvent ); } catch (const ::com::sun::star::uno::RuntimeException&) { diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index 8f5f7d712c7c..39845cad2fc1 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -402,7 +402,7 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f // initialize the component and its parent window css::uno::Reference< css::awt::XWindow > xParentWindow = xFrame->getContainerWindow(); - WorkWindow* pParent = (WorkWindow*)VCLUnoHelper::GetWindow(xParentWindow); + WorkWindow* pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow)); vcl::Window* pWindow = VCLUnoHelper::GetWindow(m_xWindow); // disable full screen mode of the frame! @@ -799,7 +799,7 @@ void SAL_CALL BackingComp::dispatch( const css::util::URL& aURL, const css::uno: // Recalculate minimum width css::uno::Reference< css::awt::XWindow > xParentWindow = m_xFrame->getContainerWindow(); - WorkWindow* pParent = (WorkWindow*)VCLUnoHelper::GetWindow(xParentWindow); + WorkWindow* pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow)); if( pParent ) { pParent->SetMinOutputSizePixel( Size( diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index ccbf9139908a..46723e3ddcc9 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -658,7 +658,7 @@ bool SfxDocumentDescPage::FillItemSet(SfxItemSet *rSet) if ( pExSet && SfxItemState::SET != pExSet->GetItemState( SID_DOCINFO, true, &pItem ) ) pInfo = m_pInfoItem; else if ( pItem ) - pInfo = new SfxDocumentInfoItem( *(const SfxDocumentInfoItem *)pItem ); + pInfo = new SfxDocumentInfoItem( *static_cast<const SfxDocumentInfoItem *>(pItem) ); if ( !pInfo ) { @@ -694,7 +694,7 @@ bool SfxDocumentDescPage::FillItemSet(SfxItemSet *rSet) void SfxDocumentDescPage::Reset(const SfxItemSet *rSet) { - m_pInfoItem = &(SfxDocumentInfoItem &)rSet->Get(SID_DOCINFO); + m_pInfoItem = const_cast<SfxDocumentInfoItem*>(&static_cast<const SfxDocumentInfoItem &>(rSet->Get(SID_DOCINFO))); m_pTitleEd->SetText( m_pInfoItem->getTitle() ); m_pThemaEd->SetText( m_pInfoItem->getSubject() ); @@ -933,12 +933,12 @@ bool SfxDocumentPage::FillItemSet( SfxItemSet* rSet ) m_pUseUserDataCB->IsValueChangedFromSaved() && GetTabDialog() && GetTabDialog()->GetExampleSet() ) { - const SfxItemSet* pExpSet = GetTabDialog()->GetExampleSet(); - const SfxPoolItem* pItem; + SfxItemSet* pExpSet = GetTabDialog()->GetExampleSet(); + SfxPoolItem* pItem; if ( pExpSet && SfxItemState::SET == pExpSet->GetItemState( SID_DOCINFO, true, &pItem ) ) { - SfxDocumentInfoItem* m_pInfoItem = (SfxDocumentInfoItem*)pItem; + SfxDocumentInfoItem* m_pInfoItem = static_cast<SfxDocumentInfoItem*>(pItem); bool bUseData = ( TRISTATE_TRUE == m_pUseUserDataCB->GetState() ); m_pInfoItem->SetUseUserData( bUseData ); rSet->Put( SfxDocumentInfoItem( *m_pInfoItem ) ); @@ -948,17 +948,17 @@ bool SfxDocumentPage::FillItemSet( SfxItemSet* rSet ) if ( bHandleDelete ) { - const SfxItemSet* pExpSet = GetTabDialog()->GetExampleSet(); - const SfxPoolItem* pItem; + SfxItemSet* pExpSet = GetTabDialog()->GetExampleSet(); + SfxPoolItem* pItem; if ( pExpSet && SfxItemState::SET == pExpSet->GetItemState( SID_DOCINFO, true, &pItem ) ) { - SfxDocumentInfoItem* m_pInfoItem = (SfxDocumentInfoItem*)pItem; + SfxDocumentInfoItem* pInfoItem = static_cast<SfxDocumentInfoItem*>(pItem); bool bUseAuthor = bEnableUseUserData && m_pUseUserDataCB->IsChecked(); - SfxDocumentInfoItem newItem( *m_pInfoItem ); + SfxDocumentInfoItem newItem( *pInfoItem ); newItem.resetUserData( bUseAuthor ? SvtUserOptions().GetFullName() : OUString() ); - m_pInfoItem->SetUseUserData( TRISTATE_TRUE == m_pUseUserDataCB->GetState() ); + pInfoItem->SetUseUserData( TRISTATE_TRUE == m_pUseUserDataCB->GetState() ); newItem.SetUseUserData( TRISTATE_TRUE == m_pUseUserDataCB->GetState() ); newItem.SetDeleteUserData( true ); @@ -1033,7 +1033,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) || !pItem ) m_pReadOnlyCB->Hide(); else - m_pReadOnlyCB->Check( ( (SfxBoolItem*)pItem )->GetValue() ); + m_pReadOnlyCB->Check( static_cast<const SfxBoolItem*>(pItem)->GetValue() ); // determine context symbol INetURLObject aURL; @@ -1197,7 +1197,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( vcl::Window* pParent, { DBG_ASSERT( pItem->IsA( TYPE( SfxStringItem ) ), "SfxDocumentInfoDialog:<SfxStringItem> expected" ); - aTitle += ( ( SfxStringItem* ) pItem )->GetValue(); + aTitle += static_cast<const SfxStringItem*>(pItem)->GetValue(); } SetText( aTitle ); @@ -1461,7 +1461,7 @@ CustomPropertiesWindow::~CustomPropertiesWindow() IMPL_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox*, pBox ) { - sal_Int64 nType = sal_Int64( (sal_IntPtr)pBox->GetEntryData( pBox->GetSelectEntryPos() ) ); + long nType = reinterpret_cast<long>( pBox->GetEntryData( pBox->GetSelectEntryPos() ) ); CustomPropertyLine* pLine = pBox->GetLine(); pLine->m_aValueEdit.Show( (CUSTOM_TYPE_TEXT == nType) || (CUSTOM_TYPE_NUMBER == nType) ); pLine->m_aDateField.Show( (CUSTOM_TYPE_DATE == nType) || (CUSTOM_TYPE_DATETIME == nType) ); @@ -1566,8 +1566,8 @@ bool CustomPropertiesWindow::IsLineValid( CustomPropertyLine* pLine ) const { bool bIsValid = true; pLine->m_bTypeLostFocus = false; - sal_Int64 nType = sal_Int64( - (sal_IntPtr)pLine->m_aTypeBox.GetEntryData( pLine->m_aTypeBox.GetSelectEntryPos() ) ); + long nType = reinterpret_cast<long>( + pLine->m_aTypeBox.GetEntryData( pLine->m_aTypeBox.GetSelectEntryPos() ) ); OUString sValue = pLine->m_aValueEdit.GetText(); if ( sValue.isEmpty() ) return true; @@ -1602,7 +1602,7 @@ void CustomPropertiesWindow::ValidateLine( CustomPropertyLine* pLine, bool bIsFr pLine->m_bTypeLostFocus = true; vcl::Window* pParent = GetParent()->GetParent(); if (MessageDialog(pParent, SfxResId(STR_SFX_QUERY_WRONG_TYPE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL).Execute() == RET_OK) - pLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( (void*)CUSTOM_TYPE_TEXT ) ); + pLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( reinterpret_cast<void*>(CUSTOM_TYPE_TEXT) ) ); else pLine->m_aValueEdit.GrabFocus(); } @@ -1840,7 +1840,7 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny ) else pNewLine->m_aYesNoButton.CheckNo(); } - pNewLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( (void*)nType ) ); + pNewLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( reinterpret_cast<void*>(nType) ) ); } TypeHdl( &pNewLine->m_aTypeBox ); @@ -1919,8 +1919,8 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c if ( !sPropertyName.isEmpty() ) { aPropertiesSeq[i].Name = sPropertyName; - sal_Int64 nType = sal_Int64( - (sal_IntPtr)pLine->m_aTypeBox.GetEntryData( pLine->m_aTypeBox.GetSelectEntryPos() ) ); + long nType = reinterpret_cast<long>( + pLine->m_aTypeBox.GetEntryData( pLine->m_aTypeBox.GetSelectEntryPos() ) ); if ( CUSTOM_TYPE_NUMBER == nType ) { double nValue = 0; @@ -2131,11 +2131,11 @@ bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet* rSet ) { if ( SfxItemState::SET != GetTabDialog()->GetExampleSet()->GetItemState( SID_DOCINFO, true, &pItem ) ) - pInfo = &( SfxDocumentInfoItem& )rSet->Get( SID_DOCINFO ); + pInfo = const_cast<SfxDocumentInfoItem*>(&static_cast<const SfxDocumentInfoItem& >(rSet->Get( SID_DOCINFO ))); else { bMustDelete = true; - pInfo = new SfxDocumentInfoItem( *( const SfxDocumentInfoItem* ) pItem ); + pInfo = new SfxDocumentInfoItem( *static_cast<const SfxDocumentInfoItem*>(pItem) ); } } @@ -2174,8 +2174,8 @@ bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet* rSet ) void SfxCustomPropertiesPage::Reset( const SfxItemSet* rItemSet ) { m_pPropertiesCtrl->ClearAllLines(); - const SfxDocumentInfoItem* m_pInfoItem = &(const SfxDocumentInfoItem &)rItemSet->Get(SID_DOCINFO); - std::vector< CustomProperty* > aCustomProps = m_pInfoItem->GetCustomProperties(); + const SfxDocumentInfoItem& rInfoItem = static_cast<const SfxDocumentInfoItem &>(rItemSet->Get(SID_DOCINFO)); + std::vector< CustomProperty* > aCustomProps = rInfoItem.GetCustomProperties(); for ( sal_uInt32 i = 0; i < aCustomProps.size(); i++ ) { m_pPropertiesCtrl->AddLine( aCustomProps[i]->m_sName, aCustomProps[i]->m_aValue, false ); @@ -2603,11 +2603,11 @@ bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet* rSet ) { if ( SfxItemState::SET != GetTabDialog()->GetExampleSet()->GetItemState( SID_DOCINFO, true, &pItem ) ) - pInfo = &( SfxDocumentInfoItem& )rSet->Get( SID_DOCINFO ); + pInfo = const_cast<SfxDocumentInfoItem*>(&static_cast<const SfxDocumentInfoItem& >(rSet->Get( SID_DOCINFO ))); else { bMustDelete = true; - pInfo = new SfxDocumentInfoItem( *( const SfxDocumentInfoItem* ) pItem ); + pInfo = new SfxDocumentInfoItem( *static_cast<const SfxDocumentInfoItem*>(pItem) ); } } @@ -2665,8 +2665,8 @@ bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet* rSet ) void SfxCmisPropertiesPage::Reset( const SfxItemSet* rItemSet ) { m_pPropertiesCtrl.ClearAllLines(); - const SfxDocumentInfoItem* m_pInfoItem = &(const SfxDocumentInfoItem &)rItemSet->Get(SID_DOCINFO); - uno::Sequence< document::CmisProperty > aCmisProps = m_pInfoItem->GetCmisProperties(); + const SfxDocumentInfoItem& rInfoItem = static_cast<const SfxDocumentInfoItem& >(rItemSet->Get(SID_DOCINFO)); + uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties(); for ( sal_Int32 i = 0; i < aCmisProps.getLength(); i++ ) { m_pPropertiesCtrl.AddLine( aCmisProps[i].Id, |