summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-02 07:36:46 +0200
committerNoel Grandin <noel@peralex.com>2014-10-02 07:37:20 +0200
commit039b887c54fd7e8cd8a4964d1633fdfc300e938e (patch)
treef65f1ea0296ea30bccb1dc79bf1066e718bc517e /sfx2/source/appl
parent059f5a95b245252d72ea0930668bb222103dbd14 (diff)
loplugin: cstylecast
Change-Id: I4a230f45e91773fca7d537e91c9e9fb54773cf10
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/appcfg.cxx50
-rw-r--r--sfx2/source/appl/appchild.cxx2
-rw-r--r--sfx2/source/appl/appopen.cxx4
-rw-r--r--sfx2/source/appl/appserv.cxx6
-rw-r--r--sfx2/source/appl/appuno.cxx104
-rw-r--r--sfx2/source/appl/childwin.cxx20
-rw-r--r--sfx2/source/appl/impldde.cxx2
-rw-r--r--sfx2/source/appl/linkmgr2.cxx2
-rw-r--r--sfx2/source/appl/module.cxx4
-rw-r--r--sfx2/source/appl/newhelp.cxx30
-rw-r--r--sfx2/source/appl/sfxhelp.cxx4
-rw-r--r--sfx2/source/appl/workwin.cxx30
12 files changed, 129 insertions, 129 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();
}