summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-21 14:08:19 +0200
committerNoel Grandin <noel@peralex.com>2014-10-23 12:36:14 +0200
commitd4ca0cc293e060e68237f251173d951eceb7898f (patch)
tree58e4b7a97b82b1dc4847fdcb063f09d23c0138d8 /cui
parent50a8c89f36b3b8f2d029a0bedc1ed9362807321d (diff)
loplugin: cstylecast
Change-Id: I0eaeebad6be75a1c0cccdf90955fde1a2909bdba
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/cfg.cxx32
-rw-r--r--cui/source/customize/macropg.cxx4
-rw-r--r--cui/source/dialogs/SpellDialog.cxx2
-rw-r--r--cui/source/dialogs/about.cxx10
-rw-r--r--cui/source/dialogs/cuicharmap.cxx4
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx6
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx20
-rw-r--r--cui/source/dialogs/hlinettp.cxx2
-rw-r--r--cui/source/dialogs/hltpbase.cxx30
-rw-r--r--cui/source/dialogs/hyphen.cxx4
-rw-r--r--cui/source/dialogs/pastedlg.cxx4
-rw-r--r--cui/source/dialogs/postdlg.cxx6
-rw-r--r--cui/source/dialogs/sdrcelldlg.cxx4
-rw-r--r--cui/source/dialogs/srchxtra.cxx22
-rw-r--r--cui/source/dialogs/zoom.cxx6
-rw-r--r--cui/source/inc/hltpbase.hxx2
-rw-r--r--cui/source/options/cuisrchdlg.cxx4
-rw-r--r--cui/source/options/fontsubs.cxx4
-rw-r--r--cui/source/options/optHeaderTabListbox.cxx4
-rw-r--r--cui/source/options/optfltr.cxx10
-rw-r--r--cui/source/options/optgdlg.cxx16
-rw-r--r--cui/source/options/optgenrl.cxx2
-rw-r--r--cui/source/options/optlingu.cxx54
-rw-r--r--cui/source/options/optmemory.cxx2
-rw-r--r--cui/source/options/optsave.cxx30
-rw-r--r--cui/source/options/treeopt.cxx22
-rw-r--r--cui/source/options/webconninfo.cxx8
-rw-r--r--cui/source/tabpages/autocdlg.cxx34
-rw-r--r--cui/source/tabpages/backgrnd.cxx36
-rw-r--r--cui/source/tabpages/border.cxx30
-rw-r--r--cui/source/tabpages/chardlg.cxx150
-rw-r--r--cui/source/tabpages/connect.cxx20
-rw-r--r--cui/source/tabpages/grfpage.cxx22
-rw-r--r--cui/source/tabpages/labdlg.cxx28
-rw-r--r--cui/source/tabpages/macroass.cxx19
-rw-r--r--cui/source/tabpages/measure.cxx38
-rw-r--r--cui/source/tabpages/numfmt.cxx30
-rw-r--r--cui/source/tabpages/numpages.cxx78
-rw-r--r--cui/source/tabpages/page.cxx115
-rw-r--r--cui/source/tabpages/paragrph.cxx92
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx4
-rw-r--r--cui/source/tabpages/tabarea.cxx116
-rw-r--r--cui/source/tabpages/tabline.cxx68
-rw-r--r--cui/source/tabpages/tabstpge.cxx18
-rw-r--r--cui/source/tabpages/textanim.cxx18
-rw-r--r--cui/source/tabpages/textattr.cxx28
-rw-r--r--cui/source/tabpages/tparea.cxx122
-rw-r--r--cui/source/tabpages/tpbitmap.cxx10
-rw-r--r--cui/source/tabpages/tpcolor.cxx14
-rw-r--r--cui/source/tabpages/tpgradnt.cxx10
-rw-r--r--cui/source/tabpages/tphatch.cxx18
-rw-r--r--cui/source/tabpages/tpline.cxx74
-rw-r--r--cui/source/tabpages/tplnedef.cxx8
-rw-r--r--cui/source/tabpages/tplneend.cxx6
-rw-r--r--cui/source/tabpages/tpshadow.cxx44
-rw-r--r--cui/source/tabpages/transfrm.cxx26
56 files changed, 795 insertions, 795 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index d68ec26f904a..6c2b3ff30945 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -800,7 +800,7 @@ SvxConfigDialog::SvxConfigDialog(vcl::Window * pParent, const SfxItemSet* pInSet
if ( pItem )
{
- OUString text = ((const SfxStringItem*)pItem)->GetValue();
+ OUString text = static_cast<const SfxStringItem*>(pItem)->GetValue();
if (text.startsWith( ITEM_TOOLBAR_URL ) )
{
@@ -2908,7 +2908,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSe
if ( pItem )
{
- OUString text = ((const SfxStringItem*)pItem)->GetValue();
+ OUString text = static_cast<const SfxStringItem*>(pItem)->GetValue();
if (text.startsWith( ITEM_TOOLBAR_URL ))
{
m_aURLToSelect = text.copy( 0 );
@@ -2938,7 +2938,7 @@ SvxToolbarConfigPage::~SvxToolbarConfigPage()
void SvxToolbarConfigPage::DeleteSelectedTopLevel()
{
sal_uInt16 nSelectionPos = m_pTopLevelListBox->GetSelectEntryPos();
- ToolbarSaveInData* pSaveInData = (ToolbarSaveInData*) GetSaveInData();
+ ToolbarSaveInData* pSaveInData = static_cast<ToolbarSaveInData*>( GetSaveInData() );
pSaveInData->RemoveToolbar( GetTopLevelSelection() );
if ( m_pTopLevelListBox->GetEntryCount() > 1 )
@@ -2986,7 +2986,7 @@ bool SvxToolbarConfigPage::DeleteSelectedContent()
// delete data for toolbar entry
delete pEntry;
- (( ToolbarSaveInData* ) GetSaveInData())->ApplyToolbar( pToolbar );
+ static_cast<ToolbarSaveInData*>(GetSaveInData())->ApplyToolbar( pToolbar );
UpdateButtonStates();
// if this is the last entry in the toolbar and it is a user
@@ -3023,7 +3023,7 @@ void SvxToolbarConfigPage::MoveEntry( bool bMoveUp )
// Apply change to currently selected toolbar
SvxConfigEntry* pToolbar = GetTopLevelSelection();
if ( pToolbar )
- ((ToolbarSaveInData*)GetSaveInData())->ApplyToolbar( pToolbar );
+ static_cast<ToolbarSaveInData*>(GetSaveInData())->ApplyToolbar( pToolbar );
else
{
SAL_WARN( "cui.customize", "SvxToolbarConfigPage::MoveEntry(): no entry" );
@@ -3038,7 +3038,7 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
SvxConfigEntry* pToolbar =
(SvxConfigEntry*)m_pTopLevelListBox->GetEntryData( nSelectionPos );
- ToolbarSaveInData* pSaveInData = (ToolbarSaveInData*) GetSaveInData();
+ ToolbarSaveInData* pSaveInData = static_cast<ToolbarSaveInData*>( GetSaveInData() );
switch( pButton->GetCurItemId() )
{
@@ -3081,7 +3081,7 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
if ( qbox.Execute() == RET_YES )
{
ToolbarSaveInData* pSaveInData_ =
- (ToolbarSaveInData*) GetSaveInData();
+ static_cast<ToolbarSaveInData*>(GetSaveInData());
pSaveInData_->RestoreToolbar( pToolbar );
@@ -3172,7 +3172,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
}
ToolbarSaveInData* pSaveInData =
- (ToolbarSaveInData*) GetSaveInData();
+ static_cast<ToolbarSaveInData*>( GetSaveInData() );
OUString aSystemName =
pSaveInData->GetSystemUIName( pEntry->GetCommand() );
@@ -3392,7 +3392,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
if ( bNeedsApply )
{
- (( ToolbarSaveInData* ) GetSaveInData())->ApplyToolbar( pToolbar );
+ static_cast<ToolbarSaveInData*>( GetSaveInData())->ApplyToolbar( pToolbar );
UpdateButtonStates();
}
@@ -3504,7 +3504,7 @@ void ToolbarSaveInData::SetSystemStyle(
if ( window != NULL && window->GetType() == WINDOW_TOOLBOX )
{
- ToolBox* toolbox = (ToolBox*)window;
+ ToolBox* toolbox = static_cast<ToolBox*>(window);
if ( nStyle == 0 )
{
@@ -4509,7 +4509,7 @@ SvTreeListEntry* SvxToolbarConfigPage::AddFunction(
if ( pToolbar != NULL )
{
- ( ( ToolbarSaveInData* ) GetSaveInData() )->ApplyToolbar( pToolbar );
+ static_cast<ToolbarSaveInData*>( GetSaveInData() )->ApplyToolbar( pToolbar );
}
return pNewLBEntry;
@@ -4612,8 +4612,8 @@ void SvxToolbarEntriesListBox::ChangeVisibility( SvTreeListEntry* pEntry )
SvxConfigEntry* pToolbar = pPage->GetTopLevelSelection();
- ToolbarSaveInData* pToolbarSaveInData = ( ToolbarSaveInData* )
- pPage->GetSaveInData();
+ ToolbarSaveInData* pToolbarSaveInData = static_cast<ToolbarSaveInData*>(
+ pPage->GetSaveInData() );
pToolbarSaveInData->ApplyToolbar( pToolbar );
@@ -4656,7 +4656,7 @@ TriState SvxToolbarEntriesListBox::NotifyMoving(
if ( pToolbar != NULL )
{
ToolbarSaveInData* pSaveInData =
- ( ToolbarSaveInData*) pPage->GetSaveInData();
+ static_cast<ToolbarSaveInData*>( pPage->GetSaveInData() );
pSaveInData->ApplyToolbar( pToolbar );
}
}
@@ -4677,14 +4677,14 @@ TriState SvxToolbarEntriesListBox::NotifyCopying(
if ( !m_bIsInternalDrag )
{
// if the target is NULL then add function to the start of the list
- ((SvxToolbarConfigPage*)pPage)->AddFunction( pTarget, pTarget == NULL );
+ static_cast<SvxToolbarConfigPage*>(pPage)->AddFunction( pTarget, pTarget == NULL );
// Instant Apply changes to UI
SvxConfigEntry* pToolbar = pPage->GetTopLevelSelection();
if ( pToolbar != NULL )
{
ToolbarSaveInData* pSaveInData =
- ( ToolbarSaveInData*) pPage->GetSaveInData();
+ static_cast<ToolbarSaveInData*>( pPage->GetSaveInData() );
pSaveInData->ApplyToolbar( pToolbar );
}
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 336277272d07..1ac54fe04dcc 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -62,7 +62,7 @@ _SvxMacroTabPage_Impl::_SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet )
{
const SfxPoolItem* pItem;
if ( SfxItemState::SET == rAttrSet.GetItemState( SID_ATTR_MACROITEM, false, &pItem ) )
- bIDEDialogMode = ((const SfxBoolItem*)pItem)->GetValue();
+ bIDEDialogMode = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
// attention, this array is indexed directly (0, 1, ...) in the code
@@ -203,7 +203,7 @@ void _SvxMacroTabPage::EnableButtons()
const SvTreeListEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected();
if ( pE )
{
- SvLBoxString* pEventMacro = (SvLBoxString*)pE->GetItem( LB_MACROS_ITEMPOS );
+ const SvLBoxString* pEventMacro = static_cast<const SvLBoxString*>(pE->GetItem( LB_MACROS_ITEMPOS ));
mpImpl->pDeletePB->Enable( 0 != pEventMacro && !mpImpl->bReadOnly );
mpImpl->pAssignPB->Enable( !mpImpl->bReadOnly );
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 0254f1df6163..cb064d60a986 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -499,7 +499,7 @@ void SpellDialog::StartSpellOptDlg_Impl()
boost::scoped_ptr<SfxSingleTabDialog> pDlg(
new SfxSingleTabDialog(this, aSet, "SpellOptionsDialog", "cui/ui/spelloptionsdialog.ui"));
SfxTabPage* pPage = SvxLinguTabPage::Create( pDlg->get_content_area(), &aSet );
- ( (SvxLinguTabPage*)pPage )->HideGroups( GROUP_MODULES );
+ static_cast<SvxLinguTabPage*>(pPage)->HideGroups( GROUP_MODULES );
pDlg->SetTabPage( pPage );
if(RET_OK == pDlg->Execute())
{
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 5ad2e66520f2..0846bd369959 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -88,8 +88,8 @@ AboutDialog::AboutDialog(vcl::Window* pParent)
SetLogo();
// Allow the button to be identifiable once they are clicked
- m_pCreditsButton->SetData( (void*)CREDITS_BUTTON );
- m_pWebsiteButton->SetData( (void*)WEBSITE_BUTTON );
+ m_pCreditsButton->SetData( reinterpret_cast<void*>(CREDITS_BUTTON) );
+ m_pWebsiteButton->SetData( reinterpret_cast<void*>(WEBSITE_BUTTON) );
// Connect all handlers
m_pCreditsButton->SetClickHdl( LINK( this, AboutDialog, HandleClick ) );
@@ -103,10 +103,10 @@ IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton )
OUString sURL = "";
// Find which button was pressed and from this, get the URL to be opened
- AboutDialogButton* pDialogButton = (AboutDialogButton*)pButton->GetData();
- if ( pDialogButton == (AboutDialogButton*)CREDITS_BUTTON )
+ AboutDialogButton aDialogButton = static_cast<AboutDialogButton>(reinterpret_cast<sal_Int64>(pButton->GetData()));
+ if ( aDialogButton == CREDITS_BUTTON )
sURL = m_aCreditsLinkStr;
- else if ( pDialogButton == (AboutDialogButton*)WEBSITE_BUTTON )
+ else if ( aDialogButton == WEBSITE_BUTTON )
{
sURL = officecfg::Office::Common::Help::StartCenter::InfoURL::get();
localizeWebserviceURI(sURL);
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 94898e692528..9c7ab5b9e2e2 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -327,7 +327,7 @@ void SvxCharacterMap::init()
{
aLastName = aFontName;
sal_uInt16 nPos = m_pFontLB->InsertEntry( aFontName );
- m_pFontLB->SetEntryData( nPos, (void*)(sal_uLong)i );
+ m_pFontLB->SetEntryData( nPos, reinterpret_cast<void*>(i) );
}
}
// the font may not be in the list =>
@@ -423,7 +423,7 @@ void SvxCharacterMap::fillAllSubsets(ListBox &rListBox)
IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl)
{
sal_uInt16 nPos = m_pFontLB->GetSelectEntryPos(),
- nFont = (sal_uInt16)(sal_uLong)m_pFontLB->GetEntryData( nPos );
+ nFont = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFontLB->GetEntryData( nPos ));
aFont = GetDevFont( nFont );
aFont.SetWeight( WEIGHT_DONTKNOW );
aFont.SetItalic( ITALIC_NONE );
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index eb811fee61fe..4a1193fe2a76 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -363,7 +363,7 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl)
if (maTakeThread.is())
maTakeThread->join();
- TPGalleryThemeProperties* mpBrowser = (TPGalleryThemeProperties*) GetParent();
+ TPGalleryThemeProperties* mpBrowser = static_cast<TPGalleryThemeProperties*>( GetParent() );
::std::vector<bool, std::allocator<bool> > aRemoveEntries( mpBrowser->aFoundList.size(), false );
::std::vector< OUString > aRemainingVector;
sal_uInt32 i, nCount;
@@ -602,9 +602,9 @@ GalleryThemeProperties::GalleryThemeProperties(vcl::Window* pParent,
void GalleryThemeProperties::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if (nId == m_nGeneralPageId)
- ( (TPGalleryThemeGeneral&) rPage ).SetXChgData( pData );
+ static_cast<TPGalleryThemeGeneral&>( rPage ).SetXChgData( pData );
else
- ( (TPGalleryThemeProperties&) rPage ).SetXChgData( pData );
+ static_cast<TPGalleryThemeProperties&>( rPage ).SetXChgData( pData );
}
// - TPGalleryThemeGeneral -
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index c355fe0f5cfa..f9888f35be53 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -51,12 +51,12 @@ void SvxHlinkCtrl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
{
case SID_HYPERLINK_GETLINK :
{
- pParent->SetPage ( (SvxHyperlinkItem*)pState);
+ pParent->SetPage( const_cast<SvxHyperlinkItem*>(static_cast<const SvxHyperlinkItem*>(pState)) );
}
break;
case SID_READONLY_MODE :
{
- pParent->SetReadOnlyMode( ( (SfxBoolItem*)pState)->GetValue() );
+ pParent->SetReadOnlyMode( static_cast<const SfxBoolItem*>(pState)->GetValue() );
}
break;
}
@@ -183,21 +183,21 @@ void SvxHpLinkDlg::Apply()
SfxItemSet aItemSet( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
SID_HYPERLINK_SETLINK );
- SvxHyperlinkTabPageBase* pCurrentPage = (SvxHyperlinkTabPageBase*)
- GetTabPage ( GetCurPageId() );
+ SvxHyperlinkTabPageBase* pCurrentPage = static_cast<SvxHyperlinkTabPageBase*>(
+ GetTabPage( GetCurPageId() ) );
if ( pCurrentPage->AskApply() )
{
pCurrentPage->FillItemSet( &aItemSet );
- SvxHyperlinkItem *aItem = (SvxHyperlinkItem *)
- aItemSet.GetItem (SID_HYPERLINK_SETLINK);
+ const SvxHyperlinkItem *aItem = static_cast<const SvxHyperlinkItem *>(
+ aItemSet.GetItem (SID_HYPERLINK_SETLINK));
OUString aStrEmpty;
if ( aItem->GetURL() != aStrEmpty )
GetDispatcher()->Execute( SID_HYPERLINK_SETLINK, SfxCallMode::ASYNCHRON |
SfxCallMode::RECORD, aItem, 0L);
- ( (SvxHyperlinkTabPageBase*)GetTabPage ( GetCurPageId() ) )->DoApply();
+ static_cast<SvxHyperlinkTabPageBase*>( GetTabPage( GetCurPageId() ) )->DoApply();
}
}
@@ -210,8 +210,8 @@ void SvxHpLinkDlg::Apply()
void SvxHpLinkDlg::Move()
{
- SvxHyperlinkTabPageBase* pCurrentPage = ( SvxHyperlinkTabPageBase* )
- GetTabPage ( GetCurPageId() );
+ SvxHyperlinkTabPageBase* pCurrentPage = static_cast<SvxHyperlinkTabPageBase*>(
+ GetTabPage ( GetCurPageId() ) );
if( pCurrentPage->IsMarkWndVisible () )
{
@@ -331,7 +331,7 @@ sal_uInt16 SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem )
ShowPage (nPageId);
- SvxHyperlinkTabPageBase* pCurrentPage = (SvxHyperlinkTabPageBase*)GetTabPage( nPageId );
+ SvxHyperlinkTabPageBase* pCurrentPage = static_cast<SvxHyperlinkTabPageBase*>(GetTabPage( nPageId ));
mbIsHTMLDoc = (pItem->GetInsertMode() & HLINK_HTMLMODE) ? true : false;
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 8f51b8fab196..3b14b9402483 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -401,7 +401,7 @@ IMPL_LINK_NOARG(SvxHyperlinkInternetTp, ClickBrowseHdl_Impl)
SfxBoolItem aBrowse( SID_BROWSE, true );
const SfxPoolItem *ppItems[] = { &aName, &aNewView, &aSilent, &aReadOnly, &aRefererItem, &aBrowse, NULL };
- (((SvxHpLinkDlg*)mpDialog)->GetBindings())->Execute( SID_OPENDOC, ppItems, 0, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
+ static_cast<SvxHpLinkDlg*>(mpDialog)->GetBindings()->Execute( SID_OPENDOC, ppItems, 0, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
return( 0L );
}
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 369f4ee7b8ba..945c7b532b65 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -217,7 +217,7 @@ void SvxHyperlinkTabPageBase::ShowMarkWnd ()
}
// Fill Dialogfields
-void SvxHyperlinkTabPageBase::FillStandardDlgFields ( SvxHyperlinkItem* pHyperlinkItem )
+void SvxHyperlinkTabPageBase::FillStandardDlgFields ( const SvxHyperlinkItem* pHyperlinkItem )
{
// Frame
sal_Int32 nPos = mpCbbFrame->GetEntryPos ( pHyperlinkItem->GetTargetFrame() );
@@ -283,20 +283,20 @@ void SvxHyperlinkTabPageBase::SetInitFocus()
// Ask dialog whether the curretn doc is a HTML-doc
bool SvxHyperlinkTabPageBase::IsHTMLDoc() const
{
- return ((SvxHpLinkDlg*)mpDialog)->IsHTMLDoc();
+ return static_cast<SvxHpLinkDlg*>(mpDialog)->IsHTMLDoc();
}
// retrieve dispatcher
SfxDispatcher* SvxHyperlinkTabPageBase::GetDispatcher() const
{
- return ((SvxHpLinkDlg*)mpDialog)->GetDispatcher();
+ return static_cast<SvxHpLinkDlg*>(mpDialog)->GetDispatcher();
}
// Click on imagebutton : Script
IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
{
- SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *)
- GetItemSet().GetItem (SID_HYPERLINK_GETLINK);
+ SvxHyperlinkItem *pHyperlinkItem = const_cast<SvxHyperlinkItem*>(static_cast<const SvxHyperlinkItem *>(
+ GetItemSet().GetItem (SID_HYPERLINK_GETLINK)));
if ( pHyperlinkItem->GetMacroEvents() )
{
@@ -322,7 +322,7 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
SfxMacroAssignDlg aDlg( this, mxDocumentFrame, *pItemSet );
// add events
- SfxMacroTabPage *pMacroPage = (SfxMacroTabPage*) aDlg.GetTabPage();
+ SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg.GetTabPage() );
if ( pHyperlinkItem->GetMacroEvents() & HYPERDLG_EVENT_MOUSEOVER_OBJECT )
pMacroPage->AddEvent( OUString( CUI_RESSTR(RID_SVXSTR_HYPDLG_MACROACT1) ),
@@ -346,7 +346,7 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
const SfxPoolItem* pItem;
if( SfxItemState::SET == pOutSet->GetItemState( SID_ATTR_MACROITEM, false, &pItem ))
{
- pHyperlinkItem->SetMacroTable( ((SvxMacroItem*)pItem)->GetMacroTable() );
+ pHyperlinkItem->SetMacroTable( static_cast<const SvxMacroItem*>(pItem)->GetMacroTable() );
}
}
delete pItemSet;
@@ -358,16 +358,16 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
// Get Macro-Infos
sal_uInt16 SvxHyperlinkTabPageBase::GetMacroEvents()
{
- SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *)
- GetItemSet().GetItem (SID_HYPERLINK_GETLINK);
+ const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>(
+ GetItemSet().GetItem (SID_HYPERLINK_GETLINK));
return pHyperlinkItem->GetMacroEvents();
}
SvxMacroTableDtor* SvxHyperlinkTabPageBase::GetMacroTable()
{
- SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *)
- GetItemSet().GetItem (SID_HYPERLINK_GETLINK);
+ const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>(
+ GetItemSet().GetItem (SID_HYPERLINK_GETLINK));
return ( (SvxMacroTableDtor*)pHyperlinkItem->GetMacroTbl() );
}
@@ -431,8 +431,8 @@ void SvxHyperlinkTabPageBase::Reset( const SfxItemSet& rItemSet)
// Set dialog-fields from create-itemset
maStrInitURL = aEmptyStr;
- SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *)
- rItemSet.GetItem (SID_HYPERLINK_GETLINK);
+ const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>(
+ rItemSet.GetItem (SID_HYPERLINK_GETLINK));
if ( pHyperlinkItem )
{
@@ -500,8 +500,8 @@ void SvxHyperlinkTabPageBase::ActivatePage( const SfxItemSet& rItemSet )
{
// Set dialog-fields from input-itemset
- SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *)
- rItemSet.GetItem (SID_HYPERLINK_GETLINK);
+ const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>(
+ rItemSet.GetItem (SID_HYPERLINK_GETLINK));
if ( pHyperlinkItem )
{
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index 4fd8aab64a4e..c6c7bb19b71c 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -53,11 +53,11 @@ void HyphenEdit::KeyInput( const KeyEvent& rKEvt )
switch ( nCode )
{
case KEY_LEFT:
- ( (SvxHyphenWordDialog*)GetParentDialog() )->SelLeft();
+ static_cast<SvxHyphenWordDialog*>( GetParentDialog() )->SelLeft();
break;
case KEY_RIGHT:
- ( (SvxHyphenWordDialog*)GetParentDialog() )->SelRight();
+ static_cast<SvxHyphenWordDialog*>( GetParentDialog() )->SelRight();
break;
case KEY_TAB:
diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx
index d8bff176376c..17468a7779e5 100644
--- a/cui/source/dialogs/pastedlg.cxx
+++ b/cui/source/dialogs/pastedlg.cxx
@@ -162,7 +162,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
if( LISTBOX_ENTRY_NOTFOUND == ObjectLB().GetEntryPos( aName ) )
ObjectLB().SetEntryData(
- ObjectLB().InsertEntry( aName ), (void*) nFormat );
+ ObjectLB().InsertEntry( aName ), reinterpret_cast<void*>(nFormat) );
}
}
@@ -199,7 +199,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
if( Dialog::Execute() == RET_OK )
{
- nSelFormat = (sal_uLong)ObjectLB().GetEntryData( ObjectLB().GetSelectEntryPos() );
+ nSelFormat = reinterpret_cast<sal_uLong>(ObjectLB().GetEntryData( ObjectLB().GetSelectEntryPos() ));
}
return nSelFormat;
diff --git a/cui/source/dialogs/postdlg.cxx b/cui/source/dialogs/postdlg.cxx
index 67eb4ca287eb..b740fd9e91bb 100644
--- a/cui/source/dialogs/postdlg.cxx
+++ b/cui/source/dialogs/postdlg.cxx
@@ -77,7 +77,7 @@ SvxPostItDialog::SvxPostItDialog(vcl::Window* pParent, const SfxItemSet& rCoreSe
{
bNew = false;
const SvxPostItAuthorItem& rAuthor =
- (const SvxPostItAuthorItem&)rSet.Get( nWhich );
+ static_cast<const SvxPostItAuthorItem&>(rSet.Get( nWhich ));
aAuthorStr = rAuthor.GetValue();
}
else
@@ -88,7 +88,7 @@ SvxPostItDialog::SvxPostItDialog(vcl::Window* pParent, const SfxItemSet& rCoreSe
if ( rSet.GetItemState( nWhich, true ) >= SfxItemState::DEFAULT )
{
const SvxPostItDateItem& rDate =
- (const SvxPostItDateItem&)rSet.Get( nWhich );
+ static_cast<const SvxPostItDateItem&>(rSet.Get( nWhich ));
aDateStr = rDate.GetValue();
}
else
@@ -103,7 +103,7 @@ SvxPostItDialog::SvxPostItDialog(vcl::Window* pParent, const SfxItemSet& rCoreSe
if ( rSet.GetItemState( nWhich, true ) >= SfxItemState::DEFAULT )
{
const SvxPostItTextItem& rText =
- (const SvxPostItTextItem&)rSet.Get( nWhich );
+ static_cast<const SvxPostItTextItem&>(rSet.Get( nWhich ));
aTextStr = rText.GetValue();
}
diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx
index b8848e54f129..48d4e446ff2f 100644
--- a/cui/source/dialogs/sdrcelldlg.cxx
+++ b/cui/source/dialogs/sdrcelldlg.cxx
@@ -46,7 +46,7 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if (nId == m_nAreaPageId)
{
- SvxAreaTabPage& rAreaPage = ((SvxAreaTabPage&)rPage);
+ SvxAreaTabPage& rAreaPage = static_cast<SvxAreaTabPage&>(rPage);
rAreaPage.SetColorList( mpColorTab );
rAreaPage.SetGradientList( mpGradientList );
rAreaPage.SetHatchingList( mpHatchingList );
@@ -59,7 +59,7 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
}
else if (nId == m_nBorderPageId)
{
- SvxBorderTabPage& rBorderPage = ((SvxBorderTabPage&)rPage);
+ SvxBorderTabPage& rBorderPage = static_cast<SvxBorderTabPage&>(rPage);
rBorderPage.SetTableMode();
}
else
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index fe23c29bf210..39fbcd2cc99a 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -76,8 +76,8 @@ void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
if ( pSh )
{
- const SvxFontListItem* pFLItem = (const SvxFontListItem*)
- pSh->GetItem( SID_ATTR_CHAR_FONTLIST );
+ const SvxFontListItem* pFLItem = static_cast<const SvxFontListItem*>(
+ pSh->GetItem( SID_ATTR_CHAR_FONTLIST ));
if ( pFLItem )
pApm_pFontList = pFLItem->GetFontList();
}
@@ -92,21 +92,21 @@ void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
}
if ( pList )
- ( (SvxCharNamePage&)rPage ).
+ static_cast<SvxCharNamePage&>(rPage).
SetFontList( SvxFontListItem( pList, SID_ATTR_CHAR_FONTLIST ) );
- ( (SvxCharNamePage&)rPage ).EnableSearchMode();
+ static_cast<SvxCharNamePage&>(rPage).EnableSearchMode();
}
else if (nId == m_nParaStdPageId)
{
- ( (SvxStdParagraphTabPage&)rPage ).EnableAutoFirstLine();
+ static_cast<SvxStdParagraphTabPage&>(rPage).EnableAutoFirstLine();
}
else if (nId == m_nParaAlignPageId)
{
- ( (SvxParaAlignTabPage&)rPage ).EnableJustifyExt();
+ static_cast<SvxParaAlignTabPage&>(rPage).EnableJustifyExt();
}
else if (nId == m_nBackPageId)
{
- ( (SvxBackgroundTabPage&)rPage ).ShowParaControl(true);
+ static_cast<SvxBackgroundTabPage&>(rPage).ShowParaControl(true);
}
}
@@ -161,7 +161,7 @@ SvxSearchAttributeDialog::SvxSearchAttributeDialog(vcl::Window* pParent,
if ( pEntry )
{
m_pAttrLB->SetCheckButtonState( pEntry, bChecked ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
- pEntry->SetUserData( (void*)(sal_uLong)nSlot );
+ pEntry->SetUserData( reinterpret_cast<void*>(nSlot) );
}
}
nWhich = aIter.NextWhich();
@@ -176,11 +176,11 @@ SvxSearchAttributeDialog::SvxSearchAttributeDialog(vcl::Window* pParent,
IMPL_LINK_NOARG(SvxSearchAttributeDialog, OKHdl)
{
SearchAttrItem aInvalidItem;
- aInvalidItem.pItem = (SfxPoolItem*)-1;
+ aInvalidItem.pItem = reinterpret_cast<SfxPoolItem*>(-1);
for ( sal_uInt16 i = 0; i < m_pAttrLB->GetEntryCount(); ++i )
{
- sal_uInt16 nSlot = (sal_uInt16)(sal_uLong)m_pAttrLB->GetEntryData(i);
+ sal_uInt16 nSlot = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pAttrLB->GetEntryData(i));
bool bChecked = m_pAttrLB->IsChecked(i);
sal_uInt16 j;
@@ -193,7 +193,7 @@ IMPL_LINK_NOARG(SvxSearchAttributeDialog, OKHdl)
{
if( !IsInvalidItem( rItem.pItem ) )
delete rItem.pItem;
- rItem.pItem = (SfxPoolItem*)-1;
+ rItem.pItem = reinterpret_cast<SfxPoolItem*>(-1);
}
else if( IsInvalidItem( rItem.pItem ) )
rItem.pItem = 0;
diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index e4a5040084d8..1c57ad68b1e9 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -177,7 +177,7 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
SfxObjectShell* pSh = SfxObjectShell::Current();
if ( pSh )
- pOldUserItem = (const SfxUInt16Item*)pSh->GetItem( SID_ATTR_ZOOM_USER );
+ pOldUserItem = static_cast<const SfxUInt16Item*>(pSh->GetItem( SID_ATTR_ZOOM_USER ));
if ( pOldUserItem )
nValue = pOldUserItem->GetValue();
@@ -202,7 +202,7 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
if ( rItem.ISA(SvxZoomItem) )
{
- const SvxZoomItem& rZoomItem = (const SvxZoomItem&)rItem;
+ const SvxZoomItem& rZoomItem = static_cast<const SvxZoomItem&>(rItem);
const sal_uInt16 nZoom = rZoomItem.GetValue();
const SvxZoomType eType = rZoomItem.GetType();
const sal_uInt16 nValSet = rZoomItem.GetValueSet();
@@ -237,7 +237,7 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
}
else
{
- const sal_uInt16 nZoom = ( (const SfxUInt16Item&)rItem ).GetValue();
+ const sal_uInt16 nZoom = static_cast<const SfxUInt16Item&>(rItem).GetValue();
SetFactor( nZoom );
}
diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx
index 02e42c5e7e71..d2c229db98c7 100644
--- a/cui/source/inc/hltpbase.hxx
+++ b/cui/source/inc/hltpbase.hxx
@@ -90,7 +90,7 @@ protected:
SvxHlinkDlgMarkWnd* mpMarkWnd;
void InitStdControls ();
- virtual void FillStandardDlgFields ( SvxHyperlinkItem* pHyperlinkItem );
+ virtual void FillStandardDlgFields ( const SvxHyperlinkItem* pHyperlinkItem );
virtual void FillDlgFields(const OUString& rStrURL) = 0;
virtual void GetCurentItemData ( OUString& rStrURL, OUString& aStrName,
OUString& aStrIntName, OUString& aStrFrame,
diff --git a/cui/source/options/cuisrchdlg.cxx b/cui/source/options/cuisrchdlg.cxx
index ef45114ddc09..a7041604683b 100644
--- a/cui/source/options/cuisrchdlg.cxx
+++ b/cui/source/options/cuisrchdlg.cxx
@@ -54,8 +54,8 @@ SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(vcl::Window *pParent,
{
// pPage will be implicitly destroyed by the
// SfxSingleTabDialog destructor
- pPage = (SvxJSearchOptionsPage *)
- SvxJSearchOptionsPage::Create(get_content_area(), &rOptionsSet );
+ pPage = static_cast<SvxJSearchOptionsPage *>(
+ SvxJSearchOptionsPage::Create(get_content_area(), &rOptionsSet ));
SetTabPage( pPage ); //! implicitly calls pPage->Reset(...)!
pPage->EnableSaveOptions(false);
}
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index 4668b48f1508..e3fb38ab8de6 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -485,7 +485,7 @@ bool SvxFontSubstCheckListBox::IsChecked(SvTreeListEntry* pEntry, sal_uInt16 nCo
void SvxFontSubstCheckListBox::SetCheckButtonState( SvTreeListEntry* pEntry, sal_uInt16 nCol, SvButtonState eState)
{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem(nCol + 1));
DBG_ASSERT(pItem,"SetCheckButton:Item not found");
if (pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
@@ -511,7 +511,7 @@ void SvxFontSubstCheckListBox::SetCheckButtonState( SvTreeListEntry* pEntry, sal
SvButtonState SvxFontSubstCheckListBox::GetCheckButtonState( SvTreeListEntry* pEntry, sal_uInt16 nCol ) const
{
SvButtonState eState = SV_BUTTON_UNCHECKED;
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem(nCol + 1));
DBG_ASSERT(pItem,"GetChButnState:Item not found");
if (pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
diff --git a/cui/source/options/optHeaderTabListbox.cxx b/cui/source/options/optHeaderTabListbox.cxx
index 67de02cc84bc..48a5299b96a6 100644
--- a/cui/source/options/optHeaderTabListbox.cxx
+++ b/cui/source/options/optHeaderTabListbox.cxx
@@ -46,7 +46,7 @@ void OptLBoxString_Impl::Paint(
vcl::Font aOldFont( rDev.GetFont() );
vcl::Font aFont( aOldFont );
//detect readonly state by asking for a valid Image
- if(pEntry && !(!((OptHeaderTabListBox&)rDev).GetCollapsedEntryBmp(pEntry)))
+ if(pEntry && !(!static_cast<OptHeaderTabListBox&>(rDev).GetCollapsedEntryBmp(pEntry)))
aFont.SetColor( Application::GetSettings().GetStyleSettings().GetDeactiveTextColor() );
rDev.SetFont( aFont );
rDev.DrawText( rPos, GetText() );
@@ -70,7 +70,7 @@ void OptHeaderTabListBox::InitEntry( SvTreeListEntry* pEntry, const OUString& rT
for ( sal_uInt16 nCol = 1; nCol < _nTabCount; ++nCol )
{
// initialize all columns with own class (column 0 == Bitmap)
- SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nCol );
+ SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nCol ));
OptLBoxString_Impl* pStr = new OptLBoxString_Impl( pEntry, 0, pCol->GetText() );
pEntry->ReplaceItem( pStr, nCol );
}
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 7170a7cfd926..d3e7f5727256 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -207,7 +207,7 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
SvTreeListEntry* pEntry = GetEntry4Type( pArr->eType );
if( pEntry )
{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem( nCol ));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem( nCol ));
if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
{
sal_uInt16 nButtonFlags = pItem->GetButtonFlags();
@@ -267,7 +267,7 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
SvTreeListEntry* pEntry = GetEntry4Type( static_cast< sal_IntPtr >( pArr->eType ) );
if( pEntry )
{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem( nCol ));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem( nCol ));
if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
{
if( (rOpt.*pArr->FnIs)() )
@@ -303,7 +303,7 @@ void OfaMSFilterTabPage2::InsertEntry( const OUString& _rTxt, sal_IntPtr _nType,
0, pCheckButtonData ) );
pEntry->AddItem( new SvLBoxString( pEntry, 0, _rTxt ) );
- pEntry->SetUserData( (void*)_nType );
+ pEntry->SetUserData( reinterpret_cast<void*>(_nType) );
m_pCheckLB->Insert( pEntry );
}
@@ -346,7 +346,7 @@ void OfaMSFilterTabPage2::MSFltrSimpleTable::HBarClick()
void OfaMSFilterTabPage2::MSFltrSimpleTable::SetCheckButtonState(
SvTreeListEntry* pEntry, sal_uInt16 nCol, SvButtonState eState)
{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem(nCol + 1));
DBG_ASSERT(pItem,"SetCheckButton:Item not found");
if (pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
@@ -373,7 +373,7 @@ SvButtonState OfaMSFilterTabPage2::MSFltrSimpleTable::GetCheckButtonState(
SvTreeListEntry* pEntry, sal_uInt16 nCol ) const
{
SvButtonState eState = SV_BUTTON_UNCHECKED;
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem(nCol + 1));
DBG_ASSERT(pItem,"GetChButnState:Item not found");
if (pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index ef1ae9661187..5d0a32eef05f 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -331,7 +331,7 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet )
const SfxPoolItem* pItem = NULL;
if ( SfxItemState::SET == rSet->GetItemState( SID_ATTR_YEAR2000, false, &pItem ) )
{
- m_pYearValueField->SetValue( ((SfxUInt16Item*)pItem)->GetValue() );
+ m_pYearValueField->SetValue( static_cast<const SfxUInt16Item*>(pItem)->GetValue() );
TwoFigureConfigHdl(m_pYearValueField);
}
else
@@ -1072,7 +1072,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet&
//sal_uInt16 p = m_pUserInterfaceLB->InsertLanguage(aLang);
OUString aLangStr( SvtLanguageTable::GetLanguageString( aLang, true ) );
sal_uInt16 p = m_pUserInterfaceLB->InsertEntry(aLangStr);
- m_pUserInterfaceLB->SetEntryData(p, (void*)(i+1));
+ m_pUserInterfaceLB->SetEntryData(p, reinterpret_cast<void*>(i+1));
}
}
@@ -1089,7 +1089,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet&
sal_Int32 d = 0;
for (sal_uInt16 i=0; i < m_pUserInterfaceLB->GetEntryCount(); i++)
{
- d = (sal_Int32)(sal_IntPtr)m_pUserInterfaceLB->GetEntryData(i);
+ d = (sal_Int32)reinterpret_cast<sal_IntPtr>(m_pUserInterfaceLB->GetEntryData(i));
if ( d > 0 && seqInstalledLanguages.getLength() > d-1 && seqInstalledLanguages[d-1].equals(m_sUserLocaleValue))
m_pUserInterfaceLB->SelectEntryPos(i);
}
@@ -1224,7 +1224,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
// handle settings for UI Language
// a change of setting needs to bring up a warning message
OUString aLangString;
- sal_Int32 d = (sal_Int32)(sal_IntPtr)m_pUserInterfaceLB->GetEntryData(m_pUserInterfaceLB->GetSelectEntryPos());
+ sal_Int32 d = (sal_Int32)reinterpret_cast<sal_IntPtr>(m_pUserInterfaceLB->GetEntryData(m_pUserInterfaceLB->GetSelectEntryPos()));
if( d > 0 && seqInstalledLanguages.getLength() > d-1)
aLangString = seqInstalledLanguages[d-1];
@@ -1526,21 +1526,21 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
const SfxPoolItem* pLang;
if( SfxItemState::SET == rSet->GetItemState(SID_ATTR_LANGUAGE, false, &pLang))
{
- LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ LanguageType eTempCurLang = static_cast<const SvxLanguageItem*>(pLang)->GetValue();
if (MsLangId::resolveSystemLanguageByScriptType(eCurLang, ::com::sun::star::i18n::ScriptType::LATIN) != eTempCurLang)
eCurLang = eTempCurLang;
}
if( SfxItemState::SET == rSet->GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, false, &pLang))
{
- LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ LanguageType eTempCurLang = static_cast<const SvxLanguageItem*>(pLang)->GetValue();
if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCJK, ::com::sun::star::i18n::ScriptType::ASIAN) != eTempCurLang)
eCurLangCJK = eTempCurLang;
}
if( SfxItemState::SET == rSet->GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, false, &pLang))
{
- LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
+ LanguageType eTempCurLang = static_cast<const SvxLanguageItem*>(pLang)->GetValue();
if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCTL, ::com::sun::star::i18n::ScriptType::COMPLEX) != eTempCurLang)
eCurLangCTL = eTempCurLang;
}
@@ -1583,7 +1583,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
// check the box "For the current document only"
// set the focus to the Western Language box
const SfxPoolItem* pLang = 0;
- if ( SfxItemState::SET == rSet->GetItemState(SID_SET_DOCUMENT_LANGUAGE, false, &pLang ) && ((const SfxBoolItem*)pLang)->GetValue() )
+ if ( SfxItemState::SET == rSet->GetItemState(SID_SET_DOCUMENT_LANGUAGE, false, &pLang ) && static_cast<const SfxBoolItem*>(pLang)->GetValue() )
{
m_pWesternLanguageLB->GrabFocus();
m_pCurrentDocCB->Enable(true);
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 1408274a7643..d1504f90622e 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -330,7 +330,7 @@ void SvxGeneralTabPage::Reset( const SfxItemSet* rSet )
if (rSet->GetItemState(nWhich) == SfxItemState::SET)
{
- if (sal_uInt16 const nField = ((SfxUInt16Item&)rSet->Get(nWhich)).GetValue())
+ if (sal_uInt16 const nField = static_cast<const SfxUInt16Item&>(rSet->Get(nWhich)).GetValue())
{
for (unsigned i = 0; i != vFields.size(); ++i)
if (nField == vFieldInfo[vFields[i]->iField].nGrabFocusId)
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index e59f541c7e46..48ad76a036f6 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -251,7 +251,7 @@ DicUserData::DicUserData(
static void lcl_SetCheckButton( SvTreeListEntry* pEntry, bool bCheck )
{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
DBG_ASSERT(pItem,"SetCheckButton:Item not found");
if (pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
@@ -460,7 +460,7 @@ void BrwString_Impl::Paint(
aFont.SetWeight( WEIGHT_BOLD );
//??? convert the lower byte from the user date into a string
- OptionsUserData aData( (sal_uLong) pEntry->GetUserData() );
+ OptionsUserData aData( reinterpret_cast<sal_uLong>( pEntry->GetUserData() ) );
if(aData.HasNumericValue())
{
OUStringBuffer sTxt;
@@ -1234,7 +1234,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
SvTreeListEntry *pEntry = m_pLinguDicsCLB->GetEntry( i );
if (pEntry)
{
- DicUserData aData( (sal_uLong)pEntry->GetUserData() );
+ DicUserData aData( reinterpret_cast<sal_uLong>(pEntry->GetUserData()) );
if (aData.GetEntryId() < nDics)
{
bool bChecked = m_pLinguDicsCLB->IsChecked( i );
@@ -1267,7 +1267,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
SvTreeListEntry *pEntry = m_pLinguOptionsCLB->GetEntry( j );
- OptionsUserData aData( (sal_uLong)pEntry->GetUserData() );
+ OptionsUserData aData( reinterpret_cast<sal_uLong>(pEntry->GetUserData()) );
OUString aPropName( lcl_GetPropertyName( (EID_OPTIONS) aData.GetEntryId() ) );
Any aAny;
@@ -1293,8 +1293,8 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
DBG_ASSERT( pPostBreakEntry, "NULL Pointer" );
if (pPreBreakEntry && pPostBreakEntry)
{
- OptionsUserData aPreBreakData( (sal_uLong)pPreBreakEntry->GetUserData() );
- OptionsUserData aPostBreakData( (sal_uLong)pPostBreakEntry->GetUserData() );
+ OptionsUserData aPreBreakData( reinterpret_cast<sal_uLong>(pPreBreakEntry->GetUserData()) );
+ OptionsUserData aPostBreakData( reinterpret_cast<sal_uLong>(pPostBreakEntry->GetUserData()) );
if ( aPreBreakData.IsModified() || aPostBreakData.IsModified() )
{
SfxHyphenRegionItem aHyp( GetWhich( SID_ATTR_HYPHENREGION ) );
@@ -1308,7 +1308,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
// automatic spell checking
bool bNewAutoCheck = m_pLinguOptionsCLB->IsChecked( (sal_uLong) EID_SPELL_AUTO );
const SfxPoolItem* pOld = GetOldItem( *rCoreSet, SID_AUTOSPELL_CHECK );
- if ( !pOld || ( (SfxBoolItem*)pOld )->GetValue() != bNewAutoCheck )
+ if ( !pOld || static_cast<const SfxBoolItem*>(pOld)->GetValue() != bNewAutoCheck )
{
rCoreSet->Put( SfxBoolItem( GetWhich( SID_AUTOSPELL_CHECK ),
bNewAutoCheck ) );
@@ -1354,7 +1354,7 @@ void SvxLinguTabPage::AddDicBoxEntry(
if (pEntry)
{
DicUserData aData( GetDicUserData( rxDic, nIdx ) );
- pEntry->SetUserData( (void *) aData.GetUserData() );
+ pEntry->SetUserData( reinterpret_cast<void *>(aData.GetUserData()) );
lcl_SetCheckButton( pEntry, aData.IsChecked() );
}
@@ -1436,57 +1436,57 @@ void SvxLinguTabPage::Reset( const SfxItemSet* rSet )
aLngCfg.GetProperty( UPN_IS_SPELL_AUTO ) >>= bVal;
const SfxPoolItem* pItem = GetItem( *rSet, SID_AUTOSPELL_CHECK );
if (pItem)
- bVal = ((SfxBoolItem *) pItem)->GetValue();
+ bVal = static_cast<const SfxBoolItem *>(pItem)->GetValue();
nUserData = OptionsUserData( EID_SPELL_AUTO, false, 0, true, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
+ pEntry->SetUserData( reinterpret_cast<void *>(nUserData) );
pModel->Insert( pEntry );
lcl_SetCheckButton( pEntry, bVal );
pEntry = CreateEntry( sGrammarAuto, CBCOL_FIRST );
aLngCfg.GetProperty( UPN_IS_GRAMMAR_AUTO ) >>= bVal;
nUserData = OptionsUserData( EID_GRAMMAR_AUTO, false, 0, true, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
+ pEntry->SetUserData( reinterpret_cast<void *>(nUserData) );
pModel->Insert( pEntry );
lcl_SetCheckButton( pEntry, bVal );
pEntry = CreateEntry( sCapitalWords, CBCOL_FIRST );
aLngCfg.GetProperty( UPN_IS_SPELL_UPPER_CASE ) >>= bVal;
nUserData = OptionsUserData( EID_CAPITAL_WORDS, false, 0, true, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
+ pEntry->SetUserData( reinterpret_cast<void *>(nUserData) );
pModel->Insert( pEntry );
lcl_SetCheckButton( pEntry, bVal );
pEntry = CreateEntry( sWordsWithDigits, CBCOL_FIRST );
aLngCfg.GetProperty( UPN_IS_SPELL_WITH_DIGITS ) >>= bVal;
nUserData = OptionsUserData( EID_WORDS_WITH_DIGITS, false, 0, true, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
+ pEntry->SetUserData( reinterpret_cast<void *>(nUserData) );
pModel->Insert( pEntry );
lcl_SetCheckButton( pEntry, bVal );
pEntry = CreateEntry( sSpellSpecial, CBCOL_FIRST );
aLngCfg.GetProperty( UPN_IS_SPELL_SPECIAL ) >>= bVal;
nUserData = OptionsUserData( EID_SPELL_SPECIAL, false, 0, true, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
+ pEntry->SetUserData( reinterpret_cast<void *>(nUserData) );
pModel->Insert( pEntry );
lcl_SetCheckButton( pEntry, bVal );
pEntry = CreateEntry( sNumMinWordlen, CBCOL_SECOND );
aLngCfg.GetProperty( UPN_HYPH_MIN_WORD_LENGTH ) >>= nVal;
nUserData = OptionsUserData( EID_NUM_MIN_WORDLEN, true, (sal_uInt16)nVal, false, false).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
+ pEntry->SetUserData( reinterpret_cast<void *>(nUserData) );
pModel->Insert( pEntry );
const SfxHyphenRegionItem *pHyp = NULL;
sal_uInt16 nWhich = GetWhich( SID_ATTR_HYPHENREGION );
if ( rSet->GetItemState( nWhich, false ) == SfxItemState::SET )
- pHyp = &( (const SfxHyphenRegionItem &) rSet->Get( nWhich ) );
+ pHyp = &static_cast<const SfxHyphenRegionItem &>( rSet->Get( nWhich ) );
pEntry = CreateEntry( sNumPreBreak, CBCOL_SECOND );
aLngCfg.GetProperty( UPN_HYPH_MIN_LEADING ) >>= nVal;
if (pHyp)
nVal = (sal_Int16) pHyp->GetMinLead();
nUserData = OptionsUserData( EID_NUM_PRE_BREAK, true, (sal_uInt16)nVal, false, false).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
+ pEntry->SetUserData( reinterpret_cast<void *>(nUserData) );
pModel->Insert( pEntry );
pEntry = CreateEntry( sNumPostBreak, CBCOL_SECOND );
@@ -1494,20 +1494,20 @@ void SvxLinguTabPage::Reset( const SfxItemSet* rSet )
if (pHyp)
nVal = (sal_Int16) pHyp->GetMinTrail();
nUserData = OptionsUserData( EID_NUM_POST_BREAK, true, (sal_uInt16)nVal, false, false).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
+ pEntry->SetUserData( reinterpret_cast<void *>(nUserData) );
pModel->Insert( pEntry );
pEntry = CreateEntry( sHyphAuto, CBCOL_FIRST );
aLngCfg.GetProperty( UPN_IS_HYPH_AUTO ) >>= bVal;
nUserData = OptionsUserData( EID_HYPH_AUTO, false, 0, true, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
+ pEntry->SetUserData( reinterpret_cast<void *>(nUserData) );
pModel->Insert( pEntry );
lcl_SetCheckButton( pEntry, bVal );
pEntry = CreateEntry( sHyphSpecial, CBCOL_FIRST );
aLngCfg.GetProperty( UPN_IS_HYPH_SPECIAL ) >>= bVal;
nUserData = OptionsUserData( EID_HYPH_SPECIAL, false, 0, true, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
+ pEntry->SetUserData( reinterpret_cast<void *>(nUserData) );
pModel->Insert( pEntry );
lcl_SetCheckButton( pEntry, bVal );
@@ -1645,7 +1645,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
SvTreeListEntry *pEntry = m_pLinguDicsCLB->GetCurEntry();
if (pEntry)
{
- DicUserData aData( (sal_uLong) pEntry->GetUserData() );
+ DicUserData aData( reinterpret_cast<sal_uLong>(pEntry->GetUserData()) );
sal_uInt16 nDicPos = aData.GetEntryId();
sal_Int32 nDics = aDics.getLength();
if (nDicPos < nDics)
@@ -1676,7 +1676,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
SvTreeListEntry *pEntry = m_pLinguDicsCLB->GetCurEntry();
if (pEntry)
{
- DicUserData aData( (sal_uLong) pEntry->GetUserData() );
+ DicUserData aData( reinterpret_cast<sal_uLong>(pEntry->GetUserData()) );
sal_uInt16 nDicPos = aData.GetEntryId();
sal_Int32 nDics = aDics.getLength();
if (nDicPos < nDics)
@@ -1715,7 +1715,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
DBG_ASSERT( pDicEntry, "missing entry" );
if (pDicEntry)
{
- DicUserData aDicData( (sal_uLong) pDicEntry->GetUserData() );
+ DicUserData aDicData( reinterpret_cast<sal_uLong>(pDicEntry->GetUserData()) );
if (aDicData.GetEntryId() == nDicPos )
{
m_pLinguDicsCLB->RemoveEntry( i );
@@ -1736,7 +1736,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
DBG_ASSERT( pEntry, "no entry selected" );
if (pEntry)
{
- OptionsUserData aData( (sal_uLong)pEntry->GetUserData() );
+ OptionsUserData aData( reinterpret_cast<sal_uLong>(pEntry->GetUserData()) );
if(aData.HasNumericValue())
{
sal_uInt16 nRID = aData.GetEntryId();
@@ -1748,7 +1748,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
if (-1 != nVal && aData.GetNumericValue() != nVal)
{
aData.SetNumericValue( (sal_uInt8)nVal ); //! sets IsModified !
- pEntry->SetUserData( (void *) aData.GetUserData() );
+ pEntry->SetUserData( reinterpret_cast<void *>(aData.GetUserData()) );
m_pLinguOptionsCLB->Invalidate();
}
}
@@ -1775,7 +1775,7 @@ IMPL_LINK( SvxLinguTabPage, SelectHdl_Impl, SvxCheckListBox *, pBox )
SvTreeListEntry *pEntry = pBox->GetCurEntry();
if (pEntry)
{
- DicUserData aData( (sal_uLong) pEntry->GetUserData() );
+ DicUserData aData( reinterpret_cast<sal_uLong>( pEntry->GetUserData() ) );
// always allow to edit (i.e. at least view the content of the dictionary)
m_pLinguDicsEditPB->Enable( true/*aData.IsEditable()*/ );
@@ -1787,7 +1787,7 @@ IMPL_LINK( SvxLinguTabPage, SelectHdl_Impl, SvxCheckListBox *, pBox )
SvTreeListEntry *pEntry = pBox->GetCurEntry();
if (pEntry)
{
- OptionsUserData aData( (sal_uLong) pEntry->GetUserData() );
+ OptionsUserData aData( reinterpret_cast<sal_uLong>( pEntry->GetUserData() ) );
m_pLinguOptionsEditPB->Enable( aData.HasNumericValue() );
}
}
diff --git a/cui/source/options/optmemory.cxx b/cui/source/options/optmemory.cxx
index 255356f742a4..e406d56e3a40 100644
--- a/cui/source/options/optmemory.cxx
+++ b/cui/source/options/optmemory.cxx
@@ -241,7 +241,7 @@ void OfaMemoryOptionsPage::Reset( const SfxItemSet* rSet )
SfxItemState eState = rSet->GetItemState( SID_ATTR_QUICKLAUNCHER, false, &pItem );
if ( SfxItemState::SET == eState )
- m_pQuickLaunchCB->Check( ( (SfxBoolItem*)pItem )->GetValue() );
+ m_pQuickLaunchCB->Check( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
else if ( SfxItemState::DISABLED == eState )
{
// quickstart not installed
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 112ee7650262..d5dc56120f18 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -105,10 +105,10 @@ SfxSaveTabPage::SfxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet
get(aODFWarningFT, "odfwarning_label");
- aODFVersionLB->SetEntryData(0, (void*)2 ); // 1.0/1.1
- aODFVersionLB->SetEntryData(1, (void*)4 ); // 1.2
- aODFVersionLB->SetEntryData(2, (void*)8 ); // 1.2 Extended (compatibility mode)
- aODFVersionLB->SetEntryData(3, (void*)0x7fffffff); // 1.2 Extended (recommended)
+ aODFVersionLB->SetEntryData(0, reinterpret_cast<void*>(2 )); // 1.0/1.1
+ aODFVersionLB->SetEntryData(1, reinterpret_cast<void*>(4 )); // 1.2
+ aODFVersionLB->SetEntryData(2, reinterpret_cast<void*>(8 )); // 1.2 Extended (compatibility mode)
+ aODFVersionLB->SetEntryData(3, reinterpret_cast<void*>(0x7fffffff)); // 1.2 Extended (recommended)
aDocTypeLB->SetEntryData(0, reinterpret_cast<void*>(APP_WRITER) );
aDocTypeLB->SetEntryData(1, reinterpret_cast<void*>(APP_WRITER_WEB) );
@@ -125,8 +125,8 @@ SfxSaveTabPage::SfxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet
SvtModuleOptions aModuleOpt;
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SMATH ) )
{
- aSaveAsLB->RemoveEntry(aSaveAsLB->GetEntryPos( (void*) APP_MATH ));
- aDocTypeLB->RemoveEntry(aDocTypeLB->GetEntryPos( (void*) APP_MATH ));
+ aSaveAsLB->RemoveEntry(aSaveAsLB->GetEntryPos( reinterpret_cast<void*>(APP_MATH) ));
+ aDocTypeLB->RemoveEntry(aDocTypeLB->GetEntryPos( reinterpret_cast<void*>(APP_MATH) ));
}
else
{
@@ -136,8 +136,8 @@ SfxSaveTabPage::SfxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) )
{
- aSaveAsLB->RemoveEntry(aSaveAsLB->GetEntryPos( (void*) APP_DRAW ));
- aDocTypeLB->RemoveEntry(aDocTypeLB->GetEntryPos( (void*) APP_DRAW ));
+ aSaveAsLB->RemoveEntry(aSaveAsLB->GetEntryPos( reinterpret_cast<void*>(APP_DRAW) ));
+ aDocTypeLB->RemoveEntry(aDocTypeLB->GetEntryPos( reinterpret_cast<void*>(APP_DRAW) ));
}
else
{
@@ -147,8 +147,8 @@ SfxSaveTabPage::SfxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) )
{
- aSaveAsLB->RemoveEntry(aSaveAsLB->GetEntryPos( (void*) APP_IMPRESS ));
- aDocTypeLB->RemoveEntry(aDocTypeLB->GetEntryPos( (void*) APP_IMPRESS ));
+ aSaveAsLB->RemoveEntry(aSaveAsLB->GetEntryPos( reinterpret_cast<void*>(APP_IMPRESS) ));
+ aDocTypeLB->RemoveEntry(aDocTypeLB->GetEntryPos( reinterpret_cast<void*>(APP_IMPRESS) ));
}
else
{
@@ -158,8 +158,8 @@ SfxSaveTabPage::SfxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) )
{
- aSaveAsLB->RemoveEntry(aSaveAsLB->GetEntryPos( (void*) APP_CALC ));
- aDocTypeLB->RemoveEntry(aDocTypeLB->GetEntryPos( (void*) APP_CALC ));
+ aSaveAsLB->RemoveEntry(aSaveAsLB->GetEntryPos( reinterpret_cast<void*>(APP_CALC) ));
+ aDocTypeLB->RemoveEntry(aDocTypeLB->GetEntryPos( reinterpret_cast<void*>(APP_CALC) ));
}
else
{
@@ -400,7 +400,7 @@ void SfxSaveTabPage::Reset( const SfxItemSet* )
{
for(sal_uInt16 n = 0; n < aDocTypeLB->GetEntryCount(); n++)
{
- sal_IntPtr nData = (sal_IntPtr) aDocTypeLB->GetEntryData(n);
+ sal_IntPtr nData = reinterpret_cast<sal_IntPtr>(aDocTypeLB->GetEntryData(n));
OUString sCommand;
sCommand = "matchByDocumentService=%1:iflags=" +
OUString::number(SFX_FILTER_IMPORT|SFX_FILTER_EXPORT) +
@@ -477,7 +477,7 @@ void SfxSaveTabPage::Reset( const SfxItemSet* )
aRelativeInetCB->Check( aSaveOpt.IsSaveRelINet() );
- void* pDefaultVersion = (void*)sal_IntPtr( aSaveOpt.GetODFDefaultVersion() );
+ void* pDefaultVersion = reinterpret_cast<void*>( aSaveOpt.GetODFDefaultVersion() );
aODFVersionLB->SelectEntryPos( aODFVersionLB->GetEntryPos( pDefaultVersion ) );
AutoClickHdl_Impl( aAutoSaveCB );
@@ -549,7 +549,7 @@ IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox )
sal_IntPtr nData = -1;
if(nCurPos < APP_COUNT)
- nData = (sal_IntPtr) aDocTypeLB->GetEntryData(nCurPos);
+ nData = reinterpret_cast<sal_IntPtr>( aDocTypeLB->GetEntryData(nCurPos) );
if ( nData >= 0 && nData < APP_COUNT )
{
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 4647feecc576..3e0644c0b70f 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1051,7 +1051,7 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
{
pPageInfo->m_pPage = ::CreateGeneralTabPage(
pPageInfo->m_nPageId, pTabBox, *pColorPageItemSet );
- mpColorPage = (SvxColorTabPage*)pPageInfo->m_pPage;
+ mpColorPage = static_cast<SvxColorTabPage*>(pPageInfo->m_pPage);
mpColorPage->SetupForViewFrame( SfxViewFrame::Current() );
}
else
@@ -1201,7 +1201,7 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
// miscellaneous - Year2000
if( SfxItemState::DEFAULT <= pDispatch->QueryState( SID_ATTR_YEAR2000, pItem ) )
- pRet->Put( SfxUInt16Item( SID_ATTR_YEAR2000, ((const SfxUInt16Item*)pItem)->GetValue() ) );
+ pRet->Put( SfxUInt16Item( SID_ATTR_YEAR2000, static_cast<const SfxUInt16Item*>(pItem)->GetValue() ) );
else
pRet->Put( SfxUInt16Item( SID_ATTR_YEAR2000, (sal_uInt16)aMisc.GetYear2000() ) );
}
@@ -1250,11 +1250,11 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
{
SfxDispatcher* pDispatch = pViewFrame->GetDispatcher();
if(SfxItemState::DEFAULT <= pDispatch->QueryState(SID_ATTR_LANGUAGE, pItem))
- pRet->Put(SfxUInt16Item(SID_ATTR_LANGUAGE, ((const SvxLanguageItem*)pItem)->GetLanguage()));
+ pRet->Put(SfxUInt16Item(SID_ATTR_LANGUAGE, static_cast<const SvxLanguageItem*>(pItem)->GetLanguage()));
if(SfxItemState::DEFAULT <= pDispatch->QueryState(SID_ATTR_CHAR_CJK_LANGUAGE, pItem))
- pRet->Put(SfxUInt16Item(SID_ATTR_CHAR_CJK_LANGUAGE, ((const SvxLanguageItem*)pItem)->GetLanguage()));
+ pRet->Put(SfxUInt16Item(SID_ATTR_CHAR_CJK_LANGUAGE, static_cast<const SvxLanguageItem*>(pItem)->GetLanguage()));
if(SfxItemState::DEFAULT <= pDispatch->QueryState(SID_ATTR_CHAR_CTL_LANGUAGE, pItem))
- pRet->Put(SfxUInt16Item(SID_ATTR_CHAR_CTL_LANGUAGE, ((const SvxLanguageItem*)pItem)->GetLanguage()));
+ pRet->Put(SfxUInt16Item(SID_ATTR_CHAR_CTL_LANGUAGE, static_cast<const SvxLanguageItem*>(pItem)->GetLanguage()));
pRet->Put(aHyphen);
if(SfxItemState::DEFAULT <= pDispatch->QueryState(SID_AUTOSPELL_CHECK, pItem))
@@ -1338,7 +1338,7 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet
sal_uInt16 nY2K = USHRT_MAX;
if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_YEAR2000, false, &pItem ) )
- nY2K = ((const SfxUInt16Item*)pItem)->GetValue();
+ nY2K = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
if( USHRT_MAX != nY2K )
{
if ( pViewFrame )
@@ -1353,11 +1353,11 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet
// evaluate print
if(SfxItemState::SET == rSet.GetItemState(SID_PRINTER_NOTFOUND_WARN, false, &pItem))
- aMisc.SetNotFoundWarning(((const SfxBoolItem*)pItem)->GetValue());
+ aMisc.SetNotFoundWarning(static_cast<const SfxBoolItem*>(pItem)->GetValue());
if(SfxItemState::SET == rSet.GetItemState(SID_PRINTER_CHANGESTODOC, false, &pItem))
{
- const SfxFlagItem* pFlag = (const SfxFlagItem*)pItem;
+ const SfxFlagItem* pFlag = static_cast<const SfxFlagItem*>(pItem);
aMisc.SetPaperSizeWarning(0 != (pFlag->GetValue() & SFX_PRINTER_CHG_SIZE ));
aMisc.SetPaperOrientationWarning(0 != (pFlag->GetValue() & SFX_PRINTER_CHG_ORIENTATION ));
}
@@ -1404,13 +1404,13 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet)
if ( SfxItemState::SET == rSet.GetItemState( SID_SPELL_MODIFIED, false, &pItem ) )
{
- bSaveSpellCheck = ( (const SfxBoolItem*)pItem )->GetValue();
+ bSaveSpellCheck = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< XLinguProperties > xProp = LinguProperties::create( xContext );
if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_HYPHENREGION, false, &pItem ) )
{
- const SfxHyphenRegionItem* pHyphenItem = (const SfxHyphenRegionItem*)pItem;
+ const SfxHyphenRegionItem* pHyphenItem = static_cast<const SfxHyphenRegionItem*>(pItem);
xProp->setHyphMinLeading( (sal_Int16) pHyphenItem->GetMinLead() );
xProp->setHyphMinTrailing( (sal_Int16) pHyphenItem->GetMinTrail() );
@@ -1440,7 +1440,7 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet)
if( SfxItemState::SET == rSet.GetItemState(SID_AUTOSPELL_CHECK, false, &pItem ))
{
- bool bOnlineSpelling = ((const SfxBoolItem*)pItem)->GetValue();
+ bool bOnlineSpelling = static_cast<const SfxBoolItem*>(pItem)->GetValue();
pDispatch->Execute(SID_AUTOSPELL_CHECK,
SfxCallMode::ASYNCHRON|SfxCallMode::RECORD, pItem, 0L);
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index 7d5a483cd647..9276e02f08d1 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -176,7 +176,7 @@ void WebConnectionInfoDialog::FillPasswordList()
aUIEntry += OUString( (sal_Unicode)'\t' );
aUIEntry += aURLEntries[nURLInd].UserList[nUserInd].UserName;
SvTreeListEntry* pEntry = m_pPasswordsLB->InsertEntry( aUIEntry );
- pEntry->SetUserData( (void*)(sal_IntPtr)(nCount++) );
+ pEntry->SetUserData( reinterpret_cast<void*>(nCount++) );
}
}
@@ -192,7 +192,7 @@ void WebConnectionInfoDialog::FillPasswordList()
aUIEntry += OUString( (sal_Unicode)'\t' );
aUIEntry += OUString( "*" );
SvTreeListEntry* pEntry = m_pPasswordsLB->InsertEntry( aUIEntry );
- pEntry->SetUserData( (void*)(sal_IntPtr)(nCount++) );
+ pEntry->SetUserData( reinterpret_cast<void*>(nCount++) );
}
}
}
@@ -214,7 +214,7 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, RemovePasswordHdl)
uno::Reference< task::XPasswordContainer2 > xPasswdContainer(
task::PasswordContainer::create(comphelper::getProcessComponentContext()));
- sal_Int32 nPos = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
+ sal_Int32 nPos = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData());
if ( nPos < m_nPos )
{
xPasswdContainer->removePersistent( aURL, aUserName );
@@ -310,7 +310,7 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, EntrySelectedHdl)
// url container entries (-> use system credentials) have
// no password
- sal_Int32 nPos = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
+ sal_Int32 nPos = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData());
m_pChangeBtn->Enable( nPos < m_nPos );
}
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index e52956604e5a..f1d3a8f3bd78 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -120,14 +120,14 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(vcl::Window* pParent, const SfxItemSet* _pSet )
m_pLanguageLB->SelectLanguage( LANGUAGE_NONE );
sal_Int32 nPos = m_pLanguageLB->GetSelectEntryPos();
DBG_ASSERT( LISTBOX_ENTRY_NOTFOUND != nPos, "listbox entry missing" );
- m_pLanguageLB->SetEntryData( nPos, (void*)(long) LANGUAGE_UNDETERMINED );
+ m_pLanguageLB->SetEntryData( nPos, reinterpret_cast<void*>(LANGUAGE_UNDETERMINED) );
// Initializing doesn't work for static on linux - therefore here
if( LANGUAGE_SYSTEM == eLastDialogLanguage )
eLastDialogLanguage = Application::GetSettings().GetLanguageTag().getLanguageType();
LanguageType nSelectLang = LANGUAGE_UNDETERMINED;
- nPos = m_pLanguageLB->GetEntryPos( (void*)(sal_IntPtr) eLastDialogLanguage );
+ nPos = m_pLanguageLB->GetEntryPos( reinterpret_cast<void*>(eLastDialogLanguage) );
if (LISTBOX_ENTRY_NOTFOUND != nPos)
nSelectLang = eLastDialogLanguage;
m_pLanguageLB->SelectLanguage( nSelectLang );
@@ -166,15 +166,15 @@ IMPL_LINK(OfaAutoCorrDlg, SelectLanguageHdl, ListBox*, pBox)
{
sal_Int32 nPos = pBox->GetSelectEntryPos();
void* pVoid = pBox->GetEntryData(nPos);
- LanguageType eNewLang = (LanguageType)(sal_IntPtr)pVoid;
+ LanguageType eNewLang = (LanguageType)reinterpret_cast<sal_IntPtr>(pVoid);
// save old settings and fill anew
if(eNewLang != eLastDialogLanguage)
{
sal_uInt16 nPageId = GetCurPageId();
if (m_nReplacePageId == nPageId)
- ((OfaAutocorrReplacePage*)GetTabPage( nPageId ))->SetLanguage(eNewLang);
+ static_cast<OfaAutocorrReplacePage*>(GetTabPage( nPageId ))->SetLanguage(eNewLang);
else if (m_nExceptionsPageId == nPageId)
- ((OfaAutocorrExceptPage*)GetTabPage( nPageId ))->SetLanguage(eNewLang);
+ static_cast<OfaAutocorrExceptPage*>(GetTabPage( nPageId ))->SetLanguage(eNewLang);
}
return 0;
}
@@ -226,7 +226,7 @@ bool OfaAutocorrOptionsPage::FillItemSet( SfxItemSet* )
void OfaAutocorrOptionsPage::ActivatePage( const SfxItemSet& )
{
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(false);
+ static_cast<OfaAutoCorrDlg*>(GetTabDialog())->EnableLanguage(false);
}
void OfaAutocorrOptionsPage::Reset( const SfxItemSet* )
@@ -601,7 +601,7 @@ bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet* )
void OfaSwAutoFmtOptionsPage::ActivatePage( const SfxItemSet& )
{
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(false);
+ static_cast<OfaAutoCorrDlg*>(GetTabDialog())->EnableLanguage(false);
}
void OfaSwAutoFmtOptionsPage::Reset( const SfxItemSet* )
@@ -761,7 +761,7 @@ bool OfaACorrCheckListBox::IsChecked(sal_uLong nPos, sal_uInt16 nCol)
void OfaACorrCheckListBox::SetCheckButtonState( SvTreeListEntry* pEntry, sal_uInt16 nCol, SvButtonState eState)
{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem(nCol + 1));
DBG_ASSERT(pItem,"SetCheckButton:Item not found");
if (pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
@@ -787,7 +787,7 @@ void OfaACorrCheckListBox::SetCheckButtonState( SvTreeListEntry* pEntry, sal_uIn
SvButtonState OfaACorrCheckListBox::GetCheckButtonState( SvTreeListEntry* pEntry, sal_uInt16 nCol ) const
{
SvButtonState eState = SV_BUTTON_UNCHECKED;
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem(nCol + 1));
DBG_ASSERT(pItem,"GetChButnState:Item not found");
if (pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
@@ -914,7 +914,7 @@ void OfaAutocorrReplacePage::ActivatePage( const SfxItemSet& )
{
if(eLang != eLastDialogLanguage)
SetLanguage(eLastDialogLanguage);
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(true);
+ static_cast<OfaAutoCorrDlg*>(GetTabDialog())->EnableLanguage(true);
}
int OfaAutocorrReplacePage::DeactivatePage( SfxItemSet* )
@@ -1415,7 +1415,7 @@ void OfaAutocorrExceptPage::ActivatePage( const SfxItemSet& )
{
if(eLang != eLastDialogLanguage)
SetLanguage(eLastDialogLanguage);
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(true);
+ static_cast<OfaAutoCorrDlg*>(GetTabDialog())->EnableLanguage(true);
}
int OfaAutocorrExceptPage::DeactivatePage( SfxItemSet* )
@@ -1898,7 +1898,7 @@ bool OfaQuoteTabPage::FillItemSet( SfxItemSet* )
void OfaQuoteTabPage::ActivatePage( const SfxItemSet& )
{
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(false);
+ static_cast<OfaAutoCorrDlg*>(GetTabDialog())->EnableLanguage(false);
}
void OfaQuoteTabPage::Reset( const SfxItemSet* )
@@ -2132,7 +2132,7 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage(vcl::Window* pParent,
{
vcl::KeyCode aKCode( *pKeys );
sal_Int32 nPos = m_pDCBExpandKey->InsertEntry( aKCode.GetName() );
- m_pDCBExpandKey->SetEntryData( nPos, (void*)(sal_uLong)*pKeys );
+ m_pDCBExpandKey->SetEntryData( nPos, reinterpret_cast<void*>(*pKeys) );
if( KEY_RETURN == *pKeys ) // default to RETURN
m_pDCBExpandKey->SelectEntryPos( nPos );
}
@@ -2186,7 +2186,7 @@ bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet* )
nVal = m_pDCBExpandKey->GetSelectEntryPos();
if( nVal < m_pDCBExpandKey->GetEntryCount() )
{
- sal_uLong nKey = (sal_uLong)m_pDCBExpandKey->GetEntryData( nVal );
+ sal_uLong nKey = reinterpret_cast<sal_uLong>(m_pDCBExpandKey->GetEntryData( nVal ));
bModified |= nKey != pOpt->nAutoCmpltExpandKey;
pOpt->nAutoCmpltExpandKey = (sal_uInt16)nKey;
}
@@ -2223,7 +2223,7 @@ void OfaAutoCompleteTabPage::Reset( const SfxItemSet* )
{
sal_uLong nKey = pOpt->nAutoCmpltExpandKey;
for( sal_Int32 n = 0, nCnt = m_pDCBExpandKey->GetEntryCount(); n < nCnt; ++n )
- if( nKey == (sal_uLong)m_pDCBExpandKey->GetEntryData( n ))
+ if( nKey == reinterpret_cast<sal_uLong>(m_pDCBExpandKey->GetEntryData( n )))
{
m_pDCBExpandKey->SelectEntryPos( n );
break;
@@ -2256,7 +2256,7 @@ void OfaAutoCompleteTabPage::Reset( const SfxItemSet* )
void OfaAutoCompleteTabPage::ActivatePage( const SfxItemSet& )
{
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage( false );
+ static_cast<OfaAutoCorrDlg*>(GetTabDialog())->EnableLanguage( false );
}
IMPL_LINK_NOARG(OfaAutoCompleteTabPage, DeleteHdl)
@@ -2584,7 +2584,7 @@ void OfaSmartTagOptionsTabPage::Reset( const SfxItemSet* )
void OfaSmartTagOptionsTabPage::ActivatePage( const SfxItemSet& )
{
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage( false );
+ static_cast<OfaAutoCorrDlg*>(GetTabDialog())->EnableLanguage( false );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 90401f5b2d55..8cb9a4a6506e 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -134,14 +134,14 @@ static void lcl_SetTransparency(SvxBrushItem& rBrush, long nTransparency)
/// Returns the fill style of the currently selected entry.
static drawing::FillStyle lcl_getFillStyle(ListBox* pLbSelect)
{
- return (drawing::FillStyle)(sal_uLong)pLbSelect->GetEntryData(pLbSelect->GetSelectEntryPos());
+ return (drawing::FillStyle)reinterpret_cast<sal_uLong>(pLbSelect->GetEntryData(pLbSelect->GetSelectEntryPos()));
}
// Selects the entry matching the specified fill style.
static void lcl_setFillStyle(ListBox* pLbSelect, drawing::FillStyle eStyle)
{
for (int i = 0; i < pLbSelect->GetEntryCount(); ++i)
- if ((drawing::FillStyle)(sal_uLong)pLbSelect->GetEntryData(i) == eStyle)
+ if ((drawing::FillStyle)reinterpret_cast<sal_uLong>(pLbSelect->GetEntryData(i)) == eStyle)
{
pLbSelect->SelectEntryPos(i);
return;
@@ -241,7 +241,7 @@ void BackgroundPreviewImpl::NotifyChange( const Color& rColor )
nTransparency = lcl_TransparencyToPercent( rColor.GetTransparency() );
- SetFillColor( rColor == aTranspCol ? GetSettings().GetStyleSettings().GetFieldColor() : (Color) rColor.GetRGBColor() );
+ SetFillColor( rColor == aTranspCol ? GetSettings().GetStyleSettings().GetFieldColor() : Color(rColor.GetRGBColor()) );
Paint( aDrawRect );
}
}
@@ -407,7 +407,7 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSe
|| ( 0 != ( pShell = SfxObjectShell::Current()) &&
0 != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) )
{
- nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue();
+ nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
}
FillColorValueSets_Impl();
@@ -499,7 +499,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
if ( SfxItemState::SET == rSet->GetItemState( SID_BACKGRND_DESTINATION,
false, &pItem ) )
{
- nDestValue = ((const SfxUInt16Item*)pItem)->GetValue();
+ nDestValue = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
m_pTblLBox->SelectEntryPos(nDestValue);
switch ( nDestValue )
@@ -518,7 +518,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
else if( SfxItemState::SET == rSet->GetItemState(
SID_PARA_BACKGRND_DESTINATION, false, &pItem ) )
{
- nDestValue = ((const SfxUInt16Item*)pItem)->GetValue();
+ nDestValue = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
// character activated?
sal_Int32 nParaSel = m_pParaLBox->GetSelectEntryPos();
if(1 == nParaSel)
@@ -544,7 +544,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
sal_uInt16 nWhich = GetWhich( nSlot );
if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
- pBgdAttr = (const SvxBrushItem*)&( rSet->Get( nWhich ) );
+ pBgdAttr = static_cast<const SvxBrushItem*>(&( rSet->Get( nWhich ) ));
m_pBtnTile->Check();
@@ -563,7 +563,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
const SfxPoolItem* pOld = GetOldItem( *rSet, SID_ATTR_BRUSH );
if ( pOld )
- aBgdColor = ( (SvxBrushItem*)pOld )->GetColor();
+ aBgdColor = static_cast<const SvxBrushItem*>(pOld)->GetColor();
}
if ( nDestValue != USHRT_MAX )
@@ -586,21 +586,21 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_BRUSH );
if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
{
- pBgdAttr = (const SvxBrushItem*)&( rSet->Get( nWhich ) );
+ pBgdAttr = static_cast<const SvxBrushItem*>(&( rSet->Get( nWhich ) ));
pTableBck_Impl->pCellBrush = new SvxBrushItem(*pBgdAttr);
}
pTableBck_Impl->nCellWhich = nWhich;
if ( rSet->GetItemState( SID_ATTR_BRUSH_ROW, false ) >= SfxItemState::DEFAULT )
{
- pBgdAttr = (const SvxBrushItem*)&( rSet->Get( SID_ATTR_BRUSH_ROW ) );
+ pBgdAttr = static_cast<const SvxBrushItem*>(&( rSet->Get( SID_ATTR_BRUSH_ROW ) ));
pTableBck_Impl->pRowBrush = new SvxBrushItem(*pBgdAttr);
}
pTableBck_Impl->nRowWhich = SID_ATTR_BRUSH_ROW;
if ( rSet->GetItemState( SID_ATTR_BRUSH_TABLE, false ) >= SfxItemState::DEFAULT )
{
- pBgdAttr = (const SvxBrushItem*)&( rSet->Get( SID_ATTR_BRUSH_TABLE ) );
+ pBgdAttr = static_cast<const SvxBrushItem*>(&( rSet->Get( SID_ATTR_BRUSH_TABLE ) ));
pTableBck_Impl->pTableBrush = new SvxBrushItem(*pBgdAttr);
}
pTableBck_Impl->nTableWhich = SID_ATTR_BRUSH_TABLE;
@@ -625,7 +625,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_BRUSH );
if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
{
- pBgdAttr = (const SvxBrushItem*)&( rSet->Get( nWhich ) );
+ pBgdAttr = static_cast<const SvxBrushItem*>(&( rSet->Get( nWhich ) ));
pParaBck_Impl->pParaBrush = new SvxBrushItem(*pBgdAttr);
}
@@ -634,7 +634,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
rSet->GetItemState( nWhich, false );
if ( rSet->GetItemState( nWhich, true ) > SfxItemState::DEFAULT )
{
- pBgdAttr = (const SvxBrushItem*)&( rSet->Get( nWhich ) );
+ pBgdAttr = static_cast<const SvxBrushItem*>(&( rSet->Get( nWhich ) ));
pParaBck_Impl->pCharBrush = new SvxBrushItem(*pBgdAttr);
}
else
@@ -662,7 +662,7 @@ void SvxBackgroundTabPage::ResetFromWallpaperItem( const SfxItemSet& rSet )
if ( rSet.GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
{
- const CntWallpaperItem* pItem = (const CntWallpaperItem*)&rSet.Get( nWhich );
+ const CntWallpaperItem* pItem = static_cast<const CntWallpaperItem*>(&rSet.Get( nWhich ));
pTemp.reset(new SvxBrushItem( *pItem, nWhich ));
pBgdAttr = pTemp.get();
}
@@ -688,7 +688,7 @@ void SvxBackgroundTabPage::ResetFromWallpaperItem( const SfxItemSet& rSet )
const SfxPoolItem* pOld = GetOldItem( rSet, SID_VIEW_FLD_PIC );
if ( pOld )
- aBgdColor = Color( ((CntWallpaperItem*)pOld)->GetColor() );
+ aBgdColor = Color( static_cast<const CntWallpaperItem*>(pOld)->GetColor() );
}
// We now have always a link to the background
@@ -771,7 +771,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
bool bGraphTransparencyChanged = bGraphTransparency && m_pGraphTransMF->IsValueChangedFromSaved();
if ( pOld )
{
- const SvxBrushItem& rOldItem = (const SvxBrushItem&)*pOld;
+ const SvxBrushItem& rOldItem = static_cast<const SvxBrushItem&>(*pOld);
SvxGraphicPosition eOldPos = rOldItem.GetGraphicPos();
const bool bIsBrush = ( drawing::FillStyle_SOLID == lcl_getFillStyle(m_pLbSelect) );
@@ -978,7 +978,7 @@ bool SvxBackgroundTabPage::FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, s
return false;
const SfxItemSet& rOldSet = GetItemSet();
- SvxBrushItem rOldItem( (const CntWallpaperItem&)*pOld, nWhich );
+ SvxBrushItem rOldItem( static_cast<const CntWallpaperItem&>(*pOld), nWhich );
SvxGraphicPosition eOldPos = rOldItem.GetGraphicPos();
const bool bIsBrush = ( drawing::FillStyle_SOLID == lcl_getFillStyle(m_pLbSelect) );
bool bModified = false;
@@ -1142,7 +1142,7 @@ void SvxBackgroundTabPage::FillColorValueSets_Impl()
XColorListRef pColorTable = NULL;
if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) )
{
- pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
+ pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
}
if ( !pColorTable.is() )
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index b514300acd1a..4eec6c2c6b50 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -221,7 +221,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
{
// paragraph or table
const SvxBoxInfoItem* pBoxInfo =
- (const SvxBoxInfoItem*)&( rCoreAttrs.Get( nWhich ) );
+ static_cast<const SvxBoxInfoItem*>(&( rCoreAttrs.Get( nWhich ) ));
mbHorEnabled = pBoxInfo->IsHorEnabled();
mbVerEnabled = pBoxInfo->IsVerEnabled();
@@ -290,7 +290,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
{
pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
- pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
+ pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
}
DBG_ASSERT( pColorTable.is(), "ColorTable not found!" );
@@ -388,9 +388,9 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
sal_uInt16 nWhichBox = GetWhich(SID_ATTR_BORDER_OUTER);
SfxMapUnit eCoreUnit;
- pBoxItem = (const SvxBoxItem*)GetItem( *rSet, SID_ATTR_BORDER_OUTER );
+ pBoxItem = static_cast<const SvxBoxItem*>(GetItem( *rSet, SID_ATTR_BORDER_OUTER ));
- pBoxInfoItem = (const SvxBoxInfoItem*)GetItem( *rSet, SID_ATTR_BORDER_INNER, false );
+ pBoxInfoItem = static_cast<const SvxBoxInfoItem*>(GetItem( *rSet, SID_ATTR_BORDER_INNER, false ));
eCoreUnit = rSet->GetPool()->GetMetric( nWhichBox );
@@ -556,7 +556,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
( 0 != (pShell = SfxObjectShell::Current()) &&
0 != (pItem = pShell->GetItem(SID_HTML_MODE))))
{
- sal_uInt16 nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue();
+ sal_uInt16 nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
if(nHtmlMode & HTMLMODE_ON)
{
// there are no shadows in Html-mode and only complete borders
@@ -598,12 +598,12 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
bool bAttrsChanged = SfxTabPage::FillItemSet( rCoreAttrs );
bool bPut = true;
- sal_uInt16 nBoxWhich = GetWhich( SID_ATTR_BORDER_OUTER );
- sal_uInt16 nBoxInfoWhich = rCoreAttrs->GetPool()->GetWhich( SID_ATTR_BORDER_INNER, false );
+ sal_uInt16 nBoxWhich = GetWhich( SID_ATTR_BORDER_OUTER );
+ sal_uInt16 nBoxInfoWhich = rCoreAttrs->GetPool()->GetWhich( SID_ATTR_BORDER_INNER, false );
const SfxItemSet& rOldSet = GetItemSet();
SvxBoxItem aBoxItem ( nBoxWhich );
SvxBoxInfoItem aBoxInfoItem ( nBoxInfoWhich );
- SvxBoxItem* pOldBoxItem = (SvxBoxItem*)GetOldItem( *rCoreAttrs, SID_ATTR_BORDER_OUTER );
+ const SvxBoxItem* pOldBoxItem = static_cast<const SvxBoxItem*>(GetOldItem( *rCoreAttrs, SID_ATTR_BORDER_OUTER ));
SfxMapUnit eCoreUnit = rOldSet.GetPool()->GetMetric( nBoxWhich );
@@ -656,8 +656,8 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
|| m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_LEFT ) != svx::FRAMESTATE_HIDE
|| m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_RIGHT ) != svx::FRAMESTATE_HIDE )
{
- SvxBoxInfoItem* pOldBoxInfoItem = (SvxBoxInfoItem*)GetOldItem(
- *rCoreAttrs, SID_ATTR_BORDER_INNER );
+ const SvxBoxInfoItem* pOldBoxInfoItem = static_cast<const SvxBoxInfoItem*>(GetOldItem(
+ *rCoreAttrs, SID_ATTR_BORDER_INNER ));
if (
!pOldBoxItem ||
m_pLeftMF->IsValueChangedFromSaved() ||
@@ -708,12 +708,12 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nBoxWhich, false ))
{
- bPut = aBoxItem != (const SvxBoxItem&)(rOldSet.Get(nBoxWhich));
+ bPut = aBoxItem != static_cast<const SvxBoxItem&>(rOldSet.Get(nBoxWhich));
}
if( SfxItemState::DEFAULT == rOldSet.GetItemState( nBoxInfoWhich, false ) )
{
- const SvxBoxInfoItem& rOldBoxInfo = (const SvxBoxInfoItem&)
- rOldSet.Get(nBoxInfoWhich);
+ const SvxBoxInfoItem& rOldBoxInfo = static_cast<const SvxBoxInfoItem&>(
+ rOldSet.Get(nBoxInfoWhich));
aBoxInfoItem.SetMinDist( rOldBoxInfo.IsMinDist() );
aBoxInfoItem.SetDefDist( rOldBoxInfo.GetDefDist() );
@@ -729,7 +729,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
}
const SfxPoolItem* pOld = GetOldItem( *rCoreAttrs, SID_ATTR_BORDER_INNER, false );
- if ( !pOld || !( *(const SvxBoxInfoItem*)pOld == aBoxInfoItem ) )
+ if ( !pOld || !( *static_cast<const SvxBoxInfoItem*>(pOld) == aBoxInfoItem ) )
{
rCoreAttrs->Put( aBoxInfoItem );
bAttrsChanged |= true;
@@ -839,7 +839,7 @@ IMPL_LINK_NOARG(SvxBorderTabPage, SelSdwHdl_Impl)
IMPL_LINK( SvxBorderTabPage, SelColHdl_Impl, ListBox *, pLb )
{
- ColorListBox* pColLb = (ColorListBox*)(pLb);
+ ColorListBox* pColLb = static_cast<ColorListBox*>(pLb);
if (pLb == m_pLbLineColor)
{
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index fc59a487e6b1..3ca996734a9f 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -203,7 +203,7 @@ void SvxCharBasePage::SetPrevFontWidthScale( const SfxItemSet& rSet )
sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH );
if( ISITEMSET )
{
- const SvxCharScaleWidthItem &rItem = ( SvxCharScaleWidthItem& ) rSet.Get( nWhich );
+ const SvxCharScaleWidthItem &rItem = static_cast<const SvxCharScaleWidthItem&>( rSet.Get( nWhich ) );
m_pPreviewWin->SetFontWidthScale( rItem.GetValue() );
}
}
@@ -416,7 +416,7 @@ const FontList* SvxCharNamePage::GetFontList() const
pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST );
if ( pItem != NULL )
{
- DBG_ASSERT(NULL != ( (SvxFontListItem*)pItem )->GetFontList(),
+ DBG_ASSERT(NULL != static_cast<const SvxFontListItem*>(pItem)->GetFontList(),
"Where is the font list?");
m_pImpl->m_pFontList = static_cast<const SvxFontListItem*>(pItem )->GetFontList()->Clone();
m_pImpl->m_bMustDelete = true;
@@ -459,7 +459,7 @@ namespace
SfxItemState eState = _pPage->GetItemSet().GetItemState( _nFontWhich );
if ( eState >= SfxItemState::DEFAULT )
{
- const SvxFontItem* pFontItem = (const SvxFontItem*)&( _pPage->GetItemSet().Get( _nFontWhich ) );
+ const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(&( _pPage->GetItemSet().Get( _nFontWhich ) ));
aFontInfo.SetName(pFontItem->GetFamilyName());
aFontInfo.SetStyleName(pFontItem->GetStyleName());
aFontInfo.SetFamily(pFontItem->GetFamily());
@@ -470,7 +470,7 @@ namespace
if ( _pFontSizeLB->IsRelative() )
{
DBG_ASSERT( _pPage->GetItemSet().GetParent(), "No parent set" );
- const SvxFontHeightItem& rOldItem = (SvxFontHeightItem&)_pPage->GetItemSet().GetParent()->Get( _nFontHeightWhich );
+ const SvxFontHeightItem& rOldItem = static_cast<const SvxFontHeightItem&>(_pPage->GetItemSet().GetParent()->Get( _nFontHeightWhich ));
// old value, scaled
long nHeight;
@@ -671,7 +671,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
if ( eState >= SfxItemState::DEFAULT )
{
- pFontItem = (const SvxFontItem*)&( rSet.Get( nWhich ) );
+ pFontItem = static_cast<const SvxFontItem*>(&( rSet.Get( nWhich ) ));
pNameBox->SetText( pFontItem->GetFamilyName() );
}
else
@@ -695,7 +695,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
if ( eState >= SfxItemState::DEFAULT )
{
- const SvxPostureItem& rItem = (SvxPostureItem&)rSet.Get( nWhich );
+ const SvxPostureItem& rItem = static_cast<const SvxPostureItem&>(rSet.Get( nWhich ));
eItalic = (FontItalic)rItem.GetValue();
bStyle = true;
}
@@ -711,7 +711,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
if ( eState >= SfxItemState::DEFAULT )
{
- SvxWeightItem& rItem = (SvxWeightItem&)rSet.Get( nWhich );
+ const SvxWeightItem& rItem = static_cast<const SvxWeightItem&>(rSet.Get( nWhich ));
eWeight = (FontWeight)rItem.GetValue();
}
else
@@ -751,7 +751,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
if ( pSizeBox->IsRelativeMode() )
{
SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
- const SvxFontHeightItem& rItem = (SvxFontHeightItem&)rSet.Get( nWhich );
+ const SvxFontHeightItem& rItem = static_cast<const SvxFontHeightItem&>(rSet.Get( nWhich ));
if( rItem.GetProp() != 100 || SFX_MAPUNIT_RELATIVE != rItem.GetPropUnit() )
{
@@ -768,7 +768,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
else if ( eState >= SfxItemState::DEFAULT )
{
SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
- const SvxFontHeightItem& rItem = (SvxFontHeightItem&)rSet.Get( nWhich );
+ const SvxFontHeightItem& rItem = static_cast<const SvxFontHeightItem&>(rSet.Get( nWhich ));
pSizeBox->SetValue( (long)CalcToPoint( rItem.GetHeight(), eUnit, 10 ) );
}
else
@@ -806,7 +806,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
case SfxItemState::DEFAULT:
case SfxItemState::SET:
{
- const SvxLanguageItem& rItem = (SvxLanguageItem&)rSet.Get( nWhich );
+ const SvxLanguageItem& rItem = static_cast<const SvxLanguageItem&>(rSet.Get( nWhich ));
LanguageType eLangType = (LanguageType)rItem.GetValue();
DBG_ASSERT( eLangType != LANGUAGE_SYSTEM, "LANGUAGE_SYSTEM not allowed" );
if ( eLangType != LANGUAGE_DONTKNOW )
@@ -901,7 +901,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
if ( pOld )
{
- const SvxFontItem& rItem = *( (const SvxFontItem*)pOld );
+ const SvxFontItem& rItem = *static_cast<const SvxFontItem*>(pOld);
if ( rItem.GetFamilyName() == aFontItem.GetFamilyName() )
bChanged = false;
@@ -912,7 +912,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
if ( !bChanged && pExampleSet &&
pExampleSet->GetItemState( nWhich, false, &pItem ) == SfxItemState::SET &&
- ( (SvxFontItem*)pItem )->GetFamilyName() != aFontItem.GetFamilyName() )
+ static_cast<const SvxFontItem*>(pItem)->GetFamilyName() != aFontItem.GetFamilyName() )
bChanged = true;
if ( bChanged && !rFontName.isEmpty() )
@@ -940,7 +940,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
if ( pOld )
{
- const SvxWeightItem& rItem = *( (const SvxWeightItem*)pOld );
+ const SvxWeightItem& rItem = *static_cast<const SvxWeightItem*>(pOld);
if ( rItem.GetValue() == aWeightItem.GetValue() )
bChanged = false;
@@ -957,7 +957,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
if ( !bChanged && pExampleSet &&
pExampleSet->GetItemState( nWhich, false, &pItem ) == SfxItemState::SET &&
- ( (SvxWeightItem*)pItem )->GetValue() != aWeightItem.GetValue() )
+ static_cast<const SvxWeightItem*>(pItem)->GetValue() != aWeightItem.GetValue() )
bChanged = true;
if ( nEntryPos >= m_pImpl->m_nExtraEntryPos )
@@ -989,7 +989,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
if ( pOld )
{
- const SvxPostureItem& rItem = *( (const SvxPostureItem*)pOld );
+ const SvxPostureItem& rItem = *static_cast<const SvxPostureItem*>(pOld);
if ( rItem.GetValue() == aPostureItem.GetValue() )
bChanged = false;
@@ -1006,7 +1006,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
if ( !bChanged && pExampleSet &&
pExampleSet->GetItemState( nWhich, false, &pItem ) == SfxItemState::SET &&
- ( (SvxPostureItem*)pItem )->GetValue() != aPostureItem.GetValue() )
+ static_cast<const SvxPostureItem*>(pItem)->GetValue() != aPostureItem.GetValue() )
bChanged = true;
if ( nEntryPos >= m_pImpl->m_nExtraEntryPos )
@@ -1041,7 +1041,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
case Ctl : nSlot = SID_ATTR_CHAR_CTL_FONTHEIGHT; break;
}
nWhich = GetWhich( nSlot );
- const SvxFontHeightItem* pOldHeight = (const SvxFontHeightItem*)GetOldItem( rSet, nSlot );
+ const SvxFontHeightItem* pOldHeight = static_cast<const SvxFontHeightItem*>(GetOldItem( rSet, nSlot ));
bChanged = ( nSize != nSavedSize );
if ( !bChanged && pExampleSet &&
@@ -1049,7 +1049,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
{
float fSize = (float)nSize / 10;
long nVal = CalcToUnit( fSize, rSet.GetPool()->GetMetric( nWhich ) );
- if ( ( (SvxFontHeightItem*)pItem )->GetHeight() != (sal_uInt32)nVal )
+ if ( static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() != (sal_uInt32)nVal )
bChanged = true;
}
@@ -1061,7 +1061,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
{
DBG_ASSERT( GetItemSet().GetParent(), "No parent set" );
const SvxFontHeightItem& rOldItem =
- (const SvxFontHeightItem&)GetItemSet().GetParent()->Get( nWhich );
+ static_cast<const SvxFontHeightItem&>(GetItemSet().GetParent()->Get( nWhich ));
SvxFontHeightItem aHeight( 240, 100, nWhich );
if ( pSizeBox->IsPtRelative() )
@@ -1114,11 +1114,11 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
}
sal_Int32 nLangPos = pLangBox->GetSelectEntryPosLBB();
- LanguageType eLangType = (LanguageType)(sal_uLong)pLangBox->GetEntryDataLBB( nLangPos );
+ LanguageType eLangType = (LanguageType)reinterpret_cast<sal_uLong>(pLangBox->GetEntryDataLBB( nLangPos ));
if ( pOld )
{
- const SvxLanguageItem& rItem = *( (const SvxLanguageItem*)pOld );
+ const SvxLanguageItem& rItem = *static_cast<const SvxLanguageItem*>(pOld);
if ( nLangPos == LISTBOX_ENTRY_NOTFOUND || eLangType == (LanguageType)rItem.GetValue() )
bChanged = false;
@@ -1234,7 +1234,7 @@ namespace
_pFontSizeLB->EnableRelativeMode( 5, 995, 5 ); // min 5%, max 995%, step 5
const SvxFontHeightItem& rHeightItem =
- (SvxFontHeightItem&)_pPage->GetItemSet().GetParent()->Get( _nHeightWhich );
+ static_cast<const SvxFontHeightItem&>(_pPage->GetItemSet().GetParent()->Get( _nHeightWhich ));
SfxMapUnit eUnit = _pPage->GetItemSet().GetPool()->GetMetric( _nHeightWhich );
short nCurHeight =
static_cast< short >( CalcToPoint( rHeightItem.GetHeight(), eUnit, 1 ) * 10 );
@@ -1358,7 +1358,7 @@ void SvxCharEffectsPage::Initialize()
( NULL != ( pShell = SfxObjectShell::Current() ) &&
NULL != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) )
{
- m_nHtmlMode = ( (const SfxUInt16Item*)pItem )->GetValue();
+ m_nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
if ( ( m_nHtmlMode & HTMLMODE_ON ) == HTMLMODE_ON )
{
//!!! hide some controls please
@@ -1374,7 +1374,7 @@ void SvxCharEffectsPage::Initialize()
{
pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
- pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
+ pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
}
if ( !pColorTable.is() )
@@ -1460,11 +1460,11 @@ void SvxCharEffectsPage::UpdatePreview_Impl()
SvxFont& rCTLFont = GetPreviewCTLFont();
sal_Int32 nPos = m_pUnderlineLB->GetSelectEntryPos();
- FontUnderline eUnderline = (FontUnderline)(sal_uLong)m_pUnderlineLB->GetEntryData( nPos );
+ FontUnderline eUnderline = (FontUnderline)reinterpret_cast<sal_uLong>(m_pUnderlineLB->GetEntryData( nPos ));
nPos = m_pOverlineLB->GetSelectEntryPos();
- FontUnderline eOverline = (FontUnderline)(sal_uLong)m_pOverlineLB->GetEntryData( nPos );
+ FontUnderline eOverline = (FontUnderline)reinterpret_cast<sal_uLong>(m_pOverlineLB->GetEntryData( nPos ));
nPos = m_pStrikeoutLB->GetSelectEntryPos();
- FontStrikeout eStrikeout = (FontStrikeout)(sal_uLong)m_pStrikeoutLB->GetEntryData( nPos );
+ FontStrikeout eStrikeout = (FontStrikeout)reinterpret_cast<sal_uLong>(m_pStrikeoutLB->GetEntryData( nPos ));
rFont.SetUnderline( eUnderline );
rCJKFont.SetUnderline( eUnderline );
rCTLFont.SetUnderline( eUnderline );
@@ -1478,7 +1478,7 @@ void SvxCharEffectsPage::UpdatePreview_Impl()
rCTLFont.SetStrikeout( eStrikeout );
nPos = m_pPositionLB->GetSelectEntryPos();
- bool bUnder = ( CHRDLG_POSITION_UNDER == (sal_uLong)m_pPositionLB->GetEntryData( nPos ) );
+ bool bUnder = ( CHRDLG_POSITION_UNDER == reinterpret_cast<sal_uLong>(m_pPositionLB->GetEntryData( nPos )) );
FontEmphasisMark eMark = (FontEmphasisMark)m_pEmphasisLB->GetSelectEntryPos();
eMark |= bUnder ? EMPHASISMARK_POS_BELOW : EMPHASISMARK_POS_ABOVE;
rFont.SetEmphasisMark( eMark );
@@ -1565,7 +1565,7 @@ void SvxCharEffectsPage::ResetColor_Impl( const SfxItemSet& rSet )
SvxFont& rCJKFont = GetPreviewCJKFont();
SvxFont& rCTLFont = GetPreviewCTLFont();
- const SvxColorItem& rItem = (SvxColorItem&)rSet.Get( nWhich );
+ const SvxColorItem& rItem = static_cast<const SvxColorItem&>(rSet.Get( nWhich ));
Color aColor = rItem.GetValue();
rFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor );
rCJKFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor );
@@ -1597,7 +1597,7 @@ void SvxCharEffectsPage::ResetColor_Impl( const SfxItemSet& rSet )
bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet )
{
sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
- const SvxColorItem* pOld = (const SvxColorItem*)GetOldItem( rSet, SID_ATTR_CHAR_COLOR );
+ const SvxColorItem* pOld = static_cast<const SvxColorItem*>(GetOldItem( rSet, SID_ATTR_CHAR_COLOR ));
const SvxColorItem* pItem = NULL;
bool bChanged = true;
const SfxItemSet* pExampleSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL;
@@ -1764,7 +1764,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
m_pUnderlineLB->SetNoSelection();
else
{
- const SvxUnderlineItem& rItem = (SvxUnderlineItem&)rSet->Get( nWhich );
+ const SvxUnderlineItem& rItem = static_cast<const SvxUnderlineItem&>(rSet->Get( nWhich ));
FontUnderline eUnderline = (FontUnderline)rItem.GetValue();
rFont.SetUnderline( eUnderline );
rCJKFont.SetUnderline( eUnderline );
@@ -1774,7 +1774,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
{
for ( sal_Int32 i = 0; i < m_pUnderlineLB->GetEntryCount(); ++i )
{
- if ( (FontUnderline)(sal_uLong)m_pUnderlineLB->GetEntryData(i) == eUnderline )
+ if ( (FontUnderline)reinterpret_cast<sal_uLong>(m_pUnderlineLB->GetEntryData(i)) == eUnderline )
{
m_pUnderlineLB->SelectEntryPos(i);
bEnable = true;
@@ -1821,7 +1821,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
m_pOverlineLB->SetNoSelection();
else
{
- const SvxOverlineItem& rItem = (SvxOverlineItem&)rSet->Get( nWhich );
+ const SvxOverlineItem& rItem = static_cast<const SvxOverlineItem&>(rSet->Get( nWhich ));
FontUnderline eOverline = (FontUnderline)rItem.GetValue();
rFont.SetOverline( eOverline );
rCJKFont.SetOverline( eOverline );
@@ -1831,7 +1831,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
{
for ( sal_Int32 i = 0; i < m_pOverlineLB->GetEntryCount(); ++i )
{
- if ( (FontUnderline)(sal_uLong)m_pOverlineLB->GetEntryData(i) == eOverline )
+ if ( (FontUnderline)reinterpret_cast<sal_uLong>(m_pOverlineLB->GetEntryData(i)) == eOverline )
{
m_pOverlineLB->SelectEntryPos(i);
bEnable = true;
@@ -1878,7 +1878,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
m_pStrikeoutLB->SetNoSelection();
else
{
- const SvxCrossedOutItem& rItem = (SvxCrossedOutItem&)rSet->Get( nWhich );
+ const SvxCrossedOutItem& rItem = static_cast<const SvxCrossedOutItem&>(rSet->Get( nWhich ));
FontStrikeout eStrikeout = (FontStrikeout)rItem.GetValue();
rFont.SetStrikeout( eStrikeout );
rCJKFont.SetStrikeout( eStrikeout );
@@ -1888,7 +1888,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
{
for ( sal_Int32 i = 0; i < m_pStrikeoutLB->GetEntryCount(); ++i )
{
- if ( (FontStrikeout)(sal_uLong)m_pStrikeoutLB->GetEntryData(i) == eStrikeout )
+ if ( (FontStrikeout)reinterpret_cast<sal_uLong>(m_pStrikeoutLB->GetEntryData(i)) == eStrikeout )
{
m_pStrikeoutLB->SelectEntryPos(i);
bEnable = true;
@@ -1919,7 +1919,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
case SfxItemState::DEFAULT:
case SfxItemState::SET:
{
- const SvxWordLineModeItem& rItem = (SvxWordLineModeItem&)rSet->Get( nWhich );
+ const SvxWordLineModeItem& rItem = static_cast<const SvxWordLineModeItem&>(rSet->Get( nWhich ));
rFont.SetWordLineMode( rItem.GetValue() );
rCJKFont.SetWordLineMode( rItem.GetValue() );
rCTLFont.SetWordLineMode( rItem.GetValue() );
@@ -1936,7 +1936,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
if ( eState >= SfxItemState::DEFAULT )
{
- const SvxEmphasisMarkItem& rItem = (SvxEmphasisMarkItem&)rSet->Get( nWhich );
+ const SvxEmphasisMarkItem& rItem = static_cast<const SvxEmphasisMarkItem&>(rSet->Get( nWhich ));
FontEmphasisMark eMark = rItem.GetEmphasisMark();
rFont.SetEmphasisMark( eMark );
rCJKFont.SetEmphasisMark( eMark );
@@ -1950,7 +1950,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
for ( sal_Int32 i = 0; i < m_pPositionLB->GetEntryCount(); i++ )
{
- if ( nEntryData == (sal_uLong)m_pPositionLB->GetEntryData(i) )
+ if ( nEntryData == reinterpret_cast<sal_uLong>(m_pPositionLB->GetEntryData(i)) )
{
m_pPositionLB->SelectEntryPos(i);
break;
@@ -2011,7 +2011,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
case SfxItemState::DEFAULT:
case SfxItemState::SET:
{
- const SvxCaseMapItem& rItem = (const SvxCaseMapItem&)rSet->Get( nWhich );
+ const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>(rSet->Get( nWhich ));
eCaseMap = (SvxCaseMap)rItem.GetValue();
break;
}
@@ -2041,7 +2041,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
case SfxItemState::DEFAULT:
case SfxItemState::SET:
{
- const SvxCharReliefItem& rItem = (const SvxCharReliefItem&)rSet->Get( nWhich );
+ const SvxCharReliefItem& rItem = static_cast<const SvxCharReliefItem&>(rSet->Get( nWhich ));
m_pReliefLB->SelectEntryPos(rItem.GetValue());
SelectHdl_Impl(m_pReliefLB);
break;
@@ -2069,7 +2069,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
case SfxItemState::DEFAULT:
case SfxItemState::SET:
{
- const SvxContourItem& rItem = (SvxContourItem&)rSet->Get( nWhich );
+ const SvxContourItem& rItem = static_cast<const SvxContourItem&>(rSet->Get( nWhich ));
m_pOutlineBtn->SetState( (TriState)rItem.GetValue() );
m_pOutlineBtn->EnableTriState( false );
break;
@@ -2098,7 +2098,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
case SfxItemState::DEFAULT:
case SfxItemState::SET:
{
- const SvxShadowedItem& rItem = (SvxShadowedItem&)rSet->Get( nWhich );
+ const SvxShadowedItem& rItem = static_cast<const SvxShadowedItem&>(rSet->Get( nWhich ));
m_pShadowBtn->SetState( (TriState)rItem.GetValue() );
m_pShadowBtn->EnableTriState( false );
break;
@@ -2127,7 +2127,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
case SfxItemState::DEFAULT:
case SfxItemState::SET:
{
- const SvxBlinkItem& rItem = (SvxBlinkItem&)rSet->Get( nWhich );
+ const SvxBlinkItem& rItem = static_cast<const SvxBlinkItem&>(rSet->Get( nWhich ));
m_pBlinkingBtn->SetState( (TriState)rItem.GetValue() );
m_pBlinkingBtn->EnableTriState( false );
break;
@@ -2155,7 +2155,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
case SfxItemState::DEFAULT:
case SfxItemState::SET:
{
- const SvxCharHiddenItem& rItem = (SvxCharHiddenItem&)rSet->Get( nWhich );
+ const SvxCharHiddenItem& rItem = static_cast<const SvxCharHiddenItem&>(rSet->Get( nWhich ));
m_pHiddenBtn->SetState( (TriState)rItem.GetValue() );
m_pHiddenBtn->EnableTriState( false );
break;
@@ -2199,7 +2199,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_UNDERLINE );
pOld = GetOldItem( *rSet, SID_ATTR_CHAR_UNDERLINE );
sal_Int32 nPos = m_pUnderlineLB->GetSelectEntryPos();
- FontUnderline eUnder = (FontUnderline)(sal_uLong)m_pUnderlineLB->GetEntryData( nPos );
+ FontUnderline eUnder = (FontUnderline)reinterpret_cast<sal_uLong>(m_pUnderlineLB->GetEntryData( nPos ));
if ( pOld )
{
@@ -2210,7 +2210,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
bool bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos &&
SfxItemState::DEFAULT > rOldSet.GetItemState( nWhich, true );
- const SvxUnderlineItem& rItem = *( (const SvxUnderlineItem*)pOld );
+ const SvxUnderlineItem& rItem = *static_cast<const SvxUnderlineItem*>(pOld);
if ( (FontUnderline)rItem.GetValue() == eUnder &&
( UNDERLINE_NONE == eUnder || rItem.GetColor() == m_pUnderlineColorLB->GetSelectEntryColor() ) &&
! bAllowChg )
@@ -2233,7 +2233,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_CHAR_OVERLINE );
pOld = GetOldItem( *rSet, SID_ATTR_CHAR_OVERLINE );
nPos = m_pOverlineLB->GetSelectEntryPos();
- FontUnderline eOver = (FontUnderline)(sal_uLong)m_pOverlineLB->GetEntryData( nPos );
+ FontUnderline eOver = (FontUnderline)reinterpret_cast<sal_uLong>(m_pOverlineLB->GetEntryData( nPos ));
if ( pOld )
{
@@ -2244,7 +2244,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
bool bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos &&
SfxItemState::DEFAULT > rOldSet.GetItemState( nWhich, true );
- const SvxOverlineItem& rItem = *( (const SvxOverlineItem*)pOld );
+ const SvxOverlineItem& rItem = *static_cast<const SvxOverlineItem*>(pOld);
if ( (FontUnderline)rItem.GetValue() == eOver &&
( UNDERLINE_NONE == eOver || rItem.GetColor() == m_pOverlineColorLB->GetSelectEntryColor() ) &&
! bAllowChg )
@@ -2267,7 +2267,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_CHAR_STRIKEOUT );
pOld = GetOldItem( *rSet, SID_ATTR_CHAR_STRIKEOUT );
nPos = m_pStrikeoutLB->GetSelectEntryPos();
- FontStrikeout eStrike = (FontStrikeout)(sal_uLong)m_pStrikeoutLB->GetEntryData( nPos );
+ FontStrikeout eStrike = (FontStrikeout)reinterpret_cast<sal_uLong>(m_pStrikeoutLB->GetEntryData( nPos ));
if ( pOld )
{
@@ -2278,7 +2278,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
bool bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos &&
SfxItemState::DEFAULT > rOldSet.GetItemState( nWhich, true );
- const SvxCrossedOutItem& rItem = *( (const SvxCrossedOutItem*)pOld );
+ const SvxCrossedOutItem& rItem = *static_cast<const SvxCrossedOutItem*>(pOld);
if ( !m_pStrikeoutLB->IsEnabled()
|| ((FontStrikeout)rItem.GetValue() == eStrike && !bAllowChg) )
bChanged = false;
@@ -2300,7 +2300,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
if ( pOld )
{
- const SvxWordLineModeItem& rItem = *( (const SvxWordLineModeItem*)pOld );
+ const SvxWordLineModeItem& rItem = *static_cast<const SvxWordLineModeItem*>(pOld);
if ( rItem.GetValue() == (bool) m_pIndividualWordsBtn->IsChecked() )
bChanged = false;
}
@@ -2327,7 +2327,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
FontEmphasisMark eMark = (FontEmphasisMark)nMarkPos;
if ( m_pPositionLB->IsEnabled() )
{
- eMark |= ( CHRDLG_POSITION_UNDER == (sal_uLong)m_pPositionLB->GetEntryData( nPosPos ) )
+ eMark |= ( CHRDLG_POSITION_UNDER == reinterpret_cast<sal_uLong>(m_pPositionLB->GetEntryData( nPosPos )) )
? EMPHASISMARK_POS_BELOW : EMPHASISMARK_POS_ABOVE;
}
@@ -2335,7 +2335,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
{
if( rOldSet.GetItemState( nWhich ) != SfxItemState::DONTCARE )
{
- const SvxEmphasisMarkItem& rItem = *( (const SvxEmphasisMarkItem*)pOld );
+ const SvxEmphasisMarkItem& rItem = *static_cast<const SvxEmphasisMarkItem*>(pOld);
if ( rItem.GetEmphasisMark() == eMark )
bChanged = false;
}
@@ -2376,7 +2376,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
bool bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos &&
SfxItemState::DEFAULT > rOldSet.GetItemState( nWhich, true );
- const SvxCaseMapItem& rItem = *( (const SvxCaseMapItem*)pOld );
+ const SvxCaseMapItem& rItem = *static_cast<const SvxCaseMapItem*>(pOld);
if ( (SvxCaseMap)rItem.GetValue() == eCaseMap && !bAllowChg )
bChanged = false;
}
@@ -2409,13 +2409,13 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
if ( pOld )
{
- const SvxContourItem& rItem = *( (const SvxContourItem*)pOld );
+ const SvxContourItem& rItem = *static_cast<const SvxContourItem*>(pOld);
if ( rItem.GetValue() == StateToAttr( eState ) && m_pOutlineBtn->GetSavedValue() == eState )
bChanged = false;
}
if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, false, &pItem ) == SfxItemState::SET &&
- !StateToAttr( eState ) && ( (SvxContourItem*)pItem )->GetValue() )
+ !StateToAttr( eState ) && static_cast<const SvxContourItem*>(pItem)->GetValue() )
bChanged = true;
if ( bChanged && eState != TRISTATE_INDET )
@@ -2435,13 +2435,13 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
if ( pOld )
{
- const SvxShadowedItem& rItem = *( (const SvxShadowedItem*)pOld );
+ const SvxShadowedItem& rItem = *static_cast<const SvxShadowedItem*>(pOld);
if ( rItem.GetValue() == StateToAttr( eState ) && m_pShadowBtn->GetSavedValue() == eState )
bChanged = false;
}
if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, false, &pItem ) == SfxItemState::SET &&
- !StateToAttr( eState ) && ( (SvxShadowedItem*)pItem )->GetValue() )
+ !StateToAttr( eState ) && static_cast<const SvxShadowedItem*>(pItem)->GetValue() )
bChanged = true;
if ( bChanged && eState != TRISTATE_INDET )
@@ -2461,13 +2461,13 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
if ( pOld )
{
- const SvxBlinkItem& rItem = *( (const SvxBlinkItem*)pOld );
+ const SvxBlinkItem& rItem = *static_cast<const SvxBlinkItem*>(pOld);
if ( rItem.GetValue() == StateToAttr( eState ) && m_pBlinkingBtn->GetSavedValue() == eState )
bChanged = false;
}
if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, false, &pItem ) == SfxItemState::SET &&
- !StateToAttr( eState ) && ( (SvxBlinkItem*)pItem )->GetValue() )
+ !StateToAttr( eState ) && static_cast<const SvxBlinkItem*>(pItem)->GetValue() )
bChanged = true;
if ( bChanged && eState != TRISTATE_INDET )
@@ -2486,13 +2486,13 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
if ( pOld )
{
- const SvxCharHiddenItem& rItem = *( (const SvxCharHiddenItem*)pOld );
+ const SvxCharHiddenItem& rItem = *static_cast<const SvxCharHiddenItem*>(pOld);
if ( rItem.GetValue() == StateToAttr( eState ) && m_pHiddenBtn->GetSavedValue() == eState )
bChanged = false;
}
if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, false, &pItem ) == SfxItemState::SET &&
- !StateToAttr( eState ) && ( (SvxCharHiddenItem*)pItem )->GetValue() )
+ !StateToAttr( eState ) && static_cast<const SvxCharHiddenItem*>(pItem)->GetValue() )
bChanged = true;
if ( bChanged && eState != TRISTATE_INDET )
@@ -2962,7 +2962,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
if ( rSet->GetItemState( nWhich ) >= SfxItemState::DEFAULT )
{
- const SvxEscapementItem& rItem = (SvxEscapementItem&)rSet->Get( nWhich );
+ const SvxEscapementItem& rItem = static_cast<const SvxEscapementItem&>(rSet->Get( nWhich ));
nEsc = rItem.GetEsc();
nEscProp = rItem.GetProp();
@@ -3033,7 +3033,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
if ( rSet->GetItemState( nWhich ) >= SfxItemState::DEFAULT )
{
- const SvxKerningItem& rItem = (SvxKerningItem&)rSet->Get( nWhich );
+ const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>(rSet->Get( nWhich ));
SfxMapUnit eUnit = rSet->GetPool()->GetMetric( nWhich );
MapUnit eOrgUnit = (MapUnit)eUnit;
MapUnit ePntUnit( MAP_POINT );
@@ -3076,7 +3076,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
if ( rSet->GetItemState( nWhich ) >= SfxItemState::DEFAULT )
{
- const SvxAutoKernItem& rItem = (SvxAutoKernItem&)rSet->Get( nWhich );
+ const SvxAutoKernItem& rItem = static_cast<const SvxAutoKernItem&>(rSet->Get( nWhich ));
m_pPairKerningBtn->Check( rItem.GetValue() );
}
else
@@ -3086,7 +3086,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH );
if ( rSet->GetItemState( nWhich ) >= SfxItemState::DEFAULT )
{
- const SvxCharScaleWidthItem& rItem = ( SvxCharScaleWidthItem& ) rSet->Get( nWhich );
+ const SvxCharScaleWidthItem& rItem = static_cast<const SvxCharScaleWidthItem&>( rSet->Get( nWhich ) );
m_nScaleWidthInitialVal = rItem.GetValue();
m_pScaleWidthMF->SetValue( m_nScaleWidthInitialVal );
}
@@ -3095,7 +3095,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE );
if ( rSet->GetItemState( nWhich ) >= SfxItemState::DEFAULT )
- m_nScaleWidthItemSetVal = ((SfxUInt16Item&) rSet->Get( nWhich )).GetValue();
+ m_nScaleWidthItemSetVal = static_cast<const SfxUInt16Item&>( rSet->Get( nWhich )).GetValue();
// Rotation
nWhich = GetWhich( SID_ATTR_CHAR_ROTATED );
@@ -3117,7 +3117,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
if( eState >= SfxItemState::DEFAULT )
{
const SvxCharRotateItem& rItem =
- (SvxCharRotateItem&) rSet->Get( nWhich );
+ static_cast<const SvxCharRotateItem&>( rSet->Get( nWhich ));
if (rItem.IsBottomToTop())
m_p90degRB->Check( true );
else if (rItem.IsTopToBotton())
@@ -3196,7 +3196,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
if ( pOld )
{
- const SvxEscapementItem& rItem = *( (const SvxEscapementItem*)pOld );
+ const SvxEscapementItem& rItem = *static_cast<const SvxEscapementItem*>(pOld);
if ( rItem.GetEsc() == nEsc && rItem.GetProp() == nEscProp )
bChanged = false;
}
@@ -3235,7 +3235,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
if ( pOld )
{
- const SvxKerningItem& rItem = *( (const SvxKerningItem*)pOld );
+ const SvxKerningItem& rItem = *static_cast<const SvxKerningItem*>(pOld);
if ( rItem.GetValue() == nKerning )
bChanged = false;
}
@@ -3400,7 +3400,7 @@ void SvxCharTwoLinesPage::SetBracket( sal_Unicode cBracket, bool bStart )
bool bFound = false;
for ( sal_Int32 i = 1; i < pBox->GetEntryCount(); ++i )
{
- if ( (sal_uLong)pBox->GetEntryData(i) != CHRDLG_ENCLOSE_SPECIAL_CHAR )
+ if ( reinterpret_cast<sal_uLong>(pBox->GetEntryData(i)) != CHRDLG_ENCLOSE_SPECIAL_CHAR )
{
const sal_Unicode cChar = pBox->GetEntry(i)[0];
if ( cChar == cBracket )
@@ -3441,7 +3441,7 @@ IMPL_LINK_NOARG(SvxCharTwoLinesPage, TwoLinesHdl_Impl)
IMPL_LINK( SvxCharTwoLinesPage, CharacterMapHdl_Impl, ListBox*, pBox )
{
sal_Int32 nPos = pBox->GetSelectEntryPos();
- if ( CHRDLG_ENCLOSE_SPECIAL_CHAR == (sal_uLong)pBox->GetEntryData( nPos ) )
+ if ( CHRDLG_ENCLOSE_SPECIAL_CHAR == reinterpret_cast<sal_uLong>(pBox->GetEntryData( nPos )) )
SelectCharacter( pBox );
else
{
@@ -3495,7 +3495,7 @@ void SvxCharTwoLinesPage::Reset( const SfxItemSet* rSet )
if ( eState >= SfxItemState::DONTCARE )
{
- const SvxTwoLinesItem& rItem = (SvxTwoLinesItem&)rSet->Get( nWhich );
+ const SvxTwoLinesItem& rItem = static_cast<const SvxTwoLinesItem&>(rSet->Get( nWhich ));
m_pTwoLinesBtn->Check( rItem.GetValue() );
if ( rItem.GetValue() )
@@ -3525,7 +3525,7 @@ bool SvxCharTwoLinesPage::FillItemSet( SfxItemSet* rSet )
if ( pOld )
{
- const SvxTwoLinesItem& rItem = *( (const SvxTwoLinesItem*)pOld );
+ const SvxTwoLinesItem& rItem = *static_cast<const SvxTwoLinesItem*>(pOld);
if ( rItem.GetValue() == bOn &&
( !bOn || ( rItem.GetStartBracket() == cStart && rItem.GetEndBracket() == cEnd ) ) )
bChanged = false;
diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx
index d5e5bd12ae39..35cb0d2a777d 100644
--- a/cui/source/tabpages/connect.cxx
+++ b/cui/source/tabpages/connect.cxx
@@ -167,7 +167,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE1HORZDIST );
if( pItem )
{
- long nValue = ( ( const SdrEdgeNode1HorzDistItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrEdgeNode1HorzDistItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldHorz1, nValue, eUnit );
}
else
@@ -181,7 +181,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE2HORZDIST );
if( pItem )
{
- long nValue = ( ( const SdrEdgeNode2HorzDistItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrEdgeNode2HorzDistItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldHorz2, nValue, eUnit );
}
else
@@ -195,7 +195,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE1VERTDIST );
if( pItem )
{
- long nValue = ( ( const SdrEdgeNode1VertDistItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrEdgeNode1VertDistItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldVert1, nValue, eUnit );
}
else
@@ -209,7 +209,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE2VERTDIST );
if( pItem )
{
- long nValue = ( ( const SdrEdgeNode2VertDistItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrEdgeNode2VertDistItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldVert2, nValue, eUnit );
}
else
@@ -223,7 +223,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE1DELTA );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldLine1, nValue, eUnit );
}
else
@@ -237,7 +237,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE2DELTA );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldLine2, nValue, eUnit );
}
else
@@ -251,7 +251,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE3DELTA );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldLine3, nValue, eUnit );
}
else
@@ -265,7 +265,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINEDELTAANZ );
if( pItem )
{
- sal_uInt16 nValue = ( ( const SdrEdgeLineDeltaAnzItem* )pItem )->GetValue();
+ sal_uInt16 nValue = static_cast<const SdrEdgeLineDeltaAnzItem*>( pItem )->GetValue();
if( nValue <= 2 )
{
m_pFtLine3->Enable( false );
@@ -292,7 +292,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_EDGEKIND );
if( pItem )
{
- SdrEdgeKind nValue = ( ( const SdrEdgeKindItem* )pItem )->GetValue();
+ SdrEdgeKind nValue = static_cast<const SdrEdgeKindItem*>( pItem )->GetValue();
m_pLbType->SelectEntryPos( sal::static_int_cast< sal_uInt16 >(nValue) );
}
else
@@ -496,7 +496,7 @@ void SvxConnectionPage::FillTypeLB()
pItem = &pPool->GetDefaultItem( SDRATTR_EDGEKIND );
if( pItem )
{
- const SdrEdgeKindItem* pEdgeKindItem = (const SdrEdgeKindItem*) pItem;
+ const SdrEdgeKindItem* pEdgeKindItem = static_cast<const SdrEdgeKindItem*>( pItem );
sal_uInt16 nCount = pEdgeKindItem->GetValueCount();
OUString aStr;
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 30e02587382c..a724ca43d082 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -142,7 +142,7 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
if(SfxItemState::SET == rSet->GetItemState( rPool.GetWhich(
SID_ATTR_GRAF_KEEP_ZOOM ), true, &pItem ))
{
- if( ((const SfxBoolItem*)pItem)->GetValue() )
+ if( static_cast<const SfxBoolItem*>(pItem)->GetValue() )
m_pZoomConstRB->Check();
else
m_pSizeConstRB->Check();
@@ -154,7 +154,7 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
{
FieldUnit eUnit = MapToFieldUnit( rSet->GetPool()->GetMetric( nW ));
- SvxGrfCrop* pCrop = (SvxGrfCrop*)pItem;
+ const SvxGrfCrop* pCrop = static_cast<const SvxGrfCrop*>(pItem);
m_pExampleWN->SetLeft( pCrop->GetLeft());
m_pExampleWN->SetRight( pCrop->GetRight());
@@ -180,7 +180,7 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
// orientation and size from the PageItem
FieldUnit eUnit = MapToFieldUnit( rSet->GetPool()->GetMetric( nW ));
- aPageSize = ((const SvxSizeItem*)pItem)->GetSize();
+ aPageSize = static_cast<const SvxSizeItem*>(pItem)->GetSize();
sal_Int64 nTmp = m_pHeightMF->Normalize(aPageSize.Height());
m_pHeightMF->SetMax( nTmp, eUnit );
@@ -207,7 +207,7 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
if (it != 0) {
referer = it->GetValue();
}
- const Graphic* pGrf = ((SvxBrushItem*)pItem)->GetGraphic(referer);
+ const Graphic* pGrf = static_cast<const SvxBrushItem*>(pItem)->GetGraphic(referer);
if( pGrf )
{
aOrigSize = GetGrfOrigSize( *pGrf );
@@ -224,8 +224,8 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
m_pExampleWN->SetFrameSize( aOrigSize );
bFound = true;
- if( !((SvxBrushItem*)pItem)->GetGraphicLink().isEmpty() )
- aGraphicName = ((SvxBrushItem*)pItem)->GetGraphicLink();
+ if( !static_cast<const SvxBrushItem*>(pItem)->GetGraphicLink().isEmpty() )
+ aGraphicName = static_cast<const SvxBrushItem*>(pItem)->GetGraphicLink();
}
}
}
@@ -254,9 +254,9 @@ bool SvxGrfCropPage::FillItemSet(SfxItemSet *rSet)
const SfxPoolItem* pItem = 0;
if( pExSet && SfxItemState::SET ==
pExSet->GetItemState( nW, false, &pItem ) )
- aSz = *(const SvxSizeItem*)pItem;
+ aSz = *static_cast<const SvxSizeItem*>(pItem);
else
- aSz = (const SvxSizeItem&)GetItemSet().Get( nW );
+ aSz = static_cast<const SvxSizeItem&>(GetItemSet().Get( nW ));
Size aTmpSz( aSz.GetSize() );
if( m_pWidthMF->IsValueChangedFromSaved() )
@@ -280,7 +280,7 @@ bool SvxGrfCropPage::FillItemSet(SfxItemSet *rSet)
{
sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_CROP );
FieldUnit eUnit = MapToFieldUnit( rSet->GetPool()->GetMetric( nW ));
- boost::scoped_ptr<SvxGrfCrop> pNew((SvxGrfCrop*)rSet->Get( nW ).Clone());
+ boost::scoped_ptr<SvxGrfCrop> pNew(static_cast<SvxGrfCrop*>(rSet->Get( nW ).Clone()));
pNew->SetLeft( lcl_GetValue( *m_pLeftMF, eUnit ) );
pNew->SetRight( lcl_GetValue( *m_pRightMF, eUnit ) );
@@ -313,7 +313,7 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet)
Size aSize;
const SfxPoolItem* pItem;
if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRAF_FRMSIZE, false, &pItem ) )
- aSize = ((const SvxSizeItem*)pItem)->GetSize();
+ aSize = static_cast<const SvxSizeItem*>(pItem)->GetSize();
nOldWidth = aSize.Width();
nOldHeight = aSize.Height();
@@ -350,7 +350,7 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet)
if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRAF_GRAPHIC, false, &pItem ) )
{
- const SvxBrushItem& rBrush = *(SvxBrushItem*)pItem;
+ const SvxBrushItem& rBrush = *static_cast<const SvxBrushItem*>(pItem);
if( !rBrush.GetGraphicLink().isEmpty() &&
aGraphicName != rBrush.GetGraphicLink() )
aGraphicName = rBrush.GetGraphicLink();
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index e1dcee776491..8b8c196c3051 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -246,31 +246,31 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
nWhich = GetWhich( SDRATTR_CAPTIONESCABS );
eUnit = pPool->GetMetric( nWhich );
- nEscAbs = ( ( const SdrCaptionEscAbsItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
+ nEscAbs = static_cast<const SdrCaptionEscAbsItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
SetMetricValue( *m_pMF_ANSATZ, nEscAbs, eUnit );
nEscAbs = static_cast<long>(m_pMF_ANSATZ->GetValue());
nWhich = GetWhich( SDRATTR_CAPTIONESCREL );
- nEscRel = (long)( ( const SdrCaptionEscRelItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
+ nEscRel = (long)static_cast<const SdrCaptionEscRelItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
//------- line length ----------
nWhich = GetWhich( SDRATTR_CAPTIONLINELEN );
eUnit = pPool->GetMetric( nWhich );
- nLineLen = ( ( const SdrCaptionLineLenItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
+ nLineLen = static_cast<const SdrCaptionLineLenItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
SetMetricValue( *m_pMF_LAENGE, nLineLen, eUnit );
nLineLen = static_cast<long>(m_pMF_LAENGE->GetValue());
//------- distance to box ----------
nWhich = GetWhich( SDRATTR_CAPTIONGAP );
eUnit = pPool->GetMetric( nWhich );
- nGap = ( ( const SdrCaptionGapItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
+ nGap = static_cast<const SdrCaptionGapItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
SetMetricValue( *m_pMF_ABSTAND, nGap, eUnit );
nGap = static_cast<long>(m_pMF_ABSTAND->GetValue());
- nCaptionType = (short)( ( const SdrCaptionTypeItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
- bFitLineLen = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
- nEscDir = (short)( ( const SdrCaptionEscDirItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
- bEscRel = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue();
+ nCaptionType = (short)static_cast<const SdrCaptionTypeItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
+ bFitLineLen = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
+ nEscDir = (short)static_cast<const SdrCaptionEscDirItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
+ bEscRel = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue();
// special treatment!!! XXX
if( nCaptionType==SDRCAPT_TYPE1 )
@@ -546,13 +546,13 @@ void SvxCaptionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if (nId == m_nPositionSizePageId)
{
- ( (SvxPositionSizeTabPage&) rPage ).SetView( pView );
- ( (SvxPositionSizeTabPage&) rPage ).Construct();
+ static_cast<SvxPositionSizeTabPage&>( rPage ).SetView( pView );
+ static_cast<SvxPositionSizeTabPage&>( rPage ).Construct();
if( nAnchorCtrls & SVX_OBJ_NORESIZE )
- ( (SvxPositionSizeTabPage&) rPage ).DisableResize();
+ static_cast<SvxPositionSizeTabPage&>( rPage ).DisableResize();
if( nAnchorCtrls & SVX_OBJ_NOPROTECT )
- ( (SvxPositionSizeTabPage&) rPage ).DisableProtect();
+ static_cast<SvxPositionSizeTabPage&>( rPage ).DisableProtect();
}
else if (nId == m_nSwPosSizePageId)
{
@@ -562,8 +562,8 @@ void SvxCaptionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
}
else if (nId == m_nCaptionPageId)
{
- ( (SvxCaptionTabPage&) rPage ).SetView( pView );
- ( (SvxCaptionTabPage&) rPage ).Construct();
+ static_cast<SvxCaptionTabPage&>( rPage ).SetView( pView );
+ static_cast<SvxCaptionTabPage&>( rPage ).Construct();
}
}
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 3af840679e2b..0288663bdf8a 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -122,11 +122,10 @@ void _SfxMacroTabPage::EnableButtons()
if ( pE )
{
// get bound macro
- const SvxMacro* pM = aTbl.Get( (sal_uInt16)(sal_uLong) pE->GetUserData() );
+ const SvxMacro* pM = aTbl.Get( (sal_uInt16)reinterpret_cast<sal_uLong>(pE->GetUserData()) );
mpImpl->pDeletePB->Enable( 0 != pM && !mpImpl->bReadOnly );
- OUString sEventMacro;
- sEventMacro = ((SvLBoxString*)pE->GetItem( LB_MACROS_ITEMPOS ))->GetText();
+ OUString sEventMacro = static_cast<const SvLBoxString*>(pE->GetItem( LB_MACROS_ITEMPOS ))->GetText();
OUString sScriptURI = mpImpl->pMacroLB->GetSelectedScriptURI();
mpImpl->pAssignPB->Enable( !mpImpl->bReadOnly && !sScriptURI.equalsIgnoreAsciiCase( sEventMacro ) );
@@ -179,7 +178,7 @@ bool _SfxMacroTabPage::FillItemSet( SfxItemSet* rSet )
const SfxPoolItem* pItem;
if( SfxItemState::SET != GetItemSet().GetItemState( aItem.Which(), true, &pItem )
- || aItem != *(SvxMacroItem*)pItem )
+ || aItem != *static_cast<const SvxMacroItem*>(pItem) )
{
rSet->Put( aItem );
return true;
@@ -215,7 +214,7 @@ void _SfxMacroTabPage::PageCreated(const SfxAllItemSet& aSet)
if( !mpImpl->bGotEvents && SfxItemState::SET == aSet.GetItemState( SID_EVENTCONFIG, true, &pEventsItem ) )
{
mpImpl->bGotEvents = true;
- const SfxEventNamesList& rList = ((SfxEventNamesItem*)pEventsItem)->GetEvents();
+ const SfxEventNamesList& rList = static_cast<const SfxEventNamesItem*>(pEventsItem)->GetEvents();
for ( size_t nNo = 0, nCnt = rList.size(); nNo < nCnt; ++nNo )
{
const SfxEventName *pOwn = rList.at(nNo);
@@ -228,13 +227,13 @@ void _SfxMacroTabPage::Reset( const SfxItemSet* rSet )
{
const SfxPoolItem* pItem;
if( SfxItemState::SET == rSet->GetItemState( GetWhich( aPageRg[0] ), true, &pItem ))
- aTbl = ((SvxMacroItem*)pItem)->GetMacroTable();
+ aTbl = static_cast<const SvxMacroItem*>(pItem)->GetMacroTable();
const SfxPoolItem* pEventsItem;
if( !mpImpl->bGotEvents && SfxItemState::SET == rSet->GetItemState( SID_EVENTCONFIG, true, &pEventsItem ) )
{
mpImpl->bGotEvents = true;
- const SfxEventNamesList& rList = ((SfxEventNamesItem*)pEventsItem)->GetEvents();
+ const SfxEventNamesList& rList = static_cast<const SfxEventNamesItem*>(pEventsItem)->GetEvents();
for ( size_t nNo = 0, nCnt = rList.size(); nNo < nCnt; ++nNo )
{
const SfxEventName *pOwn = rList.at(nNo);
@@ -311,7 +310,7 @@ IMPL_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton*, pBtn )
const bool bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled();
// remove from the table
- sal_uInt16 nEvent = (sal_uInt16)(sal_uLong)pE->GetUserData();
+ sal_uInt16 nEvent = (sal_uInt16)reinterpret_cast<sal_uLong>(pE->GetUserData());
pThis->aTbl.Erase( nEvent );
OUString sScriptURI;
@@ -415,12 +414,12 @@ void _SfxMacroTabPage::FillEvents()
SvTreeListEntry* pE = rListBox.GetEntry( n );
if( pE )
{
- SvLBoxString* pLItem = ( SvLBoxString* ) pE->GetItem( LB_MACROS_ITEMPOS );
+ SvLBoxString* pLItem = static_cast<SvLBoxString*>( pE->GetItem( LB_MACROS_ITEMPOS ) );
DBG_ASSERT( pLItem && SV_ITEM_ID_LBOXSTRING == pLItem->GetType(), "_SfxMacroTabPage::FillEvents(): no LBoxString" );
OUString sOld( pLItem->GetText() );
OUString sNew;
- sal_uInt16 nEventId = ( sal_uInt16 ) ( sal_uLong ) pE->GetUserData();
+ sal_uInt16 nEventId = ( sal_uInt16 ) reinterpret_cast<sal_uLong>( pE->GetUserData() );
if( aTbl.IsKeyValid( nEventId ) )
sNew = ConvertToUIName_Impl( aTbl.Get( nEventId ) );
diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index 5a3ee30df491..27d88fefe2cb 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -177,7 +177,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASURELINEDIST );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldLineDist, nValue, eUnit );
}
else
@@ -192,7 +192,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINEOVERHANG );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldHelplineOverhang, nValue, eUnit );
}
else
@@ -207,7 +207,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINEDIST );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldHelplineDist, nValue, eUnit );
}
else
@@ -222,7 +222,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINE1LEN );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldHelpline1Len, nValue, eUnit );
}
else
@@ -237,7 +237,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINE2LEN );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldHelpline2Len, nValue, eUnit );
}
else
@@ -249,7 +249,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
// SdrMeasureBelowRefEdgeItem
if( rAttrs->GetItemState( SDRATTR_MEASUREBELOWREFEDGE ) != SfxItemState::DONTCARE )
{
- m_pTsbBelowRefEdge->SetState( ( ( const SdrMeasureBelowRefEdgeItem& )rAttrs->Get( SDRATTR_MEASUREBELOWREFEDGE ) ).
+ m_pTsbBelowRefEdge->SetState( static_cast<const SdrMeasureBelowRefEdgeItem&>( rAttrs->Get( SDRATTR_MEASUREBELOWREFEDGE ) ).
GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
m_pTsbBelowRefEdge->EnableTriState( false );
}
@@ -265,7 +265,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREDECIMALPLACES );
if( pItem )
{
- sal_Int16 nValue = ( ( const SdrMeasureDecimalPlacesItem* )pItem )->GetValue();
+ sal_Int16 nValue = static_cast<const SdrMeasureDecimalPlacesItem*>( pItem )->GetValue();
m_pMtrFldDecimalPlaces->SetValue( nValue );
}
else
@@ -278,7 +278,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
// Attention: negate !
if( rAttrs->GetItemState( SDRATTR_MEASURETEXTROTA90 ) != SfxItemState::DONTCARE )
{
- m_pTsbParallel->SetState( ( ( const SdrMeasureTextRota90Item& )rAttrs->Get( SDRATTR_MEASURETEXTROTA90 ) ).
+ m_pTsbParallel->SetState( static_cast<const SdrMeasureTextRota90Item&>( rAttrs->Get( SDRATTR_MEASURETEXTROTA90 ) ).
GetValue() ? TRISTATE_FALSE : TRISTATE_TRUE );
m_pTsbParallel->EnableTriState( false );
}
@@ -291,7 +291,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
// SdrMeasureShowUnitItem
if( rAttrs->GetItemState( SDRATTR_MEASURESHOWUNIT ) != SfxItemState::DONTCARE )
{
- m_pTsbShowUnit->SetState( ( ( const SdrYesNoItem& )rAttrs->Get( SDRATTR_MEASURESHOWUNIT ) ).
+ m_pTsbShowUnit->SetState( static_cast<const SdrYesNoItem&>( rAttrs->Get( SDRATTR_MEASURESHOWUNIT ) ).
GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
m_pTsbShowUnit->EnableTriState( false );
}
@@ -304,12 +304,12 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
// SdrMeasureUnitItem
if( rAttrs->GetItemState( SDRATTR_MEASUREUNIT ) != SfxItemState::DONTCARE )
{
- long nFieldUnit = (long) ( ( const SdrMeasureUnitItem& )rAttrs->
+ long nFieldUnit = (long) static_cast<const SdrMeasureUnitItem&>( rAttrs->
Get( SDRATTR_MEASUREUNIT ) ).GetValue();
for( sal_Int32 i = 0; i < m_pLbUnit->GetEntryCount(); ++i )
{
- if ( (sal_IntPtr)m_pLbUnit->GetEntryData( i ) == nFieldUnit )
+ if ( reinterpret_cast<sal_IntPtr>(m_pLbUnit->GetEntryData( i )) == nFieldUnit )
{
m_pLbUnit->SelectEntryPos( i );
break;
@@ -326,7 +326,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
if ( rAttrs->GetItemState( SDRATTR_MEASURETEXTVPOS ) != SfxItemState::DONTCARE )
{
SdrMeasureTextVPos eVPos = (SdrMeasureTextVPos)
- ( ( const SdrMeasureTextVPosItem& )rAttrs->Get( SDRATTR_MEASURETEXTVPOS ) ).GetValue();
+ static_cast<const SdrMeasureTextVPosItem&>( rAttrs->Get( SDRATTR_MEASURETEXTVPOS ) ).GetValue();
{
if ( rAttrs->GetItemState( SDRATTR_MEASURETEXTHPOS ) != SfxItemState::DONTCARE )
{
@@ -334,7 +334,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
m_pTsbAutoPosH->EnableTriState( false );
SdrMeasureTextHPos eHPos = (SdrMeasureTextHPos)
- ( ( const SdrMeasureTextHPosItem& )rAttrs->Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue();
+ static_cast<const SdrMeasureTextHPosItem&>( rAttrs->Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue();
RECT_POINT eRP = RP_MM;
switch( eVPos )
{
@@ -494,7 +494,7 @@ bool SvxMeasurePage::FillItemSet( SfxItemSet* rAttrs)
{
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pLbUnit->GetEntryData( nPos );
+ sal_uInt16 nFieldUnit = (sal_uInt16)reinterpret_cast<sal_IntPtr>(m_pLbUnit->GetEntryData( nPos ));
FieldUnit _eUnit = (FieldUnit) nFieldUnit;
rAttrs->Put( SdrMeasureUnitItem( _eUnit ) );
bModified = true;
@@ -539,7 +539,7 @@ bool SvxMeasurePage::FillItemSet( SfxItemSet* rAttrs)
if ( rAttrs->GetItemState( SDRATTR_MEASURETEXTVPOS ) != SfxItemState::DONTCARE )
{
eOldVPos = (SdrMeasureTextVPos)
- ( ( const SdrMeasureTextVPosItem& )rOutAttrs.Get( SDRATTR_MEASURETEXTVPOS ) ).GetValue();
+ static_cast<const SdrMeasureTextVPosItem&>( rOutAttrs.Get( SDRATTR_MEASURETEXTVPOS ) ).GetValue();
if( eOldVPos != eVPos )
{
rAttrs->Put( SdrMeasureTextVPosItem( eVPos ) );
@@ -555,7 +555,7 @@ bool SvxMeasurePage::FillItemSet( SfxItemSet* rAttrs)
if ( rAttrs->GetItemState( SDRATTR_MEASURETEXTHPOS ) != SfxItemState::DONTCARE )
{
eOldHPos = (SdrMeasureTextHPos)
- ( ( const SdrMeasureTextHPosItem& )rOutAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue();
+ static_cast<const SdrMeasureTextHPosItem&>( rOutAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue();
if( eOldHPos != eHPos )
{
rAttrs->Put( SdrMeasureTextHPosItem( eHPos ) );
@@ -724,7 +724,7 @@ IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p )
sal_Int32 nPos = m_pLbUnit->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pLbUnit->GetEntryData( nPos );
+ sal_uInt16 nFieldUnit = (sal_uInt16)reinterpret_cast<sal_IntPtr>(m_pLbUnit->GetEntryData( nPos ));
FieldUnit _eUnit = (FieldUnit) nFieldUnit;
aAttrSet.Put( SdrMeasureUnitItem( _eUnit ) );
}
@@ -797,14 +797,14 @@ void SvxMeasurePage::FillUnitLB()
sal_IntPtr nUnit = FUNIT_NONE;
OUString aStrMetric( m_pFtAutomatic->GetText());
sal_Int32 nPos = m_pLbUnit->InsertEntry( aStrMetric );
- m_pLbUnit->SetEntryData( nPos, (void*)nUnit );
+ m_pLbUnit->SetEntryData( nPos, reinterpret_cast<void*>(nUnit) );
for( sal_uInt32 i = 0; i < aMetricArr.Count(); ++i )
{
aStrMetric = aMetricArr.GetStringByPos( i );
nUnit = aMetricArr.GetValue( i );
nPos = m_pLbUnit->InsertEntry( aStrMetric );
- m_pLbUnit->SetEntryData( nPos, (void*)nUnit );
+ m_pLbUnit->SetEntryData( nPos, reinterpret_cast<void*>(nUnit) );
}
}
void SvxMeasurePage::PageCreated(const SfxAllItemSet& aSet)
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index a4af465f4334..9d8682253d7f 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -412,8 +412,8 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
if(eState==SfxItemState::SET)
{
- const SfxBoolItem* pBoolLangItem = (const SfxBoolItem*)
- GetItem( *rSet, SID_ATTR_NUMBERFORMAT_NOLANGUAGE);
+ const SfxBoolItem* pBoolLangItem = static_cast<const SfxBoolItem*>(
+ GetItem( *rSet, SID_ATTR_NUMBERFORMAT_NOLANGUAGE));
if(pBoolLangItem!=NULL && pBoolLangItem->GetValue())
{
@@ -433,7 +433,7 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
if(pNumItem==NULL)
{
bNumItemFlag=true;
- pNumItem= (SvxNumberInfoItem *) pItem->Clone();
+ pNumItem= static_cast<SvxNumberInfoItem *>(pItem->Clone());
}
else
{
@@ -450,8 +450,8 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
if(eState==SfxItemState::SET)
{
- const SfxBoolItem* pBoolItem = (const SfxBoolItem*)
- GetItem( *rSet, SID_ATTR_NUMBERFORMAT_ONE_AREA);
+ const SfxBoolItem* pBoolItem = static_cast<const SfxBoolItem*>(
+ GetItem( *rSet, SID_ATTR_NUMBERFORMAT_ONE_AREA));
if(pBoolItem!=NULL)
{
@@ -463,8 +463,8 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
if ( eState == SfxItemState::SET )
{
- const SfxBoolItem* pBoolItem = (const SfxBoolItem*)
- GetItem( *rSet, SID_ATTR_NUMBERFORMAT_SOURCE );
+ const SfxBoolItem* pBoolItem = static_cast<const SfxBoolItem*>(
+ GetItem( *rSet, SID_ATTR_NUMBERFORMAT_SOURCE ));
if ( pBoolItem )
m_pCbSourceFormat->Check( pBoolItem->GetValue() );
else
@@ -486,8 +486,8 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
eState = rSet->GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_VALUE ) );
if ( SfxItemState::DONTCARE != eState )
- pValFmtAttr = (const SfxUInt32Item*)
- GetItem( *rSet, SID_ATTR_NUMBERFORMAT_VALUE );
+ pValFmtAttr = static_cast<const SfxUInt32Item*>(
+ GetItem( *rSet, SID_ATTR_NUMBERFORMAT_VALUE ));
eValType = pNumItem->GetValueType();
@@ -571,8 +571,8 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
}
eState = rSet->GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_ADD_AUTO ) );
if(SfxItemState::SET == eState)
- pAutoEntryAttr = (const SfxBoolItem*)
- GetItem( *rSet, SID_ATTR_NUMBERFORMAT_ADD_AUTO );
+ pAutoEntryAttr = static_cast<const SfxBoolItem*>(
+ GetItem( *rSet, SID_ATTR_NUMBERFORMAT_ADD_AUTO ));
// no_NO is an alias for nb_NO and normally isn't listed, we need it for
// backwards compatibility, but only if the format passed is of
// LanguageType no_NO.
@@ -789,8 +789,8 @@ bool SvxNumberFormatTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
{
sal_uInt16 _nWhich = GetWhich( SID_ATTR_NUMBERFORMAT_SOURCE );
SfxItemState _eItemState = rMyItemSet.GetItemState( _nWhich, false );
- const SfxBoolItem* pBoolItem = (const SfxBoolItem*)
- GetItem( rMyItemSet, SID_ATTR_NUMBERFORMAT_SOURCE );
+ const SfxBoolItem* pBoolItem = static_cast<const SfxBoolItem*>(
+ GetItem( rMyItemSet, SID_ATTR_NUMBERFORMAT_SOURCE ));
bool bOld = pBoolItem && pBoolItem->GetValue();
rCoreAttrs->Put( SfxBoolItem( _nWhich, m_pCbSourceFormat->IsChecked() ) );
if ( !bDataChanged )
@@ -822,7 +822,7 @@ void SvxNumberFormatTabPage::SetInfoItem( const SvxNumberInfoItem& rItem )
{
if(pNumItem==NULL)
{
- pNumItem = (SvxNumberInfoItem*)rItem.Clone();
+ pNumItem = static_cast<SvxNumberInfoItem*>(rItem.Clone());
}
}
@@ -1740,7 +1740,7 @@ void SvxNumberFormatTabPage::AddAutomaticLanguage_Impl(LanguageType eAutoLang, b
{
m_pLbLanguage->RemoveLanguage(LANGUAGE_SYSTEM);
sal_uInt16 nPos = m_pLbLanguage->InsertEntry(sAutomaticEntry);
- m_pLbLanguage->SetEntryData(nPos, (void*)(sal_uLong)eAutoLang);
+ m_pLbLanguage->SetEntryData(nPos, reinterpret_cast<void*>((sal_uLong)eAutoLang));
if(bSelect)
m_pLbLanguage->SelectEntryPos(nPos);
}
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index ba36db566151..71f90f564e1f 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -250,14 +250,14 @@ void SvxSingleNumPickTabPage::ActivatePage(const SfxItemSet& rSet)
if(pExampleSet)
{
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
- bIsPreset = ((const SfxBoolItem*)pItem)->GetValue();
+ bIsPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
- nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
+ nActNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
}
if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
{
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
}
if(pActNum && *pSaveNum != *pActNum)
{
@@ -302,7 +302,7 @@ void SvxSingleNumPickTabPage::Reset( const SfxItemSet* rSet )
}
DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
if(!pActNum)
pActNum = new SvxNumRule(*pSaveNum);
@@ -410,14 +410,14 @@ void SvxBulletPickTabPage::ActivatePage(const SfxItemSet& rSet)
if(pExampleSet)
{
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
- bIsPreset = ((const SfxBoolItem*)pItem)->GetValue();
+ bIsPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
- nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
+ nActNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
}
if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
{
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
}
if(pActNum && *pSaveNum != *pActNum)
{
@@ -461,7 +461,7 @@ void SvxBulletPickTabPage::Reset( const SfxItemSet* rSet )
}
DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
if(!pActNum)
pActNum = new SvxNumRule(*pSaveNum);
@@ -607,14 +607,14 @@ void SvxNumPickTabPage::ActivatePage(const SfxItemSet& rSet)
if(pExampleSet)
{
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
- bIsPreset = ((const SfxBoolItem*)pItem)->GetValue();
+ bIsPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
- nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
+ nActNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
}
if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
{
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
}
if(pActNum && *pSaveNum != *pActNum)
{
@@ -658,7 +658,7 @@ void SvxNumPickTabPage::Reset( const SfxItemSet* rSet )
}
DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
if(!pActNum)
pActNum = new SvxNumRule(*pSaveNum);
@@ -704,8 +704,8 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl)
{
SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
const SvxFontListItem* pFontListItem =
- (const SvxFontListItem* )pCurDocShell
- ->GetItem( SID_ATTR_CHAR_FONTLIST );
+ static_cast<const SvxFontListItem*>( pCurDocShell
+ ->GetItem( SID_ATTR_CHAR_FONTLIST ));
pList = pFontListItem ? pFontListItem->GetFontList() : 0;
}
if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) )
@@ -837,14 +837,14 @@ void SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet)
if(pExampleSet)
{
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
- bIsPreset = ((const SfxBoolItem*)pItem)->GetValue();
+ bIsPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
- nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
+ nActNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
}
if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
{
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
}
if(pActNum && *pSaveNum != *pActNum)
{
@@ -905,7 +905,7 @@ void SvxBitmapPickTabPage::Reset( const SfxItemSet* rSet )
}
DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
if(!pActNum)
pActNum = new SvxNumRule(*pSaveNum);
@@ -976,8 +976,8 @@ void SvxNumOptionsTabPage::GetI18nNumbering( ListBox& rFmtLB, sal_uInt16 nDoNotR
::std::vector< sal_uInt16> aRemove( rFmtLB.GetEntryCount(), nDontRemove);
for (size_t i=0; i<aRemove.size(); ++i)
{
- sal_uInt16 nEntryData = (sal_uInt16)(sal_uLong)rFmtLB.GetEntryData(
- sal::static_int_cast< sal_Int32 >(i));
+ sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(rFmtLB.GetEntryData(
+ sal::static_int_cast< sal_Int32 >(i)));
if (nEntryData > NumberingType::CHARS_LOWER_LETTER_N && nEntryData != nDoNotRemove)
aRemove[i] = nEntryData;
}
@@ -993,7 +993,7 @@ void SvxNumOptionsTabPage::GetI18nNumbering( ListBox& rFmtLB, sal_uInt16 nDoNotR
bool bInsert = true;
for(sal_Int32 nEntry = 0; nEntry < rFmtLB.GetEntryCount(); nEntry++)
{
- sal_uInt16 nEntryData = (sal_uInt16)(sal_uLong)rFmtLB.GetEntryData(nEntry);
+ sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(rFmtLB.GetEntryData(nEntry));
if(nEntryData == (sal_uInt16) nCurrent)
{
bInsert = false;
@@ -1005,7 +1005,7 @@ void SvxNumOptionsTabPage::GetI18nNumbering( ListBox& rFmtLB, sal_uInt16 nDoNotR
{
OUString aIdent = xInfo->getNumberingIdentifier( nCurrent );
sal_Int32 nPos = rFmtLB.InsertEntry(aIdent);
- rFmtLB.SetEntryData(nPos,(void*)(sal_uLong)nCurrent);
+ rFmtLB.SetEntryData(nPos, reinterpret_cast<void*>((sal_uLong)nCurrent));
}
}
}
@@ -1014,7 +1014,7 @@ void SvxNumOptionsTabPage::GetI18nNumbering( ListBox& rFmtLB, sal_uInt16 nDoNotR
{
if (aRemove[i] != nDontRemove)
{
- sal_Int32 nPos = rFmtLB.GetEntryPos( (void*)(sal_uLong)aRemove[i]);
+ sal_Int32 nPos = rFmtLB.GetEntryPos( reinterpret_cast<void*>((sal_uLong)aRemove[i]));
rFmtLB.RemoveEntry( nPos);
}
}
@@ -1155,14 +1155,14 @@ void SvxNumOptionsTabPage::ActivatePage(const SfxItemSet& rSet)
if(pExampleSet)
{
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
- bPreset = ((const SfxBoolItem*)pItem)->GetValue();
+ bPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
- nTmpNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
+ nTmpNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
}
if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
{
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
}
bModified = (!pActNum->Get( 0 ) || bPreset);
@@ -1230,7 +1230,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
}
DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
// insert levels
if(!m_pLevelLB->GetEntryCount())
@@ -1287,7 +1287,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
{
pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem )
- pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
+ pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
}
if ( !pColorTable.is() )
@@ -1307,7 +1307,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
|| ( 0 != ( pShell = SfxObjectShell::Current()) &&
0 != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) )
{
- sal_uInt16 nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue();
+ sal_uInt16 nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
bHTMLMode = 0 != (nHtmlMode&HTMLMODE_ON);
}
@@ -1331,7 +1331,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
sal_Int32 nFmtCount = m_pFmtLB->GetEntryCount();
for(sal_Int32 i = nFmtCount; i; i--)
{
- sal_uInt16 nEntryData = (sal_uInt16)(sal_uLong)m_pFmtLB->GetEntryData(i - 1);
+ sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFmtLB->GetEntryData(i - 1));
if(/*SVX_NUM_NUMBER_NONE == nEntryData ||*/
((SVX_NUM_BITMAP|LINK_TOKEN) == nEntryData))
m_pFmtLB->RemoveEntry(i - 1);
@@ -1341,14 +1341,14 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
if(!pActNum->IsFeatureSupported(NUM_ENABLE_LINKED_BMP))
{
sal_IntPtr nData = SVX_NUM_BITMAP|LINK_TOKEN;
- sal_Int32 nPos = m_pFmtLB->GetEntryPos((void*)nData);
+ sal_Int32 nPos = m_pFmtLB->GetEntryPos(reinterpret_cast<void*>(nData));
if(LISTBOX_ENTRY_NOTFOUND != nPos)
m_pFmtLB->RemoveEntry(nPos);
}
else if(!pActNum->IsFeatureSupported(NUM_ENABLE_EMBEDDED_BMP))
{
sal_IntPtr nData = SVX_NUM_BITMAP;
- sal_Int32 nPos = m_pFmtLB->GetEntryPos((void*)nData);
+ sal_Int32 nPos = m_pFmtLB->GetEntryPos(reinterpret_cast<void*>(nData));
if(LISTBOX_ENTRY_NOTFOUND != nPos)
m_pFmtLB->RemoveEntry(nPos);
}
@@ -1371,7 +1371,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
sal_Int32 nFmtCount = m_pFmtLB->GetEntryCount();
for(sal_Int32 i = nFmtCount; i; i--)
{
- sal_uInt16 nEntryData = (sal_uInt16)(sal_uLong)m_pFmtLB->GetEntryData(i - 1);
+ sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFmtLB->GetEntryData(i - 1));
if( /*nEntryData >= SVX_NUM_CHARS_UPPER_LETTER &&*/ nEntryData <= SVX_NUM_NUMBER_NONE)
m_pFmtLB->RemoveEntry(i - 1);
}
@@ -1490,7 +1490,7 @@ void SvxNumOptionsTabPage::InitControls()
if(bSameType)
{
sal_uInt16 nLBData = nNumberingType;
- m_pFmtLB->SelectEntryPos(m_pFmtLB->GetEntryPos( (void*)sal::static_int_cast<sal_uIntPtr>( nLBData ) ));
+ m_pFmtLB->SelectEntryPos(m_pFmtLB->GetEntryPos( reinterpret_cast<void*>(sal::static_int_cast<sal_uIntPtr>( nLBData ) )));
}
else
m_pFmtLB->SetNoSelection();
@@ -1713,7 +1713,7 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox )
{
SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
// PAGEDESC does not exist
- sal_uInt16 nNumType = (sal_uInt16)(sal_uLong)pBox->GetEntryData(pBox->GetSelectEntryPos());
+ sal_uInt16 nNumType = (sal_uInt16)reinterpret_cast<sal_uLong>(pBox->GetEntryData(pBox->GetSelectEntryPos()));
aNumFmt.SetNumberingType((sal_Int16)nNumType);
sal_uInt16 nNumberingType = aNumFmt.GetNumberingType();
if(SVX_NUM_BITMAP == (nNumberingType&(~LINK_TOKEN)))
@@ -2913,14 +2913,14 @@ void SvxNumPositionTabPage::ActivatePage(const SfxItemSet& rSet)
if(pExampleSet)
{
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
- bPreset = ((const SfxBoolItem*)pItem)->GetValue();
+ bPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
- nTmpNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
+ nTmpNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
}
if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
{
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
}
bModified = (!pActNum->Get( 0 ) || bPreset);
if(*pSaveNum != *pActNum ||
@@ -2998,7 +2998,7 @@ void SvxNumPositionTabPage::Reset( const SfxItemSet* rSet )
}
DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
+ pSaveNum = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
// insert levels
if(!m_pLevelLB->GetEntryCount())
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 97b662be8846..74f109188750 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -252,7 +252,7 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr
if(SfxItemState::SET == rAttr.GetItemState(SID_HTML_MODE, false, &pItem) ||
( 0 != (pShell = SfxObjectShell::Current()) &&
0 != (pItem = pShell->GetItem(SID_HTML_MODE))))
- bWeb = 0 != (((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON);
+ bWeb = 0 != (static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON);
// fill text flow listbox with valid entries
@@ -426,7 +426,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
if ( pItem )
{
- const SvxLRSpaceItem& rLRSpace = (const SvxLRSpaceItem&)*pItem;
+ const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem);
SetMetricValue( *m_pLeftMarginEdit, rLRSpace.GetLeft(), eUnit );
m_pBspWin->SetLeft(
(sal_uInt16)ConvertLong_Impl( (long)rLRSpace.GetLeft(), eUnit ) );
@@ -440,7 +440,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
if ( pItem )
{
- const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)*pItem;
+ const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(*pItem);
SetMetricValue( *m_pTopMarginEdit, rULSpace.GetUpper(), eUnit );
m_pBspWin->SetTop(
(sal_uInt16)ConvertLong_Impl( (long)rULSpace.GetUpper(), eUnit ) );
@@ -457,7 +457,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
if ( pItem )
{
- const SvxPageItem& rItem = (const SvxPageItem&)*pItem;
+ const SvxPageItem& rItem = static_cast<const SvxPageItem&>(*pItem);
eNumType = rItem.GetNumType();
nUse = rItem.GetPageUsage();
bLandscape = rItem.IsLandscape();
@@ -471,7 +471,8 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
//adjust numeration type of the page style
//Get the Position of the saved NumType
for(int i=0; i<m_pNumberFormatBox->GetEntryCount(); i++)
- if(eNumType == (sal_uInt16)(sal_uLong)m_pNumberFormatBox->GetEntryData(i)){
+ if(eNumType == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pNumberFormatBox->GetEntryData(i)))
+ {
m_pNumberFormatBox->SelectEntryPos( i );
break;
}
@@ -482,7 +483,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
if ( pItem )
{
- nPaperBin = ( (const SvxPaperBinItem*)pItem )->GetValue();
+ nPaperBin = static_cast<const SvxPaperBinItem*>(pItem)->GetValue();
if ( nPaperBin >= mpDefPrinter->GetPaperBinCount() )
nPaperBin = PAPERBIN_PRINTER_SETTINGS;
@@ -496,14 +497,14 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
aBinName = mpDefPrinter->GetPaperBinName( (sal_uInt16)nPaperBin );
sal_uInt16 nEntryPos = m_pPaperTrayBox->InsertEntry( aBinName );
- m_pPaperTrayBox->SetEntryData( nEntryPos, (void*)(sal_uLong)nPaperBin );
+ m_pPaperTrayBox->SetEntryData( nEntryPos, reinterpret_cast<void*>((sal_uLong)nPaperBin) );
m_pPaperTrayBox->SelectEntry( aBinName );
Size aPaperSize = SvxPaperInfo::GetPaperSize( mpDefPrinter );
pItem = GetItem( *rSet, SID_ATTR_PAGE_SIZE );
if ( pItem )
- aPaperSize = ( (const SvxSizeItem*)pItem )->GetSize();
+ aPaperSize = static_cast<const SvxSizeItem*>(pItem)->GetSize();
bool bOrientationSupport =
mpDefPrinter->HasSupport( SUPPORT_SET_ORIENTATION );
@@ -550,7 +551,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
OUString aStr = aPaperAry.GetString(i);
Paper eSize = (Paper)aPaperAry.GetValue(i);
sal_Int32 nPos = m_pPaperSizeBox->InsertEntry( aStr );
- m_pPaperSizeBox->SetEntryData( nPos, (void*)(sal_uLong)eSize );
+ m_pPaperSizeBox->SetEntryData( nPos, reinterpret_cast<void*>((sal_uLong)eSize) );
if ( eSize == ePaper )
nActPos = nPos;
@@ -573,12 +574,12 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
// horizontal alignment
pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT1 );
- m_pHorzBox->Check( pItem ? ( (const SfxBoolItem*)pItem )->GetValue()
+ m_pHorzBox->Check( pItem ? static_cast<const SfxBoolItem*>(pItem)->GetValue()
: sal_False );
// vertical alignment
pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT2 );
- m_pVertBox->Check( pItem ? ( (const SfxBoolItem*)pItem )->GetValue()
+ m_pVertBox->Check( pItem ? static_cast<const SfxBoolItem*>(pItem)->GetValue()
: sal_False );
// set example window on the table
@@ -595,7 +596,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
m_pAdaptBox->Show();
pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT1 );
m_pAdaptBox->Check( pItem ?
- ( (const SfxBoolItem*)pItem )->GetValue() : sal_False );
+ static_cast<const SfxBoolItem*>(pItem)->GetValue() : sal_False );
//!!! hidden, because not implemented by StarDraw
m_pLayoutBox->Hide();
@@ -639,7 +640,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
if(SfxItemState::SET == rSet->GetItemState(SID_SWREGISTER_MODE))
{
- m_pRegisterCB->Check(((const SfxBoolItem&)rSet->Get(
+ m_pRegisterCB->Check(static_cast<const SfxBoolItem&>(rSet->Get(
SID_SWREGISTER_MODE)).GetValue());
m_pRegisterCB->SaveValue();
RegisterModify(m_pRegisterCB);
@@ -647,7 +648,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
if(SfxItemState::SET == rSet->GetItemState(SID_SWREGISTER_COLLECTION))
{
m_pRegisterLB->SelectEntry(
- ((const SfxStringItem&)rSet->Get(SID_SWREGISTER_COLLECTION)).GetValue());
+ static_cast<const SfxStringItem&>(rSet->Get(SID_SWREGISTER_COLLECTION)).GetValue());
m_pRegisterLB->SaveValue();
}
@@ -656,7 +657,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
if( SfxItemState::UNKNOWN != eState )
{
sal_uInt32 nVal = SfxItemState::SET == eState
- ? ((SvxFrameDirectionItem*)pItem)->GetValue()
+ ? static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue()
: 0;
m_pTextFlowBox->SelectEntryValue( static_cast< SvxFrameDirection >( nVal ) );
@@ -687,11 +688,11 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
const SfxPoolItem* pOld = 0;
// copy old left and right margins
- SvxLRSpaceItem aMargin( (const SvxLRSpaceItem&)rOldSet.Get( nWhich ) );
+ SvxLRSpaceItem aMargin( static_cast<const SvxLRSpaceItem&>(rOldSet.Get( nWhich )) );
// copy old top and bottom margins
nWhich = GetWhich( SID_ATTR_ULSPACE );
- SvxULSpaceItem aTopMargin( (const SvxULSpaceItem&)rOldSet.Get( nWhich ) );
+ SvxULSpaceItem aTopMargin( static_cast<const SvxULSpaceItem&>(rOldSet.Get( nWhich )) );
if ( m_pLeftMarginEdit->IsValueChangedFromSaved() )
{
@@ -710,7 +711,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
{
pOld = GetOldItem( *rSet, SID_ATTR_LRSPACE );
- if ( !pOld || !( *(const SvxLRSpaceItem*)pOld == aMargin ) )
+ if ( !pOld || !( *static_cast<const SvxLRSpaceItem*>(pOld) == aMargin ) )
rSet->Put( aMargin );
else
bModified = false;
@@ -736,7 +737,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
{
pOld = GetOldItem( *rSet, SID_ATTR_ULSPACE );
- if ( !pOld || !( *(const SvxULSpaceItem*)pOld == aTopMargin ) )
+ if ( !pOld || !( *static_cast<const SvxULSpaceItem*>(pOld) == aTopMargin ) )
{
bModified = true;
rSet->Put( aTopMargin );
@@ -746,17 +747,17 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
// paper tray
nWhich = GetWhich( SID_ATTR_PAGE_PAPERBIN );
sal_Int32 nPos = m_pPaperTrayBox->GetSelectEntryPos();
- sal_uInt16 nBin = (sal_uInt16)(sal_uLong)m_pPaperTrayBox->GetEntryData( nPos );
+ sal_uInt16 nBin = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pPaperTrayBox->GetEntryData( nPos ));
pOld = GetOldItem( *rSet, SID_ATTR_PAGE_PAPERBIN );
- if ( !pOld || ( (const SvxPaperBinItem*)pOld )->GetValue() != nBin )
+ if ( !pOld || static_cast<const SvxPaperBinItem*>(pOld)->GetValue() != nBin )
{
rSet->Put( SvxPaperBinItem( nWhich, (sal_uInt8)nBin ) );
bModified = true;
}
nPos = m_pPaperSizeBox->GetSelectEntryPos();
- Paper ePaper = (Paper)(sal_uLong)m_pPaperSizeBox->GetEntryData( nPos );
+ Paper ePaper = (Paper)reinterpret_cast<sal_uLong>(m_pPaperSizeBox->GetEntryData( nPos ));
const sal_Int32 nOld = m_pPaperSizeBox->GetSavedValue();
bool bChecked = m_pLandscapeBtn->IsChecked();
@@ -771,7 +772,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
GetCoreValue( *m_pPaperHeightEdit, eUnit ) );
pOld = GetOldItem( *rSet, SID_ATTR_PAGE_SIZE );
- if ( !pOld || ( (const SvxSizeItem*)pOld )->GetSize() != aSize )
+ if ( !pOld || static_cast<const SvxSizeItem*>(pOld)->GetSize() != aSize )
{
rSet->Put( SvxSizeItem( GetWhich(SID_ATTR_PAGE_SIZE), aSize ) );
bModified = true;
@@ -789,7 +790,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
pOld = GetOldItem( *rSet, SID_ATTR_PAGE_SIZE );
- if ( !pOld || ( (const SvxSizeItem*)pOld )->GetSize() != aSize )
+ if ( !pOld || static_cast<const SvxSizeItem*>(pOld)->GetSize() != aSize )
{
rSet->Put( SvxSizeItem( GetWhich(SID_ATTR_PAGE_SIZE), aSize ) );
bModified = true;
@@ -798,7 +799,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
}
nWhich = GetWhich( SID_ATTR_PAGE );
- SvxPageItem aPage( (const SvxPageItem&)rOldSet.Get( nWhich ) );
+ SvxPageItem aPage( static_cast<const SvxPageItem&>(rOldSet.Get( nWhich )) );
bMod = m_pLayoutBox->IsValueChangedFromSaved();
if ( bMod )
@@ -813,7 +814,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
//Get the NumType value
nPos = m_pNumberFormatBox->GetSelectEntryPos();
- sal_uInt16 nEntryData = (sal_uInt16)(sal_uLong)m_pNumberFormatBox->GetEntryData(nPos);
+ sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pNumberFormatBox->GetEntryData(nPos));
if ( m_pNumberFormatBox->IsValueChangedFromSaved() )
{
aPage.SetNumType( (SvxNumType)nEntryData );
@@ -824,7 +825,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
{
pOld = GetOldItem( *rSet, SID_ATTR_PAGE );
- if ( !pOld || !( *(const SvxPageItem*)pOld == aPage ) )
+ if ( !pOld || !( *static_cast<const SvxPageItem*>(pOld) == aPage ) )
{
rSet->Put( aPage );
bModified = true;
@@ -874,8 +875,8 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
if(m_pRegisterCB->IsVisible() &&
(m_pRegisterCB->IsChecked() || m_pRegisterCB->IsValueChangedFromSaved()))
{
- const SfxBoolItem& rRegItem = (const SfxBoolItem&)rOldSet.Get(SID_SWREGISTER_MODE);
- boost::scoped_ptr<SfxBoolItem> pRegItem((SfxBoolItem*)rRegItem.Clone());
+ const SfxBoolItem& rRegItem = static_cast<const SfxBoolItem&>(rOldSet.Get(SID_SWREGISTER_MODE));
+ boost::scoped_ptr<SfxBoolItem> pRegItem(static_cast<SfxBoolItem*>(rRegItem.Clone()));
bool bCheck = m_pRegisterCB->IsChecked();
pRegItem->SetValue(bCheck);
rSet->Put(*pRegItem);
@@ -937,7 +938,7 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl)
sal_Int32 nEntryPos = m_pPaperTrayBox->InsertEntry(
EE_RESSTR( RID_SVXSTR_PAPERBIN_SETTINGS ) );
m_pPaperTrayBox->SetEntryData( nEntryPos,
- (void*)(sal_uLong)PAPERBIN_PRINTER_SETTINGS );
+ reinterpret_cast<void*>((sal_uLong)PAPERBIN_PRINTER_SETTINGS) );
OUString aPaperBin( EditResId( RID_SVXSTR_PAPERBIN ) );
sal_uInt16 nBinCount = mpDefPrinter->GetPaperBinCount();
@@ -952,7 +953,7 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl)
aName += OUString::number( i+1 );
}
nEntryPos = m_pPaperTrayBox->InsertEntry( aName );
- m_pPaperTrayBox->SetEntryData( nEntryPos, (void*)(sal_uLong)i );
+ m_pPaperTrayBox->SetEntryData( nEntryPos, reinterpret_cast<void*>((sal_uLong)i) );
}
m_pPaperTrayBox->SelectEntry( aOldName );
m_pPaperTrayBox->SetUpdateMode( true );
@@ -965,7 +966,7 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl)
IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox )
{
const sal_Int32 nPos = pBox->GetSelectEntryPos();
- Paper ePaper = (Paper)(sal_uLong)m_pPaperSizeBox->GetEntryData( nPos );
+ Paper ePaper = (Paper)reinterpret_cast<sal_uLong>(m_pPaperSizeBox->GetEntryData( nPos ));
if ( ePaper != PAPER_USER )
{
@@ -1045,7 +1046,7 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperSizeModify_Impl)
for ( sal_Int32 i = 0; i < nEntryCount; ++i )
{
- Paper eTmp = (Paper)(sal_uLong)m_pPaperSizeBox->GetEntryData(i);
+ Paper eTmp = (Paper)reinterpret_cast<sal_uLong>(m_pPaperSizeBox->GetEntryData(i));
if ( eTmp == ePaper )
{
@@ -1230,7 +1231,7 @@ void SvxPageDescPage::ResetBackground_Impl(const SfxItemSet& rSet)
if(rTmpSet.GetItemState(nWhich) == SfxItemState::SET)
{
const SvxBoxItem& rItem =
- (const SvxBoxItem&)rTmpSet.Get( nWhich );
+ static_cast<const SvxBoxItem&>(rTmpSet.Get( nWhich ));
m_pBspWin->SetHdBorder( rItem );
}
}
@@ -1317,7 +1318,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE );
if ( pItem )
- m_pBspWin->SetSize( ( (const SvxSizeItem*)pItem )->GetSize() );
+ m_pBspWin->SetSize( static_cast<const SvxSizeItem*>(pItem)->GetSize() );
const SvxSetItem* pSetItem = 0;
@@ -1329,19 +1330,19 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
{
const SfxItemSet& rHeaderSet = pSetItem->GetItemSet();
const SfxBoolItem& rHeaderOn =
- (const SfxBoolItem&)rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) );
+ static_cast<const SfxBoolItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ));
if ( rHeaderOn.GetValue() )
{
- const SvxSizeItem& rSize = (const SvxSizeItem&)
- rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) );
- const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)
- rHeaderSet.Get( GetWhich( SID_ATTR_ULSPACE ) );
+ const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(
+ rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ));
+ const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(
+ rHeaderSet.Get( GetWhich( SID_ATTR_ULSPACE ) ));
long nDist = rUL.GetLower();
m_pBspWin->SetHdHeight( rSize.GetSize().Height() - nDist );
m_pBspWin->SetHdDist( nDist );
- const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)
- rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) );
+ const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(
+ rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
m_pBspWin->SetHdLeft( rLR.GetLeft() );
m_pBspWin->SetHdRight( rLR.GetRight() );
m_pBspWin->SetHeader( true );
@@ -1378,7 +1379,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
if ( rHeaderSet.GetItemState( nWhich ) >= SfxItemState::DEFAULT )
{
const SvxBoxItem& rItem =
- (const SvxBoxItem&)rHeaderSet.Get( nWhich );
+ static_cast<const SvxBoxItem&>(rHeaderSet.Get( nWhich ));
m_pBspWin->SetHdBorder( rItem );
}
}
@@ -1391,19 +1392,19 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
{
const SfxItemSet& rFooterSet = pSetItem->GetItemSet();
const SfxBoolItem& rFooterOn =
- (const SfxBoolItem&)rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) );
+ static_cast<const SfxBoolItem&>(rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ));
if ( rFooterOn.GetValue() )
{
- const SvxSizeItem& rSize = (const SvxSizeItem&)
- rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) );
- const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)
- rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) );
+ const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(
+ rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ));
+ const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(
+ rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) ));
long nDist = rUL.GetUpper();
m_pBspWin->SetFtHeight( rSize.GetSize().Height() - nDist );
m_pBspWin->SetFtDist( nDist );
- const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)
- rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) );
+ const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(
+ rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
m_pBspWin->SetFtLeft( rLR.GetLeft() );
m_pBspWin->SetFtRight( rLR.GetRight() );
m_pBspWin->SetFooter( true );
@@ -1426,7 +1427,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
if(rFooterSet.GetItemState(nWhich) >= SfxItemState::DEFAULT)
{
//UUUU aBspWin.SetFtColor(rItem.GetColor());
- const SvxBrushItem& rItem = (const SvxBrushItem&)rFooterSet.Get(nWhich);
+ const SvxBrushItem& rItem = static_cast<const SvxBrushItem&>(rFooterSet.Get(nWhich));
SfxItemSet aTempSet(*rFooterSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
@@ -1440,7 +1441,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
if ( rFooterSet.GetItemState( nWhich ) >= SfxItemState::DEFAULT )
{
const SvxBoxItem& rItem =
- (const SvxBoxItem&)rFooterSet.Get( nWhich );
+ static_cast<const SvxBoxItem&>(rFooterSet.Get( nWhich ));
m_pBspWin->SetFtBorder( rItem );
}
}
@@ -1464,7 +1465,7 @@ int SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet )
// If not, ask user whether they shall be taken.
// If not, stay on the TabPage.
sal_Int32 nPos = m_pPaperSizeBox->GetSelectEntryPos();
- Paper ePaper = (Paper)(sal_uLong)m_pPaperSizeBox->GetEntryData( nPos );
+ Paper ePaper = (Paper)reinterpret_cast<sal_uLong>(m_pPaperSizeBox->GetEntryData( nPos ));
if ( ePaper != PAPER_SCREEN_4_3 && ePaper != PAPER_SCREEN_16_9 && ePaper != PAPER_SCREEN_16_10 && IsMarginOutOfRange() )
{
@@ -1502,7 +1503,7 @@ int SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet )
GetCoreValue( *m_pPaperHeightEdit, eUnit ) );
// put, if current size is different to the value in _pSet
- const SvxSizeItem* pSize = (const SvxSizeItem*)GetItem( *_pSet, SID_ATTR_PAGE_SIZE );
+ const SvxSizeItem* pSize = static_cast<const SvxSizeItem*>(GetItem( *_pSet, SID_ATTR_PAGE_SIZE ));
if ( aSize.Width() && ( !pSize || !IsEqualSize_Impl( pSize, aSize ) ) )
_pSet->Put( SvxSizeItem( nWh, aSize ) );
}
@@ -1539,9 +1540,9 @@ IMPL_LINK_NOARG(SvxPageDescPage, RangeHdl_Impl)
_pSet->GetItemState( GetWhich(SID_ATTR_BORDER_OUTER) ) >=
SfxItemState::DEFAULT )
{
- aBorder = ( GetMinBorderSpace_Impl(
- (const SvxShadowItem&)_pSet->Get(GetWhich(SID_ATTR_BORDER_SHADOW)),
- (const SvxBoxItem&)_pSet->Get(GetWhich(SID_ATTR_BORDER_OUTER))));
+ aBorder = GetMinBorderSpace_Impl(
+ static_cast<const SvxShadowItem&>(_pSet->Get(GetWhich(SID_ATTR_BORDER_SHADOW))),
+ static_cast<const SvxBoxItem&>(_pSet->Get(GetWhich(SID_ATTR_BORDER_OUTER))));
}
// limits paper
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index cf984bedbb22..ad93257faa94 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -150,7 +150,7 @@ sal_uInt16 GetHtmlMode_Impl(const SfxItemSet& rSet)
( 0 != (pShell = SfxObjectShell::Current()) &&
0 != (pItem = pShell->GetItem(SID_HTML_MODE))))
{
- nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue();
+ nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
}
return nHtmlMode;
@@ -218,7 +218,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
nWhich = GetWhich( SID_ATTR_PARA_LINESPACE );
SfxMapUnit eUnit = pPool->GetMetric( nWhich );
SvxLineSpacingItem aSpacing(
- (const SvxLineSpacingItem&)GetItemSet().Get( nWhich ) );
+ static_cast<const SvxLineSpacingItem&>(GetItemSet().Get( nWhich )) );
switch ( nPos )
{
@@ -248,7 +248,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
eState = GetItemSet().GetItemState( nWhich );
pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_LINESPACE );
- if ( !pOld || !( *(const SvxLineSpacingItem*)pOld == aSpacing ) ||
+ if ( !pOld || !( *static_cast<const SvxLineSpacingItem*>(pOld) == aSpacing ) ||
SfxItemState::DONTCARE == eState )
{
rOutSet->Put( aSpacing );
@@ -269,7 +269,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
DBG_ASSERT( GetItemSet().GetParent(), "No ParentSet" );
const SvxULSpaceItem& rOldItem =
- (const SvxULSpaceItem&)GetItemSet().GetParent()->Get( nWhich );
+ static_cast<const SvxULSpaceItem&>(GetItemSet().GetParent()->Get( nWhich ));
if ( m_pTopDist->IsRelative() )
aMargin.SetUpper( rOldItem.GetUpper(),
@@ -292,7 +292,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
aMargin.SetContextValue(m_pContextualCB->IsChecked());
eState = GetItemSet().GetItemState( nWhich );
- if ( !pOld || !( *(const SvxULSpaceItem*)pOld == aMargin ) ||
+ if ( !pOld || !( *static_cast<const SvxULSpaceItem*>(pOld) == aMargin ) ||
SfxItemState::DONTCARE == eState )
{
rOutSet->Put( aMargin );
@@ -316,7 +316,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
DBG_ASSERT( GetItemSet().GetParent(), "No ParentSet" );
const SvxLRSpaceItem& rOldItem =
- (const SvxLRSpaceItem&)GetItemSet().GetParent()->Get( nWhich );
+ static_cast<const SvxLRSpaceItem&>(GetItemSet().GetParent()->Get( nWhich ));
if ( m_pLeftIndent->IsRelative() )
aMargin.SetTxtLeft( rOldItem.GetTxtLeft(),
@@ -349,7 +349,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
bNullTab = true;
eState = GetItemSet().GetItemState( nWhich );
- if ( !pOld || !( *(const SvxLRSpaceItem*)pOld == aMargin ) ||
+ if ( !pOld || !( *static_cast<const SvxLRSpaceItem*>(pOld) == aMargin ) ||
SfxItemState::DONTCARE == eState )
{
rOutSet->Put( aMargin );
@@ -370,7 +370,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
if ( rInSet.GetItemState( _nWhich ) >= SfxItemState::DEFAULT )
{
const SvxTabStopItem& rTabItem =
- (const SvxTabStopItem&)rInSet.Get( _nWhich );
+ static_cast<const SvxTabStopItem&>(rInSet.Get( _nWhich ));
SvxTabStopItem aNullTab( rTabItem );
SvxTabStop aNull( 0, SVX_TAB_ADJUST_DEFAULT );
aNullTab.Insert( aNull );
@@ -380,11 +380,11 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
}
if( m_pRegisterCB->IsVisible())
{
- const SfxBoolItem* pBoolItem = (SfxBoolItem*)GetOldItem(
- *rOutSet, SID_ATTR_PARA_REGISTER);
+ const SfxBoolItem* pBoolItem = static_cast<const SfxBoolItem*>(GetOldItem(
+ *rOutSet, SID_ATTR_PARA_REGISTER));
if (!pBoolItem)
return bModified;
- boost::scoped_ptr<SfxBoolItem> pRegItem((SfxBoolItem*)pBoolItem->Clone());
+ boost::scoped_ptr<SfxBoolItem> pRegItem(static_cast<SfxBoolItem*>(pBoolItem->Clone()));
sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_REGISTER );
bool bSet = pRegItem->GetValue();
@@ -441,7 +441,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
if ( bRelativeMode )
{
const SvxLRSpaceItem& rOldItem =
- (const SvxLRSpaceItem&)rSet->Get( _nWhich );
+ static_cast<const SvxLRSpaceItem&>(rSet->Get( _nWhich ));
if ( rOldItem.GetPropLeft() != 100 )
{
@@ -485,7 +485,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
else
{
const SvxLRSpaceItem& rSpace =
- (const SvxLRSpaceItem&)rSet->Get( _nWhich );
+ static_cast<const SvxLRSpaceItem&>(rSet->Get( _nWhich ));
SetMetricValue( *m_pLeftIndent, rSpace.GetTxtLeft(), eUnit );
SetMetricValue( *m_pRightIndent, rSpace.GetRight(), eUnit );
@@ -509,7 +509,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
SfxMapUnit eUnit = pPool->GetMetric( _nWhich );
const SvxULSpaceItem& rOldItem =
- (const SvxULSpaceItem&)rSet->Get( _nWhich );
+ static_cast<const SvxULSpaceItem&>(rSet->Get( _nWhich ));
if ( bRelativeMode )
{
@@ -560,7 +560,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
eItemState = rSet->GetItemState( _nWhich );
if ( eItemState >= SfxItemState::DEFAULT )
- SetLineSpacing_Impl( (const SvxLineSpacingItem &)rSet->Get( _nWhich ) );
+ SetLineSpacing_Impl( static_cast<const SvxLineSpacingItem &>(rSet->Get( _nWhich )) );
else
m_pLineDist->SetNoSelection();
@@ -568,7 +568,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
eItemState = rSet->GetItemState( _nWhich );
if ( eItemState >= SfxItemState::DEFAULT )
- m_pRegisterCB->Check( ((const SfxBoolItem &)rSet->Get( _nWhich )).GetValue());
+ m_pRegisterCB->Check( static_cast<const SfxBoolItem &>(rSet->Get( _nWhich )).GetValue());
m_pRegisterCB->SaveValue();
sal_uInt16 nHtmlMode = GetHtmlMode_Impl(*rSet);
if(nHtmlMode & HTMLMODE_ON)
@@ -1093,7 +1093,7 @@ bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* rOutSet )
if ( bAdj )
{
- const SvxAdjustItem* pOld = (const SvxAdjustItem*)GetOldItem( *rOutSet, SID_ATTR_PARA_ADJUST );
+ const SvxAdjustItem* pOld = static_cast<const SvxAdjustItem*>(GetOldItem( *rOutSet, SID_ATTR_PARA_ADJUST ));
SvxAdjust eOneWord = m_pExpandCB->IsChecked() ? SVX_ADJUST_BLOCK : SVX_ADJUST_LEFT;
@@ -1116,7 +1116,7 @@ bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* rOutSet )
{
bModified = true;
SvxAdjustItem aAdj(
- (const SvxAdjustItem&)GetItemSet().Get( _nWhich ) );
+ static_cast<const SvxAdjustItem&>(GetItemSet().Get( _nWhich )) );
aAdj.SetAdjust( eAdjust );
aAdj.SetOneWord( eOneWord );
aAdj.SetLastBlock( eLastBlock );
@@ -1155,7 +1155,7 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet )
sal_Int32 nLBSelect = 0;
if ( eItemState >= SfxItemState::DEFAULT )
{
- const SvxAdjustItem& rAdj = (const SvxAdjustItem&)rSet->Get( _nWhich );
+ const SvxAdjustItem& rAdj = static_cast<const SvxAdjustItem&>(rSet->Get( _nWhich ));
switch ( rAdj.GetAdjust() /*!!! ask VB rAdj.GetLastBlock()*/ )
{
@@ -1207,7 +1207,7 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet )
eItemState = rSet->GetItemState( _nWhich );
if ( eItemState >= SfxItemState::DEFAULT )
{
- const SvxParaGridItem& rSnap = (const SvxParaGridItem&)rSet->Get( _nWhich );
+ const SvxParaGridItem& rSnap = static_cast<const SvxParaGridItem&>(rSet->Get( _nWhich ));
m_pSnapToGridCB->Check(rSnap.GetValue());
}
@@ -1218,7 +1218,7 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet )
{
m_pVertAlignFL->Show();
- const SvxParaVertAlignItem& rAlign = (const SvxParaVertAlignItem&)rSet->Get( _nWhich );
+ const SvxParaVertAlignItem& rAlign = static_cast<const SvxParaVertAlignItem&>(rSet->Get( _nWhich ));
m_pVertAlignLB->SelectEntryPos(rAlign.GetValue());
}
@@ -1227,7 +1227,7 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet )
//text direction
if( SfxItemState::DEFAULT <= rSet->GetItemState( _nWhich ) )
{
- const SvxFrameDirectionItem& rFrameDirItem = ( const SvxFrameDirectionItem& ) rSet->Get( _nWhich );
+ const SvxFrameDirectionItem& rFrameDirItem = static_cast<const SvxFrameDirectionItem&>( rSet->Get( _nWhich ) );
m_pTextDirectionLB->SelectEntryValue( (SvxFrameDirection)rFrameDirItem.GetValue() );
m_pTextDirectionLB->SaveValue();
}
@@ -1343,7 +1343,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
m_pMaxHyphenEdit->IsValueModified() )
{
SvxHyphenZoneItem aHyphen(
- (const SvxHyphenZoneItem&)GetItemSet().Get( _nWhich ) );
+ static_cast<const SvxHyphenZoneItem&>(GetItemSet().Get( _nWhich )) );
aHyphen.SetHyphen( eHyphenState == TRISTATE_TRUE );
if ( eHyphenState == TRISTATE_TRUE )
@@ -1354,7 +1354,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
aHyphen.GetMaxHyphens() = (sal_uInt8)m_pMaxHyphenEdit->GetValue();
if ( !pOld ||
- !( *(SvxHyphenZoneItem*)pOld == aHyphen ) ||
+ !( *static_cast<const SvxHyphenZoneItem*>(pOld) == aHyphen ) ||
m_pHyphenBox->IsValueChangedFromSaved())
{
rOutSet->Put( aHyphen );
@@ -1369,7 +1369,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_PAGENUM );
- if ( !pOld || ( (const SfxUInt16Item*)pOld )->GetValue() != aPageNum.GetValue() )
+ if ( !pOld || static_cast<const SfxUInt16Item*>(pOld)->GetValue() != aPageNum.GetValue() )
{
rOutSet->Put( aPageNum );
bModified = true;
@@ -1394,7 +1394,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
}
pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_MODEL );
- if ( !pOld || ( (const SvxPageModelItem*)pOld )->GetValue() != sPage )
+ if ( !pOld || static_cast<const SvxPageModelItem*>(pOld)->GetValue() != sPage )
{
rOutSet->Put( SvxPageModelItem( sPage, false, _nWhich ) );
bModified = true;
@@ -1423,7 +1423,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
m_pBreakPositionLB->IsValueChangedFromSaved() )
{
const SvxFmtBreakItem rOldBreak(
- (const SvxFmtBreakItem&)GetItemSet().Get( _nWhich ));
+ static_cast<const SvxFmtBreakItem&>(GetItemSet().Get( _nWhich )));
SvxFmtBreakItem aBreak(rOldBreak.GetBreak(), rOldBreak.Which());
switch ( eState )
@@ -1457,7 +1457,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_PAGEBREAK );
if ( eState != m_pPageBreakBox->GetSavedValue() ||
- !pOld || !( *(const SvxFmtBreakItem*)pOld == aBreak ) )
+ !pOld || !( *static_cast<const SvxFmtBreakItem*>(pOld) == aBreak ) )
{
bModified = true;
rOutSet->Put( aBreak );
@@ -1473,7 +1473,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
{
pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_SPLIT );
- if ( !pOld || ( (const SvxFmtSplitItem*)pOld )->GetValue() !=
+ if ( !pOld || static_cast<const SvxFmtSplitItem*>(pOld)->GetValue() !=
( eState == TRISTATE_FALSE ) )
{
rOutSet->Put( SvxFmtSplitItem( eState == TRISTATE_FALSE, _nWhich ) );
@@ -1503,7 +1503,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
(sal_uInt8)m_pWidowRowNo->GetValue() : 0, _nWhich );
pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_WIDOWS );
- if ( m_pWidowBox->IsValueChangedFromSaved() || !pOld || !( *(const SvxWidowsItem*)pOld == rItem ) )
+ if ( m_pWidowBox->IsValueChangedFromSaved() || !pOld || !( *static_cast<const SvxWidowsItem*>(pOld) == rItem ) )
{
rOutSet->Put( rItem );
bModified = true;
@@ -1522,7 +1522,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
if ( m_pOrphanBox->IsValueChangedFromSaved() ||
!pOld ||
- !( *(const SvxOrphansItem*)pOld == rItem ) )
+ !( *static_cast<const SvxOrphansItem*>(pOld) == rItem ) )
{
rOutSet->Put( rItem );
bModified = true;
@@ -1542,7 +1542,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
if( !bHtmlMode && bItemAvailable )
{
const SvxHyphenZoneItem& rHyphen =
- (const SvxHyphenZoneItem&)rSet->Get( _nWhich );
+ static_cast<const SvxHyphenZoneItem&>(rSet->Get( _nWhich ));
m_pHyphenBox->EnableTriState( false );
bIsHyphen = rHyphen.IsHyphen();
@@ -1569,7 +1569,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
if ( rSet->GetItemState(_nWhich) >= SfxItemState::DEFAULT )
{
const sal_uInt16 nPageNum =
- ( (const SfxUInt16Item&)rSet->Get( _nWhich ) ).GetValue();
+ static_cast<const SfxUInt16Item&>(rSet->Get( _nWhich ) ).GetValue();
m_pPagenumEdit->SetValue( nPageNum );
}
@@ -1585,7 +1585,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
m_pApplyCollBtn->EnableTriState( false );
const SvxPageModelItem& rModel =
- (const SvxPageModelItem&)rSet->Get( _nWhich );
+ static_cast<const SvxPageModelItem&>(rSet->Get( _nWhich ));
OUString aStr( rModel.GetValue() );
if ( !aStr.isEmpty() &&
@@ -1637,7 +1637,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
if ( eItemState >= SfxItemState::DEFAULT )
{
const SvxFmtBreakItem& rPageBreak =
- (const SvxFmtBreakItem&)rSet->Get( _nWhich );
+ static_cast<const SvxFmtBreakItem&>(rSet->Get( _nWhich ));
SvxBreak eBreak = (SvxBreak)rPageBreak.GetValue();
@@ -1709,7 +1709,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
{
m_pKeepParaBox->EnableTriState( false );
const SvxFmtKeepItem& rKeep =
- (const SvxFmtKeepItem&)rSet->Get( _nWhich );
+ static_cast<const SvxFmtKeepItem&>(rSet->Get( _nWhich ));
if ( rKeep.GetValue() )
m_pKeepParaBox->SetState( TRISTATE_TRUE );
@@ -1727,7 +1727,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
if ( eItemState >= SfxItemState::DEFAULT )
{
const SvxFmtSplitItem& rSplit =
- (const SvxFmtSplitItem&)rSet->Get( _nWhich );
+ static_cast<const SvxFmtSplitItem&>(rSet->Get( _nWhich ));
m_pKeepTogetherBox->EnableTriState( false );
if ( !rSplit.GetValue() )
@@ -1744,7 +1744,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
if ( eTmpState >= SfxItemState::DEFAULT )
{
const SvxWidowsItem& rWidow =
- (const SvxWidowsItem&)rSet->Get( _nWhich );
+ static_cast<const SvxWidowsItem&>(rSet->Get( _nWhich ));
m_pWidowBox->EnableTriState( false );
const sal_uInt16 nLines = rWidow.GetValue();
@@ -1767,7 +1767,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
if ( eTmpState >= SfxItemState::DEFAULT )
{
const SvxOrphansItem& rOrphan =
- (const SvxOrphansItem&)rSet->Get( _nWhich );
+ static_cast<const SvxOrphansItem&>(rSet->Get( _nWhich ));
const sal_uInt16 nLines = rOrphan.GetValue();
m_pOrphanBox->EnableTriState( false );
@@ -2159,24 +2159,24 @@ bool SvxAsianTabPage::FillItemSet( SfxItemSet* rSet )
SfxItemPool* pPool = rSet->GetPool();
if (m_pScriptSpaceCB->IsEnabled() && m_pScriptSpaceCB->IsValueChangedFromSaved())
{
- boost::scoped_ptr<SfxBoolItem> pNewItem((SfxBoolItem*)rSet->Get(
- pPool->GetWhich(SID_ATTR_PARA_SCRIPTSPACE)).Clone());
+ boost::scoped_ptr<SfxBoolItem> pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
+ pPool->GetWhich(SID_ATTR_PARA_SCRIPTSPACE)).Clone()));
pNewItem->SetValue(m_pScriptSpaceCB->IsChecked());
rSet->Put(*pNewItem);
bRet = true;
}
if (m_pHangingPunctCB->IsEnabled() && m_pHangingPunctCB->IsValueChangedFromSaved())
{
- boost::scoped_ptr<SfxBoolItem> pNewItem((SfxBoolItem*)rSet->Get(
- pPool->GetWhich(SID_ATTR_PARA_HANGPUNCTUATION)).Clone());
+ boost::scoped_ptr<SfxBoolItem> pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
+ pPool->GetWhich(SID_ATTR_PARA_HANGPUNCTUATION)).Clone()));
pNewItem->SetValue(m_pHangingPunctCB->IsChecked());
rSet->Put(*pNewItem);
bRet = true;
}
if (m_pForbiddenRulesCB->IsEnabled() && m_pForbiddenRulesCB->IsValueChangedFromSaved())
{
- boost::scoped_ptr<SfxBoolItem> pNewItem((SfxBoolItem*)rSet->Get(
- pPool->GetWhich(SID_ATTR_PARA_FORBIDDEN_RULES)).Clone());
+ boost::scoped_ptr<SfxBoolItem> pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
+ pPool->GetWhich(SID_ATTR_PARA_FORBIDDEN_RULES)).Clone()));
pNewItem->SetValue(m_pForbiddenRulesCB->IsChecked());
rSet->Put(*pNewItem);
bRet = true;
@@ -2193,7 +2193,7 @@ static void lcl_SetBox(const SfxItemSet& rSet, sal_uInt16 nSlotId, CheckBox& rBo
else if(eState >= SfxItemState::DEFAULT)
{
rBox.EnableTriState( false );
- rBox.Check(((const SfxBoolItem&)rSet.Get(_nWhich)).GetValue());
+ rBox.Check(static_cast<const SfxBoolItem&>(rSet.Get(_nWhich)).GetValue());
}
else
rBox.SetState( TRISTATE_INDET );
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index ffd6bd3207c2..e9a451625c8f 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -917,7 +917,7 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet* rSet)
pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_PROTECT_POS );
if ( pItem )
{
- bool bProtected = ( ( const SfxBoolItem* )pItem )->GetValue();
+ bool bProtected = static_cast<const SfxBoolItem*>(pItem)->GetValue();
m_pPositionCB->SetState( bProtected ? TRISTATE_TRUE : TRISTATE_FALSE );
m_pPositionCB->EnableTriState( false );
m_pSizeCB->Enable( !bProtected );
@@ -933,7 +933,7 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet* rSet)
if ( pItem )
{
- m_pSizeCB->SetState( ( (const SfxBoolItem*)pItem )->GetValue()
+ m_pSizeCB->SetState( static_cast<const SfxBoolItem*>(pItem)->GetValue()
? TRISTATE_TRUE : TRISTATE_FALSE );
m_pSizeCB->EnableTriState( false );
}
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index e5ab37b6f16f..cef9253bd9de 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -235,82 +235,82 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if (nId == m_nAreaTabPage )
{
- ( (SvxAreaTabPage&) rPage ).SetColorList( mpColorList );
- ( (SvxAreaTabPage&) rPage ).SetGradientList( mpGradientList );
- ( (SvxAreaTabPage&) rPage ).SetHatchingList( mpHatchingList );
- ( (SvxAreaTabPage&) rPage ).SetBitmapList( mpBitmapList );
- ( (SvxAreaTabPage&) rPage ).SetPageType( mnPageType );
- ( (SvxAreaTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxAreaTabPage&) rPage ).SetPos( mnPos );
- ( (SvxAreaTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxAreaTabPage&) rPage ).SetGrdChgd( &mnGradientListState );
- ( (SvxAreaTabPage&) rPage ).SetHtchChgd( &mnHatchingListState );
- ( (SvxAreaTabPage&) rPage ).SetBmpChgd( &mnBitmapListState );
- ( (SvxAreaTabPage&) rPage ).SetColorChgd( &mnColorListState );
- ( (SvxAreaTabPage&) rPage ).Construct();
- // ActivatePage() is not called the first time
- ( (SvxAreaTabPage&) rPage ).ActivatePage( mrOutAttrs );
+ static_cast<SvxAreaTabPage&>(rPage).SetColorList( mpColorList );
+ static_cast<SvxAreaTabPage&>(rPage).SetGradientList( mpGradientList );
+ static_cast<SvxAreaTabPage&>(rPage).SetHatchingList( mpHatchingList );
+ static_cast<SvxAreaTabPage&>(rPage).SetBitmapList( mpBitmapList );
+ static_cast<SvxAreaTabPage&>(rPage).SetPageType( mnPageType );
+ static_cast<SvxAreaTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxAreaTabPage&>(rPage).SetPos( mnPos );
+ static_cast<SvxAreaTabPage&>(rPage).SetAreaTP( &mbAreaTP );
+ static_cast<SvxAreaTabPage&>(rPage).SetGrdChgd( &mnGradientListState );
+ static_cast<SvxAreaTabPage&>(rPage).SetHtchChgd( &mnHatchingListState );
+ static_cast<SvxAreaTabPage&>(rPage).SetBmpChgd( &mnBitmapListState );
+ static_cast<SvxAreaTabPage&>(rPage).SetColorChgd( &mnColorListState );
+ static_cast<SvxAreaTabPage&>(rPage).Construct();
+ // ActivatePge() is not called the first time
+ static_cast<SvxAreaTabPage&>(rPage).ActivatePage( mrOutAttrs );
}
else if (nId == m_nShadowTabPage)
{
- ( (SvxShadowTabPage&) rPage ).SetColorList( mpColorList );
- ( (SvxShadowTabPage&) rPage ).SetPageType( mnPageType );
- ( (SvxShadowTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxShadowTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxShadowTabPage&) rPage ).SetColorChgd( &mnColorListState );
- ( (SvxShadowTabPage&) rPage ).Construct();
+ static_cast<SvxShadowTabPage&>(rPage).SetColorList( mpColorList );
+ static_cast<SvxShadowTabPage&>(rPage).SetPageType( mnPageType );
+ static_cast<SvxShadowTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxShadowTabPage&>(rPage).SetAreaTP( &mbAreaTP );
+ static_cast<SvxShadowTabPage&>(rPage).SetColorChgd( &mnColorListState );
+ static_cast<SvxShadowTabPage&>(rPage).Construct();
}
else if (nId == m_nGradientTabPage)
{
- ( (SvxGradientTabPage&) rPage ).SetColorList( mpColorList );
- ( (SvxGradientTabPage&) rPage ).SetGradientList( mpGradientList );
- ( (SvxGradientTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxGradientTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxGradientTabPage&) rPage ).SetPos( &mnPos );
- ( (SvxGradientTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxGradientTabPage&) rPage ).SetGrdChgd( &mnGradientListState );
- ( (SvxGradientTabPage&) rPage ).SetColorChgd( &mnColorListState );
- ( (SvxGradientTabPage&) rPage ).Construct();
+ static_cast<SvxGradientTabPage&>(rPage).SetColorList( mpColorList );
+ static_cast<SvxGradientTabPage&>(rPage).SetGradientList( mpGradientList );
+ static_cast<SvxGradientTabPage&>(rPage).SetPageType( &mnPageType );
+ static_cast<SvxGradientTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxGradientTabPage&>(rPage).SetPos( &mnPos );
+ static_cast<SvxGradientTabPage&>(rPage).SetAreaTP( &mbAreaTP );
+ static_cast<SvxGradientTabPage&>(rPage).SetGrdChgd( &mnGradientListState );
+ static_cast<SvxGradientTabPage&>(rPage).SetColorChgd( &mnColorListState );
+ static_cast<SvxGradientTabPage&>(rPage).Construct();
}
else if (nId == m_nHatchTabPage)
{
- ( (SvxHatchTabPage&) rPage ).SetColorList( mpColorList );
- ( (SvxHatchTabPage&) rPage ).SetHatchingList( mpHatchingList );
- ( (SvxHatchTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxHatchTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxHatchTabPage&) rPage ).SetPos( &mnPos );
- ( (SvxHatchTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxHatchTabPage&) rPage ).SetHtchChgd( &mnHatchingListState );
- ( (SvxHatchTabPage&) rPage ).SetColorChgd( &mnColorListState );
- ( (SvxHatchTabPage&) rPage ).Construct();
+ static_cast<SvxHatchTabPage&>(rPage).SetColorList( mpColorList );
+ static_cast<SvxHatchTabPage&>(rPage).SetHatchingList( mpHatchingList );
+ static_cast<SvxHatchTabPage&>(rPage).SetPageType( &mnPageType );
+ static_cast<SvxHatchTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxHatchTabPage&>(rPage).SetPos( &mnPos );
+ static_cast<SvxHatchTabPage&>(rPage).SetAreaTP( &mbAreaTP );
+ static_cast<SvxHatchTabPage&>(rPage).SetHtchChgd( &mnHatchingListState );
+ static_cast<SvxHatchTabPage&>(rPage).SetColorChgd( &mnColorListState );
+ static_cast<SvxHatchTabPage&>(rPage).Construct();
}
else if (nId == m_nBitmapTabPage)
{
- ( (SvxBitmapTabPage&) rPage ).SetColorList( mpColorList );
- ( (SvxBitmapTabPage&) rPage ).SetBitmapList( mpBitmapList );
- ( (SvxBitmapTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxBitmapTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxBitmapTabPage&) rPage ).SetPos( &mnPos );
- ( (SvxBitmapTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxBitmapTabPage&) rPage ).SetBmpChgd( &mnBitmapListState );
- ( (SvxBitmapTabPage&) rPage ).SetColorChgd( &mnColorListState );
- ( (SvxBitmapTabPage&) rPage ).Construct();
+ static_cast<SvxBitmapTabPage&>(rPage).SetColorList( mpColorList );
+ static_cast<SvxBitmapTabPage&>(rPage).SetBitmapList( mpBitmapList );
+ static_cast<SvxBitmapTabPage&>(rPage).SetPageType( &mnPageType );
+ static_cast<SvxBitmapTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxBitmapTabPage&>(rPage).SetPos( &mnPos );
+ static_cast<SvxBitmapTabPage&>(rPage).SetAreaTP( &mbAreaTP );
+ static_cast<SvxBitmapTabPage&>(rPage).SetBmpChgd( &mnBitmapListState );
+ static_cast<SvxBitmapTabPage&>(rPage).SetColorChgd( &mnColorListState );
+ static_cast<SvxBitmapTabPage&>(rPage).Construct();
}
else if (nId == m_nColorTabPage)
{
- ( (SvxColorTabPage&) rPage ).SetColorList( mpColorList );
- ( (SvxColorTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxColorTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxColorTabPage&) rPage ).SetPos( &mnPos );
- ( (SvxColorTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxColorTabPage&) rPage ).SetColorChgd( &mnColorListState );
- ( (SvxColorTabPage&) rPage ).Construct();
+ static_cast<SvxColorTabPage&>(rPage).SetColorList( mpColorList );
+ static_cast<SvxColorTabPage&>(rPage).SetPageType( &mnPageType );
+ static_cast<SvxColorTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxColorTabPage&>(rPage).SetPos( &mnPos );
+ static_cast<SvxColorTabPage&>(rPage).SetAreaTP( &mbAreaTP );
+ static_cast<SvxColorTabPage&>(rPage).SetColorChgd( &mnColorListState );
+ static_cast<SvxColorTabPage&>(rPage).Construct();
}
else if (nId == m_nTransparenceTabPage)
{
- ( (SvxTransparenceTabPage&) rPage ).SetPageType( mnPageType );
- ( (SvxTransparenceTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxTransparenceTabPage&) rPage ).Construct();
+ static_cast<SvxTransparenceTabPage&>(rPage).SetPageType( mnPageType );
+ static_cast<SvxTransparenceTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxTransparenceTabPage&>(rPage).Construct();
}
}
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
index c473966340ad..be818ba57f02 100644
--- a/cui/source/tabpages/tabline.cxx
+++ b/cui/source/tabpages/tabline.cxx
@@ -198,50 +198,50 @@ void SvxLineTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if( nId == m_nLineTabPage)
{
- ( (SvxLineTabPage&) rPage ).SetColorList( pColorList );
- ( (SvxLineTabPage&) rPage ).SetDashList( pDashList );
- ( (SvxLineTabPage&) rPage ).SetLineEndList( pLineEndList );
- ( (SvxLineTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxLineTabPage&) rPage ).SetPageType( nPageType );
- ( (SvxLineTabPage&) rPage ).SetPosDashLb( &nPosDashLb );
- ( (SvxLineTabPage&) rPage ).SetPosLineEndLb( &nPosLineEndLb );
- ( (SvxLineTabPage&) rPage ).SetDashChgd( &nDashListState );
- ( (SvxLineTabPage&) rPage ).SetLineEndChgd( &nLineEndListState );
- ( (SvxLineTabPage&) rPage ).SetObjSelected( bObjSelected );
- ( (SvxLineTabPage&) rPage ).Construct();
- ( (SvxLineTabPage&) rPage ).SetColorChgd( &mnColorListState );
+ static_cast<SvxLineTabPage&>(rPage).SetColorList( pColorList );
+ static_cast<SvxLineTabPage&>(rPage).SetDashList( pDashList );
+ static_cast<SvxLineTabPage&>(rPage).SetLineEndList( pLineEndList );
+ static_cast<SvxLineTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxLineTabPage&>(rPage).SetPageType( nPageType );
+ static_cast<SvxLineTabPage&>(rPage).SetPosDashLb( &nPosDashLb );
+ static_cast<SvxLineTabPage&>(rPage).SetPosLineEndLb( &nPosLineEndLb );
+ static_cast<SvxLineTabPage&>(rPage).SetDashChgd( &nDashListState );
+ static_cast<SvxLineTabPage&>(rPage).SetLineEndChgd( &nLineEndListState );
+ static_cast<SvxLineTabPage&>(rPage).SetObjSelected( bObjSelected );
+ static_cast<SvxLineTabPage&>(rPage).Construct();
+ static_cast<SvxLineTabPage&>(rPage).SetColorChgd( &mnColorListState );
// ActivatePage() is not called the first time
- ( (SvxLineTabPage&) rPage ).ActivatePage( rOutAttrs );
+ static_cast<SvxLineTabPage&>(rPage).ActivatePage( rOutAttrs );
}
else if(nId == m_nStyleTabPage)
{
- ( (SvxLineDefTabPage&) rPage ).SetDashList( pDashList );
- ( (SvxLineDefTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxLineDefTabPage&) rPage ).SetPageType( &nPageType );
- ( (SvxLineDefTabPage&) rPage ).SetPosDashLb( &nPosDashLb );
- ( (SvxLineDefTabPage&) rPage ).SetDashChgd( &nDashListState );
- ( (SvxLineDefTabPage&) rPage ).SetObjSelected( bObjSelected );
- ( (SvxLineDefTabPage&) rPage ).Construct();
+ static_cast<SvxLineDefTabPage&>(rPage).SetDashList( pDashList );
+ static_cast<SvxLineDefTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxLineDefTabPage&>(rPage).SetPageType( &nPageType );
+ static_cast<SvxLineDefTabPage&>(rPage).SetPosDashLb( &nPosDashLb );
+ static_cast<SvxLineDefTabPage&>(rPage).SetDashChgd( &nDashListState );
+ static_cast<SvxLineDefTabPage&>(rPage).SetObjSelected( bObjSelected );
+ static_cast<SvxLineDefTabPage&>(rPage).Construct();
}
else if(nId == m_nEndTabPage)
{
- ( (SvxLineEndDefTabPage&) rPage ).SetLineEndList( pLineEndList );
- ( (SvxLineEndDefTabPage&) rPage ).SetPolyObj( pObj );
- ( (SvxLineEndDefTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxLineEndDefTabPage&) rPage ).SetPageType( &nPageType );
- ( (SvxLineEndDefTabPage&) rPage ).SetPosLineEndLb( &nPosLineEndLb );
- ( (SvxLineEndDefTabPage&) rPage ).SetLineEndChgd( &nLineEndListState );
- ( (SvxLineEndDefTabPage&) rPage ).SetObjSelected( bObjSelected );
- ( (SvxLineEndDefTabPage&) rPage ).Construct();
+ static_cast<SvxLineEndDefTabPage&>(rPage).SetLineEndList( pLineEndList );
+ static_cast<SvxLineEndDefTabPage&>(rPage).SetPolyObj( pObj );
+ static_cast<SvxLineEndDefTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxLineEndDefTabPage&>(rPage).SetPageType( &nPageType );
+ static_cast<SvxLineEndDefTabPage&>(rPage).SetPosLineEndLb( &nPosLineEndLb );
+ static_cast<SvxLineEndDefTabPage&>(rPage).SetLineEndChgd( &nLineEndListState );
+ static_cast<SvxLineEndDefTabPage&>(rPage).SetObjSelected( bObjSelected );
+ static_cast<SvxLineEndDefTabPage&>(rPage).Construct();
}
else if (nId == m_nShadowTabPage)
{
- ( (SvxShadowTabPage&) rPage ).SetColorList( pColorList );
- ( (SvxShadowTabPage&) rPage ).SetPageType( nPageType );
- ( (SvxShadowTabPage&) rPage ).SetDlgType( 0 );
- ( (SvxShadowTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxShadowTabPage&) rPage ).SetColorChgd( &mnColorListState );
- ( (SvxShadowTabPage&) rPage ).Construct();
+ static_cast<SvxShadowTabPage&>(rPage).SetColorList( pColorList );
+ static_cast<SvxShadowTabPage&>(rPage).SetPageType( nPageType );
+ static_cast<SvxShadowTabPage&>(rPage).SetDlgType( 0 );
+ static_cast<SvxShadowTabPage&>(rPage).SetAreaTP( &mbAreaTP );
+ static_cast<SvxShadowTabPage&>(rPage).SetColorChgd( &mnColorListState );
+ static_cast<SvxShadowTabPage&>(rPage).Construct();
}
}
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index de67049d9e11..f5db32bb15b4 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -226,7 +226,7 @@ bool SvxTabulatorTabPage::FillItemSet( SfxItemSet* rSet )
if ( SfxItemState::SET != rSet->GetItemState( GetWhich( SID_ATTR_LRSPACE ), true, &pLRSpace ) )
pLRSpace = GetOldItem( *rSet, SID_ATTR_LRSPACE );
- if ( pLRSpace && ( (SvxLRSpaceItem*)pLRSpace )->GetTxtFirstLineOfst() < 0 )
+ if ( pLRSpace && static_cast<const SvxLRSpaceItem*>(pLRSpace)->GetTxtFirstLineOfst() < 0 )
{
SvxTabStop aNull( 0, SVX_TAB_ADJUST_DEFAULT );
aNewTabs.Insert( aNull );
@@ -243,13 +243,13 @@ bool SvxTabulatorTabPage::FillItemSet( SfxItemSet* rSet )
aTmp.Insert( aTmpStop );
}
- if ( !pOld || !( *( (SvxTabStopItem*)pOld ) == aTmp ) )
+ if ( !pOld || !( *static_cast<const SvxTabStopItem*>(pOld) == aTmp ) )
{
rSet->Put( aTmp );
bModified = true;
}
}
- else if ( !pOld || !( *( (SvxTabStopItem*)pOld ) == aNewTabs ) )
+ else if ( !pOld || !( *static_cast<const SvxTabStopItem*>(pOld) == aNewTabs ) )
{
rSet->Put( aNewTabs );
bModified = true;
@@ -279,7 +279,7 @@ void SvxTabulatorTabPage::Reset( const SfxItemSet* rSet )
{
if ( MAP_100TH_MM != eUnit )
{
- SvxTabStopItem aTmp( *( (const SvxTabStopItem*)pItem ) );
+ SvxTabStopItem aTmp( *static_cast<const SvxTabStopItem*>(pItem) );
aNewTabs.Remove( 0, aNewTabs.Count() );
for ( sal_uInt16 i = 0; i < aTmp.Count(); ++i )
@@ -290,7 +290,7 @@ void SvxTabulatorTabPage::Reset( const SfxItemSet* rSet )
}
}
else
- aNewTabs = *( (const SvxTabStopItem*)pItem );
+ aNewTabs = *static_cast<const SvxTabStopItem*>(pItem);
}
else
aNewTabs.Remove( 0, aNewTabs.Count() );
@@ -301,14 +301,14 @@ void SvxTabulatorTabPage::Reset( const SfxItemSet* rSet )
if ( pItem )
nDefDist = LogicToLogic(
- (long)((const SfxUInt16Item*)pItem)->GetValue(), eUnit, MAP_100TH_MM );
+ (long)static_cast<const SfxUInt16Item*>(pItem)->GetValue(), eUnit, MAP_100TH_MM );
// Tab pos currently selected
sal_uInt16 nTabPos = 0;
pItem = GetItem( *rSet, SID_ATTR_TABSTOP_POS );
if ( pItem )
- nTabPos = ( (const SfxUInt16Item*)pItem )->GetValue();
+ nTabPos = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
InitTabPos_Impl( nTabPos );
}
@@ -378,7 +378,7 @@ void SvxTabulatorTabPage::InitTabPos_Impl( sal_uInt16 nTabPos )
if ( GetItemSet().GetItemState( SID_ATTR_TABSTOP_OFFSET, true, &pItem )
== SfxItemState::SET )
{
- nOffset = ( (const SfxInt32Item*)pItem )->GetValue();
+ nOffset = static_cast<const SfxInt32Item*>(pItem)->GetValue();
MapUnit eUnit = (MapUnit)GetItemSet().GetPool()->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MAP_100TH_MM );
}
@@ -488,7 +488,7 @@ IMPL_LINK( SvxTabulatorTabPage, NewHdl_Impl, Button *, pBtn )
if ( GetItemSet().GetItemState( SID_ATTR_TABSTOP_OFFSET, true, &pItem ) ==
SfxItemState::SET )
{
- nOffset = ( (const SfxInt32Item*)pItem )->GetValue();
+ nOffset = static_cast<const SfxInt32Item*>(pItem)->GetValue();
MapUnit eUnit = (MapUnit)GetItemSet().GetPool()->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MAP_100TH_MM );
}
diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx
index 4e1761d0a18d..43588c46aae2 100644
--- a/cui/source/tabpages/textanim.cxx
+++ b/cui/source/tabpages/textanim.cxx
@@ -64,8 +64,8 @@ void SvxTextTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if (nId == m_nTextId)
{
- ( (SvxTextAttrPage&) rPage ).SetView( pView );
- ( (SvxTextAttrPage&) rPage ).Construct();
+ static_cast<SvxTextAttrPage&>(rPage).SetView( pView );
+ static_cast<SvxTextAttrPage&>(rPage).Construct();
}
}
@@ -149,7 +149,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIKIND );
if( pItem )
{
- eAniKind = ( ( const SdrTextAniKindItem* )pItem )->GetValue();
+ eAniKind = static_cast<const SdrTextAniKindItem*>(pItem)->GetValue();
m_pLbEffect->SelectEntryPos( sal::static_int_cast< sal_Int32 >(eAniKind) );
}
else
@@ -162,7 +162,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDIRECTION );
if( pItem )
{
- SdrTextAniDirection eValue = ( ( const SdrTextAniDirectionItem* )pItem )->GetValue();
+ SdrTextAniDirection eValue = static_cast<const SdrTextAniDirectionItem*>(pItem)->GetValue();
SelectDirection( eValue );
}
else
@@ -184,7 +184,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
if( pItem )
{
m_pTsbStartInside->EnableTriState( false );
- bool bValue = ( ( const SdrTextAniStartInsideItem* )pItem )->GetValue();
+ bool bValue = static_cast<const SdrTextAniStartInsideItem*>(pItem)->GetValue();
if( bValue )
m_pTsbStartInside->SetState( TRISTATE_TRUE );
else
@@ -201,7 +201,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
if( pItem )
{
m_pTsbStopInside->EnableTriState( false );
- bool bValue = ( ( const SdrTextAniStopInsideItem* )pItem )->GetValue();
+ bool bValue = static_cast<const SdrTextAniStopInsideItem*>(pItem)->GetValue();
if( bValue )
m_pTsbStopInside->SetState( TRISTATE_TRUE );
else
@@ -218,7 +218,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
if( pItem )
{
m_pTsbEndless->EnableTriState( false );
- long nValue = (long) ( ( const SdrTextAniCountItem* )pItem )->GetValue();
+ long nValue = (long) static_cast<const SdrTextAniCountItem*>(pItem)->GetValue();
m_pNumFldCount->SetValue( nValue );
if( nValue == 0 )
{
@@ -251,7 +251,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
if( pItem )
{
m_pTsbAuto->EnableTriState( false );
- long nValue = (long) ( ( const SdrTextAniDelayItem* )pItem )->GetValue();
+ long nValue = (long) static_cast<const SdrTextAniDelayItem*>(pItem)->GetValue();
m_pMtrFldDelay->SetValue( nValue );
if( nValue == 0 )
{
@@ -276,7 +276,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
if( pItem )
{
m_pTsbPixel->EnableTriState( false );
- long nValue = (long) ( ( const SdrTextAniAmountItem* )pItem )->GetValue();
+ long nValue = (long) static_cast<const SdrTextAniAmountItem*>(pItem)->GetValue();
if( nValue <= 0 )
{
m_pTsbPixel->SetState( TRISTATE_TRUE );
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index 3f74020f47c6..6dfe0033e27c 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -123,7 +123,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_LEFTDIST );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldLeft, nValue, eUnit );
}
else
@@ -135,7 +135,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_RIGHTDIST );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldRight, nValue, eUnit );
}
else
@@ -147,7 +147,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_UPPERDIST );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>( pItem )->GetValue();
SetMetricValue( *m_pMtrFldTop, nValue, eUnit );
}
else
@@ -159,7 +159,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_LOWERDIST );
if( pItem )
{
- long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
+ long nValue = static_cast<const SdrMetricItem*>(pItem)->GetValue();
SetMetricValue( *m_pMtrFldBottom, nValue, eUnit );
}
else
@@ -169,7 +169,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
// adjust to height
if ( rAttrs->GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) != SfxItemState::DONTCARE )
{
- m_pTsbAutoGrowHeight->SetState( ( ( const SdrOnOffItem& )rAttrs->Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ).
+ m_pTsbAutoGrowHeight->SetState( static_cast<const SdrOnOffItem&>( rAttrs->Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ).
GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
m_pTsbAutoGrowHeight->EnableTriState( false );
}
@@ -180,7 +180,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
// adjust to width
if ( rAttrs->GetItemState( SDRATTR_TEXT_AUTOGROWWIDTH ) != SfxItemState::DONTCARE )
{
- m_pTsbAutoGrowWidth->SetState( ( ( const SdrOnOffItem& )rAttrs->Get( SDRATTR_TEXT_AUTOGROWWIDTH ) ).
+ m_pTsbAutoGrowWidth->SetState( static_cast<const SdrOnOffItem&>( rAttrs->Get( SDRATTR_TEXT_AUTOGROWWIDTH ) ).
GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
m_pTsbAutoGrowWidth->EnableTriState( false );
}
@@ -191,7 +191,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
// autogrowsize
if ( rAttrs->GetItemState( SDRATTR_TEXT_AUTOGROWSIZE ) != SfxItemState::DONTCARE )
{
- m_pTsbAutoGrowSize->SetState( ( ( const SdrOnOffItem& )rAttrs->Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ).
+ m_pTsbAutoGrowSize->SetState( static_cast<const SdrOnOffItem&>( rAttrs->Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ).
GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
m_pTsbAutoGrowSize->EnableTriState( false );
}
@@ -202,7 +202,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
// wordwrap text
if ( rAttrs->GetItemState( SDRATTR_TEXT_WORDWRAP ) != SfxItemState::DONTCARE )
{
- m_pTsbWordWrapText->SetState( ( ( const SdrOnOffItem& )rAttrs->Get( SDRATTR_TEXT_WORDWRAP ) ).
+ m_pTsbWordWrapText->SetState( static_cast<const SdrOnOffItem&>( rAttrs->Get( SDRATTR_TEXT_WORDWRAP ) ).
GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
m_pTsbWordWrapText->EnableTriState( false );
}
@@ -219,8 +219,8 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState)
{
// VertAdjust and HorAdjust are unequivocal, thus
- SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)rAttrs->Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
- SdrTextHorzAdjust eTHA = (SdrTextHorzAdjust)((const SdrTextHorzAdjustItem&)rAttrs->Get(SDRATTR_TEXT_HORZADJUST)).GetValue();
+ SdrTextVertAdjust eTVA = (SdrTextVertAdjust)static_cast<const SdrTextVertAdjustItem&>(rAttrs->Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
+ SdrTextHorzAdjust eTHA = (SdrTextHorzAdjust)static_cast<const SdrTextHorzAdjustItem&>(rAttrs->Get(SDRATTR_TEXT_HORZADJUST)).GetValue();
RECT_POINT eRP = RP_LB;
m_pTsbFullWidth->EnableTriState( false );
@@ -294,7 +294,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
if ( rAttrs->GetItemState( SDRATTR_TEXT_FITTOSIZE ) != SfxItemState::DONTCARE )
{
SdrFitToSizeType eFTS = (SdrFitToSizeType)
- ( ( const SdrTextFitToSizeTypeItem& )rAttrs->Get( SDRATTR_TEXT_FITTOSIZE ) ).GetValue();
+ static_cast<const SdrTextFitToSizeTypeItem&>( rAttrs->Get( SDRATTR_TEXT_FITTOSIZE ) ).GetValue();
m_pTsbFitToSize->SetState( eFTS == SDRTEXTFIT_NONE ? TRISTATE_FALSE : TRISTATE_TRUE );
m_pTsbFitToSize->EnableTriState( false );
}
@@ -304,7 +304,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
if( rAttrs->GetItemState( SDRATTR_TEXT_CONTOURFRAME ) != SfxItemState::DONTCARE )
{
- bool bContour = ( ( const SdrOnOffItem& )rAttrs->Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
+ bool bContour = static_cast<const SdrOnOffItem&>( rAttrs->Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
m_pTsbContour->SetState( bContour ? TRISTATE_TRUE : TRISTATE_FALSE );
m_pTsbContour->EnableTriState( false );
}
@@ -443,7 +443,7 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
if ( rOutAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST ) != SfxItemState::DONTCARE )
{
eOldTVA = (SdrTextVertAdjust)
- ( ( const SdrTextVertAdjustItem& )rOutAttrs.Get( SDRATTR_TEXT_VERTADJUST ) ).GetValue();
+ static_cast<const SdrTextVertAdjustItem&>( rOutAttrs.Get( SDRATTR_TEXT_VERTADJUST ) ).GetValue();
if( eOldTVA != eTVA )
rAttrs->Put( SdrTextVertAdjustItem( eTVA ) );
}
@@ -453,7 +453,7 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
if ( rOutAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST ) != SfxItemState::DONTCARE )
{
eOldTHA = (SdrTextHorzAdjust)
- ( ( const SdrTextHorzAdjustItem& )rOutAttrs.Get( SDRATTR_TEXT_HORZADJUST ) ).GetValue();
+ static_cast<const SdrTextHorzAdjustItem&>( rOutAttrs.Get( SDRATTR_TEXT_HORZADJUST ) ).GetValue();
if( eOldTHA != eTHA )
rAttrs->Put( SdrTextHorzAdjustItem( eTHA ) );
}
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 0dfd93040826..020c0b194821 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -234,7 +234,7 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(vcl::Window* pParent, const SfxIt
nPageType (0),
nDlgType (0),
bBitmap ( false ),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
+ pXPool ( static_cast<XOutdevItemPool*>(rInAttrs.GetPool()) ),
aXFillAttr ( pXPool ),
rXFSet ( aXFillAttr.GetItemSet() )
{
@@ -305,8 +305,8 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
const SfxPoolItem* pLinearItem = NULL;
SfxItemState eStateGradient(rOutAttrs.GetItemState(XATTR_FILLFLOATTRANSPARENCE, true, &pGradientItem));
SfxItemState eStateLinear(rOutAttrs.GetItemState(XATTR_FILLTRANSPARENCE, true, &pLinearItem));
- bool bGradActive = (eStateGradient == SfxItemState::SET && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled());
- bool bLinearActive = (eStateLinear == SfxItemState::SET && ((XFillTransparenceItem*)pLinearItem)->GetValue() != 0);
+ bool bGradActive = (eStateGradient == SfxItemState::SET && static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->IsEnabled());
+ bool bLinearActive = (eStateLinear == SfxItemState::SET && static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue() != 0);
// #103765#
bool bGradUsed = (eStateGradient == SfxItemState::DONTCARE);
@@ -325,7 +325,7 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
XFillTransparenceItem aItem(nPos);
SdrPercentItem aShadowItem(makeSdrShadowTransparenceItem(nPos));
const SfxPoolItem* pOld = GetOldItem(*rAttrs, XATTR_FILLTRANSPARENCE);
- if(!pOld || !(*(const XFillTransparenceItem*)pOld == aItem) || !bLinearActive)
+ if(!pOld || !(*static_cast<const XFillTransparenceItem*>(pOld) == aItem) || !bLinearActive)
{
rAttrs->Put(aItem);
rAttrs->Put(aShadowItem);
@@ -361,7 +361,7 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
XFillFloatTransparenceItem aItem( rXFSet.GetPool()/*aString*/, aTmpGradient);
const SfxPoolItem* pOld = GetOldItem(*rAttrs, XATTR_FILLFLOATTRANSPARENCE);
- if(!pOld || !(*(const XFillFloatTransparenceItem*)pOld == aItem) || !bGradActive)
+ if(!pOld || !(*static_cast<const XFillFloatTransparenceItem*>(pOld) == aItem) || !bGradActive)
{
rAttrs->Put(aItem);
bModified = true;
@@ -408,16 +408,16 @@ void SvxTransparenceTabPage::Reset(const SfxItemSet* rAttrs)
SfxItemState eStateGradient(rAttrs->GetItemState(XATTR_FILLFLOATTRANSPARENCE, true, &pGradientItem));
if(!pGradientItem)
pGradientItem = &rAttrs->Get(XATTR_FILLFLOATTRANSPARENCE);
- bool bGradActive = (eStateGradient == SfxItemState::SET && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled());
+ bool bGradActive = (eStateGradient == SfxItemState::SET && static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->IsEnabled());
const SfxPoolItem* pLinearItem = NULL;
SfxItemState eStateLinear(rAttrs->GetItemState(XATTR_FILLTRANSPARENCE, true, &pLinearItem));
if(!pLinearItem)
pLinearItem = &rAttrs->Get(XATTR_FILLTRANSPARENCE);
- bool bLinearActive = (eStateLinear == SfxItemState::SET && ((XFillTransparenceItem*)pLinearItem)->GetValue() != 0);
+ bool bLinearActive = (eStateLinear == SfxItemState::SET && static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue() != 0);
// transparence gradient
- const XGradient& rGradient = ((XFillFloatTransparenceItem*)pGradientItem)->GetGradientValue();
+ const XGradient& rGradient = static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->GetGradientValue();
XGradientStyle eXGS(rGradient.GetGradientStyle());
m_pLbTrgrGradientType->SelectEntryPos(sal::static_int_cast< sal_Int32 >(eXGS));
m_pMtrTrgrAngle->SetValue(rGradient.GetAngle() / 10);
@@ -428,7 +428,7 @@ void SvxTransparenceTabPage::Reset(const SfxItemSet* rAttrs)
m_pMtrTrgrEndValue->SetValue((sal_uInt16)((((sal_uInt16)rGradient.GetEndColor().GetRed() + 1) * 100) / 255));
// linear transparence
- sal_uInt16 nTransp = ((XFillTransparenceItem*)pLinearItem)->GetValue();
+ sal_uInt16 nTransp = static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue();
m_pMtrTransparent->SetValue(bLinearActive ? nTransp : 50);
ModifyTransparentHdl_Impl(NULL);
@@ -509,17 +509,17 @@ bool SvxTransparenceTabPage::InitPreview ( const SfxItemSet& rSet )
}
// Get fillstyle for preview
- rXFSet.Put ( ( XFillStyleItem& ) rSet.Get(XATTR_FILLSTYLE) );
- rXFSet.Put ( ( XFillColorItem& ) rSet.Get(XATTR_FILLCOLOR) );
- rXFSet.Put ( ( XFillGradientItem& ) rSet.Get(XATTR_FILLGRADIENT) );
- rXFSet.Put ( ( XFillHatchItem& ) rSet.Get(XATTR_FILLHATCH) );
- rXFSet.Put ( ( XFillBackgroundItem&)rSet.Get(XATTR_FILLBACKGROUND) );
- rXFSet.Put ( ( XFillBitmapItem& ) rSet.Get(XATTR_FILLBITMAP) );
+ rXFSet.Put ( static_cast<const XFillStyleItem&>( rSet.Get(XATTR_FILLSTYLE)) );
+ rXFSet.Put ( static_cast<const XFillColorItem&>( rSet.Get(XATTR_FILLCOLOR)) );
+ rXFSet.Put ( static_cast<const XFillGradientItem&>( rSet.Get(XATTR_FILLGRADIENT)) );
+ rXFSet.Put ( static_cast<const XFillHatchItem&>( rSet.Get(XATTR_FILLHATCH)) );
+ rXFSet.Put ( static_cast<const XFillBackgroundItem&>(rSet.Get(XATTR_FILLBACKGROUND)) );
+ rXFSet.Put ( static_cast<const XFillBitmapItem&>( rSet.Get(XATTR_FILLBITMAP)) );
m_pCtlXRectPreview->SetAttributes( aXFillAttr.GetItemSet() );
m_pCtlBitmapPreview->SetAttributes( aXFillAttr.GetItemSet() );
- bBitmap = ( ( ( XFillStyleItem& )rSet.Get(XATTR_FILLSTYLE) ).GetValue() == drawing::FillStyle_BITMAP );
+ bBitmap = static_cast<const XFillStyleItem&>( rSet.Get(XATTR_FILLSTYLE) ).GetValue() == drawing::FillStyle_BITMAP;
// show the right preview window
if ( bBitmap )
@@ -610,7 +610,7 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
// init with pointer to fixed bool
pbAreaTP(&maFixed_sal_Bool),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
+ pXPool ( static_cast<XOutdevItemPool*>( rInAttrs.GetPool() ) ),
aXFillAttr ( pXPool ),
rXFSet ( aXFillAttr.GetItemSet() ),
@@ -812,7 +812,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
if( *pnBitmapListState )
{
if( *pnBitmapListState & CT_CHANGED )
- pBitmapList = ( (SvxAreaTabDialog*) GetParentDialog() )->GetNewBitmapList();
+ pBitmapList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewBitmapList();
_nPos = m_pLbBitmap->GetSelectEntryPos();
@@ -831,7 +831,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
if( *pnHatchingListState )
{
if( *pnHatchingListState & CT_CHANGED )
- pHatchingList = ( (SvxAreaTabDialog*) GetParentDialog() )->GetNewHatchingList();
+ pHatchingList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewHatchingList();
_nPos = m_pLbHatching->GetSelectEntryPos();
@@ -852,7 +852,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
if( *pnGradientListState )
{
if( *pnGradientListState & CT_CHANGED )
- pGradientList = ( (SvxAreaTabDialog*) GetParentDialog() )->GetNewGradientList();
+ pGradientList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewGradientList();
_nPos = m_pLbGradient->GetSelectEntryPos();
@@ -871,7 +871,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
if( *pnColorListState )
{
if( *pnColorListState & CT_CHANGED )
- pColorList = ( (SvxAreaTabDialog*) GetParentDialog() )->GetNewColorList();
+ pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
// aLbColor
_nPos = m_pLbColor->GetSelectEntryPos();
m_pLbColor->Clear();
@@ -1010,7 +1010,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XFillStyleItem aStyleItem( drawing::FillStyle_NONE );
pOld = GetOldItem( *rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
+ if ( !pOld || !( *static_cast<const XFillStyleItem*>(pOld) == aStyleItem ) )
{
rAttrs->Put( aStyleItem );
bModified = true;
@@ -1027,7 +1027,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
XFillColorItem aItem( m_pLbColor->GetSelectEntry(),
m_pLbColor->GetSelectEntryColor() );
pOld = GetOldItem( *rAttrs, XATTR_FILLCOLOR );
- if ( !pOld || !( *(const XFillColorItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XFillColorItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -1040,7 +1040,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XFillStyleItem aStyleItem( drawing::FillStyle_SOLID );
pOld = GetOldItem( *rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
+ if ( !pOld || !( *static_cast<const XFillStyleItem*>(pOld) == aStyleItem ) )
{
rAttrs->Put( aStyleItem );
bModified = true;
@@ -1058,7 +1058,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
OUString aString = m_pLbGradient->GetSelectEntry();
XFillGradientItem aItem( aString, aGradient );
pOld = GetOldItem( *rAttrs, XATTR_FILLGRADIENT );
- if ( !pOld || !( *(const XFillGradientItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XFillGradientItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -1071,7 +1071,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XFillStyleItem aStyleItem( drawing::FillStyle_GRADIENT );
pOld = GetOldItem( *rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
+ if ( !pOld || !( *static_cast<const XFillStyleItem*>(pOld) == aStyleItem ) )
{
rAttrs->Put( aStyleItem );
bModified = true;
@@ -1089,7 +1089,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
OUString aString = m_pLbHatching->GetSelectEntry();
XFillHatchItem aItem( aString, aHatching );
pOld = GetOldItem( *rAttrs, XATTR_FILLHATCH );
- if ( !pOld || !( *(const XFillHatchItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XFillHatchItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -1104,7 +1104,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
XFillColorItem aFillColorItem( m_pLbHatchBckgrdColor->GetSelectEntry(),
m_pLbHatchBckgrdColor->GetSelectEntryColor() );
pOld = GetOldItem( *rAttrs, XATTR_FILLCOLOR );
- if ( !pOld || !( *(const XFillColorItem*)pOld == aFillColorItem ) )
+ if ( !pOld || !( *static_cast<const XFillColorItem*>(pOld) == aFillColorItem ) )
{
rAttrs->Put( aFillColorItem );
bModified = true;
@@ -1117,7 +1117,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XFillStyleItem aStyleItem( drawing::FillStyle_HATCH );
pOld = GetOldItem( *rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
+ if ( !pOld || !( *static_cast<const XFillStyleItem*>(pOld) == aStyleItem ) )
{
rAttrs->Put( aStyleItem );
bModified = true;
@@ -1145,7 +1145,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
const OUString aString(m_pLbBitmap->GetSelectEntry());
const XFillBitmapItem aFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject());
pOld = GetOldItem( *rAttrs, XATTR_FILLBITMAP );
- if ( !pOld || !( *(const XFillBitmapItem*)pOld == aFillBitmapItem ) )
+ if ( !pOld || !( *static_cast<const XFillBitmapItem*>(pOld) == aFillBitmapItem ) )
{
rAttrs->Put( aFillBitmapItem );
bModified = true;
@@ -1158,7 +1158,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XFillStyleItem aStyleItem( drawing::FillStyle_BITMAP );
pOld = GetOldItem( *rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
+ if ( !pOld || !( *static_cast<const XFillStyleItem*>(pOld) == aStyleItem ) )
{
rAttrs->Put( aStyleItem );
bModified = true;
@@ -1194,7 +1194,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XGradientStepCountItem aFillBitmapItem( nValue );
pOld = GetOldItem( *rAttrs, XATTR_GRADIENTSTEPCOUNT );
- if ( !pOld || !( *(const XGradientStepCountItem*)pOld == aFillBitmapItem ) )
+ if ( !pOld || !( *static_cast<const XGradientStepCountItem*>(pOld) == aFillBitmapItem ) )
{
rAttrs->Put( aFillBitmapItem );
bModified = true;
@@ -1210,7 +1210,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
XFillBmpTileItem aFillBmpTileItem(
sal::static_int_cast< sal_Bool >( eState ) );
pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_TILE );
- if ( !pOld || !( *(const XFillBmpTileItem*)pOld == aFillBmpTileItem ) )
+ if ( !pOld || !( *static_cast<const XFillBmpTileItem*>(pOld) == aFillBmpTileItem ) )
{
rAttrs->Put( aFillBmpTileItem );
bModified = true;
@@ -1226,7 +1226,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
XFillBmpStretchItem aFillBmpStretchItem(
sal::static_int_cast< sal_Bool >( eState ) );
pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_STRETCH );
- if ( !pOld || !( *(const XFillBmpStretchItem*)pOld == aFillBmpStretchItem ) )
+ if ( !pOld || !( *static_cast<const XFillBmpStretchItem*>(pOld) == aFillBmpStretchItem ) )
{
rAttrs->Put( aFillBmpStretchItem );
bModified = true;
@@ -1254,7 +1254,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
if( pItem )
{
pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_SIZELOG );
- if ( !pOld || !( *(const XFillBmpSizeLogItem*)pOld == *pItem ) )
+ if ( !pOld || !( *static_cast<const XFillBmpSizeLogItem*>(pOld) == *pItem ) )
{
rAttrs->Put( *pItem );
bModified = true;
@@ -1289,7 +1289,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
if( pItem )
{
pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_SIZEX );
- if ( !pOld || !( *(const XFillBmpSizeXItem*)pOld == *pItem ) )
+ if ( !pOld || !( *static_cast<const XFillBmpSizeXItem*>(pOld) == *pItem ) )
{
rAttrs->Put( *pItem );
bModified = true;
@@ -1325,7 +1325,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
if( pItem )
{
pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_SIZEY );
- if ( !pOld || !( *(const XFillBmpSizeYItem*)pOld == *pItem ) )
+ if ( !pOld || !( *static_cast<const XFillBmpSizeYItem*>(pOld) == *pItem ) )
{
rAttrs->Put( *pItem );
bModified = true;
@@ -1348,7 +1348,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XFillBmpTileOffsetXItem aFillBmpTileOffsetXItem( (sal_uInt16) m_pMtrFldOffset->GetValue() );
pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_TILEOFFSETX );
- if ( !pOld || !( *(const XFillBmpTileOffsetXItem*)pOld == aFillBmpTileOffsetXItem ) )
+ if ( !pOld || !( *static_cast<const XFillBmpTileOffsetXItem*>(pOld) == aFillBmpTileOffsetXItem ) )
{
rAttrs->Put( aFillBmpTileOffsetXItem );
rAttrs->Put( XFillBmpTileOffsetYItem( 0 ) );
@@ -1359,7 +1359,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XFillBmpTileOffsetYItem aFillBmpTileOffsetYItem( (sal_uInt16) m_pMtrFldOffset->GetValue() );
pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_TILEOFFSETY );
- if ( !pOld || !( *(const XFillBmpTileOffsetYItem*)pOld == aFillBmpTileOffsetYItem ) )
+ if ( !pOld || !( *static_cast<const XFillBmpTileOffsetYItem*>(pOld) == aFillBmpTileOffsetYItem ) )
{
rAttrs->Put( aFillBmpTileOffsetYItem );
rAttrs->Put( XFillBmpTileOffsetXItem( 0 ) );
@@ -1379,7 +1379,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
bPut = true;
else
{
- RECT_POINT eValue = ( ( const XFillBmpPosItem& ) rOutAttrs.Get( XATTR_FILLBMP_POS ) ).GetValue();
+ RECT_POINT eValue = static_cast<const XFillBmpPosItem&>( rOutAttrs.Get( XATTR_FILLBMP_POS ) ).GetValue();
if( eValue != _eRP )
bPut = true;
}
@@ -1387,7 +1387,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XFillBmpPosItem aFillBmpPosItem( _eRP );
pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_POS );
- if ( !pOld || !( *(const XFillBmpPosItem*)pOld == aFillBmpPosItem ) )
+ if ( !pOld || !( *static_cast<const XFillBmpPosItem*>(pOld) == aFillBmpPosItem ) )
{
rAttrs->Put( aFillBmpPosItem );
bModified = true;
@@ -1404,7 +1404,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XFillBmpPosOffsetXItem aFillBmpPosOffsetXItem( (sal_uInt16) m_pMtrFldXOffset->GetValue() );
pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_POSOFFSETX );
- if ( !pOld || !( *(const XFillBmpPosOffsetXItem*)pOld == aFillBmpPosOffsetXItem ) )
+ if ( !pOld || !( *static_cast<const XFillBmpPosOffsetXItem*>(pOld) == aFillBmpPosOffsetXItem ) )
{
rAttrs->Put( aFillBmpPosOffsetXItem );
bModified = true;
@@ -1421,7 +1421,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XFillBmpPosOffsetYItem aFillBmpPosOffsetYItem( (sal_uInt16) m_pMtrFldYOffset->GetValue() );
pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_POSOFFSETY );
- if ( !pOld || !( *(const XFillBmpPosOffsetYItem*)pOld == aFillBmpPosOffsetYItem ) )
+ if ( !pOld || !( *static_cast<const XFillBmpPosOffsetYItem*>(pOld) == aFillBmpPosOffsetYItem ) )
{
rAttrs->Put( aFillBmpPosOffsetYItem );
bModified = true;
@@ -1445,7 +1445,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
drawing::FillStyle eXFS;
if( rAttrs->GetItemState( XATTR_FILLSTYLE ) != SfxItemState::DONTCARE )
{
- eXFS = (drawing::FillStyle) ( ( ( const XFillStyleItem& ) rAttrs->
+ eXFS = (drawing::FillStyle) ( static_cast<const XFillStyleItem&>( rAttrs->
Get( GetWhich( XATTR_FILLSTYLE ) ) ).GetValue() );
m_pTypeLB->SelectEntryPos( sal::static_int_cast< sal_Int32 >( eXFS ) );
@@ -1550,7 +1550,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
( rAttrs->GetItemState( XATTR_FILLSTYLE ) != SfxItemState::DONTCARE ) )
{
m_pTsbStepCount->EnableTriState( false );
- sal_uInt16 nValue = ( ( const XGradientStepCountItem& ) rAttrs->Get( XATTR_GRADIENTSTEPCOUNT ) ).GetValue();
+ sal_uInt16 nValue = static_cast<const XGradientStepCountItem&>( rAttrs->Get( XATTR_GRADIENTSTEPCOUNT ) ).GetValue();
if( nValue == 0 )
{
m_pTsbStepCount->SetState( TRISTATE_TRUE );
@@ -1575,7 +1575,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
{
m_pTsbTile->EnableTriState( false );
- if( ( ( const XFillBmpTileItem& ) rAttrs->Get( XATTR_FILLBMP_TILE ) ).GetValue() )
+ if( static_cast<const XFillBmpTileItem&>( rAttrs->Get( XATTR_FILLBMP_TILE ) ).GetValue() )
m_pTsbTile->SetState( TRISTATE_TRUE );
else
m_pTsbTile->SetState( TRISTATE_FALSE );
@@ -1587,7 +1587,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
{
m_pTsbStretch->EnableTriState( false );
- if( ( ( const XFillBmpStretchItem& ) rAttrs->Get( XATTR_FILLBMP_STRETCH ) ).GetValue() )
+ if( static_cast<const XFillBmpStretchItem&>( rAttrs->Get( XATTR_FILLBMP_STRETCH ) ).GetValue() )
m_pTsbStretch->SetState( TRISTATE_TRUE );
else
m_pTsbStretch->SetState( TRISTATE_FALSE );
@@ -1601,7 +1601,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
{
m_pTsbScale->EnableTriState( false );
- if( ( ( const XFillBmpSizeLogItem& ) rAttrs->Get( XATTR_FILLBMP_SIZELOG ) ).GetValue() )
+ if( static_cast<const XFillBmpSizeLogItem&>( rAttrs->Get( XATTR_FILLBMP_SIZELOG ) ).GetValue() )
m_pTsbScale->SetState( TRISTATE_FALSE );
else
m_pTsbScale->SetState( TRISTATE_TRUE );
@@ -1618,7 +1618,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
//aMtrFldXSize
if( rAttrs->GetItemState( XATTR_FILLBMP_SIZEX ) != SfxItemState::DONTCARE )
{
- sal_Int32 nValue = ( ( const XFillBmpSizeXItem& ) rAttrs->Get( XATTR_FILLBMP_SIZEX ) ).GetValue();
+ sal_Int32 nValue = static_cast<const XFillBmpSizeXItem&>( rAttrs->Get( XATTR_FILLBMP_SIZEX ) ).GetValue();
if( m_pTsbScale->GetState() == TRISTATE_TRUE )
{
// If there's a percentage value in the item,
@@ -1646,7 +1646,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
//aMtrFldYSize
if( rAttrs->GetItemState( XATTR_FILLBMP_SIZEY ) != SfxItemState::DONTCARE )
{
- sal_Int32 nValue = ( ( const XFillBmpSizeYItem& ) rAttrs->Get( XATTR_FILLBMP_SIZEY ) ).GetValue();
+ sal_Int32 nValue = static_cast<const XFillBmpSizeYItem&>( rAttrs->Get( XATTR_FILLBMP_SIZEY ) ).GetValue();
if( m_pTsbScale->GetState() == TRISTATE_TRUE )
{
// If there's a percentage value in the item,
@@ -1680,7 +1680,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
//aMtrFldOffset
if( rAttrs->GetItemState( XATTR_FILLBMP_TILEOFFSETX ) != SfxItemState::DONTCARE )
{
- sal_uInt16 nValue = ( ( const XFillBmpTileOffsetXItem& ) rAttrs->Get( XATTR_FILLBMP_TILEOFFSETX ) ).GetValue();
+ sal_uInt16 nValue = static_cast<const XFillBmpTileOffsetXItem&>( rAttrs->Get( XATTR_FILLBMP_TILEOFFSETX ) ).GetValue();
if( nValue > 0 )
{
m_pMtrFldOffset->SetValue( nValue );
@@ -1688,7 +1688,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
}
else if( rAttrs->GetItemState( XATTR_FILLBMP_TILEOFFSETY ) != SfxItemState::DONTCARE )
{
- nValue = ( ( const XFillBmpTileOffsetYItem& ) rAttrs->Get( XATTR_FILLBMP_TILEOFFSETY ) ).GetValue();
+ nValue = static_cast<const XFillBmpTileOffsetYItem&>( rAttrs->Get( XATTR_FILLBMP_TILEOFFSETY ) ).GetValue();
if( nValue > 0 )
{
m_pMtrFldOffset->SetValue( nValue );
@@ -1705,7 +1705,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
//aCtlPosition
if( rAttrs->GetItemState( XATTR_FILLBMP_POS ) != SfxItemState::DONTCARE )
{
- RECT_POINT eValue = ( ( const XFillBmpPosItem& ) rAttrs->Get( XATTR_FILLBMP_POS ) ).GetValue();
+ RECT_POINT eValue = static_cast<const XFillBmpPosItem&>( rAttrs->Get( XATTR_FILLBMP_POS ) ).GetValue();
m_pCtlPosition->SetActualRP( eValue );
}
else
@@ -1714,7 +1714,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
//aMtrFldXOffset
if( rAttrs->GetItemState( XATTR_FILLBMP_POSOFFSETX ) != SfxItemState::DONTCARE )
{
- sal_Int32 nValue = ( ( const XFillBmpPosOffsetXItem& ) rAttrs->Get( XATTR_FILLBMP_POSOFFSETX ) ).GetValue();
+ sal_Int32 nValue = static_cast<const XFillBmpPosOffsetXItem&>( rAttrs->Get( XATTR_FILLBMP_POSOFFSETX ) ).GetValue();
m_pMtrFldXOffset->SetValue( nValue );
}
else
@@ -1723,7 +1723,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
//aMtrFldYOffset
if( rAttrs->GetItemState( XATTR_FILLBMP_POSOFFSETY ) != SfxItemState::DONTCARE )
{
- sal_Int32 nValue = ( ( const XFillBmpPosOffsetYItem& ) rAttrs->Get( XATTR_FILLBMP_POSOFFSETY ) ).GetValue();
+ sal_Int32 nValue = static_cast<const XFillBmpPosOffsetYItem&>( rAttrs->Get( XATTR_FILLBMP_POSOFFSETY ) ).GetValue();
m_pMtrFldYOffset->SetValue( nValue );
}
else
@@ -1847,7 +1847,7 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyColorHdl_Impl)
else if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), true, &pPoolItem ) )
{
rXFSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
- Color aColor( ( ( const XFillColorItem* ) pPoolItem )->GetColorValue() );
+ Color aColor( static_cast<const XFillColorItem*>( pPoolItem )->GetColorValue() );
rXFSet.Put( XFillColorItem( OUString(), aColor ) );
}
else
@@ -1904,7 +1904,7 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyGradientHdl_Impl)
else if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLGRADIENT ), true, &pPoolItem ) )
{
rXFSet.Put( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
- rXFSet.Put( XFillGradientItem( OUString(), ( ( const XFillGradientItem* ) pPoolItem )->GetGradientValue() ) );
+ rXFSet.Put( XFillGradientItem( OUString(), static_cast<const XFillGradientItem*>( pPoolItem )->GetGradientValue() ) );
}
else
rXFSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
@@ -1960,7 +1960,7 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyHatchingHdl_Impl)
else if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLHATCH ), true, &pPoolItem ) )
{
rXFSet.Put( XFillStyleItem( drawing::FillStyle_HATCH ) );
- rXFSet.Put( XFillHatchItem( OUString(), ( ( const XFillHatchItem* ) pPoolItem )->GetHatchValue() ) );
+ rXFSet.Put( XFillHatchItem( OUString(), static_cast<const XFillHatchItem*>( pPoolItem )->GetHatchValue() ) );
}
else
rXFSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
@@ -1984,7 +1984,7 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl)
}
else if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), true, &pPoolItem ) )
{
- Color aColor( ( ( const XFillColorItem* ) pPoolItem )->GetColorValue() );
+ Color aColor( static_cast<const XFillColorItem*>( pPoolItem )->GetColorValue() );
rXFSet.Put( XFillColorItem( OUString(), aColor ) );
}
else
@@ -2013,7 +2013,7 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ToggleHatchBckgrdColorHdl_Impl)
{
if ( SfxItemState::SET == rOutAttrs.GetItemState( XATTR_FILLCOLOR ) )//>= SfxItemState::DEFAULT )
{
- XFillColorItem aColorItem( (const XFillColorItem&)rOutAttrs.Get( XATTR_FILLCOLOR ) );
+ XFillColorItem aColorItem( static_cast<const XFillColorItem&>(rOutAttrs.Get( XATTR_FILLCOLOR )) );
m_pLbHatchBckgrdColor->SelectEntry( aColorItem.GetColorValue() );
}
}
@@ -2090,7 +2090,7 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyBitmapHdl_Impl)
else if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), true, &pPoolItem ) )
{
rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
- rXFSet.Put(XFillBitmapItem(OUString(), ((const XFillBitmapItem*)pPoolItem)->GetGraphicObject()));
+ rXFSet.Put(XFillBitmapItem(OUString(), static_cast<const XFillBitmapItem*>(pPoolItem)->GetGraphicObject()));
}
else
rXFSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 4d740319bbc8..dbef4d939c9c 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -67,7 +67,7 @@ SvxBitmapTabPage::SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rIn
bBmpChanged ( false ),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
+ pXPool ( static_cast<XOutdevItemPool*>( rInAttrs.GetPool() )),
aXFStyleItem ( drawing::FillStyle_BITMAP ),
aXBitmapItem ( OUString(), Graphic() ),
aXFillAttr ( pXPool ),
@@ -153,7 +153,7 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& )
*pnColorListState & CT_MODIFIED )
{
if( *pnColorListState & CT_CHANGED )
- pColorList = ( (SvxAreaTabDialog*) GetParentDialog() )->GetNewColorList();
+ pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
// LbColor
nPos = m_pLbColor->GetSelectEntryPos();
@@ -315,11 +315,11 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBitmapHdl_Impl)
if(SfxItemState::SET == rOutAttrs.GetItemState(GetWhich(XATTR_FILLSTYLE), true, &pPoolItem))
{
- const drawing::FillStyle eXFS((drawing::FillStyle)((const XFillStyleItem*)pPoolItem)->GetValue());
+ const drawing::FillStyle eXFS((drawing::FillStyle)static_cast<const XFillStyleItem*>(pPoolItem)->GetValue());
if((drawing::FillStyle_BITMAP == eXFS) && (SfxItemState::SET == rOutAttrs.GetItemState(GetWhich(XATTR_FILLBITMAP), true, &pPoolItem)))
{
- pGraphicObject.reset(new GraphicObject(((const XFillBitmapItem*)pPoolItem)->GetGraphicObject()));
+ pGraphicObject.reset(new GraphicObject(static_cast<const XFillBitmapItem*>(pPoolItem)->GetGraphicObject()));
}
}
@@ -798,7 +798,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickLoadHdl_Impl)
if( pBmpList->Load() )
{
pBitmapList = pBmpList;
- ( (SvxAreaTabDialog*) GetParentDialog() )->SetNewBitmapList( pBitmapList );
+ static_cast<SvxAreaTabDialog*>( GetParentDialog() )->SetNewBitmapList( pBitmapList );
m_pLbBitmaps->Clear();
m_pLbBitmaps->Fill( pBitmapList );
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 0040b684297b..7dbda37f4572 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -314,7 +314,7 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
, pbAreaTP( NULL )
, aXFStyleItem( drawing::FillStyle_SOLID )
, aXFillColorItem( OUString(), Color( COL_BLACK ) )
- , aXFillAttr( (XOutdevItemPool*) rInAttrs.GetPool() )
+ , aXFillAttr( static_cast<XOutdevItemPool*>( rInAttrs.GetPool() ))
, rXFSet( aXFillAttr.GetItemSet() )
, eCM( CM_RGB )
{
@@ -447,9 +447,9 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
{
m_pLbColorModel->SelectEntryPos( CM_RGB );
- ChangeColor(((const XFillColorItem*)pPoolItem)->GetColorValue());
+ ChangeColor(static_cast<const XFillColorItem*>(pPoolItem)->GetColorValue());
- m_pEdtName->SetText( ( ( const XFillColorItem* ) pPoolItem )->GetName() );
+ m_pEdtName->SetText( static_cast<const XFillColorItem*>( pPoolItem )->GetName() );
m_pR->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
m_pG->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
@@ -598,7 +598,7 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet )
if ( nState >= SfxItemState::DEFAULT )
{
- XFillColorItem aColorItem( (const XFillColorItem&)rSet->Get( XATTR_FILLCOLOR ) );
+ XFillColorItem aColorItem( static_cast<const XFillColorItem&>(rSet->Get( XATTR_FILLCOLOR )) );
aNewColor = aColorItem.GetColorValue();
m_pLbColor->SelectEntry(aNewColor);
m_pValSetColorList->SelectItem( m_pLbColor->GetSelectEntryPos() + 1 );
@@ -1123,9 +1123,9 @@ void SvxColorTabPage::SetupForViewFrame( SfxViewFrame *pViewFrame )
{
const OfaRefItem<XColorList> *pPtr = NULL;
if ( pViewFrame != NULL && pViewFrame->GetDispatcher() )
- pPtr = (const OfaRefItem<XColorList> *)pViewFrame->
+ pPtr = static_cast<const OfaRefItem<XColorList> *>(pViewFrame->
GetDispatcher()->Execute( SID_GET_COLORLIST,
- SfxCallMode::SYNCHRON );
+ SfxCallMode::SYNCHRON ));
pColorList = pPtr ? pPtr->GetValue() : XColorList::GetStdColorList();
SetPageType( &pShadow->nUnknownType );
@@ -1151,7 +1151,7 @@ void SvxColorTabPage::SaveToViewFrame( SfxViewFrame *pViewFrame )
return;
const OfaRefItem<XColorList> * pPtr;
- pPtr = (const OfaRefItem<XColorList>*)pViewFrame->GetDispatcher()->Execute( SID_GET_COLORLIST, SfxCallMode::SYNCHRON );
+ pPtr = static_cast<const OfaRefItem<XColorList>*>(pViewFrame->GetDispatcher()->Execute( SID_GET_COLORLIST, SfxCallMode::SYNCHRON ));
if( pPtr )
{
XColorListRef pReference = pPtr->GetValue();
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 085ba9ce144f..a96b2183bd92 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -60,7 +60,7 @@ SvxGradientTabPage::SvxGradientTabPage
pPos ( 0 ),
pbAreaTP ( 0 ),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
+ pXPool ( static_cast<XOutdevItemPool*>( rInAttrs.GetPool() )),
aXFStyleItem ( drawing::FillStyle_GRADIENT ),
aXGradientItem ( OUString(), XGradient( COL_BLACK, COL_WHITE ) ),
aXFillAttr ( pXPool ),
@@ -167,7 +167,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& )
*pnColorListState & CT_MODIFIED )
{
if( *pnColorListState & CT_CHANGED )
- pColorList = ( (SvxAreaTabDialog*) GetParentDialog() )->GetNewColorList();
+ pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
// LbColorFrom
nPos = m_pLbColorFrom->GetSelectEntryPos();
@@ -651,7 +651,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickLoadHdl_Impl)
if ( pGrdList->Load() )
{
pGradientList = pGrdList;
- ( (SvxAreaTabDialog*) GetParentDialog() )->
+ static_cast<SvxAreaTabDialog*>( GetParentDialog() )->
SetNewGradientList( pGradientList );
m_pLbGradients->Clear();
@@ -778,10 +778,10 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl)
const SfxPoolItem* pPoolItem = NULL;
if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLSTYLE ), true, &pPoolItem ) )
{
- if( ( drawing::FillStyle_GRADIENT == (drawing::FillStyle) ( ( const XFillStyleItem* ) pPoolItem )->GetValue() ) &&
+ if( ( drawing::FillStyle_GRADIENT == (drawing::FillStyle) static_cast<const XFillStyleItem*>( pPoolItem )->GetValue() ) &&
( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLGRADIENT ), true, &pPoolItem ) ) )
{
- pGradient.reset(new XGradient( ( ( const XFillGradientItem* ) pPoolItem )->GetGradientValue() ));
+ pGradient.reset(new XGradient( static_cast<const XFillGradientItem*>( pPoolItem )->GetGradientValue() ));
}
}
if( !pGradient )
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index ee0c8a2a666f..ba6633ed9b71 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -63,7 +63,7 @@ SvxHatchTabPage::SvxHatchTabPage
pPos ( 0 ),
pbAreaTP ( 0 ),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
+ pXPool ( static_cast<XOutdevItemPool*>(rInAttrs.GetPool()) ),
aXFStyleItem ( drawing::FillStyle_HATCH ),
aXHatchItem ( OUString(), XHatch() ),
aXFillAttr ( pXPool ),
@@ -163,7 +163,7 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
*pnColorListState & CT_MODIFIED )
{
if( *pnColorListState & CT_CHANGED )
- pColorList = ( (SvxAreaTabDialog*) GetParentDialog() )->GetNewColorList();
+ pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
// LbLineColor
nPos = m_pLbLineColor->GetSelectEntryPos();
@@ -209,8 +209,8 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
}
}
- rXFSet.Put ( ( XFillColorItem& ) rSet.Get(XATTR_FILLCOLOR) );
- rXFSet.Put ( ( XFillBackgroundItem&)rSet.Get(XATTR_FILLBACKGROUND) );
+ rXFSet.Put( static_cast<const XFillColorItem&>( rSet.Get(XATTR_FILLCOLOR)) );
+ rXFSet.Put( static_cast<const XFillBackgroundItem&>(rSet.Get(XATTR_FILLBACKGROUND)) );
m_pCtlPreview->SetAttributes( aXFillAttr.GetItemSet() );
m_pCtlPreview->Invalidate();
}
@@ -331,8 +331,8 @@ void SvxHatchTabPage::Reset( const SfxItemSet* rSet )
m_pBtnSave->Disable();
}
- rXFSet.Put ( ( XFillColorItem& ) rSet->Get(XATTR_FILLCOLOR) );
- rXFSet.Put ( ( XFillBackgroundItem&)rSet->Get(XATTR_FILLBACKGROUND) );
+ rXFSet.Put( static_cast<const XFillColorItem&>( rSet->Get(XATTR_FILLCOLOR)) );
+ rXFSet.Put( static_cast<const XFillBackgroundItem&>(rSet->Get(XATTR_FILLBACKGROUND)) );
m_pCtlPreview->SetAttributes( aXFillAttr.GetItemSet() );
m_pCtlPreview->Invalidate();
}
@@ -392,10 +392,10 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ChangeHatchHdl_Impl)
const SfxPoolItem* pPoolItem = NULL;
if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLSTYLE ), true, &pPoolItem ) )
{
- if( ( drawing::FillStyle_HATCH == (drawing::FillStyle) ( ( const XFillStyleItem* ) pPoolItem )->GetValue() ) &&
+ if( ( drawing::FillStyle_HATCH == (drawing::FillStyle) static_cast<const XFillStyleItem*>( pPoolItem )->GetValue() ) &&
( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLHATCH ), true, &pPoolItem ) ) )
{
- pHatch.reset(new XHatch( ( ( const XFillHatchItem* ) pPoolItem )->GetHatchValue() ));
+ pHatch.reset(new XHatch( static_cast<const XFillHatchItem*>( pPoolItem )->GetHatchValue() ));
}
}
if( !pHatch )
@@ -690,7 +690,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickLoadHdl_Impl)
if( pHatchList->Load() )
{
pHatchingList = pHatchList;
- ( (SvxAreaTabDialog*) GetParentDialog() )->SetNewHatchingList( pHatchingList );
+ static_cast<SvxAreaTabDialog*>( GetParentDialog() )->SetNewHatchingList( pHatchingList );
m_pLbHatchings->Clear();
m_pLbHatchings->Fill( pHatchingList );
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 311bb5dc2387..ae9395d33810 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -98,7 +98,7 @@ SvxLineTabPage::SvxLineTabPage
eRP( RP_LT ),
bObjSelected( false ),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
+ pXPool ( static_cast<XOutdevItemPool*>(rInAttrs.GetPool()) ),
aXLStyle ( XLINE_DASH ),
aXWidth ( 1 ),
aXDash ( OUString(), XDash( XDASH_RECT, 3, 7, 2, 40, 15 ) ),
@@ -537,7 +537,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
( *pnDashListState & CT_CHANGED ) )
{
if( *pnDashListState & CT_CHANGED )
- pDashList = ( (SvxLineTabDialog*) GetParentDialog() )->GetNewDashList();
+ pDashList = static_cast<SvxLineTabDialog*>( GetParentDialog() )->GetNewDashList();
*pnDashListState = CT_NONE;
@@ -567,7 +567,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
if( ( *pnLineEndListState & CT_MODIFIED ) || ( *pnLineEndListState & CT_CHANGED ) )
{
if( *pnLineEndListState & CT_CHANGED )
- pLineEndList = ( (SvxLineTabDialog*) GetParentDialog() )->GetNewLineEndList();
+ pLineEndList = static_cast<SvxLineTabDialog*>( GetParentDialog() )->GetNewLineEndList();
*pnLineEndListState = CT_NONE;
@@ -622,7 +622,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
if( *pnColorListState )
{
if( *pnColorListState & CT_CHANGED )
- pColorList = ( (SvxLineTabDialog*) GetParentDialog() )->GetNewColorList();
+ pColorList = static_cast<SvxLineTabDialog*>( GetParentDialog() )->GetNewColorList();
// aLbColor
sal_Int32 nColorPos = m_pLbColor->GetSelectEntryPos();
m_pLbColor->Clear();
@@ -702,7 +702,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
XLineDashItem aDashItem( m_pLbLineStyle->GetSelectEntry(),
pDashList->GetDash( nPos - 2 )->GetDash() );
pOld = GetOldItem( *rAttrs, XATTR_LINEDASH );
- if ( !pOld || !( *(const XLineDashItem*)pOld == aDashItem ) )
+ if ( !pOld || !( *static_cast<const XLineDashItem*>(pOld) == aDashItem ) )
{
rAttrs->Put( aDashItem );
bModified = true;
@@ -710,7 +710,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
}
}
pOld = GetOldItem( *rAttrs, XATTR_LINESTYLE );
- if ( !pOld || !( *(const XLineStyleItem*)pOld == *pStyleItem ) )
+ if ( !pOld || !( *static_cast<const XLineStyleItem*>(pOld) == *pStyleItem ) )
{
rAttrs->Put( *pStyleItem );
bModified = true;
@@ -723,7 +723,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XLineWidthItem aItem( GetCoreValue( *m_pMtrLineWidth, ePoolUnit ) );
pOld = GetOldItem( *rAttrs, XATTR_LINEWIDTH );
- if ( !pOld || !( *(const XLineWidthItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XLineWidthItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -734,7 +734,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XLineStartWidthItem aItem( GetCoreValue( *m_pMtrStartWidth, ePoolUnit ) );
pOld = GetOldItem( *rAttrs, XATTR_LINESTARTWIDTH );
- if ( !pOld || !( *(const XLineStartWidthItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XLineStartWidthItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -745,7 +745,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XLineEndWidthItem aItem( GetCoreValue( *m_pMtrEndWidth, ePoolUnit ) );
pOld = GetOldItem( *rAttrs, XATTR_LINEENDWIDTH );
- if ( !pOld || !( *(const XLineEndWidthItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XLineEndWidthItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -757,7 +757,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XLineColorItem aItem( m_pLbColor->GetSelectEntry(), m_pLbColor->GetSelectEntryColor() );
pOld = GetOldItem( *rAttrs, XATTR_LINECOLOR );
- if ( !pOld || !( *(const XLineColorItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XLineColorItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -776,7 +776,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
else if( pLineEndList->Count() > (long) ( nPos - 1 ) )
pItem.reset(new XLineStartItem( m_pLbStartStyle->GetSelectEntry(), pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
pOld = GetOldItem( *rAttrs, XATTR_LINESTART );
- if( pItem && ( !pOld || !( *(const XLineEndItem*)pOld == *pItem ) ) )
+ if( pItem && ( !pOld || !( *static_cast<const XLineEndItem*>(pOld) == *pItem ) ) )
{
rAttrs->Put( *pItem );
bModified = true;
@@ -793,7 +793,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
pItem.reset(new XLineEndItem( m_pLbEndStyle->GetSelectEntry(), pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
pOld = GetOldItem( *rAttrs, XATTR_LINEEND );
if( pItem &&
- ( !pOld || !( *(const XLineEndItem*)pOld == *pItem ) ) )
+ ( !pOld || !( *static_cast<const XLineEndItem*>(pOld) == *pItem ) ) )
{
rAttrs->Put( *pItem );
bModified = true;
@@ -807,7 +807,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XLineStartCenterItem aItem( sal::static_int_cast< sal_Bool >( eState ) );
pOld = GetOldItem( *rAttrs, XATTR_LINESTARTCENTER );
- if ( !pOld || !( *(const XLineStartCenterItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XLineStartCenterItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -818,7 +818,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XLineEndCenterItem aItem( sal::static_int_cast< sal_Bool >( eState ) );
pOld = GetOldItem( *rAttrs, XATTR_LINEENDCENTER );
- if ( !pOld || !( *(const XLineEndCenterItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XLineEndCenterItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -831,7 +831,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XLineTransparenceItem aItem( nVal );
pOld = GetOldItem( *rAttrs, XATTR_LINETRANSPARENCE );
- if ( !pOld || !( *(const XLineTransparenceItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XLineTransparenceItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -872,7 +872,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
{
pOld = GetOldItem( *rAttrs, XATTR_LINEJOINT );
- if(!pOld || !(*(const XLineJointItem*)pOld == *pNew))
+ if(!pOld || !(*static_cast<const XLineJointItem*>(pOld) == *pNew))
{
rAttrs->Put( *pNew );
bModified = true;
@@ -909,7 +909,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
{
pOld = GetOldItem( *rAttrs, XATTR_LINECAP );
- if(!pOld || !(*(const XLineCapItem*)pOld == *pNew))
+ if(!pOld || !(*static_cast<const XLineCapItem*>(pOld) == *pNew))
{
rAttrs->Put( *pNew );
bModified = true;
@@ -922,7 +922,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
// Was set by selection or the size is different
SvxSizeItem aSItem(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),aSymbolSize);
const SfxPoolItem* pSOld = GetOldItem( *rAttrs, rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE) );
- bNewSize = pSOld ? *(const SvxSizeItem *)pSOld != aSItem : bNewSize ;
+ bNewSize = pSOld ? *static_cast<const SvxSizeItem *>(pSOld) != aSItem : bNewSize ;
if(bNewSize)
{
rAttrs->Put(aSItem);
@@ -931,7 +931,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
SfxInt32Item aTItem(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),nSymbolType);
const SfxPoolItem* pTOld = GetOldItem( *rAttrs, rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE) );
- bool bNewType = pTOld == NULL || *(const SfxInt32Item*)pTOld != aTItem;
+ bool bNewType = pTOld == NULL || *static_cast<const SfxInt32Item*>(pTOld) != aTItem;
if(bNewType && nSymbolType==SVX_SYMBOLTYPE_UNKNOWN)
bNewType=false; // a small fix, type wasn't set -> don't create a type item after all!
if(bNewType)
@@ -945,7 +945,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
SvxBrushItem aBItem(aSymbolGraphic,GPOS_MM,rAttrs->GetPool()->GetWhich(SID_ATTR_BRUSH));
const SfxPoolItem* pBOld = GetOldItem( *rAttrs, rAttrs->GetPool()->GetWhich(SID_ATTR_BRUSH) );
bool bNewBrush =
- pBOld == NULL || *(const SvxBrushItem*)pBOld != aBItem;
+ pBOld == NULL || *static_cast<const SvxBrushItem*>(pBOld) != aBItem;
if(bNewBrush)
{
rAttrs->Put(aBItem);
@@ -1097,7 +1097,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
bool bIgnoreSize=false;
if(rAttrs->GetItemState(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),true,&pPoolItem) == SfxItemState::SET)
{
- nSymType=((const SfxInt32Item *)pPoolItem)->GetValue();
+ nSymType=static_cast<const SfxInt32Item *>(pPoolItem)->GetValue();
}
if(nSymType == SVX_SYMBOLTYPE_AUTO)
@@ -1179,7 +1179,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
}
if(rAttrs->GetItemState(rAttrs->GetPool()->GetWhich(SID_ATTR_BRUSH),true,&pPoolItem) == SfxItemState::SET)
{
- const Graphic* pGraphic = ((const SvxBrushItem *)pPoolItem)->GetGraphic();
+ const Graphic* pGraphic = static_cast<const SvxBrushItem *>(pPoolItem)->GetGraphic();
if( pGraphic )
{
if(!bIgnoreGraphic)
@@ -1198,7 +1198,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
if(rAttrs->GetItemState(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),true,&pPoolItem) == SfxItemState::SET)
{
- aSymbolSize = ((const SvxSizeItem *)pPoolItem)->GetSize();
+ aSymbolSize = static_cast<const SvxSizeItem *>(pPoolItem)->GetSize();
}
m_pGridIconSize->Enable(bEnable);
@@ -1213,7 +1213,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
if( rAttrs->GetItemState( XATTR_LINESTYLE ) != SfxItemState::DONTCARE )
{
- eXLS = (XLineStyle) ( ( const XLineStyleItem& ) rAttrs->Get( XATTR_LINESTYLE ) ).GetValue();
+ eXLS = (XLineStyle) static_cast<const XLineStyleItem&>( rAttrs->Get( XATTR_LINESTYLE ) ).GetValue();
switch( eXLS )
{
@@ -1226,7 +1226,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
case XLINE_DASH:
m_pLbLineStyle->SetNoSelection();
- m_pLbLineStyle->SelectEntry( ( ( const XLineDashItem& ) rAttrs->Get( XATTR_LINEDASH ) ).GetName() );
+ m_pLbLineStyle->SelectEntry( static_cast<const XLineDashItem&>( rAttrs->Get( XATTR_LINEDASH ) ).GetName() );
break;
default:
@@ -1241,7 +1241,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
// Line strength
if( rAttrs->GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
{
- SetMetricValue( *m_pMtrLineWidth, ( ( const XLineWidthItem& ) rAttrs->Get( XATTR_LINEWIDTH ) ).GetValue(), ePoolUnit );
+ SetMetricValue( *m_pMtrLineWidth, static_cast<const XLineWidthItem&>( rAttrs->Get( XATTR_LINEWIDTH ) ).GetValue(), ePoolUnit );
}
else
m_pMtrLineWidth->SetText( "" );
@@ -1251,7 +1251,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
if ( rAttrs->GetItemState( XATTR_LINECOLOR ) != SfxItemState::DONTCARE )
{
- Color aCol = ( ( const XLineColorItem& ) rAttrs->Get( XATTR_LINECOLOR ) ).GetColorValue();
+ Color aCol = static_cast<const XLineColorItem&>( rAttrs->Get( XATTR_LINECOLOR ) ).GetColorValue();
m_pLbColor->SelectEntry( aCol );
if( m_pLbColor->GetSelectEntryCount() == 0 )
{
@@ -1269,7 +1269,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
{
// #86265# select entry using list and polygon, not string
bool bSelected(false);
- const basegfx::B2DPolyPolygon& rItemPolygon = ((const XLineStartItem&)rAttrs->Get(XATTR_LINESTART)).GetLineStartValue();
+ const basegfx::B2DPolyPolygon& rItemPolygon = static_cast<const XLineStartItem&>(rAttrs->Get(XATTR_LINESTART)).GetLineStartValue();
for(sal_Int32 a(0);!bSelected && a < pLineEndList->Count(); a++)
{
@@ -1301,7 +1301,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
{
// #86265# select entry using list and polygon, not string
bool bSelected(false);
- const basegfx::B2DPolyPolygon& rItemPolygon = ((const XLineEndItem&)rAttrs->Get(XATTR_LINEEND)).GetLineEndValue();
+ const basegfx::B2DPolyPolygon& rItemPolygon = static_cast<const XLineEndItem&>(rAttrs->Get(XATTR_LINEEND)).GetLineEndValue();
for(sal_Int32 a(0);!bSelected && a < pLineEndList->Count(); a++)
{
@@ -1332,7 +1332,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
else if( rAttrs->GetItemState( XATTR_LINESTARTWIDTH ) != SfxItemState::DONTCARE )
{
SetMetricValue( *m_pMtrStartWidth,
- ( ( const XLineStartWidthItem& ) rAttrs->Get( XATTR_LINESTARTWIDTH ) ).GetValue(),
+ static_cast<const XLineStartWidthItem&>( rAttrs->Get( XATTR_LINESTARTWIDTH ) ).GetValue(),
ePoolUnit );
}
else
@@ -1346,7 +1346,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
else if( rAttrs->GetItemState( XATTR_LINEENDWIDTH ) != SfxItemState::DONTCARE )
{
SetMetricValue( *m_pMtrEndWidth,
- ( ( const XLineEndWidthItem& ) rAttrs->Get( XATTR_LINEENDWIDTH ) ).GetValue(),
+ static_cast<const XLineEndWidthItem&>( rAttrs->Get( XATTR_LINEENDWIDTH ) ).GetValue(),
ePoolUnit );
}
else
@@ -1361,7 +1361,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
{
m_pTsbCenterStart->EnableTriState( false );
- if( ( ( const XLineStartCenterItem& ) rAttrs->Get( XATTR_LINESTARTCENTER ) ).GetValue() )
+ if( static_cast<const XLineStartCenterItem&>( rAttrs->Get( XATTR_LINESTARTCENTER ) ).GetValue() )
m_pTsbCenterStart->SetState( TRISTATE_TRUE );
else
m_pTsbCenterStart->SetState( TRISTATE_FALSE );
@@ -1380,7 +1380,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
{
m_pTsbCenterEnd->EnableTriState( false );
- if( ( ( const XLineEndCenterItem& ) rAttrs->Get( XATTR_LINEENDCENTER ) ).GetValue() )
+ if( static_cast<const XLineEndCenterItem&>( rAttrs->Get( XATTR_LINEENDCENTER ) ).GetValue() )
m_pTsbCenterEnd->SetState( TRISTATE_TRUE );
else
m_pTsbCenterEnd->SetState( TRISTATE_FALSE );
@@ -1393,7 +1393,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
// Transparency
if( rAttrs->GetItemState( XATTR_LINETRANSPARENCE ) != SfxItemState::DONTCARE )
{
- sal_uInt16 nTransp = ( ( const XLineTransparenceItem& ) rAttrs->Get( XATTR_LINETRANSPARENCE ) ).GetValue();
+ sal_uInt16 nTransp = static_cast<const XLineTransparenceItem&>( rAttrs->Get( XATTR_LINETRANSPARENCE ) ).GetValue();
m_pMtrTransparent->SetValue( nTransp );
ChangeTransparentHdl_Impl( NULL );
}
@@ -1424,7 +1424,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
}
else if(SfxItemState::DONTCARE != rAttrs->GetItemState(XATTR_LINEJOINT))
{
- const com::sun::star::drawing::LineJoint eLineJoint = ((const XLineJointItem&)(rAttrs->Get(XATTR_LINEJOINT))).GetValue();
+ const com::sun::star::drawing::LineJoint eLineJoint = static_cast<const XLineJointItem&>(rAttrs->Get(XATTR_LINEJOINT)).GetValue();
switch(eLineJoint)
{
@@ -1449,7 +1449,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
}
else if(SfxItemState::DONTCARE != rAttrs->GetItemState(XATTR_LINECAP))
{
- const com::sun::star::drawing::LineCap eLineCap(((const XLineCapItem&)(rAttrs->Get(XATTR_LINECAP))).GetValue());
+ const com::sun::star::drawing::LineCap eLineCap(static_cast<const XLineCapItem&>(rAttrs->Get(XATTR_LINECAP)).GetValue());
switch(eLineCap)
{
@@ -1515,7 +1515,7 @@ IMPL_LINK( SvxLineTabPage, ChangePreviewHdl_Impl, void *, pCntrl )
const SfxPoolItem* pOld = GetOldItem( rXLSet, XATTR_LINEWIDTH );
sal_Int32 nStartLineWidth = 0;
if(pOld)
- nStartLineWidth = (( const XLineWidthItem *)pOld)->GetValue();
+ nStartLineWidth = static_cast<const XLineWidthItem *>(pOld)->GetValue();
nActLineWidth = nStartLineWidth;
}
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 931038b71acd..2c446c149cc0 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -59,7 +59,7 @@ SvxLineDefTabPage::SvxLineDefTabPage
rOutAttrs ( rInAttrs ),
bObjSelected ( false ),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
+ pXPool ( static_cast<XOutdevItemPool*>(rInAttrs.GetPool()) ),
aXLStyle ( XLINE_DASH ),
aXWidth ( XOUT_WIDTH ),
aXDash ( OUString(), XDash( XDASH_RECT, 3, 7, 2, 40, 15 ) ),
@@ -280,7 +280,7 @@ void SvxLineDefTabPage::Reset( const SfxItemSet* rAttrs )
{
if( rAttrs->GetItemState( GetWhich( XATTR_LINESTYLE ) ) != SfxItemState::DONTCARE )
{
- XLineStyle eXLS = (XLineStyle) ( ( const XLineStyleItem& ) rAttrs->Get( GetWhich( XATTR_LINESTYLE ) ) ).GetValue();
+ XLineStyle eXLS = (XLineStyle) static_cast<const XLineStyleItem&>( rAttrs->Get( GetWhich( XATTR_LINESTYLE ) ) ).GetValue();
switch( eXLS )
{
@@ -291,7 +291,7 @@ void SvxLineDefTabPage::Reset( const SfxItemSet* rAttrs )
case XLINE_DASH:
{
- const XLineDashItem& rDashItem = ( const XLineDashItem& ) rAttrs->Get( XATTR_LINEDASH );
+ const XLineDashItem& rDashItem = static_cast<const XLineDashItem&>( rAttrs->Get( XATTR_LINEDASH ) );
aDash = rDashItem.GetDashValue();
m_pLbLineStyles->SetNoSelection();
@@ -755,7 +755,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickLoadHdl_Impl)
if( pDshLst->Load() )
{
pDashList = pDshLst;
- ( (SvxLineTabDialog*) GetParentDialog() )->SetNewDashList( pDashList );
+ static_cast<SvxLineTabDialog*>( GetParentDialog() )->SetNewDashList( pDashList );
m_pLbLineStyles->Clear();
m_pLbLineStyles->Fill( pDashList );
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 5fed72ee7862..ddff8770d2a2 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -62,7 +62,7 @@ SvxLineEndDefTabPage::SvxLineEndDefTabPage
pPolyObj ( NULL ),
bObjSelected ( false ),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
+ pXPool ( static_cast<XOutdevItemPool*>(rInAttrs.GetPool()) ),
aXLStyle ( XLINE_SOLID ),
aXWidth ( XOUT_WIDTH ),
aXColor ( OUString(), COL_BLACK ),
@@ -419,7 +419,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl)
else return( 0L ); // cancel
}
- basegfx::B2DPolyPolygon aNewPolyPolygon(((SdrPathObj*)pNewObj)->GetPathPoly());
+ basegfx::B2DPolyPolygon aNewPolyPolygon(static_cast<const SdrPathObj*>(pNewObj)->GetPathPoly());
basegfx::B2DRange aNewRange(basegfx::tools::getRange(aNewPolyPolygon));
// normalize
@@ -581,7 +581,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl)
if( pLeList->Load() )
{
pLineEndList = pLeList;
- ( (SvxLineTabDialog*) GetParentDialog() )->SetNewLineEndList( pLineEndList );
+ static_cast<SvxLineTabDialog*>( GetParentDialog() )->SetNewLineEndList( pLineEndList );
m_pLbLineEnds->Clear();
m_pLbLineEnds->Fill( pLineEndList );
Reset( &rOutAttrs );
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index 9621c459677a..6aa0fe91962f 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -58,7 +58,7 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA
nDlgType ( 0 ),
pbAreaTP ( 0 ),
bDisable ( false ),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
+ pXPool ( static_cast<XOutdevItemPool*>(rInAttrs.GetPool()) ),
aXFillAttr ( pXPool ),
rXFSet ( aXFillAttr.GetItemSet() )
{
@@ -95,15 +95,15 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA
drawing::FillStyle eXFS = drawing::FillStyle_SOLID;
if( rOutAttrs.GetItemState( XATTR_FILLSTYLE ) != SfxItemState::DONTCARE )
{
- eXFS = (drawing::FillStyle) ( ( ( const XFillStyleItem& ) rOutAttrs.
+ eXFS = (drawing::FillStyle) ( static_cast<const XFillStyleItem&>( rOutAttrs.
Get( GetWhich( XATTR_FILLSTYLE ) ) ).GetValue() );
switch( eXFS )
{
case drawing::FillStyle_SOLID:
if( SfxItemState::DONTCARE != rOutAttrs.GetItemState( XATTR_FILLCOLOR ) )
{
- XFillColorItem aColorItem( ( const XFillColorItem& )
- rOutAttrs.Get( XATTR_FILLCOLOR ) );
+ XFillColorItem aColorItem( static_cast<const XFillColorItem&>(
+ rOutAttrs.Get( XATTR_FILLCOLOR ) ) );
rXFSet.Put( aColorItem );
}
break;
@@ -111,7 +111,7 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA
case drawing::FillStyle_GRADIENT:
if( SfxItemState::DONTCARE != rOutAttrs.GetItemState( XATTR_FILLGRADIENT ) )
{
- XFillGradientItem aGradientItem( ( ( const XFillGradientItem& )
+ XFillGradientItem aGradientItem( static_cast<const XFillGradientItem&>(
rOutAttrs.Get( XATTR_FILLGRADIENT ) ) );
rXFSet.Put( aGradientItem );
}
@@ -120,7 +120,7 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA
case drawing::FillStyle_HATCH:
if( SfxItemState::DONTCARE != rOutAttrs.GetItemState( XATTR_FILLHATCH ) )
{
- XFillHatchItem aHatchItem( ( ( const XFillHatchItem& )
+ XFillHatchItem aHatchItem( static_cast<const XFillHatchItem& >(
rOutAttrs.Get( XATTR_FILLHATCH ) ) );
rXFSet.Put( aHatchItem );
}
@@ -130,8 +130,8 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA
{
if( SfxItemState::DONTCARE != rOutAttrs.GetItemState( XATTR_FILLBITMAP ) )
{
- XFillBitmapItem aBitmapItem( ( const XFillBitmapItem& )
- rOutAttrs.Get( XATTR_FILLBITMAP ) );
+ XFillBitmapItem aBitmapItem( static_cast<const XFillBitmapItem& >(
+ rOutAttrs.Get( XATTR_FILLBITMAP ) ) );
rXFSet.Put( aBitmapItem );
}
}
@@ -254,7 +254,7 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs )
{
SdrOnOffItem aItem( makeSdrShadowItem(sal::static_int_cast< sal_Bool >( eState )) );
pOld = GetOldItem( *rAttrs, SDRATTR_SHADOW );
- if ( !pOld || !( *(const SdrOnOffItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const SdrOnOffItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -293,15 +293,15 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs )
if( rOutAttrs.GetItemState( SDRATTR_SHADOWXDIST ) != SfxItemState::DONTCARE &&
rOutAttrs.GetItemState( SDRATTR_SHADOWYDIST ) != SfxItemState::DONTCARE )
{
- nOldX = ( ( const SdrMetricItem& ) rOutAttrs.
+ nOldX = static_cast<const SdrMetricItem&>( rOutAttrs.
Get( SDRATTR_SHADOWXDIST ) ).GetValue();
- nOldY = ( ( const SdrMetricItem& ) rOutAttrs.
+ nOldY = static_cast<const SdrMetricItem&>( rOutAttrs.
Get( SDRATTR_SHADOWYDIST ) ).GetValue();
}
SdrMetricItem aXItem( makeSdrShadowXDistItem(nX) );
pOld = GetOldItem( *rAttrs, SDRATTR_SHADOWXDIST );
if ( nX != nOldX &&
- ( !pOld || !( *(const SdrMetricItem*)pOld == aXItem ) ) )
+ ( !pOld || !( *static_cast<const SdrMetricItem*>(pOld) == aXItem ) ) )
{
rAttrs->Put( aXItem );
bModified = true;
@@ -309,7 +309,7 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs )
SdrMetricItem aYItem( makeSdrShadowYDistItem(nY) );
pOld = GetOldItem( *rAttrs, SDRATTR_SHADOWYDIST );
if ( nY != nOldY &&
- ( !pOld || !( *(const SdrMetricItem*)pOld == aYItem ) ) )
+ ( !pOld || !( *static_cast<const SdrMetricItem*>(pOld) == aYItem ) ) )
{
rAttrs->Put( aYItem );
bModified = true;
@@ -323,7 +323,7 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs )
{
XColorItem aItem(makeSdrShadowColorItem(m_pLbShadowColor->GetSelectEntryColor()));
pOld = GetOldItem( *rAttrs, SDRATTR_SHADOWCOLOR );
- if ( !pOld || !( *(const XColorItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const XColorItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -336,7 +336,7 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs )
{
SdrPercentItem aItem( makeSdrShadowTransparenceItem(nVal) );
pOld = GetOldItem( *rAttrs, SDRATTR_SHADOWTRANSPARENCE );
- if ( !pOld || !( *(const SdrPercentItem*)pOld == aItem ) )
+ if ( !pOld || !( *static_cast<const SdrPercentItem*>(pOld) == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -363,7 +363,7 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs )
{
m_pTsbShowShadow->EnableTriState( false );
- if( ( ( const SdrOnOffItem& ) rAttrs->Get( SDRATTR_SHADOW ) ).GetValue() )
+ if( static_cast<const SdrOnOffItem&>( rAttrs->Get( SDRATTR_SHADOW ) ).GetValue() )
m_pTsbShowShadow->SetState( TRISTATE_TRUE );
else
{
@@ -379,8 +379,8 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs )
if( rAttrs->GetItemState( SDRATTR_SHADOWXDIST ) != SfxItemState::DONTCARE &&
rAttrs->GetItemState( SDRATTR_SHADOWYDIST ) != SfxItemState::DONTCARE )
{
- sal_Int32 nX = ( ( const SdrMetricItem& ) rAttrs->Get( SDRATTR_SHADOWXDIST ) ).GetValue();
- sal_Int32 nY = ( ( const SdrMetricItem& ) rAttrs->Get( SDRATTR_SHADOWYDIST ) ).GetValue();
+ sal_Int32 nX = static_cast<const SdrMetricItem&>( rAttrs->Get( SDRATTR_SHADOWXDIST ) ).GetValue();
+ sal_Int32 nY = static_cast<const SdrMetricItem&>( rAttrs->Get( SDRATTR_SHADOWYDIST ) ).GetValue();
if( nX != 0 )
SetMetricValue( *m_pMtrDistance, nX < 0L ? -nX : nX, ePoolUnit );
@@ -403,8 +403,8 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs )
{
// determine default-distance
SfxItemPool* pPool = rOutAttrs.GetPool();
- SdrMetricItem* pXDistItem = (SdrMetricItem*)&pPool->GetDefaultItem (SDRATTR_SHADOWXDIST);
- SdrMetricItem* pYDistItem = (SdrMetricItem*)&pPool->GetDefaultItem (SDRATTR_SHADOWYDIST);
+ const SdrMetricItem* pXDistItem = static_cast<const SdrMetricItem*>(&pPool->GetDefaultItem(SDRATTR_SHADOWXDIST));
+ const SdrMetricItem* pYDistItem = static_cast<const SdrMetricItem*>(&pPool->GetDefaultItem(SDRATTR_SHADOWYDIST));
if (pXDistItem && pYDistItem)
{
sal_Int32 nX = pXDistItem->GetValue();
@@ -424,14 +424,14 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs )
if( rAttrs->GetItemState( SDRATTR_SHADOWCOLOR ) != SfxItemState::DONTCARE )
{
- m_pLbShadowColor->SelectEntry( ( ( const XColorItem& ) rAttrs->Get( SDRATTR_SHADOWCOLOR ) ).GetColorValue() );
+ m_pLbShadowColor->SelectEntry( static_cast<const XColorItem&>( rAttrs->Get( SDRATTR_SHADOWCOLOR ) ).GetColorValue() );
}
else
m_pLbShadowColor->SetNoSelection();
if( rAttrs->GetItemState( SDRATTR_SHADOWTRANSPARENCE ) != SfxItemState::DONTCARE )
{
- sal_uInt16 nTransp = ( ( const SdrPercentItem& ) rAttrs->Get( SDRATTR_SHADOWTRANSPARENCE ) ).GetValue();
+ sal_uInt16 nTransp = static_cast<const SdrPercentItem&>( rAttrs->Get( SDRATTR_SHADOWTRANSPARENCE ) ).GetValue();
m_pMtrTransparent->SetValue( nTransp );
}
else
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 26a8678ddc82..84789033ea19 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -297,7 +297,7 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
const SfxPoolItem* pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ROT_X );
if(pItem)
{
- const double fTmp(((double)((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getX()) / fUIScale);
+ const double fTmp(((double)static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getX()) / fUIScale);
SetMetricValue(*m_pMtrPosX, basegfx::fround(fTmp), ePoolUnit);
}
else
@@ -308,7 +308,7 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
pItem = GetItem(*rAttrs, SID_ATTR_TRANSFORM_ROT_Y);
if(pItem)
{
- const double fTmp(((double)((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getY()) / fUIScale);
+ const double fTmp(((double)static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getY()) / fUIScale);
SetMetricValue(*m_pMtrPosY, basegfx::fround(fTmp), ePoolUnit);
}
else
@@ -319,7 +319,7 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ANGLE );
if(pItem)
{
- m_pCtlAngle->SetRotation(((const SfxInt32Item*)pItem)->GetValue());
+ m_pCtlAngle->SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue());
}
else
{
@@ -528,7 +528,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
if( pItem )
{
const double fUIScale(boost::rational_cast<double>(this->pView->GetModel()->GetUIScale()));
- const double fTmp((double)((const SdrMetricItem*)pItem)->GetValue() / fUIScale);
+ const double fTmp((double)static_cast<const SdrMetricItem*>(pItem)->GetValue() / fUIScale);
SetMetricValue(*m_pMtrRadius, basegfx::fround(fTmp), ePoolUnit);
}
else
@@ -551,7 +551,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
if( pItem )
{
- m_pMtrAngle->SetValue( ( (const SfxInt32Item*)pItem )->GetValue() );
+ m_pMtrAngle->SetValue( static_cast<const SfxInt32Item*>(pItem)->GetValue() );
}
else
{
@@ -906,21 +906,21 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_X );
if ( pItem )
{
- const double fTmp((((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getX()) / fUIScale);
+ const double fTmp((static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getX()) / fUIScale);
SetMetricValue(*m_pMtrPosX, basegfx::fround(fTmp), mePoolUnit);
}
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_Y );
if ( pItem )
{
- const double fTmp((((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getY()) / fUIScale);
+ const double fTmp((static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getY()) / fUIScale);
SetMetricValue(*m_pMtrPosY, basegfx::fround(fTmp), mePoolUnit);
}
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_POS );
if ( pItem )
{
- bool bProtected = ( ( const SfxBoolItem* )pItem )->GetValue();
+ bool bProtected = static_cast<const SfxBoolItem*>( pItem )->GetValue();
m_pTsbPosProtect->SetState( bProtected ? TRISTATE_TRUE : TRISTATE_FALSE );
m_pTsbPosProtect->EnableTriState( false );
}
@@ -938,7 +938,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
{ // #i75273# set width
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH );
- mfOldWidth = std::max( pItem ? (double)((const SfxUInt32Item*)pItem)->GetValue() : 0.0, 1.0 );
+ mfOldWidth = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 );
double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale);
if(m_pMtrWidth->GetDecimalDigits())
@@ -950,7 +950,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
{ // #i75273# set height
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT );
- mfOldHeight = std::max( pItem ? (double)((const SfxUInt32Item*)pItem)->GetValue() : 0.0, 1.0 );
+ mfOldHeight = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 );
double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale);
if(m_pMtrHeight->GetDecimalDigits())
@@ -963,7 +963,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_SIZE );
if ( pItem )
{
- m_pTsbSizeProtect->SetState( ( (const SfxBoolItem*)pItem )->GetValue()
+ m_pTsbSizeProtect->SetState( static_cast<const SfxBoolItem*>(pItem)->GetValue()
? TRISTATE_TRUE : TRISTATE_FALSE );
m_pTsbSizeProtect->EnableTriState( false );
}
@@ -973,7 +973,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_AUTOWIDTH );
if ( pItem )
{
- m_pTsbAutoGrowWidth->SetState( ( ( const SfxBoolItem* )pItem )->GetValue()
+ m_pTsbAutoGrowWidth->SetState( static_cast<const SfxBoolItem*>( pItem )->GetValue()
? TRISTATE_TRUE : TRISTATE_FALSE );
}
else
@@ -982,7 +982,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_AUTOHEIGHT );
if ( pItem )
{
- m_pTsbAutoGrowHeight->SetState( ( ( const SfxBoolItem* )pItem )->GetValue()
+ m_pTsbAutoGrowHeight->SetState( static_cast<const SfxBoolItem*>( pItem )->GetValue()
? TRISTATE_TRUE : TRISTATE_FALSE );
}
else