diff options
author | Oliver Specht <oliver.specht@cib.de> | 2015-09-30 16:10:07 +0200 |
---|---|---|
committer | Oliver Specht <oliver.specht@cib.de> | 2015-10-06 07:29:37 +0000 |
commit | 89d39bc100aabf5dccbe77c0b5c0c85736e85b39 (patch) | |
tree | 871a91210913ecee91530c95392534bf18f80f3f /sw/source/ui | |
parent | 32b9901dae7403453d773f5904de15551a323595 (diff) |
tdf#94559: 4th step to remove rtti.hxx
replaced use of PTR_CAST, IS_TYPE, ISA in
idl, editeng, sc, sd, sw, sfx2, sot, starmath
Change-Id: I4a5bba4fdc4829099618c09b690c83f876a3d653
Reviewed-on: https://gerrit.libreoffice.org/19132
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/dialog/docstdlg.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldtdlg.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/fmtui/tmpdlg.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/misc/docfnote.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/misc/num.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/table/colwd.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/table/rowht.cxx | 4 |
9 files changed, 20 insertions, 22 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 4b672fb64f51..c4ec368b83d2 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1947,13 +1947,12 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* ) nOldMarkMode != pOpt->GetMarkAlignMode()) { // update all documents - TypeId aType(TYPE(SwDocShell)); - SwDocShell* pDocShell = static_cast<SwDocShell*>(SfxObjectShell::GetFirst(&aType)); + SwDocShell* pDocShell = static_cast<SwDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<SwDocShell>)); while( pDocShell ) { pDocShell->GetWrtShell()->UpdateRedlineAttr(); - pDocShell = static_cast<SwDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType)); + pDocShell = static_cast<SwDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<SwDocShell>)); } } diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx index 1744d261c699..18adafa64d49 100644 --- a/sw/source/ui/dialog/docstdlg.cxx +++ b/sw/source/ui/dialog/docstdlg.cxx @@ -122,9 +122,9 @@ void SwDocStatPage::Update() { SfxViewShell *pVSh = SfxViewShell::Current(); SwViewShell *pSh = 0; - if ( pVSh->ISA(SwView) ) + if ( dynamic_cast< const SwView *>( pVSh ) != nullptr ) pSh = static_cast<SwView*>(pVSh)->GetWrtShellPtr(); - else if ( pVSh->ISA(SwPagePreview) ) + else if ( dynamic_cast< const SwPagePreview *>( pVSh ) != nullptr ) pSh = static_cast<SwPagePreview*>(pVSh)->GetViewShell(); OSL_ENSURE( pSh, "Shell not found" ); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index a03d382ce7ee..ab0a489f1d5a 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -340,7 +340,7 @@ SwEditRegionDlg::SwEditRegionDlg( vcl::Window* pParent, SwWrtShell& rWrtSh ) get(m_pDismiss, "remove"); get(m_pOK, "ok"); - bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() ); + bWeb = dynamic_cast<SwWebDocShell*>( rSh.GetView().GetDocShell() ) != nullptr; m_pTree->SetSelectHdl(LINK(this, SwEditRegionDlg, GetFirstEntryHdl)); m_pTree->SetDeselectHdl(LINK(this, SwEditRegionDlg, DeselectHdl)); @@ -1419,7 +1419,7 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog( SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get(); long nHtmlMode = rHtmlOpt.GetExportMode(); - bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() ); + bool bWeb = dynamic_cast<SwWebDocShell*>( rSh.GetView().GetDocShell() ) != nullptr ; if(bWeb) { RemoveTabPage(m_nNotePageId); @@ -1574,7 +1574,7 @@ void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh) { m_pWrtSh = &rSh; - bool bWeb = 0 != PTR_CAST(SwWebDocShell, m_pWrtSh->GetView().GetDocShell()); + bool bWeb = dynamic_cast<SwWebDocShell*>( m_pWrtSh->GetView().GetDocShell() )!= nullptr; if(bWeb) { m_pHideCB->Hide(); @@ -2099,7 +2099,7 @@ SwSectionPropertyTabDialog::SwSectionPropertyTabDialog( SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get(); long nHtmlMode = rHtmlOpt.GetExportMode(); - bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() ); + bool bWeb = dynamic_cast<SwWebDocShell*>( rSh.GetView().GetDocShell() ) != nullptr ; if(bWeb) { RemoveTabPage(m_nNotePageId); diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx index 87d9b1cb2157..e0f3d9b94fe7 100644 --- a/sw/source/ui/fldui/fldtdlg.cxx +++ b/sw/source/ui/fldui/fldtdlg.cxx @@ -308,11 +308,10 @@ void SwFieldDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) SfxViewFrame* pViewFrame = pDispatch ? pDispatch->GetFrame() : 0; if(pViewFrame) { - const TypeId aSwViewTypeId = TYPE(SwView); - SfxViewShell* pViewShell = SfxViewShell::GetFirst( &aSwViewTypeId ); + SfxViewShell* pViewShell = SfxViewShell::GetFirst( true, checkSfxViewShell<SwView> ); while(pViewShell && pViewShell->GetViewFrame() != pViewFrame) { - pViewShell = SfxViewShell::GetNext( *pViewShell, &aSwViewTypeId ); + pViewShell = SfxViewShell::GetNext( *pViewShell, true, checkSfxViewShell<SwView> ); } if(pViewShell) static_cast<SwFieldDBPage&>(rPage).SetWrtShell(static_cast<SwView*>(pViewShell)->GetWrtShell()); diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index d344cd8ca3b5..5463e135a3f8 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -538,14 +538,14 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) aList.push_back( rCharFormatLB->GetEntry(j) ); aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ; - FieldUnit eMetric = ::GetDfltMetric(pDocShell->ISA(SwWebDocShell)); + FieldUnit eMetric = ::GetDfltMetric(dynamic_cast< const SwWebDocShell *>( pDocShell ) != nullptr); aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric))); rPage.PageCreated(aSet); } else if (nId == m_nNumPosId) { SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell(); - FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell)); + FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebDocShell*>( pDocShell) != nullptr ); aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric))); rPage.PageCreated(aSet); diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index cdea464d6b50..589c55fa0ac3 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -149,7 +149,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet* ) : new SwFootnoteInfo( pSh->GetFootnoteInfo() )); SfxObjectShell * pDocSh = SfxObjectShell::Current(); - if (PTR_CAST(SwWebDocShell, pDocSh)) + if (dynamic_cast<SwWebDocShell*>( pDocSh) ) m_pStylesContainer->Hide(); if ( bEndNote ) diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 8636c8e2b144..6d7a370dd269 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -570,7 +570,7 @@ void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh) const SwRect& rPrtRect = pWrtSh->GetAnyCurRect(RECT_PAGE); m_pPreviewWIN->SetPageWidth(rPrtRect.Width()); - FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &pWrtSh->GetView())); + FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>( &pWrtSh->GetView()) != nullptr ); if(eMetric == FUNIT_MM) { m_pDistBorderMF->SetDecimalDigits(1); @@ -1004,14 +1004,14 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage) aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ; - FieldUnit eMetric = ::GetDfltMetric(pDocShell->ISA(SwWebDocShell)); + FieldUnit eMetric = ::GetDfltMetric(dynamic_cast< const SwWebDocShell *>( pDocShell ) != nullptr); aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric) ) ); rPage.PageCreated(aSet); } else if (nPageId == m_nPositionPageId) { SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell(); - FieldUnit eMetric = ::GetDfltMetric(pDocShell->ISA(SwWebDocShell)); + FieldUnit eMetric = ::GetDfltMetric(dynamic_cast< const SwWebDocShell *>( pDocShell ) != nullptr); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)) ); rPage.PageCreated(aSet); diff --git a/sw/source/ui/table/colwd.cxx b/sw/source/ui/table/colwd.cxx index 1ab303f1d9fd..bea63ffdec9f 100644 --- a/sw/source/ui/table/colwd.cxx +++ b/sw/source/ui/table/colwd.cxx @@ -48,8 +48,8 @@ SwTableWidthDlg::SwTableWidthDlg(vcl::Window *pParent, SwTableFUNC &rTableFnc ) get(m_pWidthMF, "width"); bool bIsWeb = rTableFnc.GetShell() - && (0 != PTR_CAST( SwWebDocShell, - rTableFnc.GetShell()->GetView().GetDocShell()) ); + && (dynamic_cast< const SwWebDocShell* >( + rTableFnc.GetShell()->GetView().GetDocShell()) != nullptr ); FieldUnit eFieldUnit = SW_MOD()->GetUsrPref( bIsWeb )->GetMetric(); ::SetFieldUnit(*m_pWidthMF, eFieldUnit); diff --git a/sw/source/ui/table/rowht.cxx b/sw/source/ui/table/rowht.cxx index 0dddb91636a0..8dbec1ddb59d 100644 --- a/sw/source/ui/table/rowht.cxx +++ b/sw/source/ui/table/rowht.cxx @@ -56,8 +56,8 @@ SwTableHeightDlg::SwTableHeightDlg(vcl::Window *pParent, SwWrtShell &rS) get(m_pHeightEdit, "heightmf"); get(m_pAutoHeightCB, "fit"); - FieldUnit eFieldUnit = SW_MOD()->GetUsrPref( 0 != PTR_CAST( SwWebDocShell, - rSh.GetView().GetDocShell() ) )->GetMetric(); + FieldUnit eFieldUnit = SW_MOD()->GetUsrPref( dynamic_cast< const SwWebDocShell*>( + rSh.GetView().GetDocShell() ) != nullptr )->GetMetric(); ::SetFieldUnit(*m_pHeightEdit, eFieldUnit); m_pHeightEdit->SetMin(MINLAY, FUNIT_TWIP); |