summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-28 19:06:33 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-28 19:09:25 +0100
commit65e9940d8d13e0e2ac9cac3421955124d1c73390 (patch)
tree089685d7ac1e2978bba363900b02b9f3cc015452 /sfx2
parent8d6c8d7fa0a4c56ebcf9d141d8cd99706d756991 (diff)
Clean up C-style casts from pointers to void
Change-Id: I717c260ecdc378a9fd33494f2b98eccec0417d66
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/fileobj.cxx2
-rw-r--r--sfx2/source/appl/impldde.cxx2
-rw-r--r--sfx2/source/appl/newhelp.cxx10
-rw-r--r--sfx2/source/appl/opengrf.cxx2
-rw-r--r--sfx2/source/appl/shutdowniconunx.cxx6
-rw-r--r--sfx2/source/control/dispatch.cxx2
-rw-r--r--sfx2/source/control/objface.cxx10
-rw-r--r--sfx2/source/control/shell.cxx6
-rw-r--r--sfx2/source/dialog/styfitem.cxx12
-rw-r--r--sfx2/source/dialog/versdlg.cxx6
-rw-r--r--sfx2/source/menu/mnuitem.cxx2
11 files changed, 30 insertions, 30 deletions
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index 307dc70881f5..b0930e8de47f 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -173,7 +173,7 @@ bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
aMeta.Write( aMemStm );
}
}
- rData <<= css::uno::Sequence< sal_Int8 >( (sal_Int8*) aMemStm.GetData(),
+ rData <<= css::uno::Sequence< sal_Int8 >( static_cast<sal_Int8 const *>(aMemStm.GetData()),
aMemStm.Seek( STREAM_SEEK_TO_END ) );
bNativFormat = bOldNativFormat;
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index 00efd456bd4e..4a3c0be1e6b7 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -325,7 +325,7 @@ IMPL_LINK( SvDDEObject, ImplGetDDEData, DdeData*, pData )
default:
{
- const sal_Char* p = (sal_Char*)( pData->operator const void*() );
+ const sal_Char* p = static_cast<sal_Char const *>(pData->operator const void*());
long nLen = SotClipboardFormatId::STRING == nFmt ? (p ? strlen( p ) : 0) : (long)*pData;
Sequence< sal_Int8 > aSeq( reinterpret_cast<const sal_Int8*>(p), nLen );
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index d73c9e7d9179..aee3adfd646b 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -308,7 +308,7 @@ ContentListBox_Impl::~ContentListBox_Impl()
while ( pEntry )
{
ClearChildren( pEntry );
- delete (ContentEntry_Impl*)pEntry->GetUserData();
+ delete static_cast<ContentEntry_Impl*>(pEntry->GetUserData());
pEntry = GetEntry( nPos++ );
}
}
@@ -341,7 +341,7 @@ void ContentListBox_Impl::ClearChildren( SvTreeListEntry* pParent )
while ( pEntry )
{
ClearChildren( pEntry );
- delete (ContentEntry_Impl*)pEntry->GetUserData();
+ delete static_cast<ContentEntry_Impl*>(pEntry->GetUserData());
pEntry = NextSibling( pEntry );
}
}
@@ -356,7 +356,7 @@ void ContentListBox_Impl::RequestingChildren( SvTreeListEntry* pParent )
{
if ( pParent->GetUserData() )
{
- OUString aTmpURL( ( (ContentEntry_Impl*)pParent->GetUserData() )->aURL );
+ OUString aTmpURL( static_cast<ContentEntry_Impl*>(pParent->GetUserData())->aURL );
std::vector<OUString > aList =
SfxContentHelper::GetHelpTreeViewContents( aTmpURL );
@@ -413,8 +413,8 @@ OUString ContentListBox_Impl::GetSelectEntry() const
{
OUString aRet;
SvTreeListEntry* pEntry = FirstSelected();
- if ( pEntry && !( (ContentEntry_Impl*)pEntry->GetUserData() )->bIsFolder )
- aRet = ( (ContentEntry_Impl*)pEntry->GetUserData() )->aURL;
+ if ( pEntry && !static_cast<ContentEntry_Impl*>(pEntry->GetUserData())->bIsFolder )
+ aRet = static_cast<ContentEntry_Impl*>(pEntry->GetUserData())->aURL;
return aRet;
}
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 075899772f7f..2051eb6c0b53 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -237,7 +237,7 @@ bool SvxOpenGraphicDialog::IsAsLink() const
{
Any aVal = mpImpl->xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0 );
DBG_ASSERT(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
- return aVal.hasValue() && ( *(sal_Bool*) aVal.getValue() );
+ return aVal.hasValue() && ( *static_cast<sal_Bool const *>(aVal.getValue()) );
}
}
catch(const IllegalArgumentException&)
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
index b5aee739a96d..72ad1ea3a63d 100644
--- a/sfx2/source/appl/shutdowniconunx.cxx
+++ b/sfx2/source/appl/shutdowniconunx.cxx
@@ -73,7 +73,7 @@ GFileMonitor* pMonitor = NULL;
static void open_url_cb( GtkWidget *, gpointer data )
{
- ShutdownIcon::OpenURL( *(OUString *)data,
+ ShutdownIcon::OpenURL( *static_cast<OUString *>(data),
OUString( "_default" ) );
}
@@ -128,7 +128,7 @@ static GdkPixbuf * ResIdToPixbuf( sal_uInt16 nResId )
g_return_val_if_fail( Size( pSalAlpha->Width(), pSalAlpha->Height() ) == aSize, NULL );
int nX, nY;
- guchar *pPixbufData = ( guchar * )g_malloc( 4 * aSize.Width() * aSize.Height() );
+ guchar *pPixbufData = static_cast<guchar *>(g_malloc( 4 * aSize.Width() * aSize.Height() ));
guchar *pDestData = pPixbufData;
for( nY = 0; nY < pSalBitmap->Height(); nY++ )
@@ -163,7 +163,7 @@ extern "C" {
static void oustring_delete (gpointer data,
GClosure * /* closure */)
{
- OUString *pURL = (OUString *) data;
+ OUString *pURL = static_cast<OUString *>(data);
delete pURL;
}
}
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 142646dc19f9..f7b2961ad309 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1610,7 +1610,7 @@ void SfxDispatcher::SetSlotFilter(SfxSlotFilterState nEnable,
extern "C" int SAL_CALL SfxCompareSIDs_Impl(const void* pSmaller, const void* pBigger)
{
- return ( (long) *((sal_uInt16*)pSmaller) ) - ( (long) *((sal_uInt16*)pBigger) );
+ return ( (long) *static_cast<sal_uInt16 const *>(pSmaller) ) - ( (long) *static_cast<sal_uInt16 const *>(pBigger) );
}
/** Searches for 'nSID' in the Filter set by <SetSlotFilter()> and
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index a9256120f8e6..b36a20d293c8 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -40,15 +40,15 @@ extern "C" {
static int SAL_CALL
SfxCompareSlots_qsort( const void* pSmaller, const void* pBigger )
{
- return ( (int) ((SfxSlot*)pSmaller)->GetSlotId() ) -
- ( (int) ((SfxSlot*)pBigger)->GetSlotId() );
+ return ( (int) static_cast<SfxSlot const *>(pSmaller)->GetSlotId() ) -
+ ( (int) static_cast<SfxSlot const *>(pBigger)->GetSlotId() );
}
static int SAL_CALL
SfxCompareSlots_bsearch( const void* pSmaller, const void* pBigger )
{
- return ( (int) *((sal_uInt16*)pSmaller) ) -
- ( (int) ((SfxSlot*)pBigger)->GetSlotId() );
+ return ( (int) *static_cast<sal_uInt16 const *>(pSmaller) ) -
+ ( (int) static_cast<SfxSlot const *>(pBigger)->GetSlotId() );
}
}
@@ -306,7 +306,7 @@ const SfxSlot* SfxInterface::GetSlot( sal_uInt16 nFuncId ) const
if ( !p && pGenoType )
return pGenoType->GetSlot( nFuncId );
- return p ? (const SfxSlot*)p : 0;
+ return p ? static_cast<const SfxSlot*>(p) : 0;
}
const SfxSlot* SfxInterface::GetSlot( const OUString& rCommand ) const
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index b055444c1808..9e5a9b5b5c23 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -408,7 +408,7 @@ bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot )
sal_IntPtr ShellCall_Impl( void* pObj, void* pArg )
{
- ((SfxShell* )pObj)->ExecuteSlot( *(SfxRequest*)pArg, (SfxInterface*)0L );
+ static_cast<SfxShell*>(pObj)->ExecuteSlot( *static_cast<SfxRequest*>(pArg), (SfxInterface*)0L );
return 0;
}
@@ -669,8 +669,8 @@ bool SfxShell::HasUIFeature( sal_uInt32 )
sal_IntPtr DispatcherUpdate_Impl( void*, void* pArg )
{
- ((SfxDispatcher*) pArg)->Update_Impl( true );
- ((SfxDispatcher*) pArg)->GetBindings()->InvalidateAll(false);
+ static_cast<SfxDispatcher*>(pArg)->Update_Impl( true );
+ static_cast<SfxDispatcher*>(pArg)->GetBindings()->InvalidateAll(false);
return 0;
}
diff --git a/sfx2/source/dialog/styfitem.cxx b/sfx2/source/dialog/styfitem.cxx
index 58dee4128d7c..bc3aeb6553e2 100644
--- a/sfx2/source/dialog/styfitem.cxx
+++ b/sfx2/source/dialog/styfitem.cxx
@@ -54,8 +54,8 @@ SfxStyleFamilyItem::SfxStyleFamilyItem( const ResId &rResId ) :
}
if(nMask & RSC_SFX_STYLE_ITEM_BITMAP)
{
- aBitmap = Bitmap(ResId((RSHEADER_TYPE *)GetClassRes(),*rResId.GetResMgr()));
- IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
+ aBitmap = Bitmap(ResId(static_cast<RSHEADER_TYPE *>(GetClassRes()),*rResId.GetResMgr()));
+ IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE *>(GetClassRes()) ) );
}
if(nMask & RSC_SFX_STYLE_ITEM_TEXT)
{
@@ -73,8 +73,8 @@ SfxStyleFamilyItem::SfxStyleFamilyItem( const ResId &rResId ) :
nFamily = SFX_STYLE_FAMILY_PARA;
if(nMask & RSC_SFX_STYLE_ITEM_IMAGE)
{
- aImage = Image(ResId((RSHEADER_TYPE *)GetClassRes(),*rResId.GetResMgr()));
- IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
+ aImage = Image(ResId(static_cast<RSHEADER_TYPE *>(GetClassRes()),*rResId.GetResMgr()));
+ IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE *>(GetClassRes()) ) );
}
else
aImage = Image(aBitmap);
@@ -101,9 +101,9 @@ SfxStyleFamilies::SfxStyleFamilies( const ResId& rResId ) :
sal_uIntPtr nCount = ReadLongRes();
for( sal_uIntPtr i = 0; i < nCount; i++ )
{
- const ResId aResId((RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr());
+ const ResId aResId(static_cast<RSHEADER_TYPE *>(GetClassRes()), *rResId.GetResMgr());
SfxStyleFamilyItem *pItem = new SfxStyleFamilyItem(aResId);
- IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
+ IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE *>(GetClassRes()) ) );
aEntryList.push_back( pItem );
}
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index 36cdebf9ec8b..ec29b3dcce23 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -173,7 +173,7 @@ void SfxVersionsTabListBox_Impl::setColSizes()
for (SvTreeListEntry* pEntry = First(); pEntry; pEntry = Next(pEntry))
{
- aAuthors.insert(((SfxVersionInfo*)pEntry->GetUserData())->aAuthor);
+ aAuthors.insert(static_cast<SfxVersionInfo*>(pEntry->GetUserData())->aAuthor);
}
long nMaxAuthorWidth = nRest/4;
@@ -412,7 +412,7 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
}
if (pButton == m_pDeleteButton && pEntry)
{
- pObjShell->GetMedium()->RemoveVersion_Impl( ((SfxVersionInfo*) pEntry->GetUserData())->aName );
+ pObjShell->GetMedium()->RemoveVersion_Impl( static_cast<SfxVersionInfo*>(pEntry->GetUserData())->aName );
pObjShell->SetModified( true );
m_pVersionBox->SetUpdateMode( false );
m_pVersionBox->Clear();
@@ -425,7 +425,7 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
}
else if (pButton == m_pViewButton && pEntry)
{
- SfxVersionInfo* pInfo = (SfxVersionInfo*) pEntry->GetUserData();
+ SfxVersionInfo* pInfo = static_cast<SfxVersionInfo*>(pEntry->GetUserData());
boost::scoped_ptr<SfxViewVersionDialog_Impl> pDlg(new SfxViewVersionDialog_Impl(this, *pInfo, false));
pDlg->Execute();
}
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 16c42e71fbc2..ea660ab612e8 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -418,7 +418,7 @@ SfxUnoMenuControl::~SfxUnoMenuControl()
sal_IntPtr Select_Impl( void* /*pHdl*/, void* pVoid )
{
- Menu* pMenu = (Menu*)pVoid;
+ Menu* pMenu = static_cast<Menu*>(pVoid);
OUString aURL( pMenu->GetItemCommand( pMenu->GetCurItemId() ) );
if( aURL.isEmpty() )