summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-26 15:31:36 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-26 15:33:37 +0100
commit0d05f417c3a7dcde89f5e15b29f39ce2db65b543 (patch)
tree52f3890d679ef16bdd74c075a0e89f7cc036b087 /svtools
parent3b9e0676b0a193dbf802a6b703827c9cc0689900 (diff)
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: Iabe2ecce65a91b003fe042a22630131449968fd8
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/brwbox/brwbox1.cxx2
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx2
-rw-r--r--svtools/source/contnr/imivctl1.cxx14
-rw-r--r--svtools/source/contnr/ivctrl.cxx6
-rw-r--r--svtools/source/contnr/simptabl.cxx4
-rw-r--r--svtools/source/contnr/svimpbox.cxx4
-rw-r--r--svtools/source/contnr/treelist.cxx4
-rw-r--r--svtools/source/contnr/treelistbox.cxx2
-rw-r--r--svtools/source/control/calendar.cxx8
-rw-r--r--svtools/source/control/ctrltool.cxx18
-rw-r--r--svtools/source/control/fmtfield.cxx4
-rw-r--r--svtools/source/control/tabbar.cxx2
-rw-r--r--svtools/source/graphic/descriptor.cxx2
-rw-r--r--svtools/source/graphic/grfcache.cxx10
-rw-r--r--svtools/source/graphic/grfmgr.cxx2
-rw-r--r--svtools/source/graphic/grfmgr2.cxx2
-rw-r--r--svtools/source/misc/embedtransfer.cxx2
17 files changed, 44 insertions, 44 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 8d4127f4ce20..67353f473e22 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -872,7 +872,7 @@ sal_uInt16 BrowseBox::ColCount() const
long BrowseBox::ImpGetDataRowHeight() const
{
- BrowseBox *pThis = (BrowseBox*)this;
+ BrowseBox *pThis = const_cast<BrowseBox*>(this);
pThis->nDataRowHeight = pThis->CalcReverseZoom(pDataWin->GetTextHeight() + 2);
pThis->Resize();
getDataWindow()->Invalidate();
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index bcb227145ec2..c48a0a924943 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -880,7 +880,7 @@ namespace svt
return true;
// save the cell content
- if (IsEditing() && aController->IsModified() && !((EditBrowseBox *) this)->SaveModified())
+ if (IsEditing() && aController->IsModified() && !const_cast<EditBrowseBox *>(this)->SaveModified())
{
// maybe we're not visible ...
EnableAndShow();
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 7e2c61033d1a..0e3d008cdce7 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2079,9 +2079,9 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingHeight( SvxIconChoiceCtrlEntry* pEntry
}
if( nHeight > nMaxBoundHeight )
{
- ((SvxIconChoiceCtrl_Impl*)this)->nMaxBoundHeight = nHeight;
- ((SvxIconChoiceCtrl_Impl*)this)->aHorSBar.SetLineSize( GetScrollBarLineSize() );
- ((SvxIconChoiceCtrl_Impl*)this)->aVerSBar.SetLineSize( GetScrollBarLineSize() );
+ const_cast<SvxIconChoiceCtrl_Impl*>(this)->nMaxBoundHeight = nHeight;
+ const_cast<SvxIconChoiceCtrl_Impl*>(this)->aHorSBar.SetLineSize( GetScrollBarLineSize() );
+ const_cast<SvxIconChoiceCtrl_Impl*>(this)->aVerSBar.SetLineSize( GetScrollBarLineSize() );
}
return nHeight;
}
@@ -2521,7 +2521,7 @@ void SvxIconChoiceCtrl_Impl::SetGrid( const Size& rSize )
{
const SvxIconChoiceCtrlColumnInfo* pCol = GetColumn( 0 );
if( pCol )
- ((SvxIconChoiceCtrlColumnInfo*)pCol)->SetWidth( nGridDX );
+ const_cast<SvxIconChoiceCtrlColumnInfo*>(pCol)->SetWidth( nGridDX );
}
nGridDY = aSize.Height();
SetDefaultTextSize();
@@ -2540,8 +2540,8 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcMaxTextRect( const SvxIconChoiceCtrlEntry*
else
aBoundRect = pEntry->aGridRect;
- Rectangle aBmpRect( ((SvxIconChoiceCtrl_Impl*)this)->CalcBmpRect(
- (SvxIconChoiceCtrlEntry*)pEntry ) );
+ Rectangle aBmpRect( const_cast<SvxIconChoiceCtrl_Impl*>(this)->CalcBmpRect(
+ const_cast<SvxIconChoiceCtrlEntry*>(pEntry) ) );
if( nWinBits & WB_ICON )
{
aBoundRect.Top() = aBmpRect.Bottom();
@@ -3369,7 +3369,7 @@ void IcnViewEdit_Impl::StopEditing( bool bCancel )
sal_uLong SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
{
if( !(nFlags & F_ENTRYLISTPOS_VALID ))
- ((SvxIconChoiceCtrl_Impl*)this)->SetListPositions();
+ const_cast<SvxIconChoiceCtrl_Impl*>(this)->SetListPositions();
return pEntry->nPos;
}
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx
index 0ced60f2dfd3..ce1c05c49f64 100644
--- a/svtools/source/contnr/ivctrl.cxx
+++ b/svtools/source/contnr/ivctrl.cxx
@@ -231,7 +231,7 @@ SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( const Point& rPixPos, bool
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
- return ((SvtIconChoiceCtrl*)this)->_pImp->GetEntry( aPos, bHit );
+ return const_cast<SvtIconChoiceCtrl*>(this)->_pImp->GetEntry( aPos, bHit );
}
void SvtIconChoiceCtrl::SetStyle( WinBits nWinStyle )
@@ -296,7 +296,7 @@ void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt )
bool bKeyUsed = DoKeyInput( rKEvt );
if ( !bKeyUsed )
{
- _pCurKeyEvent = (KeyEvent*)&rKEvt;
+ _pCurKeyEvent = const_cast<KeyEvent*>(&rKEvt);
Control::KeyInput( rKEvt );
_pCurKeyEvent = NULL;
}
@@ -306,7 +306,7 @@ bool SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt )
// under OS/2, we get key up/down even while editing
if( IsEntryEditing() )
return true;
- _pCurKeyEvent = (KeyEvent*)&rKEvt;
+ _pCurKeyEvent = const_cast<KeyEvent*>(&rKEvt);
bool bHandled = _pImp->KeyInput( rKEvt );
_pCurKeyEvent = NULL;
return bHandled;
diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx
index 8e7d7ad0d127..a6e07c52d7fc 100644
--- a/svtools/source/contnr/simptabl.cxx
+++ b/svtools/source/contnr/simptabl.cxx
@@ -466,8 +466,8 @@ sal_Int32 SvSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRig
IMPL_LINK( SvSimpleTable, CompareHdl, SvSortData*, pData)
{
- SvTreeListEntry* pLeft = (SvTreeListEntry*)(pData->pLeft );
- SvTreeListEntry* pRight = (SvTreeListEntry*)(pData->pRight );
+ SvTreeListEntry* pLeft = const_cast<SvTreeListEntry*>(pData->pLeft);
+ SvTreeListEntry* pRight = const_cast<SvTreeListEntry*>(pData->pRight);
return (long) ColCompare(pLeft,pRight);
}
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index e16f38ec44ed..c069bef5b569 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -3388,8 +3388,8 @@ void SvImpLBox::ShowFocusRect( const SvTreeListEntry* pEntry )
{
if( pEntry )
{
- long nY = GetEntryLine( (SvTreeListEntry*)pEntry );
- Rectangle aRect = pView->GetFocusRect( (SvTreeListEntry*)pEntry, nY );
+ long nY = GetEntryLine( const_cast<SvTreeListEntry*>(pEntry) );
+ Rectangle aRect = pView->GetFocusRect( const_cast<SvTreeListEntry*>(pEntry), nY );
vcl::Region aOldClip( pView->GetClipRegion());
vcl::Region aClipRegion( GetClipRegionRect() );
pView->SetClipRegion( aClipRegion );
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index 1a9bc8d858b4..d684e4b3fd7b 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -587,7 +587,7 @@ sal_uLong SvTreeList::GetVisiblePos( const SvListView* pView, SvTreeListEntry* p
if ( !pView->bVisPositionsValid )
{
// to make GetVisibleCount refresh the positions
- ((SvListView*)pView)->nVisibleCount = 0;
+ const_cast<SvListView*>(pView)->nVisibleCount = 0;
GetVisibleCount( const_cast<SvListView*>(pView) );
}
const SvViewDataEntry* pViewData = pView->GetViewData( pEntry );
@@ -911,7 +911,7 @@ sal_uLong SvTreeList::Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pParent,s
sal_uLong SvTreeList::GetAbsPos( const SvTreeListEntry* pEntry) const
{
if ( !bAbsPositionsValid )
- ((SvTreeList*)this)->SetAbsolutePositions();
+ const_cast<SvTreeList*>(this)->SetAbsolutePositions();
return pEntry->nAbsPos;
}
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 3cce392c8ba5..a3f04834e15e 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -921,7 +921,7 @@ sal_uLong SvTreeListBox::GetLevelChildCount( SvTreeListEntry* _pParent ) const
SvViewDataEntry* SvTreeListBox::GetViewDataEntry( SvTreeListEntry* pEntry ) const
{
- return (SvViewDataEntry*)SvListView::GetViewData(pEntry);
+ return const_cast<SvViewDataEntry*>(SvListView::GetViewData(pEntry));
}
SvViewDataItem* SvTreeListBox::GetViewDataItem(SvTreeListEntry* pEntry, SvLBoxItem* pItem)
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 72f2966fa0b6..1d02dc34ab09 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -2132,9 +2132,9 @@ Size Calendar::CalcWindowSizePixel( long nCalcMonthPerLine,
{
vcl::Font aTempFont = aOldFont;
ImplGetWeekFont( aTempFont );
- ((Calendar*)this)->SetFont( aTempFont );
+ const_cast<Calendar*>(this)->SetFont( aTempFont );
nWeekWidth = GetTextWidth( a99Text )+WEEKNUMBER_OFFX;
- ((Calendar*)this)->SetFont( aOldFont );
+ const_cast<Calendar*>(this)->SetFont( aOldFont );
}
else
nWeekWidth = 0;
@@ -2146,7 +2146,7 @@ Size Calendar::CalcWindowSizePixel( long nCalcMonthPerLine,
aFont.SetWeight( WEIGHT_BOLD );
else
aFont.SetWeight( WEIGHT_NORMAL );
- ((Calendar*)this)->SetFont( aFont );
+ const_cast<Calendar*>(this)->SetFont( aFont );
}
Size aSize;
@@ -2154,7 +2154,7 @@ Size Calendar::CalcWindowSizePixel( long nCalcMonthPerLine,
long nTextHeight = GetTextHeight();
if ( mnWinStyle & WB_BOLDTEXT )
- ((Calendar*)this)->SetFont( aOldFont );
+ const_cast<Calendar*>(this)->SetFont( aOldFont );
aSize.Width() += ((n99TextWidth+DAY_OFFX)*7) + nWeekWidth;
aSize.Width() += MONTH_BORDERX*2;
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 92dbaf63f64f..e0c327bc06b6 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -510,7 +510,7 @@ OUString FontList::GetFontMapText( const vcl::FontInfo& rInfo ) const
if ( !bNotSynthetic )
{
if (maMapStyleNotAvailable.isEmpty())
- ((FontList*)this)->maMapStyleNotAvailable = SVT_RESSTR(STR_SVT_FONTMAP_STYLENOTAVAILABLE);
+ const_cast<FontList*>(this)->maMapStyleNotAvailable = SVT_RESSTR(STR_SVT_FONTMAP_STYLENOTAVAILABLE);
return maMapStyleNotAvailable;
}
}
@@ -519,7 +519,7 @@ OUString FontList::GetFontMapText( const vcl::FontInfo& rInfo ) const
if ( (nType & (FONTLIST_FONTNAMETYPE_PRINTER | FONTLIST_FONTNAMETYPE_SCREEN)) == FONTLIST_FONTNAMETYPE_PRINTER )
{
if (maMapPrinterOnly.isEmpty())
- ((FontList*)this)->maMapPrinterOnly = SVT_RESSTR(STR_SVT_FONTMAP_PRINTERONLY);
+ const_cast<FontList*>(this)->maMapPrinterOnly = SVT_RESSTR(STR_SVT_FONTMAP_PRINTERONLY);
return maMapPrinterOnly;
}
// Only Screen-Font?
@@ -527,13 +527,13 @@ OUString FontList::GetFontMapText( const vcl::FontInfo& rInfo ) const
&& rInfo.GetType() == TYPE_RASTER )
{
if (maMapScreenOnly.isEmpty())
- ((FontList*)this)->maMapScreenOnly = SVT_RESSTR(STR_SVT_FONTMAP_SCREENONLY);
+ const_cast<FontList*>(this)->maMapScreenOnly = SVT_RESSTR(STR_SVT_FONTMAP_SCREENONLY);
return maMapScreenOnly;
}
else
{
if (maMapBoth.isEmpty())
- ((FontList*)this)->maMapBoth = SVT_RESSTR(STR_SVT_FONTMAP_BOTH);
+ const_cast<FontList*>(this)->maMapBoth = SVT_RESSTR(STR_SVT_FONTMAP_BOTH);
return maMapBoth;
}
}
@@ -718,8 +718,8 @@ const sal_IntPtr* FontList::GetSizeAry( const vcl::FontInfo& rInfo ) const
// first delete Size-Array
if ( mpSizeAry )
{
- delete[] ((FontList*)this)->mpSizeAry;
- ((FontList*)this)->mpSizeAry = NULL;
+ delete[] const_cast<FontList*>(this)->mpSizeAry;
+ const_cast<FontList*>(this)->mpSizeAry = NULL;
}
// use standarad sizes if no name
@@ -744,18 +744,18 @@ const sal_IntPtr* FontList::GetSizeAry( const vcl::FontInfo& rInfo ) const
sal_uInt16 i;
sal_uInt16 nRealCount = 0;
long nOldHeight = 0;
- ((FontList*)this)->mpSizeAry = new sal_IntPtr[nDevSizeCount+1];
+ const_cast<FontList*>(this)->mpSizeAry = new sal_IntPtr[nDevSizeCount+1];
for ( i = 0; i < nDevSizeCount; i++ )
{
Size aSize = pDevice->GetDevFontSize( rInfo, i );
if ( aSize.Height() != nOldHeight )
{
nOldHeight = aSize.Height();
- ((FontList*)this)->mpSizeAry[nRealCount] = nOldHeight;
+ const_cast<FontList*>(this)->mpSizeAry[nRealCount] = nOldHeight;
nRealCount++;
}
}
- ((FontList*)this)->mpSizeAry[nRealCount] = 0;
+ const_cast<FontList*>(this)->mpSizeAry[nRealCount] = 0;
pDevice->SetMapMode( aOldMapMode );
return mpSizeAry;
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index 1b43103b4e9b..d021fc900ca6 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -418,8 +418,8 @@ OUString FormattedField::GetTextValue() const
{
if (m_bValueDirty)
{
- ((FormattedField*)this)->m_sCurrentTextValue = GetText();
- ((FormattedField*)this)->m_bValueDirty = false;
+ const_cast<FormattedField*>(this)->m_sCurrentTextValue = GetText();
+ const_cast<FormattedField*>(this)->m_bValueDirty = false;
}
return m_sCurrentTextValue;
}
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 2e071de0b707..ad9345f3dd70 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -2620,7 +2620,7 @@ Size TabBar::CalcWindowSizePixel() const
if (mpImpl->mpItemList.size() > 0)
{
- ((TabBar*)this)->ImplCalcWidth();
+ const_cast<TabBar*>(this)->ImplCalcWidth();
for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
{
ImplTabBarItem* pItem = mpImpl->mpItemList[i];
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx
index d73cd740a82d..f0020618878c 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -334,7 +334,7 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry**
{
const char* pMimeType;
- switch( const_cast< Graphic* >( mpGraphic )->GetLink().GetType() )
+ switch( mpGraphic->GetLink().GetType() )
{
case( GFX_LINK_TYPE_NATIVE_GIF ): pMimeType = MIMETYPE_GIF; break;
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index d6d04fcc78c7..81eefd14759d 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -184,7 +184,7 @@ GraphicCacheEntry::GraphicCacheEntry( const GraphicObject& rObj ) :
mbSwappedAll ( true )
{
mbSwappedAll = !ImplInit( rObj );
- maGraphicObjectList.push_back( (GraphicObject*)&rObj );
+ maGraphicObjectList.push_back( const_cast<GraphicObject*>(&rObj) );
}
GraphicCacheEntry::~GraphicCacheEntry()
@@ -314,7 +314,7 @@ void GraphicCacheEntry::AddGraphicObjectReference( const GraphicObject& rObj, Gr
mbSwappedAll = !ImplInit( rObj );
ImplFillSubstitute( rSubstitute );
- maGraphicObjectList.push_back( (GraphicObject*) &rObj );
+ maGraphicObjectList.push_back( const_cast<GraphicObject*>(&rObj) );
}
bool GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj )
@@ -1053,7 +1053,7 @@ bool GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const
{
const Point aPtPixel( pOut->LogicToPixel( rPt ) );
const Size aSzPixel( pOut->LogicToPixel( rSz ) );
- const GraphicCacheEntry* pCacheEntry = ( (GraphicCache*) this )->ImplGetCacheEntry( rObj );
+ const GraphicCacheEntry* pCacheEntry = const_cast<GraphicCache*>(this)->ImplGetCacheEntry( rObj );
bool bFound = false;
if( pCacheEntry )
@@ -1072,14 +1072,14 @@ bool GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const
OString GraphicCache::GetUniqueID( const GraphicObject& rObj ) const
{
OString aRet;
- GraphicCacheEntry* pEntry = ( (GraphicCache*) this )->ImplGetCacheEntry( rObj );
+ GraphicCacheEntry* pEntry = const_cast<GraphicCache*>(this)->ImplGetCacheEntry( rObj );
// ensure that the entry is correctly initialized (it has to be read at least once)
if( pEntry && pEntry->GetID().IsEmpty() )
pEntry->TryToSwapIn();
// do another call to ImplGetCacheEntry in case of modified entry list
- pEntry = ( (GraphicCache*) this )->ImplGetCacheEntry( rObj );
+ pEntry = const_cast<GraphicCache*>(this)->ImplGetCacheEntry( rObj );
if( pEntry )
aRet = pEntry->GetID().GetIDString();
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 30758854e030..c91b6e0236b3 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -199,7 +199,7 @@ void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const OSt
mpMgr = mpGlobalMgr;
}
else
- mpMgr = (GraphicManager*) pMgr;
+ mpMgr = const_cast<GraphicManager*>(pMgr);
mpMgr->ImplRegisterObj( *this, maGraphic, pID, pCopyObj );
}
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index f82fc9fea513..55b09cc170f8 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -149,7 +149,7 @@ void GraphicManager::ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubst
assert(std::find(maObjList.begin(), maObjList.end(),
const_cast<GraphicObject*>(&rObj)) == maObjList.end());
- maObjList.push_back( (GraphicObject*)&rObj );
+ maObjList.push_back( const_cast<GraphicObject*>(&rObj) );
mpCache->AddGraphicObject( rObj, rSubstitute, pID, pCopyObj );
if( !rObj.IsSwappedOut() )
mnUsedSize += rObj.maGraphic.GetSizeBytes();
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index 836b98977238..b6d9102872a0 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -163,7 +163,7 @@ bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavo
aMemStm.SetVersion( SOFFICE_FILEFORMAT_CURRENT );
const GDIMetaFile& aMetaFile = m_pGraphic->GetGDIMetaFile();
- ((GDIMetaFile*)(&aMetaFile))->Write( aMemStm );
+ const_cast<GDIMetaFile*>(&aMetaFile)->Write( aMemStm );
uno::Any aAny;
aAny <<= uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aMemStm.GetData() ),
aMemStm.Seek( STREAM_SEEK_TO_END ) );