diff options
Diffstat (limited to 'sc/source')
40 files changed, 216 insertions, 216 deletions
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index feab52a78dea..50fa044963ee 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -124,7 +124,7 @@ ScContentTree::ScContentTree( vcl::Window* pParent, const ResId& rResId ) : for (i=0; i<SC_CONTENT_COUNT; i++) pPosList[pTypeList[i]] = i; // invers zum suchen - pParentWindow = (ScNavigatorDlg*)pParent; + pParentWindow = static_cast<ScNavigatorDlg*>(pParent); pRootNodes[0] = NULL; for (i=1; i<SC_CONTENT_COUNT; i++) @@ -484,7 +484,7 @@ void ScContentTree::KeyInput( const KeyEvent& rKEvt ) case SC_CONTENT_DRAWING: { vcl::Window* pWindow=(vcl::Window*)GetParent(pEntry); - ScNavigatorDlg* pScNavigatorDlg = (ScNavigatorDlg*)pWindow; + ScNavigatorDlg* pScNavigatorDlg = static_cast<ScNavigatorDlg*>(pWindow); ScTabViewShell* pScTabViewShell = NULL; ScDrawView* pScDrawView = NULL; if (pScNavigatorDlg!=NULL) @@ -687,7 +687,7 @@ void ScContentTree::RequestHelp( const HelpEvent& rHEvt ) if (bRet) { SvLBoxTab* pTab; - SvLBoxString* pItem = (SvLBoxString*)(GetItem( pEntry, aPos.X(), &pTab )); + SvLBoxString* pItem = static_cast<SvLBoxString*>(GetItem( pEntry, aPos.X(), &pTab )); if( pItem ) { aPos = GetEntryPosition( pEntry ); @@ -972,7 +972,7 @@ void ScContentTree::GetDrawNames( sal_uInt16 nType ) if(pChild) pWindow=(vcl::Window*)GetParent(pChild); if(pWindow) - pScNavigatorDlg = (ScNavigatorDlg*)pWindow; + pScNavigatorDlg = static_cast<ScNavigatorDlg*>(pWindow); if (pScNavigatorDlg!=NULL) pScTabViewShell=pScNavigatorDlg->GetTabViewShell(); if(pScTabViewShell !=NULL) @@ -1029,7 +1029,7 @@ void ScContentTree::GetLinkNames() { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScAreaLink)) - InsertContent( SC_CONTENT_AREALINK, ((ScAreaLink*)pBase)->GetSource() ); + InsertContent( SC_CONTENT_AREALINK, static_cast<ScAreaLink*>(pBase)->GetSource() ); // in der Liste die Namen der Quellbereiche } @@ -1052,7 +1052,7 @@ const ScAreaLink* ScContentTree::GetLink( sal_uLong nIndex ) if (pBase->ISA(ScAreaLink)) { if (nFound == nIndex) - return (const ScAreaLink*) pBase; + return static_cast<const ScAreaLink*>(pBase); ++nFound; } } @@ -1672,7 +1672,7 @@ void ScContentTree::InitEntry(SvTreeListEntry* pEntry, { sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2" SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); - SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite ); + SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nColToHilite )); SvLBoxString* pStr = new SvLBoxString( pEntry, 0, pCol->GetText() ); pEntry->ReplaceItem( pStr, nColToHilite ); } diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 6b3218eb83cd..efd1e80df588 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -543,7 +543,7 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper( void ScNavigatorDialogWrapper::Resizing( Size& rSize ) { - ((ScNavigatorDlg*)GetWindow())->Resizing(rSize); + static_cast<ScNavigatorDlg*>(GetWindow())->Resizing(rSize); } // class ScNavigatorPI @@ -1190,7 +1190,7 @@ void ScNavigatorDlg::ShowScenarios( bool bShow, bool bSetSize ) } else { - SfxNavigator* pNav = (SfxNavigator*)GetParent(); + SfxNavigator* pNav = static_cast<SfxNavigator*>(GetParent()); Size aFloating = pNav->GetFloatingSize(); aFloating.Height() = aSize.Height(); pNav->SetFloatingSize( aFloating ); diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index eaf20ba1f7eb..d72a7456c21d 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -246,7 +246,7 @@ void ScScenarioWindow::NotifyState( const SfxPoolItem* pState ) if ( pState->ISA(SfxStringItem) ) { - OUString aNewEntry( ((const SfxStringItem*)pState)->GetValue() ); + OUString aNewEntry( static_cast<const SfxStringItem*>(pState)->GetValue() ); if ( !aNewEntry.isEmpty() ) aLbScenario.SelectEntry( aNewEntry ); @@ -255,7 +255,7 @@ void ScScenarioWindow::NotifyState( const SfxPoolItem* pState ) } else if ( pState->ISA(SfxStringListItem) ) { - aLbScenario.UpdateEntries( ((SfxStringListItem*)pState)->GetList() ); + aLbScenario.UpdateEntries( static_cast<const SfxStringListItem*>(pState)->GetList() ); } } else diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx index b8a4e2e477e4..110953960262 100644 --- a/sc/source/ui/optdlg/tpcalc.cxx +++ b/sc/source/ui/optdlg/tpcalc.cxx @@ -39,7 +39,7 @@ ScTpCalcOptions::ScTpCalcOptions(vcl::Window* pParent, const SfxItemSet& rCoreAt : SfxTabPage(pParent, "OptCalculatePage", "modules/scalc/ui/optcalculatepage.ui", &rCoreAttrs) , pOldOptions(new ScDocOptions( - ((const ScTpCalcItem&)rCoreAttrs.Get( + static_cast<const ScTpCalcItem&>(rCoreAttrs.Get( GetWhich(SID_SCDOCOPTIONS))).GetDocOptions())) , pLocalOptions(new ScDocOptions) , nWhichCalc(GetWhich(SID_SCDOCOPTIONS)) diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx index c53c61395e1f..fc8cd2bcd8f7 100644 --- a/sc/source/ui/optdlg/tpdefaults.cxx +++ b/sc/source/ui/optdlg/tpdefaults.cxx @@ -63,7 +63,7 @@ void ScTpDefaultsOptions::Reset(const SfxItemSet* rCoreSet) const SfxPoolItem* pItem = NULL; if(SfxItemState::SET == rCoreSet->GetItemState(SID_SCDEFAULTSOPTIONS, false , &pItem)) - aOpt = ((const ScTpDefaultsItem*)pItem)->GetDefaultsOptions(); + aOpt = static_cast<const ScTpDefaultsItem*>(pItem)->GetDefaultsOptions(); m_pEdNSheets->SetValue( static_cast<sal_uInt16>( aOpt.GetInitTabCount()) ); m_pEdSheetPrefix->SetText( aOpt.GetInitTabPrefix() ); diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 01641e8796c4..a1c40ce1107f 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -291,7 +291,7 @@ void ScTpFormulaOptions::Reset(const SfxItemSet* rCoreSet) const SfxPoolItem* pItem = NULL; if(SfxItemState::SET == rCoreSet->GetItemState(SID_SCFORMULAOPTIONS, false , &pItem)) - aOpt = ((const ScTpFormulaItem*)pItem)->GetFormulaOptions(); + aOpt = static_cast<const ScTpFormulaItem*>(pItem)->GetFormulaOptions(); // formula grammar. ::formula::FormulaGrammar::Grammar eGram = aOpt.GetFormulaSyntax(); diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx index 99d13ac98256..ae2d9def5809 100644 --- a/sc/source/ui/optdlg/tpprint.cxx +++ b/sc/source/ui/optdlg/tpprint.cxx @@ -62,7 +62,7 @@ void ScTpPrintOptions::Reset( const SfxItemSet* rCoreSet ) const SfxPoolItem* pItem; if(SfxItemState::SET == rCoreSet->GetItemState(SID_SCPRINTOPTIONS, false , &pItem)) - aOptions = ((const ScTpPrintItem*)pItem)->GetPrintOptions(); + aOptions = static_cast<const ScTpPrintItem*>(pItem)->GetPrintOptions(); else { // when called from print dialog and no options set, use configuration @@ -71,7 +71,7 @@ void ScTpPrintOptions::Reset( const SfxItemSet* rCoreSet ) if ( SfxItemState::SET == rCoreSet->GetItemState( SID_PRINT_SELECTEDSHEET, false , &pItem ) ) { - bool bChecked = ( (const SfxBoolItem*)pItem )->GetValue(); + bool bChecked = static_cast<const SfxBoolItem*>(pItem)->GetValue(); m_pSelectedSheetsCB->Check( bChecked ); } else diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index aa331aae35db..d972f94857b8 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -142,8 +142,8 @@ SfxTabPage* ScTpUserLists::Create( vcl::Window* pParent, const SfxItemSet* rAttr void ScTpUserLists::Reset( const SfxItemSet* rCoreAttrs ) { - const ScUserListItem& rUserListItem = (const ScUserListItem&) - rCoreAttrs->Get( nWhichUserLists ); + const ScUserListItem& rUserListItem = static_cast<const ScUserListItem&>( + rCoreAttrs->Get( nWhichUserLists )); const ScUserList* pCoreList = rUserListItem.GetUserList(); OSL_ENSURE( pCoreList, "UserList not found :-/" ); @@ -198,8 +198,8 @@ bool ScTpUserLists::FillItemSet( SfxItemSet* rCoreAttrs ) if ( bModifyMode || bCancelMode ) BtnClickHdl( mpBtnAdd ); - const ScUserListItem& rUserListItem = (const ScUserListItem&) - GetItemSet().Get( nWhichUserLists ); + const ScUserListItem& rUserListItem = static_cast<const ScUserListItem&>( + GetItemSet().Get( nWhichUserLists )); ScUserList* pCoreList = rUserListItem.GetUserList(); bool bDataModified = false; diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx index 2d81b53ecdcd..2308812e170b 100644 --- a/sc/source/ui/optdlg/tpview.cxx +++ b/sc/source/ui/optdlg/tpview.cxx @@ -150,7 +150,7 @@ void ScTpContentOptions::Reset( const SfxItemSet* rCoreSet ) const SfxPoolItem* pItem; if(SfxItemState::SET == rCoreSet->GetItemState(SID_SCVIEWOPTIONS, false , &pItem)) pLocalOptions = new ScViewOptions( - ((const ScTpViewItem*)pItem)->GetViewOptions() ); + static_cast<const ScTpViewItem*>(pItem)->GetViewOptions() ); else pLocalOptions = new ScViewOptions; pFormulaCB ->Check(pLocalOptions->GetOption(VOPT_FORMULAS)); @@ -176,9 +176,9 @@ void ScTpContentOptions::Reset( const SfxItemSet* rCoreSet ) pGuideLineCB->Check( pLocalOptions->GetOption(VOPT_HELPLINES) ); if(SfxItemState::SET == rCoreSet->GetItemState(SID_SC_INPUT_RANGEFINDER, false, &pItem)) - pRangeFindCB->Check(((const SfxBoolItem*)pItem)->GetValue()); + pRangeFindCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); if(SfxItemState::SET == rCoreSet->GetItemState(SID_SC_OPT_SYNCZOOM, false, &pItem)) - pSyncZoomCB->Check(((const SfxBoolItem*)pItem)->GetValue()); + pSyncZoomCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); pRangeFindCB->SaveValue(); pSyncZoomCB->SaveValue(); @@ -207,7 +207,7 @@ void ScTpContentOptions::ActivatePage( const SfxItemSet& rSet) { const SfxPoolItem* pItem; if(SfxItemState::SET == rSet.GetItemState(SID_SCVIEWOPTIONS, false , &pItem)) - *pLocalOptions = ((const ScTpViewItem*)pItem)->GetViewOptions(); + *pLocalOptions = static_cast<const ScTpViewItem*>(pItem)->GetViewOptions(); } int ScTpContentOptions::DeactivatePage( SfxItemSet* pSetP ) @@ -290,7 +290,7 @@ void ScTpContentOptions::InitGridOpt() { const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE ); if ( pItem ) - pColorList = ((SvxColorListItem*)pItem)->GetColorList(); + pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList(); } else pColorList = XColorList::GetStdColorList(); @@ -392,7 +392,7 @@ ScTpLayoutOptions::ScTpLayoutOptions( vcl::Window* pParent, { // nur diese Metriken benutzen sal_Int32 nPos = m_pUnitLB->InsertEntry( sMetric ); - m_pUnitLB->SetEntryData( nPos, (void*)(sal_IntPtr)eFUnit ); + m_pUnitLB->SetEntryData( nPos, reinterpret_cast<void*>((sal_IntPtr)eFUnit) ); } break; default: @@ -425,7 +425,7 @@ bool ScTpLayoutOptions::FillItemSet( SfxItemSet* rCoreSet ) const sal_Int32 nMPos = m_pUnitLB->GetSelectEntryPos(); if ( m_pUnitLB->IsValueChangedFromSaved() ) { - sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pUnitLB->GetEntryData( nMPos ); + sal_uInt16 nFieldUnit = (sal_uInt16)reinterpret_cast<sal_IntPtr>(m_pUnitLB->GetEntryData( nMPos )); rCoreSet->Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nFieldUnit ) ); bRet = true; @@ -527,12 +527,12 @@ void ScTpLayoutOptions::Reset( const SfxItemSet* rCoreSet ) m_pUnitLB->SetNoSelection(); if ( rCoreSet->GetItemState( SID_ATTR_METRIC ) >= SfxItemState::DEFAULT ) { - const SfxUInt16Item& rItem = (SfxUInt16Item&)rCoreSet->Get( SID_ATTR_METRIC ); + const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(rCoreSet->Get( SID_ATTR_METRIC )); FieldUnit eFieldUnit = (FieldUnit)rItem.GetValue(); for ( sal_Int32 i = 0; i < m_pUnitLB->GetEntryCount(); ++i ) { - if ( (FieldUnit)(sal_IntPtr)m_pUnitLB->GetEntryData( i ) == eFieldUnit ) + if ( (FieldUnit)reinterpret_cast<sal_IntPtr>(m_pUnitLB->GetEntryData( i )) == eFieldUnit ) { m_pUnitLB->SelectEntryPos( i ); break; @@ -544,7 +544,7 @@ void ScTpLayoutOptions::Reset( const SfxItemSet* rCoreSet ) const SfxPoolItem* pItem; if(SfxItemState::SET == rCoreSet->GetItemState(SID_ATTR_DEFTABSTOP, false, &pItem)) - m_pTabMF->SetValue(m_pTabMF->Normalize(((SfxUInt16Item*)pItem)->GetValue()), FUNIT_TWIP); + m_pTabMF->SetValue(m_pTabMF->Normalize(static_cast<const SfxUInt16Item*>(pItem)->GetValue()), FUNIT_TWIP); m_pTabMF->SaveValue(); m_pUnitLB ->SaveValue(); @@ -574,34 +574,34 @@ void ScTpLayoutOptions::Reset( const SfxItemSet* rCoreSet ) } } if(SfxItemState::SET == rCoreSet->GetItemState(SID_SC_INPUT_SELECTION, false, &pItem)) - m_pAlignCB->Check(((const SfxBoolItem*)pItem)->GetValue()); + m_pAlignCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); if(SfxItemState::SET == rCoreSet->GetItemState(SID_SC_INPUT_SELECTIONPOS, false, &pItem)) - m_pAlignLB->SelectEntryPos(((const SfxUInt16Item*)pItem)->GetValue()); + m_pAlignLB->SelectEntryPos(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); if(SfxItemState::SET == rCoreSet->GetItemState(SID_SC_INPUT_EDITMODE, false, &pItem)) - m_pEditModeCB->Check(((const SfxBoolItem*)pItem)->GetValue()); + m_pEditModeCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); if(SfxItemState::SET == rCoreSet->GetItemState(SID_SC_INPUT_FMT_EXPAND, false, &pItem)) - m_pFormatCB->Check(((const SfxBoolItem*)pItem)->GetValue()); + m_pFormatCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); if(SfxItemState::SET == rCoreSet->GetItemState(SID_SC_INPUT_REF_EXPAND, false, &pItem)) - m_pExpRefCB->Check(((const SfxBoolItem*)pItem)->GetValue()); + m_pExpRefCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); if (rCoreSet->HasItem(SID_SC_OPT_SORT_REF_UPDATE, &pItem)) m_pSortRefUpdateCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); if(SfxItemState::SET == rCoreSet->GetItemState(SID_SC_INPUT_MARK_HEADER, false, &pItem)) - m_pMarkHdrCB->Check(((const SfxBoolItem*)pItem)->GetValue()); + m_pMarkHdrCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); if(SfxItemState::SET == rCoreSet->GetItemState(SID_SC_INPUT_TEXTWYSIWYG, false, &pItem)) - m_pTextFmtCB->Check(((const SfxBoolItem*)pItem)->GetValue()); + m_pTextFmtCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); if( SfxItemState::SET == rCoreSet->GetItemState( SID_SC_INPUT_REPLCELLSWARN, false, &pItem ) ) - m_pReplWarnCB->Check( ( (const SfxBoolItem*)pItem)->GetValue() ); + m_pReplWarnCB->Check( static_cast<const SfxBoolItem*>(pItem)->GetValue() ); if( SfxItemState::SET == rCoreSet->GetItemState( SID_SC_INPUT_LEGACY_CELL_SELECTION, false, &pItem ) ) - m_pLegacyCellSelectionCB->Check( ( (const SfxBoolItem*)pItem)->GetValue() ); + m_pLegacyCellSelectionCB->Check( static_cast<const SfxBoolItem*>(pItem)->GetValue() ); m_pAlignCB ->SaveValue(); m_pAlignLB ->SaveValue(); @@ -639,7 +639,7 @@ IMPL_LINK_NOARG(ScTpLayoutOptions, MetricHdl) const sal_Int32 nMPos = m_pUnitLB->GetSelectEntryPos(); if(nMPos != LISTBOX_ENTRY_NOTFOUND) { - FieldUnit eFieldUnit = (FieldUnit)(sal_IntPtr)m_pUnitLB->GetEntryData( nMPos ); + FieldUnit eFieldUnit = (FieldUnit)reinterpret_cast<sal_IntPtr>(m_pUnitLB->GetEntryData( nMPos )); sal_Int64 nVal = m_pTabMF->Denormalize( m_pTabMF->GetValue( FUNIT_TWIP ) ); ::SetFieldUnit( *m_pTabMF, eFieldUnit ); diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index 234ea334c912..637647b9543b 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -503,7 +503,7 @@ IMPL_LINK( ScPrintAreasDlg, Impl_GetFocusHdl, Control*, pCtr ) pCtr ==(Control *) pEdRepeatRow || pCtr ==(Control *) pEdRepeatCol) { - pRefInputEdit = (formula::RefEdit*) pCtr; + pRefInputEdit = static_cast<formula::RefEdit*>(pCtr); } else if ( pCtr ==(Control *) pLbPrintArea) { diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx b/sc/source/ui/pagedlg/hfedtdlg.cxx index bfd430d0c977..745aa4e72bec 100644 --- a/sc/source/ui/pagedlg/hfedtdlg.cxx +++ b/sc/source/ui/pagedlg/hfedtdlg.cxx @@ -32,13 +32,13 @@ //! use SIDs? #define IS_SHARE_HEADER(set) \ - ((SfxBoolItem&) \ - ((SvxSetItem&)(set).Get(ATTR_PAGE_HEADERSET)).GetItemSet(). \ + static_cast<const SfxBoolItem&>( \ + static_cast<const SvxSetItem&>((set).Get(ATTR_PAGE_HEADERSET)).GetItemSet(). \ Get(ATTR_PAGE_SHARED)).GetValue() #define IS_SHARE_FOOTER(set) \ - ((SfxBoolItem&) \ - ((SvxSetItem&)(set).Get(ATTR_PAGE_FOOTERSET)).GetItemSet(). \ + static_cast<const SfxBoolItem&>( \ + static_cast<const SvxSetItem&>((set).Get(ATTR_PAGE_FOOTERSET)).GetItemSet(). \ Get(ATTR_PAGE_SHARED)).GetValue() ScHFEditDlg::ScHFEditDlg( SfxViewFrame* pFrameP, @@ -48,7 +48,7 @@ ScHFEditDlg::ScHFEditDlg( SfxViewFrame* pFrameP, const OString& rID, const OUString& rUIXMLDescription ) : SfxTabDialog( pFrameP, pParent, rID, rUIXMLDescription, &rCoreSet ) { - eNumType = ((const SvxPageItem&)rCoreSet.Get(ATTR_PAGE)).GetNumType(); + eNumType = static_cast<const SvxPageItem&>(rCoreSet.Get(ATTR_PAGE)).GetNumType(); OUString aTmp = GetText(); @@ -163,9 +163,9 @@ ScHFEditActiveDlg::ScHFEditActiveDlg( SfxViewFrame* pFrameP, : ScHFEditDlg( pFrameP, pParent, rCoreSet, rPageStyle, "HeaderFooterDialog", "modules/scalc/ui/headerfooterdialog.ui" ) { - const SvxPageItem& rPageItem = (const SvxPageItem&) + const SvxPageItem& rPageItem = static_cast<const SvxPageItem&>( rCoreSet.Get( - rCoreSet.GetPool()->GetWhich(SID_ATTR_PAGE) ); + rCoreSet.GetPool()->GetWhich(SID_ATTR_PAGE) )); bool bRightPage = ( SVX_PAGE_LEFT != SvxPageUsage(rPageItem.GetPageUsage()) ); @@ -197,7 +197,7 @@ void ScHFEditDlg::PageCreated( sal_uInt16 /* nId */, SfxTabPage& rPage ) { // kann ja nur ne ScHFEditPage sein... - ((ScHFEditPage&)rPage).SetNumType(eNumType); + static_cast<ScHFEditPage&>(rPage).SetNumType(eNumType); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx index 21054e5effe2..994067e639be 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -107,8 +107,8 @@ bool ScHFPage::FillItemSet( SfxItemSet* rOutSet ) void ScHFPage::ActivatePage( const SfxItemSet& rSet ) { sal_uInt16 nPageWhich = GetWhich( SID_ATTR_PAGE ); - const SvxPageItem& rPageItem = (const SvxPageItem&) - rSet.Get(nPageWhich); + const SvxPageItem& rPageItem = static_cast<const SvxPageItem&>( + rSet.Get(nPageWhich)); nPageUsage = rPageItem.GetPageUsage(); @@ -215,8 +215,8 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl) pDlg->SetTabPage( ScLeftFooterEditPage::Create( pDlg->get_content_area(), &aDataSet ), NULL, nSettingsId ); } - SvxNumType eNumType = ((const SvxPageItem&)aDataSet.Get(ATTR_PAGE)).GetNumType(); - ((ScHFEditPage*)pDlg->GetTabPage())->SetNumType(eNumType); + SvxNumType eNumType = static_cast<const SvxPageItem&>(aDataSet.Get(ATTR_PAGE)).GetNumType(); + static_cast<ScHFEditPage*>(pDlg->GetTabPage())->SetNumType(eNumType); aText += " (" + ScGlobal::GetRscString( STR_PAGESTYLE ); aText += ": " + aStrPageStyle + ")"; diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index c6ce541199a7..33db5b31cde4 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -60,9 +60,9 @@ static void lcl_GetFieldData( ScHeaderFieldData& rData ) if (pShell) { if (pShell->ISA(ScTabViewShell)) - ((ScTabViewShell*)pShell)->FillFieldData(rData); + static_cast<ScTabViewShell*>(pShell)->FillFieldData(rData); else if (pShell->ISA(ScPreviewShell)) - ((ScPreviewShell*)pShell)->FillFieldData(rData); + static_cast<ScPreviewShell*>(pShell)->FillFieldData(rData); } } diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx index 9382f9a34b3b..591b324b7d23 100644 --- a/sc/source/ui/pagedlg/tptable.cxx +++ b/sc/source/ui/pagedlg/tptable.cxx @@ -70,9 +70,9 @@ static bool lcl_PutBoolItem( sal_uInt16 nWhich, #define SCALE_HDL LINK(this,ScTablePage,ScaleHdl) #define WAS_DEFAULT(w,s) (SfxItemState::DEFAULT==(s).GetItemState((w),true)) -#define GET_BOOL(sid,set) ((const SfxBoolItem&)((set).Get(GetWhich((sid))))).GetValue() -#define GET_USHORT(sid,set) (sal_uInt16)((const SfxUInt16Item&)((set).Get(GetWhich((sid))))).GetValue() -#define GET_SHOW(sid,set) ( ScVObjMode( ((const ScViewObjectModeItem&)((set).Get(GetWhich((sid))))).GetValue() ) \ +#define GET_BOOL(sid,set) static_cast<const SfxBoolItem&>((set).Get(GetWhich((sid)))).GetValue() +#define GET_USHORT(sid,set) (sal_uInt16)static_cast<const SfxUInt16Item&>((set).Get(GetWhich((sid)))).GetValue() +#define GET_SHOW(sid,set) ( ScVObjMode( static_cast<const ScViewObjectModeItem&>((set).Get(GetWhich((sid)))).GetValue() ) \ == VOBJ_MODE_SHOW ) // List box entries "Scaling mode" #define SC_TPTABLE_SCALE_PERCENT 0 @@ -166,7 +166,7 @@ void ScTablePage::Reset( const SfxItemSet* rCoreSet ) nWhich = GetWhich(SID_SCATTR_PAGE_SCALE); if ( rCoreSet->GetItemState( nWhich, true ) >= SfxItemState::DEFAULT ) { - sal_uInt16 nScale = ((const SfxUInt16Item&)rCoreSet->Get(nWhich)).GetValue(); + sal_uInt16 nScale = static_cast<const SfxUInt16Item&>(rCoreSet->Get(nWhich)).GetValue(); if( nScale > 0 ) m_pLbScaleMode->SelectEntryPos( SC_TPTABLE_SCALE_PERCENT ); m_pEdScaleAll->SetValue( (nScale > 0) ? nScale : 100 ); @@ -191,7 +191,7 @@ void ScTablePage::Reset( const SfxItemSet* rCoreSet ) nWhich = GetWhich(SID_SCATTR_PAGE_SCALETOPAGES); if ( rCoreSet->GetItemState( nWhich, true ) >= SfxItemState::DEFAULT ) { - sal_uInt16 nPages = ((const SfxUInt16Item&)rCoreSet->Get(nWhich)).GetValue(); + sal_uInt16 nPages = static_cast<const SfxUInt16Item&>(rCoreSet->Get(nWhich)).GetValue(); if( nPages > 0 ) m_pLbScaleMode->SelectEntryPos( SC_TPTABLE_SCALE_TO_PAGES ); m_pEdScalePageNum->SetValue( (nPages > 0) ? nPages : 1 ); diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx index 4e5ade154797..80b103e277f3 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx @@ -238,7 +238,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate( SvxCellHorJustify meHorAlignState = SVX_HOR_JUSTIFY_STANDARD; if(eState >= SfxItemState::DEFAULT && pState && pState->ISA(SvxHorJustifyItem) ) { - const SvxHorJustifyItem* pItem = (const SvxHorJustifyItem*)pState; + const SvxHorJustifyItem* pItem = static_cast<const SvxHorJustifyItem*>(pState); meHorAlignState = (SvxCellHorJustify)pItem->GetValue(); } @@ -263,7 +263,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate( case SID_ATTR_ALIGN_INDENT: if(eState >= SfxItemState::DEFAULT && pState && pState->ISA(SfxUInt16Item) ) { - const SfxUInt16Item* pItem = (const SfxUInt16Item*)pState; + const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pState); sal_uInt16 nVal = pItem->GetValue(); mpMFLeftIndent->SetValue( CalcToPoint(nVal, SFX_MAPUNIT_TWIP, 1) ); } @@ -277,7 +277,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate( if(eState >= SfxItemState::DEFAULT && pState && pState->ISA(SfxBoolItem) ) { mpCBXMergeCell->Enable(); - const SfxBoolItem* pItem = (const SfxBoolItem*)pState; + const SfxBoolItem* pItem = static_cast<const SfxBoolItem*>(pState); mpCBXMergeCell->Check(pItem->GetValue()); } else @@ -300,7 +300,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate( if(eState >= SfxItemState::DEFAULT && pState && pState->ISA(SfxBoolItem) ) { mpCBXWrapText->EnableTriState(false); - const SfxBoolItem* pItem = (const SfxBoolItem*)pState; + const SfxBoolItem* pItem = static_cast<const SfxBoolItem*>(pState); mpCBXWrapText->Check(pItem->GetValue()); } else if(eState == SfxItemState::DONTCARE) @@ -313,7 +313,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate( case SID_ATTR_ALIGN_DEGREES: if (eState >= SfxItemState::DEFAULT) { - long nTmp = ((const SfxInt32Item*)pState)->GetValue(); + long nTmp = static_cast<const SfxInt32Item*>(pState)->GetValue(); mpMtrAngle->SetValue( nTmp / 100); //wj mpCtrlDial->SetRotation( nTmp ); switch(nTmp) @@ -353,7 +353,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate( if (eState >= SfxItemState::DEFAULT) { mpCbStacked->EnableTriState(false); - const SfxBoolItem* aStackItem = (const SfxBoolItem*)pState; + const SfxBoolItem* aStackItem = static_cast<const SfxBoolItem*>(pState); mbMultiDisable = aStackItem->GetValue(); mpCbStacked->Check(mbMultiDisable); mpFtRotate->Enable(!mbMultiDisable); diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx index 4b687dd7b975..2024f155d934 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx @@ -350,7 +350,7 @@ void CellAppearancePropertyPanel::NotifyItemUpdate( if(pSvxColorItem) { - maLineColor = ((const SvxColorItem*)pState)->GetValue(); + maLineColor = static_cast<const SvxColorItem*>(pState)->GetValue(); if(maLineColor == COL_AUTO) mbLineColorAvailable = false; else diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx index 6efa8f3d2b4c..c01add14a97e 100644 --- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx +++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx @@ -218,7 +218,7 @@ void NumberFormatPropertyPanel::NotifyItemUpdate( { if( eState >= SfxItemState::DEFAULT) { - const SfxInt16Item* pItem = (const SfxInt16Item*)pState; + const SfxInt16Item* pItem = static_cast<const SfxInt16Item*>(pState); sal_uInt16 nVal = pItem->GetValue(); mnCategorySelected = nVal; mpLbCategory->SelectEntryPos(nVal); @@ -256,7 +256,7 @@ void NumberFormatPropertyPanel::NotifyItemUpdate( sal_uInt16 nLeadZeroes = 0; if( eState >= SfxItemState::DEFAULT) { - const SfxStringItem* pItem = (const SfxStringItem*)pState; + const SfxStringItem* pItem = static_cast<const SfxStringItem*>(pState); OUString aCode = pItem->GetValue(); /* if(aCode.Equals(String::CreateFromAscii("General"))) { diff --git a/sc/source/ui/styleui/styledlg.cxx b/sc/source/ui/styleui/styledlg.cxx index c6dfe8e5d3c8..c834d8467904 100644 --- a/sc/source/ui/styleui/styledlg.cxx +++ b/sc/source/ui/styleui/styledlg.cxx @@ -137,7 +137,7 @@ void ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) OSL_ENSURE( pInfoItem, "NumberInfoItem nicht gefunden!" ); - aSet.Put (SvxNumberInfoItem( (const SvxNumberInfoItem&)*pInfoItem ) ); + aSet.Put (SvxNumberInfoItem( static_cast<const SvxNumberInfoItem&>(*pInfoItem) ) ); rTabPage.PageCreated(aSet); } else if (nPageId == m_nFontId) @@ -147,7 +147,7 @@ void ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) OSL_ENSURE( pInfoItem, "FontListItem nicht gefunden!" ); - aSet.Put (SvxFontListItem(((const SvxFontListItem&)*pInfoItem).GetFontList(), SID_ATTR_CHAR_FONTLIST)); + aSet.Put (SvxFontListItem(static_cast<const SvxFontListItem&>(*pInfoItem).GetFontList(), SID_ATTR_CHAR_FONTLIST)); rTabPage.PageCreated(aSet); } } @@ -161,9 +161,9 @@ void ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) } else if (nPageId == m_nHeaderId || nPageId == m_nFooterId) { - ((ScHFPage&)rTabPage).SetStyleDlg( this ); - ((ScHFPage&)rTabPage).SetPageStyle( GetStyleSheet().GetName() ); - ((ScHFPage&)rTabPage).DisableDeleteQueryBox(); + static_cast<ScHFPage&>(rTabPage).SetStyleDlg( this ); + static_cast<ScHFPage&>(rTabPage).SetPageStyle( GetStyleSheet().GetName() ); + static_cast<ScHFPage&>(rTabPage).DisableDeleteQueryBox(); } else if (nPageId == m_nBackgroundId) { diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx index 55eb288a0ec4..23f5881e4228 100644 --- a/sc/source/ui/undo/areasave.cxx +++ b/sc/source/ui/undo/areasave.cxx @@ -109,7 +109,7 @@ bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScAreaLink)) { - if ( nPos >= size() || !(*this)[nPos]->IsEqual( *(ScAreaLink*)pBase ) ) + if ( nPos >= size() || !(*this)[nPos]->IsEqual( *static_cast<ScAreaLink*>(pBase) ) ) return false; ++nPos; @@ -178,7 +178,7 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum if (!pColl) pColl = new ScAreaLinkSaveCollection; - ScAreaLinkSaver* pSaver = new ScAreaLinkSaver( *(ScAreaLink*)pBase ); + ScAreaLinkSaver* pSaver = new ScAreaLinkSaver( *static_cast<ScAreaLink*>(pBase )); pColl->push_back(pSaver); } } diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index 2e244ec1a9be..c1f58d85b92d 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -80,7 +80,7 @@ bool ScSimpleUndo::Merge( SfxUndoAction *pNextAction ) // Take SdrUndoAction from ScUndoDraw Action, // ScUndoDraw is later deleted by the UndoManager - ScUndoDraw* pCalcUndo = (ScUndoDraw*)pNextAction; + ScUndoDraw* pCalcUndo = static_cast<ScUndoDraw*>(pNextAction); pDetectiveUndo = pCalcUndo->GetDrawUndo(); pCalcUndo->ForgetDrawUndo(); return true; diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index a23e390f7f9c..858cd426eeb4 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -131,7 +131,7 @@ bool ScUndoInsertCells::Merge( SfxUndoAction* pNextAction ) if ( bPartOfPaste && pNextAction->ISA( ScUndoWrapper ) ) { - ScUndoWrapper* pWrapper = (ScUndoWrapper*)pNextAction; + ScUndoWrapper* pWrapper = static_cast<ScUndoWrapper*>(pNextAction); SfxUndoAction* pWrappedAction = pWrapper->GetWrappedUndo(); if ( pWrappedAction && pWrappedAction->ISA( ScUndoPaste ) ) { @@ -316,7 +316,7 @@ void ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget) pPasteUndo->Repeat( rTarget ); } else - ((ScTabViewTarget&)rTarget).GetViewShell()->InsertCells( eCmd, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->InsertCells( eCmd, true ); } } @@ -551,7 +551,7 @@ void ScUndoDeleteCells::Redo() void ScUndoDeleteCells::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->DeleteCells( eCmd, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DeleteCells( eCmd, true ); } bool ScUndoDeleteCells::CanRepeat(SfxRepeatTarget& rTarget) const @@ -730,7 +730,7 @@ void ScUndoDeleteMulti::Repeat(SfxRepeatTarget& rTarget) { // if single selection if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->DeleteCells( DEL_DELROWS, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DeleteCells( DEL_DELROWS, true ); } bool ScUndoDeleteMulti::CanRepeat(SfxRepeatTarget& rTarget) const @@ -831,7 +831,7 @@ void ScUndoCut::Redo() void ScUndoCut::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->CutToClip( NULL, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->CutToClip( NULL, true ); } bool ScUndoCut::CanRepeat(SfxRepeatTarget& rTarget) const @@ -1092,7 +1092,7 @@ void ScUndoPaste::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell* pViewSh = ((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell* pViewSh = static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pViewSh->GetActiveWin() ); if (pOwnClip) { @@ -1487,7 +1487,7 @@ void ScUndoListNames::Redo() void ScUndoListNames::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->InsertNameList(); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->InsertNameList(); } bool ScUndoListNames::CanRepeat(SfxRepeatTarget& rTarget) const @@ -1651,7 +1651,7 @@ void ScUndoUseScenario::Repeat(SfxRepeatTarget& rTarget) if (rTarget.ISA(ScTabViewTarget)) { OUString aTemp = aName; - ((ScTabViewTarget&)rTarget).GetViewShell()->UseScenario(aTemp); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->UseScenario(aTemp); } } @@ -1659,7 +1659,7 @@ bool ScUndoUseScenario::CanRepeat(SfxRepeatTarget& rTarget) const { if (rTarget.ISA(ScTabViewTarget)) { - ScViewData& rViewData = ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData(); + ScViewData& rViewData = static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData(); return !rViewData.GetDocument()->IsScenario( rViewData.GetTabNo() ); } return false; @@ -1714,7 +1714,7 @@ void ScUndoSelectionStyle::DoChange( const bool bUndo ) { ScStyleSheetPool* pStlPool = rDoc.GetStyleSheetPool(); ScStyleSheet* pStyleSheet = - (ScStyleSheet*) pStlPool->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); + static_cast<ScStyleSheet*>( pStlPool->Find( aStyleName, SFX_STYLE_FAMILY_PARA ) ); if (!pStyleSheet) { OSL_FAIL("StyleSheet not found"); @@ -1752,15 +1752,15 @@ void ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget) { ScDocument& rDoc = pDocShell->GetDocument(); ScStyleSheetPool* pStlPool = rDoc.GetStyleSheetPool(); - ScStyleSheet* pStyleSheet = (ScStyleSheet*) pStlPool-> - Find( aStyleName, SFX_STYLE_FAMILY_PARA ); + ScStyleSheet* pStyleSheet = static_cast<ScStyleSheet*>( pStlPool-> + Find( aStyleName, SFX_STYLE_FAMILY_PARA )); if (!pStyleSheet) { OSL_FAIL("StyleSheet not found"); return; } - ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); rViewShell.SetStyleSheetToMarked( pStyleSheet, true ); } } @@ -1851,7 +1851,7 @@ void ScUndoEnterMatrix::Repeat(SfxRepeatTarget& rTarget) { OUString aTemp = aFormula; ScDocument& rDoc = pDocShell->GetDocument(); - ((ScTabViewTarget&)rTarget).GetViewShell()->EnterMatrix(aTemp, rDoc.GetGrammar()); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->EnterMatrix(aTemp, rDoc.GetGrammar()); } } @@ -1918,7 +1918,7 @@ void ScUndoIndent::Redo() void ScUndoIndent::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->ChangeIndent( bIsIncrement ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->ChangeIndent( bIsIncrement ); } bool ScUndoIndent::CanRepeat(SfxRepeatTarget& rTarget) const @@ -1974,7 +1974,7 @@ void ScUndoTransliterate::Redo() void ScUndoTransliterate::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->TransliterateText( nTransliterationType ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->TransliterateText( nTransliterationType ); } bool ScUndoTransliterate::CanRepeat(SfxRepeatTarget& rTarget) const @@ -2036,7 +2036,7 @@ void ScUndoClearItems::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScViewData& rViewData = ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData(); + ScViewData& rViewData = static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData(); rViewData.GetDocFunc().ClearItems( rViewData.GetMarkData(), pWhich, false ); } } @@ -2100,7 +2100,7 @@ void ScUndoRemoveBreaks::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); rViewShell.RemoveManualBreaks(); } } @@ -2210,7 +2210,7 @@ void ScUndoRemoveMerge::Redo() void ScUndoRemoveMerge::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->RemoveMerge(); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->RemoveMerge(); } bool ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx index 071198b43d7e..dfd6242346a9 100644 --- a/sc/source/ui/undo/undoblk2.cxx +++ b/sc/source/ui/undo/undoblk2.cxx @@ -164,7 +164,7 @@ void ScUndoWidthOrHeight::Redo() void ScUndoWidthOrHeight::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->SetMarkedWidthOrHeight( bWidth, eMode, nNewSize, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->SetMarkedWidthOrHeight( bWidth, eMode, nNewSize, true ); } bool ScUndoWidthOrHeight::CanRepeat(SfxRepeatTarget& rTarget) const diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 1cd2ce779f94..494fd3dcfc2e 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -211,7 +211,7 @@ void ScUndoDeleteContents::Redo() void ScUndoDeleteContents::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->DeleteContents( nFlags, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DeleteContents( nFlags, true ); } bool ScUndoDeleteContents::CanRepeat(SfxRepeatTarget& rTarget) const @@ -344,7 +344,7 @@ void ScUndoFillTable::Redo() void ScUndoFillTable::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->FillTab( nFlags, nFunction, bSkipEmpty, bAsLink ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->FillTab( nFlags, nFunction, bSkipEmpty, bAsLink ); } bool ScUndoFillTable::CanRepeat(SfxRepeatTarget& rTarget) const @@ -367,9 +367,9 @@ ScUndoSelectionAttr::ScUndoSelectionAttr( ScDocShell* pNewDocShell, bMulti ( bNewMulti ) { ScDocumentPool* pPool = pDocShell->GetDocument().GetPool(); - pApplyPattern = (ScPatternAttr*) &pPool->Put( *pNewApply ); - pLineOuter = pNewOuter ? (SvxBoxItem*) &pPool->Put( *pNewOuter ) : NULL; - pLineInner = pNewInner ? (SvxBoxInfoItem*) &pPool->Put( *pNewInner ) : NULL; + pApplyPattern = const_cast<ScPatternAttr*>(static_cast<const ScPatternAttr*>( &pPool->Put( *pNewApply ) )); + pLineOuter = pNewOuter ? const_cast<SvxBoxItem*>(static_cast<const SvxBoxItem*>( &pPool->Put( *pNewOuter ) )) : NULL; + pLineInner = pNewInner ? const_cast<SvxBoxInfoItem*>(static_cast<const SvxBoxInfoItem*>( &pPool->Put( *pNewInner ) )) : NULL; } ScUndoSelectionAttr::~ScUndoSelectionAttr() @@ -479,7 +479,7 @@ void ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); if (pLineOuter) rViewShell.ApplyPatternLines( *pApplyPattern, pLineOuter, pLineInner, true ); else @@ -626,7 +626,7 @@ void ScUndoAutoFill::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); if (eFillCmd==FILL_SIMPLE) rViewShell.FillSimple( eFillDir, true ); else @@ -754,7 +754,7 @@ void ScUndoMerge::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); bool bCont = false; rViewShell.MergeCells( false, bCont, true ); } @@ -906,7 +906,7 @@ void ScUndoAutoFormat::Redo() void ScUndoAutoFormat::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->AutoFormat( nFormatNo, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->AutoFormat( nFormatNo, true ); } bool ScUndoAutoFormat::CanRepeat(SfxRepeatTarget& rTarget) const @@ -1085,7 +1085,7 @@ void ScUndoReplace::Redo() void ScUndoReplace::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->SearchAndReplace( pSearchItem, true, false ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->SearchAndReplace( pSearchItem, true, false ); } bool ScUndoReplace::CanRepeat(SfxRepeatTarget& rTarget) const @@ -1267,7 +1267,7 @@ void ScUndoConversion::Redo() void ScUndoConversion::Repeat( SfxRepeatTarget& rTarget ) { if( rTarget.ISA( ScTabViewTarget ) ) - ((ScTabViewTarget&)rTarget).GetViewShell()->DoSheetConversion( maConvParam, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DoSheetConversion( maConvParam, true ); } bool ScUndoConversion::CanRepeat(SfxRepeatTarget& rTarget) const @@ -1353,7 +1353,7 @@ void ScUndoRefConversion::Redo() void ScUndoRefConversion::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->DoRefConversion(); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DoRefConversion(); } bool ScUndoRefConversion::CanRepeat(SfxRepeatTarget& rTarget) const @@ -1479,8 +1479,8 @@ static ScAreaLink* lcl_FindAreaLink( sfx2::LinkManager* pLinkManager, const OUSt { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScAreaLink)) - if ( ((ScAreaLink*)pBase)->IsEqual( rDoc, rFlt, rOpt, rSrc, rDest ) ) - return (ScAreaLink*)pBase; + if ( static_cast<ScAreaLink*>(pBase)->IsEqual( rDoc, rFlt, rOpt, rSrc, rDest ) ) + return static_cast<ScAreaLink*>(pBase); } OSL_FAIL("ScAreaLink not found"); diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 485e89015388..c239686cc030 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -91,9 +91,9 @@ ScUndoCursorAttr::ScUndoCursorAttr( ScDocShell* pNewDocShell, bIsAutomatic( bAutomatic ) { ScDocumentPool* pPool = pDocShell->GetDocument().GetPool(); - pNewPattern = (ScPatternAttr*) &pPool->Put( *pNewPat ); - pOldPattern = (ScPatternAttr*) &pPool->Put( *pOldPat ); - pApplyPattern = (ScPatternAttr*) &pPool->Put( *pApplyPat ); + pNewPattern = const_cast<ScPatternAttr*>(static_cast<const ScPatternAttr*>( &pPool->Put( *pNewPat ) )); + pOldPattern = const_cast<ScPatternAttr*>(static_cast<const ScPatternAttr*>( &pPool->Put( *pOldPat ) )); + pApplyPattern = const_cast<ScPatternAttr*>(static_cast<const ScPatternAttr*>( &pPool->Put( *pApplyPat ) )); } ScUndoCursorAttr::~ScUndoCursorAttr() @@ -176,7 +176,7 @@ void ScUndoCursorAttr::Redo() void ScUndoCursorAttr::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->ApplySelectionPattern( *pApplyPattern ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->ApplySelectionPattern( *pApplyPattern ); } bool ScUndoCursorAttr::CanRepeat(SfxRepeatTarget& rTarget) const @@ -316,7 +316,7 @@ void ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget) if (rTarget.ISA(ScTabViewTarget)) { OUString aTemp = maNewString; - ((ScTabViewTarget&)rTarget).GetViewShell()->EnterDataAtCursor( aTemp ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->EnterDataAtCursor( aTemp ); } } @@ -561,7 +561,7 @@ void ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); if (bInsert) rViewShell.InsertPageBreak(bColumn, true); @@ -634,7 +634,7 @@ void ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); ScViewData& rViewData = rViewShell.GetViewData(); rViewData.GetDocShell()->SetPrintZoom( rViewData.GetTabNo(), nNewScale, nNewPages ); } @@ -718,7 +718,7 @@ void ScUndoThesaurus::Redo() void ScUndoThesaurus::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->DoThesaurus( true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DoThesaurus( true ); } bool ScUndoThesaurus::CanRepeat(SfxRepeatTarget& rTarget) const diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index e2baf7de8809..ddd57d1e37e0 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -223,7 +223,7 @@ void ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); if (bMake) rViewShell.MakeOutline( bColumns, true ); @@ -315,7 +315,7 @@ void ScUndoOutlineLevel::Redo() void ScUndoOutlineLevel::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->SelectLevel( bColumns, nLevel, true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->SelectLevel( bColumns, nLevel, true ); } bool ScUndoOutlineLevel::CanRepeat(SfxRepeatTarget& rTarget) const @@ -412,7 +412,7 @@ void ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); if (bShow) rViewShell.ShowMarkedOutlines( true ); @@ -503,7 +503,7 @@ void ScUndoRemoveAllOutlines::Redo() void ScUndoRemoveAllOutlines::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->RemoveAllOutlines( true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->RemoveAllOutlines( true ); } bool ScUndoRemoveAllOutlines::CanRepeat(SfxRepeatTarget& rTarget) const @@ -606,7 +606,7 @@ void ScUndoAutoOutline::Redo() void ScUndoAutoOutline::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->AutoOutline( true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->AutoOutline( true ); } bool ScUndoAutoOutline::CanRepeat(SfxRepeatTarget& rTarget) const @@ -1241,7 +1241,7 @@ void ScUndoImportData::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); SCTAB nDummy; ScImportParam aNewParam(aImportParam); @@ -1417,7 +1417,7 @@ void ScUndoRepeatDB::Redo() void ScUndoRepeatDB::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->RepeatDB( true ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->RepeatDB( true ); } bool ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index d120a7cad022..db8d941a90b4 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -160,7 +160,7 @@ void ScUndoInsertTab::Redo() void ScUndoInsertTab::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData().GetDispatcher(). + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData().GetDispatcher(). Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD); } @@ -255,7 +255,7 @@ void ScUndoInsertTables::Redo() void ScUndoInsertTables::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData().GetDispatcher(). + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData().GetDispatcher(). Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD); } @@ -414,7 +414,7 @@ void ScUndoDeleteTab::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ScTabViewShell* pViewShell = ((ScTabViewTarget&)rTarget).GetViewShell(); + ScTabViewShell* pViewShell = static_cast<ScTabViewTarget&>(rTarget).GetViewShell(); pViewShell->DeleteTable( pViewShell->GetViewData().GetTabNo(), true ); } } @@ -868,7 +868,7 @@ void ScUndoMakeScenario::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) { - ((ScTabViewTarget&)rTarget).GetViewShell()->MakeScenario( aName, aComment, aColor, nFlags ); + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->MakeScenario( aName, aComment, aColor, nFlags ); } } @@ -1024,7 +1024,7 @@ void ScUndoImportTab::Redo() void ScUndoImportTab::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData().GetDispatcher(). + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData().GetDispatcher(). Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD); } @@ -1158,7 +1158,7 @@ void ScUndoShowHideTab::Redo() void ScUndoShowHideTab::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData().GetDispatcher(). + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData().GetDispatcher(). Execute( bShow ? FID_TABLE_SHOW : FID_TABLE_HIDE, SfxCallMode::SLOT | SfxCallMode::RECORD); } @@ -1485,7 +1485,7 @@ SdrObject* ScUndoRenameObject::GetObject() while (pObject) { if ( pObject->GetObjIdentifier() == OBJ_OLE2 && - ((SdrOle2Obj*)pObject)->GetPersistName() == aPersistName ) + static_cast<SdrOle2Obj*>(pObject)->GetPersistName() == aPersistName ) { return pObject; } @@ -1565,7 +1565,7 @@ void ScUndoLayoutRTL::Redo() void ScUndoLayoutRTL::Repeat(SfxRepeatTarget& rTarget) { if (rTarget.ISA(ScTabViewTarget)) - ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData().GetDispatcher(). + static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData().GetDispatcher(). Execute( FID_TAB_RTL, SfxCallMode::SLOT | SfxCallMode::RECORD); } diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index bf6d3f552745..cf927611a8c1 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -799,9 +799,9 @@ uno::Any SAL_CALL ScAutoFormatFieldObj::getPropertyValue( const OUString& aPrope { case ATTR_STACKED: { - const SfxInt32Item* pRotItem = (const SfxInt32Item*)pData->GetItem( nFieldIndex, ATTR_ROTATE_VALUE ); + const SfxInt32Item* pRotItem = static_cast<const SfxInt32Item*>(pData->GetItem( nFieldIndex, ATTR_ROTATE_VALUE )); sal_Int32 nRot = pRotItem ? pRotItem->GetValue() : 0; - bool bStacked = ((const SfxBoolItem*)pItem)->GetValue(); + bool bStacked = static_cast<const SfxBoolItem*>(pItem)->GetValue(); SvxOrientationItem( nRot, bStacked, 0 ).QueryValue( aVal ); } break; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 67aa0ea25808..9280d96418ed 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1531,7 +1531,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint ) { if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) ) { - const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint; + const ScUpdateRefHint& rRef = static_cast<const ScUpdateRefHint&>(rHint); ScDocument& rDoc = pDocShell->GetDocument(); boost::scoped_ptr<ScRangeList> pUndoRanges; @@ -1571,7 +1571,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint ) } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId(); if ( nId == SFX_HINT_DYING ) { ForgetCurrentAttrs(); @@ -2018,10 +2018,10 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const OUString& aPropert { case ATTR_VALUE_FORMAT: // default has no language set - aAny <<= (sal_Int32)( ((const SfxUInt32Item&)rSet.Get(pEntry->nWID)).GetValue() ); + aAny <<= (sal_Int32)( static_cast<const SfxUInt32Item&>(rSet.Get(pEntry->nWID)).GetValue() ); break; case ATTR_INDENT: - aAny <<= (sal_Int16)( TwipsToHMM(((const SfxUInt16Item&) + aAny <<= (sal_Int16)( TwipsToHMM(static_cast<const SfxUInt16Item&>( rSet.Get(pEntry->nWID)).GetValue()) ); break; default: @@ -2048,12 +2048,12 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const OUString& aPropert { if (pEntry->nWID == SC_WID_UNO_TBLBORD2) ScHelperFunctions::AssignTableBorder2ToAny( aAny, - (const SvxBoxItem&)pPattern->GetItem(ATTR_BORDER), - (const SvxBoxInfoItem&)pPattern->GetItem(ATTR_BORDER_INNER) ); + static_cast<const SvxBoxItem&>(pPattern->GetItem(ATTR_BORDER)), + static_cast<const SvxBoxInfoItem&>(pPattern->GetItem(ATTR_BORDER_INNER)) ); else ScHelperFunctions::AssignTableBorderToAny( aAny, - (const SvxBoxItem&)pPattern->GetItem(ATTR_BORDER), - (const SvxBoxInfoItem&)pPattern->GetItem(ATTR_BORDER_INNER) ); + static_cast<const SvxBoxItem&>(pPattern->GetItem(ATTR_BORDER)), + static_cast<const SvxBoxInfoItem&>(pPattern->GetItem(ATTR_BORDER_INNER)) ); } } break; @@ -2122,8 +2122,8 @@ static void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const { // language for number formats SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); - sal_uLong nOldFormat = ((const SfxUInt32Item&)rSet.Get( ATTR_VALUE_FORMAT )).GetValue(); - LanguageType eOldLang = ((const SvxLanguageItem&)rSet.Get( ATTR_LANGUAGE_FORMAT )).GetLanguage(); + sal_uLong nOldFormat = static_cast<const SfxUInt32Item&>(rSet.Get( ATTR_VALUE_FORMAT )).GetValue(); + LanguageType eOldLang = static_cast<const SvxLanguageItem&>(rSet.Get( ATTR_LANGUAGE_FORMAT )).GetLanguage(); nOldFormat = pFormatter->GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang ); sal_Int32 nIntVal = 0; @@ -2451,9 +2451,9 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE { ScDocument& rDoc = pDocShell->GetDocument(); - sal_uLong nOldFormat = ((const SfxUInt32Item&) + sal_uLong nOldFormat = static_cast<const SfxUInt32Item&>( pDataSet->Get( ATTR_VALUE_FORMAT )).GetValue(); - LanguageType eOldLang = ((const SvxLanguageItem&) + LanguageType eOldLang = static_cast<const SvxLanguageItem&>( pDataSet->Get( ATTR_LANGUAGE_FORMAT )).GetLanguage(); nOldFormat = rDoc.GetFormatTable()-> GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang ); @@ -2461,13 +2461,13 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE } break; case ATTR_INDENT: - rAny <<= (sal_Int16)( TwipsToHMM(((const SfxUInt16Item&) + rAny <<= (sal_Int16)( TwipsToHMM(static_cast<const SfxUInt16Item&>( pDataSet->Get(pEntry->nWID)).GetValue()) ); break; case ATTR_STACKED: { - sal_Int32 nRot = ((const SfxInt32Item&)pDataSet->Get(ATTR_ROTATE_VALUE)).GetValue(); - bool bStacked = ((const SfxBoolItem&)pDataSet->Get(pEntry->nWID)).GetValue(); + sal_Int32 nRot = static_cast<const SfxInt32Item&>(pDataSet->Get(ATTR_ROTATE_VALUE)).GetValue(); + bool bStacked = static_cast<const SfxBoolItem&>(pDataSet->Get(pEntry->nWID)).GetValue(); SvxOrientationItem( nRot, bStacked, 0 ).QueryValue( rAny ); } break; @@ -2531,7 +2531,7 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE formula::FormulaGrammar::Grammar eGrammar = (bXML ? rDoc.GetStorageGrammar() : formula::FormulaGrammar::mapAPItoGrammar( bEnglish, bXML)); - const std::vector<sal_uInt32>& rIndex = ((const ScCondFormatItem&) + const std::vector<sal_uInt32>& rIndex = static_cast<const ScCondFormatItem&>( pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData(); sal_uLong nIndex = 0; if(!rIndex.empty()) @@ -2554,7 +2554,7 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE formula::FormulaGrammar::Grammar eGrammar = (bXML ? rDoc.GetStorageGrammar() : formula::FormulaGrammar::mapAPItoGrammar( bEnglish, bXML)); - sal_uLong nIndex = ((const SfxUInt32Item&) + sal_uLong nIndex = static_cast<const SfxUInt32Item&>( pPattern->GetItem(ATTR_VALIDDATA)).GetValue(); rAny <<= uno::Reference<beans::XPropertySet>( new ScTableValidationObj( &rDoc, nIndex, eGrammar )); @@ -2750,7 +2750,7 @@ void SAL_CALL ScCellRangesBase::firePropertiesChangeEvent( const uno::Sequence< IMPL_LINK( ScCellRangesBase, ValueListenerHdl, SfxHint*, pHint ) { if ( pDocShell && pHint && dynamic_cast<const SfxSimpleHint*>(pHint) && - (((const SfxSimpleHint*)pHint)->GetId() & SC_HINT_DATACHANGED)) + (static_cast<const SfxSimpleHint*>(pHint)->GetId() & SC_HINT_DATACHANGED)) { // This may be called several times for a single change, if several formulas // in the range are notified. So only a flag is set that is checked when @@ -3533,7 +3533,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC { // Date/Time Erkennung - sal_uLong nIndex = (sal_uLong)((SfxUInt32Item*)rDoc.GetAttr( + sal_uLong nIndex = (sal_uLong)static_cast<const SfxUInt32Item*>(rDoc.GetAttr( aIter.GetPos(), ATTR_VALUE_FORMAT))->GetValue(); short nTyp = rDoc.GetFormatTable()->GetType(nIndex); if ((nTyp == NUMBERFORMAT_DATE) || (nTyp == NUMBERFORMAT_TIME) || @@ -4734,7 +4734,7 @@ uno::Reference<table::XCellRange> ScCellRangeObj::CreateRangeFromDoc( ScDocument { SfxObjectShell* pObjSh = pDoc->GetDocumentShell(); if ( pObjSh && pObjSh->ISA(ScDocShell) ) - return new ScCellRangeObj( (ScDocShell*) pObjSh, rR ); + return new ScCellRangeObj( static_cast<ScDocShell*>(pObjSh), rR ); return NULL; } @@ -7652,7 +7652,7 @@ void SAL_CALL ScTableSheetObj::link( const OUString& aUrl, const OUString& aShee ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; if (pBase->ISA(ScTableLink)) { - ScTableLink* pTabLink = (ScTableLink*)pBase; + ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase); if ( aFileString.equals(pTabLink->GetFileName()) ) pTabLink->Update(); // inkl. Paint&Undo @@ -9008,12 +9008,12 @@ void ScCellsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) { if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) ) { - const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint; + const ScUpdateRefHint& rRef = static_cast<const ScUpdateRefHint&>(rHint); aRanges.UpdateReference( rRef.GetMode(), &pDocShell->GetDocument(), rRef.GetRange(), rRef.GetDx(), rRef.GetDy(), rRef.GetDz() ); } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && - ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) + static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { pDocShell = NULL; // ungueltig geworden } @@ -9698,7 +9698,7 @@ void ScUniqueCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHi } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId(); if ( nId == SFX_HINT_DYING ) pDocShell = NULL; // ungueltig geworden } diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 15495c4c77d6..cad19eeaa308 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2899,7 +2899,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint if ( m_pDocument->HasUnoRefUndo() ) pUndoRanges.reset(new ScRangeList(aRanges)); - const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint; + const ScUpdateRefHint& rRef = static_cast<const ScUpdateRefHint&>(rHint); bool bChanged = aRanges.UpdateReference( rRef.GetMode(), m_pDocument, rRef.GetRange(), rRef.GetDx(), rRef.GetDy(), rRef.GetDz()); @@ -2951,7 +2951,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint IMPL_LINK( ScChart2DataSequence, ValueListenerHdl, SfxHint*, pHint ) { if ( m_pDocument && pHint && dynamic_cast<const SfxSimpleHint*>(pHint) && - ((const SfxSimpleHint*)pHint)->GetId() & SC_HINT_DATACHANGED) + static_cast<const SfxSimpleHint*>(pHint)->GetId() & SC_HINT_DATACHANGED) { // This may be called several times for a single change, if several formulas // in the range are notified. So only a flag is set that is checked when diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index c20fcfc98fb6..346092e3d84e 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -71,12 +71,12 @@ static SdrOle2Obj* lcl_FindChartObj( ScDocShell* pDocShell, SCTAB nTab, const OU { if ( pObject->GetObjIdentifier() == OBJ_OLE2 && rDoc.IsChart(pObject) ) { - uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)pObject)->GetObjRef(); + uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObject)->GetObjRef(); if ( xObj.is() ) { OUString aObjName = pDocShell->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xObj ); if ( aObjName == rName ) - return (SdrOle2Obj*)pObject; + return static_cast<SdrOle2Obj*>(pObject); } } pObject = aIter.Next(); @@ -135,7 +135,7 @@ ScChartObj* ScChartsObj::GetObjectByIndex_Impl(long nIndex) const { if ( nPos == nIndex ) { - uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)pObject)->GetObjRef(); + uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObject)->GetObjRef(); if ( xObj.is() ) aName = pDocShell->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xObj ); break; // nicht weitersuchen @@ -415,7 +415,7 @@ uno::Sequence<OUString> SAL_CALL ScChartsObj::getElementNames() throw(uno::Runti if ( pObject->GetObjIdentifier() == OBJ_OLE2 && rDoc.IsChart(pObject) ) { OUString aName; - uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)pObject)->GetObjRef(); + uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObject)->GetObjRef(); if ( xObj.is() ) aName = pDocShell->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xObj ); diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 540771da77fc..1f10bc6f3a68 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -1670,7 +1670,7 @@ void ScDatabaseRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const ScDBRangeRefreshedHint*>(&rHint) ) { ScDBData* pDBData = GetDBData_Impl(); - const ScDBRangeRefreshedHint& rRef = (const ScDBRangeRefreshedHint&)rHint; + const ScDBRangeRefreshedHint& rRef = static_cast<const ScDBRangeRefreshedHint&>(rHint); ScImportParam aParam; pDBData->GetImportParam(aParam); if (aParam == rRef.GetImportParam()) diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index f553e5153923..db2a626175a0 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -645,7 +645,7 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } else if ( dynamic_cast<const ScPointerChangedHint*>(&rHint) ) { - sal_uInt16 nFlags = ((const ScPointerChangedHint&)rHint).GetFlags(); + sal_uInt16 nFlags = static_cast<const ScPointerChangedHint&>(rHint).GetFlags(); if (nFlags & SC_POINTERCHANGED_NUMFMT) { // NumberFormatter-Pointer am Uno-Objekt neu setzen @@ -2962,7 +2962,7 @@ void ScTableColumnsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) //! Referenz-Update fuer Tab und Start/Ende } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && - ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) + static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { pDocShell = NULL; // ungueltig geworden } @@ -3230,7 +3230,7 @@ void ScTableRowsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) //! Referenz-Update fuer Tab und Start/Ende } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && - ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) + static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { pDocShell = NULL; // ungueltig geworden } @@ -3693,7 +3693,7 @@ void ScScenariosObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) //! Referenz-Update fuer Tab und Start/Ende } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && - ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) + static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { pDocShell = NULL; // ungueltig geworden } diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx index ff9d594f43b3..892708d78fb1 100644 --- a/sc/source/ui/unoobj/editsrc.cxx +++ b/sc/source/ui/unoobj/editsrc.cxx @@ -202,7 +202,7 @@ void ScAnnotationEditSource::Notify( SfxBroadcaster&, const SfxHint& rHint ) } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId(); if ( nId == SFX_HINT_DYING ) { pDocShell = NULL; // ungueltig geworden diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index e8afa40eab5b..4b43f7405a87 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -318,7 +318,7 @@ void ScCellFieldsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) //! Ref-Update } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && - ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) + static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { pDocShell = NULL; // ungueltig geworden } diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index 1bc5987038ca..df41763763ff 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -101,7 +101,7 @@ void ScSheetLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) } else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) ) { - const ScLinkRefreshedHint& rLH = (const ScLinkRefreshedHint&) rHint; + const ScLinkRefreshedHint& rLH = static_cast<const ScLinkRefreshedHint&>(rHint); if ( rLH.GetLinkType() == SC_LINKREFTYPE_SHEET && rLH.GetUrl() == aFileName ) Refreshed_Impl(); } @@ -118,7 +118,7 @@ ScTableLink* ScSheetLinkObj::GetLink_Impl() const ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; if (pBase->ISA(ScTableLink)) { - ScTableLink* pTabLink = (ScTableLink*)pBase; + ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase); if ( pTabLink->GetFileName().equals(aFileName) ) return pTabLink; } @@ -630,7 +630,7 @@ void ScAreaLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) } else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) ) { - const ScLinkRefreshedHint& rLH = (const ScLinkRefreshedHint&) rHint; + const ScLinkRefreshedHint& rLH = static_cast<const ScLinkRefreshedHint&>(rHint); if ( rLH.GetLinkType() == SC_LINKREFTYPE_AREA ) { // get this link to compare dest position @@ -1076,7 +1076,7 @@ void ScDDELinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) } else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) ) { - const ScLinkRefreshedHint& rLH = (const ScLinkRefreshedHint&) rHint; + const ScLinkRefreshedHint& rLH = static_cast<const ScLinkRefreshedHint&>(rHint); if ( rLH.GetLinkType() == SC_LINKREFTYPE_DDE && rLH.GetDdeAppl() == aAppl && rLH.GetDdeTopic() == aTopic && diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx index c3b8701fa6c8..e74c770a3564 100644 --- a/sc/source/ui/unoobj/notesuno.cxx +++ b/sc/source/ui/unoobj/notesuno.cxx @@ -86,7 +86,7 @@ void ScAnnotationObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) //! Ref-Update } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && - ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) + static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING ) { pDocShell = NULL; // ungueltig geworden } diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index 2d2643375896..482a5d318c77 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -336,7 +336,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const SdrObject *pObj = GetSdrObject(); if (pObj) { - ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel(); + ScDrawLayer* pModel = static_cast<ScDrawLayer*>(pObj->GetModel()); SdrPage* pPage = pObj->GetPage(); if ( pModel && pPage ) { @@ -346,7 +346,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const SfxObjectShell* pObjSh = pDoc->GetDocumentShell(); if ( pObjSh && pObjSh->ISA(ScDocShell) ) { - ScDocShell* pDocSh = (ScDocShell*)pObjSh; + ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh); SCTAB nTab = 0; if ( lcl_GetPageNum( pPage, *pModel, nTab ) ) @@ -468,7 +468,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const SdrObject *pObj = GetSdrObject(); if (pObj) { - ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel(); + ScDrawLayer* pModel = static_cast<ScDrawLayer*>(pObj->GetModel()); SdrPage* pPage = pObj->GetPage(); if ( pModel && pPage ) { @@ -481,7 +481,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const SfxObjectShell* pObjSh = pDoc->GetDocumentShell(); if ( pObjSh && pObjSh->ISA(ScDocShell) ) { - ScDocShell* pDocSh = (ScDocShell*)pObjSh; + ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh); uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY ); if (xShape.is()) { @@ -566,7 +566,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const SdrObject *pObj = GetSdrObject(); if (pObj) { - ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel(); + ScDrawLayer* pModel = static_cast<ScDrawLayer*>(pObj->GetModel()); SdrPage* pPage = pObj->GetPage(); if ( pModel && pPage ) { @@ -579,7 +579,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const SfxObjectShell* pObjSh = pDoc->GetDocumentShell(); if ( pObjSh && pObjSh->ISA(ScDocShell) ) { - ScDocShell* pDocSh = (ScDocShell*)pObjSh; + ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh); uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY ); if (xShape.is()) { @@ -665,7 +665,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) SdrObject *pObj = GetSdrObject(); if (pObj) { - ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel(); + ScDrawLayer* pModel = static_cast<ScDrawLayer*>(pObj->GetModel()); SdrPage* pPage = pObj->GetPage(); if ( pModel && pPage ) { @@ -678,7 +678,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) SfxObjectShell* pObjSh = pDoc->GetDocumentShell(); if ( pObjSh && pObjSh->ISA(ScDocShell) ) { - ScDocShell* pDocSh = (ScDocShell*)pObjSh; + ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh); uno::Reference< uno::XInterface > xAnchor; if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjDataTab(pObj, nTab)) xAnchor.set(static_cast<cppu::OWeakObject*>(new ScCellObj( pDocSh, pAnchor->maStart))); @@ -713,7 +713,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) SdrObject *pObj = GetSdrObject(); if (pObj) { - ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel(); + ScDrawLayer* pModel = static_cast<ScDrawLayer*>(pObj->GetModel()); SdrPage* pPage = pObj->GetPage(); if ( pModel && pPage ) { @@ -772,7 +772,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) SdrObject *pObj = GetSdrObject(); if (pObj) { - ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel(); + ScDrawLayer* pModel = static_cast<ScDrawLayer*>(pObj->GetModel()); SdrPage* pPage = pObj->GetPage(); if ( pModel && pPage ) { @@ -1025,7 +1025,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScShapeObj::getAnchor() SdrObject* pObj = GetSdrObject(); if( pObj ) { - ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel(); + ScDrawLayer* pModel = static_cast<ScDrawLayer*>(pObj->GetModel()); SdrPage* pPage = pObj->GetPage(); if ( pModel ) { @@ -1035,7 +1035,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScShapeObj::getAnchor() SfxObjectShell* pObjSh = pDoc->GetDocumentShell(); if ( pObjSh && pObjSh->ISA(ScDocShell) ) { - ScDocShell* pDocSh = (ScDocShell*)pObjSh; + ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh); SCTAB nTab = 0; if ( lcl_GetPageNum( pPage, *pModel, nTab ) ) @@ -1285,7 +1285,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScShapeObj::getParent() throw (uno::R SdrObject* pObj = GetSdrObject(); if( pObj ) { - ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel(); + ScDrawLayer* pModel = static_cast<ScDrawLayer*>(pObj->GetModel()); SdrPage* pPage = pObj->GetPage(); if ( pModel ) { @@ -1295,7 +1295,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScShapeObj::getParent() throw (uno::R SfxObjectShell* pObjSh = pDoc->GetDocumentShell(); if ( pObjSh && pObjSh->ISA(ScDocShell) ) { - ScDocShell* pDocSh = (ScDocShell*)pObjSh; + ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh); SCTAB nTab = 0; if ( lcl_GetPageNum( pPage, *pModel, nTab ) ) diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index d06f68bd1115..8283657b538b 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1187,13 +1187,13 @@ const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const OUString& rPropName, if ( pEntry ) // only item-wids in header/footer map { rpResultEntry = pEntry; - return &((const SvxSetItem&)pStyle->GetItemSet().Get(ATTR_PAGE_HEADERSET)).GetItemSet(); + return &static_cast<const SvxSetItem&>(pStyle->GetItemSet().Get(ATTR_PAGE_HEADERSET)).GetItemSet(); } pEntry = lcl_GetFooterStyleMap()->getByName( rPropName ); if ( pEntry ) // only item-wids in header/footer map { rpResultEntry = pEntry; - return &((const SvxSetItem&)pStyle->GetItemSet().Get(ATTR_PAGE_FOOTERSET)).GetItemSet(); + return &static_cast<const SvxSetItem&>(pStyle->GetItemSet().Get(ATTR_PAGE_FOOTERSET)).GetItemSet(); } } pEntry = pPropSet->getPropertyMap().getByName( rPropName ); @@ -1310,26 +1310,26 @@ uno::Any SAL_CALL ScStyleObj::getPropertyDefault( const OUString& aPropertyName { case ATTR_VALUE_FORMAT: // default has no language set - aAny <<= sal_Int32( ((const SfxUInt32Item&)pItemSet->Get(nWhich)).GetValue() ); + aAny <<= sal_Int32( static_cast<const SfxUInt32Item&>(pItemSet->Get(nWhich)).GetValue() ); break; case ATTR_INDENT: - aAny <<= sal_Int16( TwipsToHMM(((const SfxUInt16Item&) + aAny <<= sal_Int16( TwipsToHMM(static_cast<const SfxUInt16Item&>( pItemSet->Get(nWhich)).GetValue()) ); break; case ATTR_PAGE_SCALE: case ATTR_PAGE_SCALETOPAGES: case ATTR_PAGE_FIRSTPAGENO: - aAny <<= sal_Int16( ((const SfxUInt16Item&)pItemSet->Get(nWhich)).GetValue() ); + aAny <<= sal_Int16( static_cast<const SfxUInt16Item&>(pItemSet->Get(nWhich)).GetValue() ); break; case ATTR_PAGE_CHARTS: case ATTR_PAGE_OBJECTS: case ATTR_PAGE_DRAWINGS: //! sal_Bool-MID fuer ScViewObjectModeItem definieren? - aAny <<= ((const ScViewObjectModeItem&)pItemSet->Get(nWhich)).GetValue() == VOBJ_MODE_SHOW; + aAny <<= static_cast<const ScViewObjectModeItem&>(pItemSet->Get(nWhich)).GetValue() == VOBJ_MODE_SHOW; break; case ATTR_PAGE_SCALETO: { - const ScPageScaleToItem aItem((const ScPageScaleToItem&)pItemSet->Get(nWhich)); + const ScPageScaleToItem aItem(static_cast<const ScPageScaleToItem&>(pItemSet->Get(nWhich))); if ( aPropertyName == SC_UNO_PAGE_SCALETOX ) aAny = uno::makeAny(static_cast<sal_Int16>(aItem.GetWidth())); else @@ -1570,7 +1570,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt const SfxItemPropertySimpleEntry* pHeaderEntry = lcl_GetHeaderStyleMap()->getByName( rPropertyName ); if ( pHeaderEntry ) // only item-wids in header/footer map { - SvxSetItem aNewHeader( (const SvxSetItem&)rSet.Get(ATTR_PAGE_HEADERSET) ); + SvxSetItem aNewHeader( static_cast<const SvxSetItem&>(rSet.Get(ATTR_PAGE_HEADERSET)) ); if (pValue) pPropSet->setPropertyValue( *pHeaderEntry, *pValue, aNewHeader.GetItemSet() ); else @@ -1584,7 +1584,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt const SfxItemPropertySimpleEntry* pFooterEntry = lcl_GetFooterStyleMap()->getByName( rPropertyName ); if ( pFooterEntry ) // only item-wids in header/footer map { - SvxSetItem aNewFooter( (const SvxSetItem&)rSet.Get(ATTR_PAGE_FOOTERSET) ); + SvxSetItem aNewFooter( static_cast<const SvxSetItem&>(rSet.Get(ATTR_PAGE_FOOTERSET)) ); if (pValue) pPropSet->setPropertyValue( *pFooterEntry, *pValue, aNewFooter.GetItemSet() ); else @@ -1609,9 +1609,9 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt // language for number formats SvNumberFormatter* pFormatter = pDocShell->GetDocument().GetFormatTable(); - sal_uInt32 nOldFormat = ((const SfxUInt32Item&) + sal_uInt32 nOldFormat = static_cast<const SfxUInt32Item&>( rSet.Get( ATTR_VALUE_FORMAT )).GetValue(); - LanguageType eOldLang = ((const SvxLanguageItem&) + LanguageType eOldLang = static_cast<const SvxLanguageItem&>( rSet.Get( ATTR_LANGUAGE_FORMAT )).GetLanguage(); nOldFormat = pFormatter-> GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang ); @@ -1744,7 +1744,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt sal_Int16 nPages = 0; if (*pValue >>= nPages) { - ScPageScaleToItem aItem = ((const ScPageScaleToItem&)rSet.Get(ATTR_PAGE_SCALETO)); + ScPageScaleToItem aItem = static_cast<const ScPageScaleToItem&>(rSet.Get(ATTR_PAGE_SCALETO)); if ( rPropertyName == SC_UNO_PAGE_SCALETOX ) aItem.SetWidth(static_cast<sal_uInt16>(nPages)); else @@ -1888,9 +1888,9 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName ) case ATTR_VALUE_FORMAT: if ( pDocShell ) { - sal_uInt32 nOldFormat = ((const SfxUInt32Item&) + sal_uInt32 nOldFormat = static_cast<const SfxUInt32Item&>( pItemSet->Get( ATTR_VALUE_FORMAT )).GetValue(); - LanguageType eOldLang = ((const SvxLanguageItem&) + LanguageType eOldLang = static_cast<const SvxLanguageItem&>( pItemSet->Get( ATTR_LANGUAGE_FORMAT )).GetLanguage(); nOldFormat = pDocShell->GetDocument().GetFormatTable()-> GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang ); @@ -1898,32 +1898,32 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName ) } break; case ATTR_INDENT: - aAny <<= sal_Int16( TwipsToHMM(((const SfxUInt16Item&) + aAny <<= sal_Int16( TwipsToHMM(static_cast<const SfxUInt16Item&>( pItemSet->Get(nWhich)).GetValue()) ); break; case ATTR_STACKED: { - sal_Int32 nRot = ((const SfxInt32Item&)pItemSet->Get(ATTR_ROTATE_VALUE)).GetValue(); - bool bStacked = ((const SfxBoolItem&)pItemSet->Get(nWhich)).GetValue(); + sal_Int32 nRot = static_cast<const SfxInt32Item&>(pItemSet->Get(ATTR_ROTATE_VALUE)).GetValue(); + bool bStacked = static_cast<const SfxBoolItem&>(pItemSet->Get(nWhich)).GetValue(); SvxOrientationItem( nRot, bStacked, 0 ).QueryValue( aAny ); } break; case ATTR_PAGE_SCALE: case ATTR_PAGE_SCALETOPAGES: case ATTR_PAGE_FIRSTPAGENO: - aAny <<= sal_Int16( ((const SfxUInt16Item&)pItemSet->Get(nWhich)).GetValue() ); + aAny <<= sal_Int16( static_cast<const SfxUInt16Item&>(pItemSet->Get(nWhich)).GetValue() ); break; case ATTR_PAGE_CHARTS: case ATTR_PAGE_OBJECTS: case ATTR_PAGE_DRAWINGS: //! sal_Bool-MID fuer ScViewObjectModeItem definieren? - aAny <<= ((const ScViewObjectModeItem&)pItemSet->Get(nWhich)).GetValue() == VOBJ_MODE_SHOW; + aAny <<= static_cast<const ScViewObjectModeItem&>(pItemSet->Get(nWhich)).GetValue() == VOBJ_MODE_SHOW; break; case ATTR_PAGE_PAPERBIN: { // property PrinterPaperTray is the name of the tray - sal_uInt8 nValue = ((const SvxPaperBinItem&)pItemSet->Get(nWhich)).GetValue(); + sal_uInt8 nValue = static_cast<const SvxPaperBinItem&>(pItemSet->Get(nWhich)).GetValue(); OUString aName; if ( nValue == PAPERBIN_PRINTER_SETTINGS ) aName = OUString(SC_PAPERBIN_DEFAULTNAME ); @@ -1938,7 +1938,7 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName ) break; case ATTR_PAGE_SCALETO: { - ScPageScaleToItem aItem((const ScPageScaleToItem&)pItemSet->Get(ATTR_PAGE_SCALETO)); + ScPageScaleToItem aItem(static_cast<const ScPageScaleToItem&>(pItemSet->Get(ATTR_PAGE_SCALETO))); if ( aPropertyName == SC_UNO_PAGE_SCALETOX ) aAny = uno::makeAny(static_cast<sal_Int16>(aItem.GetWidth())); else diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 841f6fa6311d..e7d9c6e47997 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -209,7 +209,7 @@ SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder() // -> use global pool from module SfxItemSet aDefaults( pHdrEngine->GetEmptyItemSet() ); - const ScPatternAttr& rPattern = (const ScPatternAttr&)SC_MOD()->GetPool().GetDefaultItem(ATTR_PATTERN); + const ScPatternAttr& rPattern = static_cast<const ScPatternAttr&>(SC_MOD()->GetPool().GetDefaultItem(ATTR_PATTERN)); rPattern.FillEditItemSet( &aDefaults ); // FillEditItemSet adjusts font height to 1/100th mm, // but for header/footer twips is needed, as in the PatternAttr: @@ -1029,7 +1029,7 @@ void ScCellTextData::Notify( SfxBroadcaster&, const SfxHint& rHint ) } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) ) { - sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId(); + sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId(); if ( nId == SFX_HINT_DYING ) { pDocShell = NULL; // invalid now diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index 764800fce1cf..db4769f89dc3 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -386,7 +386,7 @@ awt::Rectangle ScViewPaneBase::GetVisArea() const ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ? pViewShell->GetViewData().GetActivePart() : (ScSplitPos) nPane; - ScGridWindow* pWindow = (ScGridWindow*)pViewShell->GetWindowByPos(eWhich); + ScGridWindow* pWindow = static_cast<ScGridWindow*>(pViewShell->GetWindowByPos(eWhich)); ScDocument* pDoc = pViewShell->GetViewData().GetDocument(); if (pWindow && pDoc) { |