const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I302db31913a60a677b8dc226e48bd8f43b055a1e
This commit is contained in:
@@ -369,7 +369,7 @@ SvxMacroTableDtor* SvxHyperlinkTabPageBase::GetMacroTable()
|
|||||||
const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>(
|
const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>(
|
||||||
GetItemSet().GetItem (SID_HYPERLINK_GETLINK));
|
GetItemSet().GetItem (SID_HYPERLINK_GETLINK));
|
||||||
|
|
||||||
return ( (SvxMacroTableDtor*)pHyperlinkItem->GetMacroTbl() );
|
return const_cast<SvxMacroTableDtor*>(pHyperlinkItem->GetMacroTbl());
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to detect the current protocol that is used in rStrURL
|
// try to detect the current protocol that is used in rStrURL
|
||||||
|
@@ -230,7 +230,7 @@ IconChoiceDialog ::~IconChoiceDialog ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( pData->bOnDemand )
|
if ( pData->bOnDemand )
|
||||||
delete (SfxItemSet*)&pData->pPage->GetItemSet();
|
delete &pData->pPage->GetItemSet();
|
||||||
delete pData->pPage;
|
delete pData->pPage;
|
||||||
}
|
}
|
||||||
delete pData;
|
delete pData;
|
||||||
@@ -403,7 +403,7 @@ IMPL_LINK_NOARG(IconChoiceDialog, ResetHdl)
|
|||||||
{
|
{
|
||||||
// CSet on AIS has problems here, therefore separated
|
// CSet on AIS has problems here, therefore separated
|
||||||
const SfxItemSet* _pSet = &( pData->pPage->GetItemSet() );
|
const SfxItemSet* _pSet = &( pData->pPage->GetItemSet() );
|
||||||
pData->pPage->Reset( *(SfxItemSet*)_pSet );
|
pData->pPage->Reset( *const_cast<SfxItemSet*>(_pSet) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pData->pPage->Reset( *pSet );
|
pData->pPage->Reset( *pSet );
|
||||||
@@ -558,7 +558,7 @@ void IconChoiceDialog::ResetPageImpl ()
|
|||||||
{
|
{
|
||||||
// CSet on AIS has problems here, therefore separated
|
// CSet on AIS has problems here, therefore separated
|
||||||
const SfxItemSet* _pSet = &pData->pPage->GetItemSet();
|
const SfxItemSet* _pSet = &pData->pPage->GetItemSet();
|
||||||
pData->pPage->Reset( *(SfxItemSet*)_pSet );
|
pData->pPage->Reset( *const_cast<SfxItemSet*>(_pSet) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pData->pPage->Reset( *pSet );
|
pData->pPage->Reset( *pSet );
|
||||||
|
@@ -632,7 +632,7 @@ void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, sal_uLong nPos, bool
|
|||||||
{
|
{
|
||||||
OUString aEntry, sFileNm, sLinkNm, sTypeNm, sFilter;
|
OUString aEntry, sFileNm, sLinkNm, sTypeNm, sFilter;
|
||||||
|
|
||||||
pLinkMgr->GetDisplayNames( (SvBaseLink*)&rLink, &sTypeNm, &sFileNm, &sLinkNm, &sFilter );
|
pLinkMgr->GetDisplayNames( &rLink, &sTypeNm, &sFileNm, &sLinkNm, &sFilter );
|
||||||
|
|
||||||
// GetTab(0) gives the position of the bitmap which is automatically inserted by the TabListBox.
|
// GetTab(0) gives the position of the bitmap which is automatically inserted by the TabListBox.
|
||||||
// So the first text column's width is Tab(2)-Tab(1).
|
// So the first text column's width is Tab(2)-Tab(1).
|
||||||
|
@@ -165,7 +165,7 @@ protected :
|
|||||||
|
|
||||||
virtual void PageCreated( sal_uInt16 nId, IconChoicePage& rPage );
|
virtual void PageCreated( sal_uInt16 nId, IconChoicePage& rPage );
|
||||||
SfxItemSet* CreateInputItemSet( sal_uInt16 nId );
|
SfxItemSet* CreateInputItemSet( sal_uInt16 nId );
|
||||||
inline SfxItemSet* GetInputSetImpl() { return (SfxItemSet*)pSet; }
|
inline SfxItemSet* GetInputSetImpl() { return const_cast<SfxItemSet*>(pSet); }
|
||||||
inline IconChoicePage* GetTabPage( sal_uInt16 nPageId )
|
inline IconChoicePage* GetTabPage( sal_uInt16 nPageId )
|
||||||
{ return ( GetPageData (nPageId)->pPage?GetPageData (nPageId)->pPage:NULL); }
|
{ return ( GetPageData (nPageId)->pPage?GetPageData (nPageId)->pPage:NULL); }
|
||||||
void RefreshInputSet();
|
void RefreshInputSet();
|
||||||
|
@@ -65,8 +65,7 @@ ColorData SvxChartColorTable::getColorData( size_t _nIndex ) const
|
|||||||
return COL_BLACK;
|
return COL_BLACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetColor should be const but unfortunately isn't
|
return m_aColorEntries[ _nIndex ].GetColor().GetRGBColor();
|
||||||
return const_cast< XColorEntry & >( m_aColorEntries[ _nIndex ] ).GetColor().GetRGBColor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// mutators
|
// mutators
|
||||||
|
@@ -539,7 +539,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
|
|||||||
if ( pBgdAttr )
|
if ( pBgdAttr )
|
||||||
{
|
{
|
||||||
FillControls_Impl(*pBgdAttr, aUserData);
|
FillControls_Impl(*pBgdAttr, aUserData);
|
||||||
aBgdColor = ( (SvxBrushItem*)pBgdAttr )->GetColor();
|
aBgdColor = const_cast<SvxBrushItem*>(pBgdAttr)->GetColor();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -1610,7 +1610,7 @@ bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet )
|
|||||||
|
|
||||||
if ( !bChanged && pExampleSet &&
|
if ( !bChanged && pExampleSet &&
|
||||||
pExampleSet->GetItemState( nWhich, false, reinterpret_cast<const SfxPoolItem**>(&pItem) ) == SfxItemState::SET &&
|
pExampleSet->GetItemState( nWhich, false, reinterpret_cast<const SfxPoolItem**>(&pItem) ) == SfxItemState::SET &&
|
||||||
( (SvxColorItem*)pItem )->GetValue() != aSelectedColor )
|
pItem->GetValue() != aSelectedColor )
|
||||||
bChanged = true;
|
bChanged = true;
|
||||||
|
|
||||||
bool bModified = false;
|
bool bModified = false;
|
||||||
|
Reference in New Issue
Block a user