aboutsummaryrefslogtreecommitdiff
ModeNameSize
-rw-r--r--README57logplain
d---------git-hooks114logplain
d---------source3509logplain
ption> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2015-09-30 16:10:07 +0200
committerOliver Specht <oliver.specht@cib.de>2015-10-06 07:29:37 +0000
commit89d39bc100aabf5dccbe77c0b5c0c85736e85b39 (patch)
tree871a91210913ecee91530c95392534bf18f80f3f /sc/source/ui
parent32b9901dae7403453d773f5904de15551a323595 (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 'sc/source/ui')
-rw-r--r--sc/source/ui/app/client.cxx8
-rw-r--r--sc/source/ui/app/drwtrans.cxx6
-rw-r--r--sc/source/ui/app/inputhdl.cxx6
-rw-r--r--sc/source/ui/app/inputwin.cxx25
-rw-r--r--sc/source/ui/app/scmod.cxx41
-rw-r--r--sc/source/ui/app/seltrans.cxx2
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx4
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx2
-rw-r--r--sc/source/ui/docshell/arealink.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx4
-rw-r--r--sc/source/ui/docshell/docsh3.cxx2
-rw-r--r--sc/source/ui/docshell/docsh4.cxx20
-rw-r--r--sc/source/ui/docshell/docsh6.cxx4
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx10
-rw-r--r--sc/source/ui/docshell/impex.cxx8
-rw-r--r--sc/source/ui/docshell/servobj.cxx2
-rw-r--r--sc/source/ui/docshell/tablink.cxx5
-rw-r--r--sc/source/ui/docshell/tpstat.cxx2
-rw-r--r--sc/source/ui/drawfunc/chartsh.cxx4
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx4
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx12
-rw-r--r--sc/source/ui/drawfunc/fuconarc.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconpol.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx6
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx2
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx4
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx4
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx2
-rw-r--r--sc/source/ui/drawfunc/futext.cxx6
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx2
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx24
-rw-r--r--sc/source/ui/drawfunc/mediash.cxx4
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx2
-rw-r--r--sc/source/ui/formdlg/formula.cxx13
-rw-r--r--sc/source/ui/inc/ChildWindowWrapper.hxx2
-rw-r--r--sc/source/ui/inc/prevwsh.hxx6
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx12
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx38
-rw-r--r--sc/source/ui/miscdlgs/mvtabdlg.cxx2
-rw-r--r--sc/source/ui/navipi/content.cxx19
-rw-r--r--sc/source/ui/navipi/navcitem.cxx4
-rw-r--r--sc/source/ui/navipi/navipi.cxx6
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx4
-rw-r--r--sc/source/ui/optdlg/opredlin.cxx2
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx2
-rw-r--r--sc/source/ui/optdlg/tpview.cxx4
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx4
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx8
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx2
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx6
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.cxx8
-rw-r--r--sc/source/ui/undo/areasave.cxx6
-rw-r--r--sc/source/ui/undo/undobase.cxx2
-rw-r--r--sc/source/ui/undo/undoblk.cxx60
-rw-r--r--sc/source/ui/undo/undoblk2.cxx4
-rw-r--r--sc/source/ui/undo/undoblk3.cxx38
-rw-r--r--sc/source/ui/undo/undocell.cxx20
-rw-r--r--sc/source/ui/undo/undodat.cxx30
-rw-r--r--sc/source/ui/undo/undotab.cxx28
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx4
-rw-r--r--sc/source/ui/unoobj/docuno.cxx8
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx6
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx12
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx10
-rw-r--r--sc/source/ui/vba/vbaworksheets.cxx2
-rw-r--r--sc/source/ui/view/auditsh.cxx2
-rw-r--r--sc/source/ui/view/cellsh1.cxx8
-rw-r--r--sc/source/ui/view/cellsh3.cxx2
-rw-r--r--sc/source/ui/view/drawvie3.cxx4
-rw-r--r--sc/source/ui/view/drawvie4.cxx2
-rw-r--r--sc/source/ui/view/drawview.cxx12
-rw-r--r--sc/source/ui/view/editsh.cxx6
-rw-r--r--sc/source/ui/view/formatsh.cxx6
-rw-r--r--sc/source/ui/view/hdrcont.cxx3
-rw-r--r--sc/source/ui/view/output.cxx2
-rw-r--r--sc/source/ui/view/output2.cxx6
-rw-r--r--sc/source/ui/view/prevwsh.cxx2
-rw-r--r--sc/source/ui/view/reffact.cxx10
-rw-r--r--sc/source/ui/view/spelldialog.cxx6
-rw-r--r--sc/source/ui/view/spelleng.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx6
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx10
-rw-r--r--sc/source/ui/view/tabvwshb.cxx6
-rw-r--r--sc/source/ui/view/tabvwshe.cxx4
-rw-r--r--sc/source/ui/view/tabvwshf.cxx2
-rw-r--r--sc/source/ui/view/tabvwshg.cxx2
-rw-r--r--sc/source/ui/view/viewfun2.cxx8
-rw-r--r--sc/source/ui/view/viewfun5.cxx8
-rw-r--r--sc/source/ui/view/viewfun7.cxx4
-rw-r--r--sc/source/ui/view/viewutil.cxx2
94 files changed, 360 insertions, 378 deletions
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index 0fea634e739b..11702c6efc23 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -80,7 +80,7 @@ SdrOle2Obj* ScClient::GetDrawObj()
void ScClient::RequestNewObjectArea( Rectangle& aLogicRect )
{
SfxViewShell* pSfxViewSh = GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( pSfxViewSh );
if (!pViewSh)
{
OSL_FAIL("Wrong ViewShell");
@@ -142,7 +142,7 @@ void ScClient::RequestNewObjectArea( Rectangle& aLogicRect )
void ScClient::ObjectAreaChanged()
{
SfxViewShell* pSfxViewSh = GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( pSfxViewSh );
if (!pViewSh)
{
OSL_FAIL("Wrong ViewShell");
@@ -174,7 +174,7 @@ void ScClient::ObjectAreaChanged()
// set document modified (SdrModel::SetChanged is not used)
// TODO/LATER: is there a reason that this code is not executed in Draw?
// SfxViewShell* pSfxViewSh = GetViewShell();
-// ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
+// ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( pSfxViewSh );
if (pViewSh)
pViewSh->GetViewData().GetDocShell()->SetDrawModified();
}
@@ -226,7 +226,7 @@ void ScClient::ViewChanged()
//SetObjArea( aObjArea );
SfxViewShell* pSfxViewSh = GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( pSfxViewSh );
if ( pViewSh )
{
vcl::Window* pWin = pViewSh->GetActiveWin();
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index c2182667c703..4cd8e87c5b3b 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -127,7 +127,7 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
// URL button
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObject);
+ SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( pObject );
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
@@ -267,7 +267,7 @@ static bool lcl_HasOnlyControls( SdrModel* pModel )
bOnlyControls = true; // only set if there are any objects at all
while ( pObj )
{
- if (!pObj->ISA(SdrUnoObj))
+ if (dynamic_cast<const SdrUnoObj*>( pObj) == nullptr)
{
bOnlyControls = false;
break;
@@ -746,7 +746,7 @@ void ScDrawTransferObj::InitDocShell()
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->ISA(SdrUnoObj) )
+ if ( dynamic_cast<const SdrUnoObj*>( pObject) != nullptr )
pObject->NbcSetLayer(SC_LAYER_CONTROLS);
else
pObject->NbcSetLayer(SC_LAYER_FRONT);
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 8cabdcb91706..9d5567df845b 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1676,7 +1676,7 @@ void ScInputHandler::ViewShellGone(ScTabViewShell* pViewSh) // Executed synchron
UpdateAutoCorrFlag();
}
- pActiveViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ pActiveViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
if ( pActiveViewSh && pActiveViewSh == pViewSh )
{
@@ -2226,7 +2226,7 @@ void ScInputHandler::ShowRefFrame()
// Modifying pActiveViewSh here would interfere with the bInEnterHandler / bRepeat
// checks in NotifyChange, and lead to keeping the wrong value in pActiveViewSh.
// A local variable is used instead.
- ScTabViewShell* pVisibleSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pVisibleSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
if ( pRefViewSh && pRefViewSh != pVisibleSh )
{
bool bFound = false;
@@ -3395,7 +3395,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
if ( pSourceSh )
pActiveViewSh = pSourceSh;
else
- pActiveViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ pActiveViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
ImplCreateEditEngine();
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index a717f00fdd38..ae0554381779 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -161,7 +161,7 @@ static VclPtr<ScTextWndBase> lcl_chooseRuntimeImpl( vcl::Window* pParent, SfxBin
{
SfxViewFrame* pViewFrm = pDisp->GetFrame();
if ( pViewFrm )
- pViewSh = PTR_CAST( ScTabViewShell, pViewFrm->GetViewShell() );
+ pViewSh = dynamic_cast<ScTabViewShell*>( pViewFrm->GetViewShell() );
}
if ( !lcl_isExperimentalMode() )
@@ -196,7 +196,7 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, SfxBindings* pBind ) :
{
SfxViewFrame* pViewFrm = pDisp->GetFrame();
if ( pViewFrm )
- pViewSh = PTR_CAST( ScTabViewShell, pViewFrm->GetViewShell() );
+ pViewSh = dynamic_cast<ScTabViewShell*>( pViewFrm->GetViewShell() );
}
OSL_ENSURE( pViewSh, "no view shell for input window" );
@@ -271,8 +271,7 @@ void ScInputWindow::dispose()
if ( !bDown )
{
- TypeId aScType = TYPE(ScTabViewShell);
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> );
while ( pSh )
{
ScInputHandler* pHdl = static_cast<ScTabViewShell*>(pSh)->GetInputHandler();
@@ -281,7 +280,7 @@ void ScInputWindow::dispose()
pHdl->SetInputWindow( NULL );
pHdl->StopInputWinEngine( false ); // reset pTopView pointer
}
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> );
}
}
@@ -309,7 +308,7 @@ void ScInputWindow::SetInputHandler( ScInputHandler* pNew )
bool ScInputWindow::UseSubTotal(ScRangeList* pRangeList)
{
bool bSubTotal = false;
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
if ( pViewSh )
{
ScDocument* pDoc = pViewSh->GetViewData().GetDocument();
@@ -401,7 +400,7 @@ void ScInputWindow::Select()
case SID_INPUT_SUM:
{
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
if ( pViewSh )
{
const ScMarkData& rMark = pViewSh->GetViewData().GetMarkData();
@@ -511,7 +510,7 @@ void ScInputWindow::Select()
sal_Int32 nStartPos = 1;
sal_Int32 nEndPos = 1;
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
if ( pViewSh )
{
const OUString& rString = aTextWindow.GetTextString();
@@ -1799,7 +1798,7 @@ void ScTextWnd::StartEditEngine()
// as long as EditEngine and DrawText sometimes differ for CTL text,
// repaint now to have the EditEngine's version visible
// SfxObjectShell* pObjSh = SfxObjectShell::Current();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr )
{
ScDocument& rDoc = static_cast<ScDocShell*>(pObjSh)->GetDocument(); // any document
SvtScriptType nScript = rDoc.GetStringScriptType( aString );
@@ -1896,7 +1895,7 @@ void ScTextWnd::SetTextString( const OUString& rNewString )
SvtScriptType nOldScript = SvtScriptType::NONE;
SvtScriptType nNewScript = SvtScriptType::NONE;
SfxObjectShell* pObjSh = SfxObjectShell::Current();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr )
{
// any document can be used (used only for its break iterator)
ScDocument& rDoc = static_cast<ScDocShell*>(pObjSh)->GetDocument();
@@ -2140,7 +2139,7 @@ void ScPosWnd::FillRangeNames()
Clear();
SfxObjectShell* pObjSh = SfxObjectShell::Current();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr )
{
ScDocument& rDoc = static_cast<ScDocShell*>(pObjSh)->GetDocument();
@@ -2392,7 +2391,7 @@ void ScPosWnd::DoEnter()
}
else
{
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
ScInputHandler* pHdl = pScMod->GetInputHdl( pViewSh );
if (pHdl)
pHdl->InsertFunction( aText );
@@ -2531,7 +2530,7 @@ void ScPosWnd::ReleaseFocus_Impl()
HideTip();
SfxViewShell* pCurSh = SfxViewShell::Current();
- ScInputHandler* pHdl = SC_MOD()->GetInputHdl( PTR_CAST( ScTabViewShell, pCurSh ) );
+ ScInputHandler* pHdl = SC_MOD()->GetInputHdl( dynamic_cast<ScTabViewShell*>( pCurSh ) );
if ( pHdl && pHdl->IsTopMode() )
{
// Focus back in input row?
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 1265653b1081..81626abc9dc4 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -246,7 +246,7 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while(pViewShell)
{
- if ( pViewShell->ISA(ScTabViewShell) )
+ if ( dynamic_cast<const ScTabViewShell*>( pViewShell) != nullptr )
{
ScTabViewShell* pViewSh = static_cast<ScTabViewShell*>(pViewShell);
pViewSh->PaintGrid();
@@ -258,7 +258,7 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
if ( pHdl )
pHdl->ForgetLastPattern(); // EditEngine BackgroundColor may change
}
- else if ( pViewShell->ISA(ScPreviewShell) )
+ else if ( dynamic_cast<const ScPreviewShell*>( pViewShell) != nullptr )
{
vcl::Window* pWin = pViewShell->GetWindow();
if (pWin)
@@ -293,7 +293,7 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
SfxViewShell* pSh = SfxViewShell::GetFirst();
while ( pSh )
{
- if ( pSh->ISA( ScTabViewShell ) )
+ if ( dynamic_cast<const ScTabViewShell*>( pSh) != nullptr )
{
ScTabViewShell* pViewSh = static_cast<ScTabViewShell*>(pSh);
@@ -305,7 +305,7 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
pViewSh->DigitLanguageChanged();
pViewSh->PaintGrid();
}
- else if ( pSh->ISA( ScPreviewShell ) )
+ else if ( dynamic_cast<const ScPreviewShell*>( pSh) != nullptr )
{
ScPreviewShell* pPreviewSh = static_cast<ScPreviewShell*>(pSh);
ScPreview* pPreview = pPreviewSh->GetPreview();
@@ -398,7 +398,7 @@ void ScModule::Execute( SfxRequest& rReq )
bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
else
{ // Toggle
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
if ( pDocSh )
bSet = !pDocSh->GetDocument().GetDocOptions().IsAutoSpell();
else
@@ -476,7 +476,7 @@ void ScModule::Execute( SfxRequest& rReq )
if (pReqArgs)
{
const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(pReqArgs->Get(SID_PSZ_FUNCTION));
- OSL_ENSURE(rItem.ISA(SfxUInt16Item),"wrong Parameter");
+ OSL_ENSURE(dynamic_cast<const SfxUInt16Item*>( &rItem) != nullptr,"wrong Parameter");
ScAppOptions aNewOpts( GetAppOptions() );
aNewOpts.SetStatusFunc( rItem.GetValue() );
@@ -501,7 +501,7 @@ void ScModule::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( GetPool().GetWhich(nSlot), true, &pItem ) )
{
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
if ( pDocSh )
{
ScDocument& rDoc = pDocSh->GetDocument();
@@ -524,7 +524,7 @@ void ScModule::Execute( SfxRequest& rReq )
ScInputHandler* pInputHandler = GetInputHdl();
if ( pInputHandler )
pInputHandler->UpdateSpellSettings(); // EditEngine flags
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
if ( pViewSh )
pViewSh->UpdateDrawTextOutliner(); // EditEngine flags
@@ -570,7 +570,7 @@ void ScModule::Execute( SfxRequest& rReq )
void ScModule::GetState( SfxItemSet& rSet )
{
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
bool bTabView = pDocSh && (pDocSh->GetBestViewShell() != NULL);
SfxWhichIter aIter(rSet);
@@ -961,8 +961,8 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
SfxBindings* pBindings = pViewFrm ? &pViewFrm->GetBindings() : NULL;
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
+ ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
ScDocument* pDoc = pDocSh ? &pDocSh->GetDocument() : NULL;
const SfxPoolItem* pItem = NULL;
bool bRepaint = false;
@@ -1331,8 +1331,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
}
// for all (tab-) views:
- TypeId aScType = TYPE(ScTabViewShell);
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> );
while ( pSh )
{
ScTabViewShell* pOneViewSh = static_cast<ScTabViewShell*>(pSh);
@@ -1351,7 +1350,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
pOneViewSh->PaintTop();
pOneViewSh->PaintLeft();
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> );
}
}
}
@@ -1369,7 +1368,7 @@ ScInputHandler* ScModule::GetInputHdl( ScTabViewShell* pViewSh, bool bUseRef )
{
// in case a UIActive embedded object has no ViewShell (UNO component)
// the own calc view shell will be set as current, but no handling should happen
- ScTabViewShell* pCurViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pCurViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
if ( pCurViewSh && !pCurViewSh->GetUIActiveClient() )
pViewSh = pCurViewSh;
}
@@ -1552,7 +1551,7 @@ void ScModule::SetRefDialog( sal_uInt16 nId, bool bVis, SfxViewFrame* pViewFrm )
{
// store the dialog id also in the view shell
SfxViewShell* pViewSh = pViewFrm->GetViewShell();
- if ( pViewSh && pViewSh->ISA( ScTabViewShell ) )
+ if ( pViewSh && dynamic_cast<const ScTabViewShell*>( pViewSh) != nullptr )
static_cast<ScTabViewShell*>(pViewSh)->SetCurRefDlgId( nCurRefDlgId );
else
{
@@ -1834,7 +1833,7 @@ static void lcl_CheckNeedsRepaint( ScDocShell* pDocShell )
while ( pFrame )
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
if ( pViewSh )
pViewSh->CheckNeedsRepaint();
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
@@ -1966,14 +1965,12 @@ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId )
const ScAppOptions& rAppOpt = GetAppOptions();
- ScDocShell* pDocSh = PTR_CAST(ScDocShell,
- SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell *>( SfxObjectShell::Current() );
ScDocOptions aCalcOpt = pDocSh
? pDocSh->GetDocument().GetDocOptions()
: GetDocOptions();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,
- SfxViewShell::Current());
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( SfxViewShell::Current() );
ScViewOptions aViewOpt = pViewSh
? pViewSh->GetViewData().GetOptions()
: GetViewOptions();
@@ -2149,7 +2146,7 @@ IMPL_LINK_TYPED( ScModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void )
const SvxFieldItem& rField = pInfo->GetField();
const SvxFieldData* pField = rField.GetField();
- if (pField && pField->ISA(SvxURLField))
+ if (pField && dynamic_cast<const SvxURLField*>( pField) != nullptr)
{
// URLField
const SvxURLField* pURLField = static_cast<const SvxURLField*>(pField);
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index b48acb4c89df..0e199354d94f 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -43,7 +43,7 @@ static bool lcl_IsURLButton( SdrObject* pObject )
{
bool bRet = false;
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObject);
+ SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( pObject );
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 44c59c04ba35..79d4b92b2b1e 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -61,7 +61,7 @@ void ScZoomSliderControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState
ScZoomSliderWnd* pBox = static_cast<ScZoomSliderWnd*>(rTbx.GetItemWindow( nId ));
OSL_ENSURE( pBox ,"Control not found!" );
- if ( SfxItemState::DEFAULT != eState || pState->ISA( SfxVoidItem ) )
+ if ( SfxItemState::DEFAULT != eState || dynamic_cast<const SfxVoidItem*>( pState) != nullptr )
{
SvxZoomSliderItem aZoomSliderItem( 100 );
pBox->Disable();
@@ -70,7 +70,7 @@ void ScZoomSliderControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState
else
{
pBox->Enable();
- OSL_ENSURE( pState->ISA( SvxZoomSliderItem ), "invalid item type" );
+ OSL_ENSURE( dynamic_cast<const SvxZoomSliderItem*>( pState) != nullptr, "invalid item type" );
const SvxZoomSliderItem* pZoomSliderItem = dynamic_cast< const SvxZoomSliderItem* >( pState );
OSL_ENSURE( pZoomSliderItem, "Sc::ScZoomSliderControl::StateChanged(), wrong item type!" );
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index 98c77dae318e..5ca9b8f5dfc0 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -208,7 +208,7 @@ ScImportOptionsDlg::ScImportOptionsDlg(
m_pCbQuoteAll->Show();
m_pCbQuoteAll->Check( false );
m_pCbFormulas->Show();
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current());
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
bool bFormulas = pViewSh &&
pViewSh->GetViewData().GetOptions().GetOption( VOPT_FORMULAS);
m_pCbFormulas->Check( bFormulas );
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index c982dcb1bfa0..f1f24800df08 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -72,7 +72,7 @@ ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const OUString& rFile,
bInCreate (false),
bDoInsert (true)
{
- OSL_ENSURE(pShell->ISA(ScDocShell), "ScAreaLink mit falscher ObjectShell");
+ OSL_ENSURE(dynamic_cast< const ScDocShell *>( pShell ) != nullptr, "ScAreaLink mit falscher ObjectShell");
pImpl->m_pDocSh = static_cast< ScDocShell* >( pShell );
SetRefreshHandler( LINK( this, ScAreaLink, RefreshHdl ) );
SetRefreshControl( &pImpl->m_pDocSh->GetDocument().GetRefreshTimerControlAddress() );
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 15fa0ece667a..b554dd29060b 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -5220,7 +5220,7 @@ bool ScDocFunc::InsertAreaLink( const OUString& rFile, const OUString& rFilter,
while (nLinkPos<nLinkCount)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[nLinkPos];
- if ( pBase->ISA(ScAreaLink) &&
+ if ( dynamic_cast< const ScAreaLink *>( pBase ) != nullptr &&
static_cast<ScAreaLink*>(pBase)->GetDestArea().aStart == rDestRange.aStart )
{
if ( bUndo )
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 9860e53bc953..b3fd054626bc 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2501,7 +2501,7 @@ bool ScDocShell::PrepareClose( bool bUI )
if( pFrame )
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
if(pViewSh!=NULL)
{
vcl::Window *pWin=pViewSh->GetWindow();
@@ -2887,7 +2887,7 @@ VclPtr<SfxDocumentInfoDialog> ScDocShell::CreateDocumentInfoDialog(
vcl::Window *pParent, const SfxItemSet &rSet )
{
VclPtr<SfxDocumentInfoDialog> pDlg = VclPtr<SfxDocumentInfoDialog>::Create( pParent, rSet );
- ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell *>( SfxObjectShell::Current() );
// Only for statistics, if this Doc is shown; not from the Doc Manager
if( pDocSh == this )
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 0671e754a2fb..a1135db48cbb 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -480,7 +480,7 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlag
while (pFrame)
{
SfxViewShell* pSh = pFrame->GetViewShell();
- if (pSh && pSh->ISA(ScTabViewShell))
+ if (pSh && dynamic_cast<const ScTabViewShell*>( pSh) != nullptr)
{
ScTabViewShell* pViewSh = static_cast<ScTabViewShell*>(pSh);
ScInputHandler* pInputHdl = pScMod->GetInputHdl(pViewSh);
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 262b902ab9d4..79cabb134d8c 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -677,26 +677,26 @@ void ScDocShell::Execute( SfxRequest& rReq )
SfxMedium* pMed = NULL;
if ( pReqArgs &&
pReqArgs->GetItemState( SID_FILE_NAME, true, &pItem ) == SfxItemState::SET &&
- pItem->ISA(SfxStringItem) )
+ dynamic_cast<const SfxStringItem*>( pItem) != nullptr )
{
OUString aFileName =
static_cast<const SfxStringItem*>(pItem)->GetValue();
OUString aFilterName;
if ( pReqArgs->GetItemState( SID_FILTER_NAME, true, &pItem ) == SfxItemState::SET &&
- pItem->ISA(SfxStringItem) )
+ dynamic_cast<const SfxStringItem*>( pItem) != nullptr )
{
aFilterName = static_cast<const SfxStringItem*>(pItem)->GetValue();
}
OUString aOptions;
if ( pReqArgs->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) == SfxItemState::SET &&
- pItem->ISA(SfxStringItem) )
+ dynamic_cast<const SfxStringItem*>( pItem) != nullptr )
{
aOptions = static_cast<const SfxStringItem*>(pItem)->GetValue();
}
short nVersion = 0;
if ( pReqArgs->GetItemState( SID_VERSION, true, &pItem ) == SfxItemState::SET &&
- pItem->ISA(SfxInt16Item) )
+ dynamic_cast<const SfxInt16Item*>( pItem) != nullptr )
{
nVersion = static_cast<const SfxInt16Item*>(pItem)->GetValue();
}
@@ -817,7 +817,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( nSlot, true, &pItem ) == SfxItemState::SET )
{
- if ( pItem->ISA(SfxStringItem) )
+ if ( dynamic_cast<const SfxStringItem*>( pItem) != nullptr )
{
OUString aName = static_cast<const SfxStringItem*>(pItem)->GetValue();
SCTAB nTab;
@@ -845,7 +845,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( nSlot, true, &pItem ) == SfxItemState::SET )
{
- if ( pItem->ISA(SfxStringItem) )
+ if ( dynamic_cast<const SfxStringItem*>( pItem) != nullptr )
{
OUString aName = static_cast<const SfxStringItem*>(pItem)->GetValue();
SCTAB nTab;
@@ -893,7 +893,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( nSlot, true, &pItem ) == SfxItemState::SET )
{
- if ( pItem->ISA(SfxUInt16Item) )
+ if ( dynamic_cast<const SfxUInt16Item*>( pItem) != nullptr )
{
sal_uInt16 nY2k = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
// immer an den DocOptions setzen, damit das auch fuer SO50
@@ -2205,7 +2205,7 @@ bool ScDocShell::DdeSetData( const OUString& rItem,
ScViewData* ScDocShell::GetViewData()
{
SfxViewShell* pCur = SfxViewShell::Current();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,pCur);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( pCur );
return pViewSh ? &pViewSh->GetViewData() : NULL;
}
@@ -2231,7 +2231,7 @@ ScTabViewShell* ScDocShell::GetBestViewShell( bool bOnlyVisible )
if( pFrame )
{
SfxViewShell* p = pFrame->GetViewShell();
- pViewSh = PTR_CAST(ScTabViewShell,p);
+ pViewSh = dynamic_cast< ScTabViewShell *>( p );
}
}
return pViewSh;
@@ -2295,7 +2295,7 @@ IMPL_LINK_TYPED( ScDocShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg
SfxItemSet* pSet = pMed->GetItemSet();
if ( pSet &&
pSet->GetItemState( SID_VERSION, true, &pItem ) == SfxItemState::SET &&
- pItem->ISA( SfxInt16Item ) )
+ dynamic_cast<const SfxInt16Item*>( pItem) != nullptr )
{
pImpl->pRequest->AppendItem( *pItem );
}
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 5acc3dd912da..737423695da7 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -354,7 +354,7 @@ void ScDocShell::UpdateLinks()
{
--k;
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[k];
- if (pBase->ISA(ScTableLink))
+ if (dynamic_cast<const ScTableLink*>( pBase) != nullptr)
{
ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase);
if (pTabLink->IsUsed())
@@ -418,7 +418,7 @@ bool ScDocShell::ReloadTabLinks()
for (size_t i=0; i<nCount; i++ )
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
- if (pBase->ISA(ScTableLink))
+ if (dynamic_cast<const ScTableLink*>( pBase) != nullptr)
{
ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase);
// pTabLink->SetAddUndo(sal_False); //! Undo's zusammenfassen
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 1a32289a8540..0730927a608f 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2257,8 +2257,7 @@ ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
return NULL;
ScDocument* pSrcDoc = NULL;
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType, false));
+ ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>, false));
while (pShell)
{
SfxMedium* pMedium = pShell->GetMedium();
@@ -2287,7 +2286,7 @@ ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
break;
}
}
- pShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pShell, &aType, false));
+ pShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pShell, checkSfxObjectShell<ScDocShell>, false));
}
initDocInCache(maRefCache, pSrcDoc, nFileId);
@@ -2556,14 +2555,13 @@ bool ScExternalRefManager::isOwnDocument(const OUString& rFile) const
void ScExternalRefManager::convertToAbsName(OUString& rFile) const
{
// unsaved documents have no AbsName
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType, false));
+ ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>, false));
while (pShell)
{
if (rFile == pShell->GetName())
return;
- pShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pShell, &aType, false));
+ pShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pShell, checkSfxObjectShell<ScDocShell>, false));
}
SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 4feaccc3af15..0e84f2da3246 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -80,7 +80,7 @@ enum SylkVersion
// Whole document without Undo
ScImportExport::ScImportExport( ScDocument* p )
- : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
+ : pDocSh( dynamic_cast< ScDocShell* >(p->GetDocumentShell()) ), pDoc( p ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
bFormulas( false ), bIncludeFiltered( true ),
bAll( true ), bSingle( true ), bUndo( false ),
@@ -94,7 +94,7 @@ ScImportExport::ScImportExport( ScDocument* p )
// Insert am current cell without range(es)
ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
- : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
+ : pDocSh( dynamic_cast< ScDocShell* >(p->GetDocumentShell()) ), pDoc( p ),
aRange( rPt ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
bFormulas( false ), bIncludeFiltered( true ),
@@ -110,7 +110,7 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
// ctor with a range is only used for export
//! ctor with a string (and bSingle=true) is also used for DdeSetData
ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
- : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
+ : pDocSh( dynamic_cast<ScDocShell* >(p->GetDocumentShell()) ), pDoc( p ),
aRange( r ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
bFormulas( false ), bIncludeFiltered( true ),
@@ -128,7 +128,7 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
// Evaluate input string - either range, cell or the whole document (when error)
// If a View exists, the TabNo of the view will be used.
ScImportExport::ScImportExport( ScDocument* p, const OUString& rPos )
- : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
+ : pDocSh( dynamic_cast< ScDocShell* >(p->GetDocumentShell()) ), pDoc( p ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
bFormulas( false ), bIncludeFiltered( true ),
bAll( false ), bSingle( true ), bUndo( pDocSh != NULL ),
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index 8fddc9b74427..e090bd26724b 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -209,7 +209,7 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
// don't access DocShell anymore for EndListening etc.
}
}
- else if (rBC.ISA(SfxApplication))
+ else if (dynamic_cast<const SfxApplication*>( &rBC) != nullptr)
{
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
if ( !aItemStr.isEmpty() && pSimpleHint &&
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 07d5c7a3ba92..4cb613f5fd51 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -442,8 +442,7 @@ bool ScDocumentLoader::GetFilterName( const OUString& rFileName,
OUString& rFilter, OUString& rOptions,
bool bWithContent, bool bWithInteraction )
{
- TypeId aScType = TYPE(ScDocShell);
- SfxObjectShell* pDocSh = SfxObjectShell::GetFirst( &aScType );
+ SfxObjectShell* pDocSh = SfxObjectShell::GetFirst( checkSfxObjectShell<ScDocShell> );
while ( pDocSh )
{
if ( pDocSh->HasName() )
@@ -456,7 +455,7 @@ bool ScDocumentLoader::GetFilterName( const OUString& rFileName,
return true;
}
}
- pDocSh = SfxObjectShell::GetNext( *pDocSh, &aScType );
+ pDocSh = SfxObjectShell::GetNext( *pDocSh, checkSfxObjectShell<ScDocShell> );
}
INetURLObject aUrl( rFileName );
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index 0be22a9b0428..2675f2834263 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -39,7 +39,7 @@ ScDocStatPage::ScDocStatPage( vcl::Window *pParent, const SfxItemSet& rSet )
get(m_pFtCells,"nocells");
get(m_pFtPages,"nopages");
get(m_pFtFormula,"noformula");
- ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
ScDocStat aDocStat;
if ( pDocSh )
diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx
index 07752f6aac77..1fb50a91877c 100644
--- a/sc/source/ui/drawfunc/chartsh.cxx
+++ b/sc/source/ui/drawfunc/chartsh.cxx
@@ -78,7 +78,7 @@ void ScChartShell::GetExportAsGraphicState( SfxItemSet& rSet )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrOle2Obj ) )
+ if( pObj && dynamic_cast<const SdrOle2Obj*>( pObj) != nullptr )
bEnable = true;
}
@@ -95,7 +95,7 @@ void ScChartShell::ExecuteExportAsGraphic( SfxRequest& )
{
SdrObject* pObject = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObject && pObject->ISA( SdrOle2Obj ) )
+ if( pObject && dynamic_cast<const SdrOle2Obj*>( pObject) != nullptr )
{
Reference< drawing::XShape > xSourceDoc = Reference< drawing::XShape >( pObject->getUnoShape(), UNO_QUERY_THROW );
GraphicHelper::SaveShapeAsGraphic( xSourceDoc );
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index d582b3a9778e..24d69a1907bb 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -365,7 +365,7 @@ bool ScDrawShell::AreAllObjectsOnLayer(sal_uInt16 nLayerNo,const SdrMarkList& rM
for (size_t i=0; i<nCount; ++i)
{
SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj();
- if ( !pObj->ISA(SdrUnoObj) )
+ if ( dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
{
if(nLayerNo!=pObj->GetLayer())
{
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index cdb6999bbad4..8a94c121896f 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -80,7 +80,7 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink
aHLinkItem.SetURL( pInfo->GetHlink() );
aHLinkItem.SetInsertMode(HLINK_FIELD);
}
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
+ SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( pObj );
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
@@ -166,7 +166,7 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
if ( rMarkList.GetMarkCount() == 1 )
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj );
+ SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( pObj );
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference<awt::XControlModel> xControlModel =
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 04b9d34dc68c..a0c259259b13 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -182,7 +182,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
const SfxPoolItem* pItem;
if ( pReqArgs &&
pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET &&
- pItem->ISA(SfxUInt32Item) )
+ dynamic_cast<const SfxUInt32Item*>( pItem) != nullptr )
{
nFormat = static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pItem)->GetValue());
}
@@ -227,7 +227,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
aString = static_cast<const SfxStringItem*>(pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
- const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem );
if ( pFontItem )
{
OUString aFontName(pFontItem->GetValue());
@@ -274,7 +274,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
if (pFieldItem)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if ( pField && pField->ISA(SvxURLField) )
+ if ( pField && dynamic_cast<const SvxURLField*>( pField) != nullptr )
{
// altes Feld selektieren
@@ -323,7 +323,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
if ( pFieldItem )
{
const SvxFieldData* pField = pFieldItem->GetField();
- if( pField && pField->ISA( SvxURLField ) )
+ if( pField && dynamic_cast<const SvxURLField*>( pField) != nullptr )
{
const SvxURLField* pURLField = static_cast< const SvxURLField* >( pField );
ScGlobal::OpenURL( pURLField->GetURL(), pURLField->GetTargetFrame() );
@@ -391,7 +391,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
if (pFieldItem)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if ( pField && pField->ISA(SvxURLField) )
+ if ( pField && dynamic_cast<const SvxURLField*>( pField) != nullptr )
{
const SvxURLField* pURLField = static_cast<const SvxURLField*>(pField);
aHLinkItem.SetName( pURLField->GetRepresentation() );
@@ -423,7 +423,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
if ( pFieldItem )
{
const SvxFieldData* pField = pFieldItem->GetField();
- bEnable = pField && pField->ISA( SvxURLField );
+ bEnable = pField && dynamic_cast<const SvxURLField*>( pField) != nullptr;
}
}
if( !bEnable )
diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx
index c916a5177cf9..dcfaa8281380 100644
--- a/sc/source/ui/drawfunc/fuconarc.cxx
+++ b/sc/source/ui/drawfunc/fuconarc.cxx
@@ -189,7 +189,7 @@ SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const Rectangle
if(pObj)
{
- if(pObj->ISA(SdrCircObj))
+ if(dynamic_cast<const SdrCircObj*>( pObj) != nullptr)
{
Rectangle aRect(rRectangle);
diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx
index 2132b081d9eb..aa8ff4fc65b0 100644
--- a/sc/source/ui/drawfunc/fuconpol.cxx
+++ b/sc/source/ui/drawfunc/fuconpol.cxx
@@ -242,7 +242,7 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
if(pObj)
{
- if(pObj->ISA(SdrPathObj))
+ if(dynamic_cast<const SdrPathObj*>( pObj) != nullptr)
{
basegfx::B2DPolyPolygon aPoly;
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index a39f12fc9235..5698732d94c8 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -129,7 +129,7 @@ bool FuConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
// create OutlinerParaObject now so it can be set to vertical
- if ( pObj->ISA(SdrTextObj) )
+ if ( dynamic_cast<const SdrTextObj*>( pObj) != nullptr )
static_cast<SdrTextObj*>(pObj)->ForceOutlinerParaObject();
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
if( pOPO && !pOPO->IsVertical() )
@@ -232,7 +232,7 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
{
case SID_DRAW_LINE:
{
- if(pObj->ISA(SdrPathObj))
+ if(dynamic_cast<const SdrPathObj*>( pObj) != nullptr)
{
sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
basegfx::B2DPolygon aPoly;
@@ -250,7 +250,7 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
case SID_DRAW_CAPTION:
case SID_DRAW_CAPTION_VERTICAL:
{
- if(pObj->ISA(SdrCaptionObj))
+ if(dynamic_cast<const SdrCaptionObj*>( pObj) != nullptr)
{
bool bIsVertical(SID_DRAW_CAPTION_VERTICAL == nID);
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index 60447d90decd..b8cc232ca08e 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -230,7 +230,7 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
SdrObject* pObj = pMark->GetMarkedSdrObj();
// bei Uno-Controls nicht in Textmodus
- if ( pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) )
+ if ( dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
{
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
bool bVertical = ( pOPO && pOPO->IsVertical() );
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index aeefe44bbab3..073508bb4aaf 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -186,7 +186,7 @@ bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const KeyEvent* pInitialKey )
{
bool bReturn = false;
- if ( pObj && pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) )
+ if ( pObj && dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
{
// start text edit - like FuSelection::MouseButtonUp,
// but with bCursorToEnd instead of mouse position
@@ -269,7 +269,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
{
bool bOle = pViewShell->GetViewFrame()->GetFrame().IsInPlace();
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrOle2Obj ) && !bOle )
+ if( pObj && dynamic_cast<const SdrOle2Obj*>( pObj) != nullptr && !bOle )
{
pViewShell->ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 );
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 7670949fa3d8..c7fd4c96c8ae 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -342,7 +342,7 @@ FuInsertMedia::FuInsertMedia( ScTabViewShell* pViewSh,
if( pReqArgs )
{
- const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, &pReqArgs->Get( rReq.GetSlot() ) );
+ const SfxStringItem* pStringItem = dynamic_cast<const SfxStringItem*>( &pReqArgs->Get( rReq.GetSlot() ) );
if( pStringItem )
{
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 02c5ecca76fb..cb472fc4c90f 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -551,9 +551,9 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV
if( pReqArgs->HasItem( FN_PARAM_4, &pItem ) )
{
- if ( pItem->ISA( SfxUInt16Item ) )
+ if ( dynamic_cast<const SfxUInt16Item*>( pItem) != nullptr )
nToTable = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
- else if ( pItem->ISA( SfxBoolItem ) )
+ else if ( dynamic_cast<const SfxBoolItem*>( pItem) != nullptr )
{
// in der idl fuer Basic steht FN_PARAM_4 als SfxBoolItem
// -> wenn gesetzt, neue Tabelle, sonst aktuelle Tabelle
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index f3e172db308c..02fb2c9fea2a 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -535,7 +535,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
// not in UNO controls
// #i32352# not in media objects
- else if ( pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) && !pObj->ISA(SdrMediaObj) )
+ else if ( dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr && dynamic_cast<const SdrMediaObj*>( pObj) == nullptr )
{
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
bool bVertical = ( pOPO && pOPO->IsVertical() );
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index f9581a437493..b7996f533f26 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -474,7 +474,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
if(rMarkList.GetMark(0))
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if(pObj && pObj->ISA(SdrTextObj))
+ if(pObj && dynamic_cast<const SdrTextObj*>( pObj) != nullptr)
{
SdrTextObj* pText = static_cast<SdrTextObj*>(pObj);
SfxItemSet aSet(pDrDoc->GetItemPool());
@@ -651,7 +651,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
if (nSdrObjKind == OBJ_TEXT ||
nSdrObjKind == OBJ_TITLETEXT ||
nSdrObjKind == OBJ_OUTLINETEXT ||
- pObj->ISA(SdrTextObj))
+ dynamic_cast<const SdrTextObj*>( pObj) != nullptr)
{
SdrPageView* pPV = pView->GetSdrPageView();
@@ -728,7 +728,7 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
if(pObj)
{
- if(pObj->ISA(SdrTextObj))
+ if(dynamic_cast<const SdrTextObj*>( pObj) != nullptr)
{
SdrTextObj* pText = static_cast<SdrTextObj*>(pObj);
pText->SetLogicRect(rRectangle);
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index 61f8d809eedb..2c4e8ed7ffc4 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -88,7 +88,7 @@ void FuText::StopEditMode(bool /*bTextDirection*/)
/* Note has been created before editing, if first undo action is
an insert action. Needed below to decide whether to drop the
undo if editing a new note has been cancelled. */
- bNewNote = (pCalcUndo->GetActionCount() > 0) && pCalcUndo->GetAction( 0 )->ISA( SdrUndoNewObj );
+ bNewNote = (pCalcUndo->GetActionCount() > 0) && dynamic_cast< SdrUndoNewObj* >(pCalcUndo->GetAction( 0 ));
// create a "insert note" undo action if needed
if( bNewNote )
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index 94742a0a177c..b3145732e6e6 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -94,7 +94,7 @@ void ScGraphicShell::GetFilterState( SfxItemSet& rSet )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
+ if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
bEnable = true;
}
@@ -111,7 +111,7 @@ void ScGraphicShell::ExecuteFilter( SfxRequest& rReq )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
+ if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
GraphicObject aFilterObj( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() );
@@ -145,7 +145,7 @@ void ScGraphicShell::GetExternalEditState( SfxItemSet& rSet )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
+ if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
bEnable = true;
}
@@ -162,7 +162,7 @@ void ScGraphicShell::ExecuteExternalEdit( SfxRequest& )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
+ if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() );
m_ExternalEdits.push_back( std::unique_ptr<SdrExternalToolEdit>(
@@ -183,7 +183,7 @@ void ScGraphicShell::GetCompressGraphicState( SfxItemSet& rSet )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
+ if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
bEnable = true;
}
@@ -200,7 +200,7 @@ void ScGraphicShell::ExecuteCompressGraphic( SfxRequest& )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
+ if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
ScopedVclPtrInstance< CompressGraphicsDialog > dialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() );
@@ -228,7 +228,7 @@ void ScGraphicShell::GetCropGraphicState( SfxItemSet& rSet )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
+ if( pObj && 0 != dynamic_cast<const SdrGrafObj*>( pObj) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
bEnable = true;
}
@@ -245,7 +245,7 @@ void ScGraphicShell::ExecuteCropGraphic( SfxRequest& )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
+ if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
pView->SetEditMode(SDREDITMODE_EDIT);
pView->SetDragMode(SDRDRAG_CROP);
@@ -262,7 +262,7 @@ void ScGraphicShell::ExecuteSaveGraphic(SfxRequest& /*rReq*/)
if( rMarkList.GetMarkCount() == 1 )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
+ if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
GraphicObject aGraphicObject( static_cast<SdrGrafObj*>( pObj )->GetGraphicObject() );
{
@@ -283,7 +283,7 @@ void ScGraphicShell::GetSaveGraphicState(SfxItemSet &rSet)
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
+ if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
bEnable = true;
}
@@ -300,7 +300,7 @@ void ScGraphicShell::ExecuteChangePicture(SfxRequest& /*rReq*/)
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
+ if( pObj && 0 != dynamic_cast<const SdrGrafObj*>( pObj) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC));
@@ -335,7 +335,7 @@ void ScGraphicShell::GetChangePictureState(SfxItemSet &rSet)
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
+ if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
bEnable = true;
}
diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx
index 17d3dd569e43..a7281ad77115 100644
--- a/sc/source/ui/drawfunc/mediash.cxx
+++ b/sc/source/ui/drawfunc/mediash.cxx
@@ -78,7 +78,7 @@ void ScMediaShell::GetMediaState( SfxItemSet& rSet )
{
SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrMediaObj ) )
+ if( pObj && dynamic_cast<const SdrMediaObj*>( pObj) != nullptr )
{
::avmedia::MediaItem aItem( SID_AVMEDIA_TOOLBOX );
@@ -117,7 +117,7 @@ void ScMediaShell::ExecuteMedia( SfxRequest& rReq )
{
SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrMediaObj ) )
+ if( pObj && dynamic_cast<const SdrMediaObj*>( pObj) != nullptr )
{
static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).executeMediaItem(
static_cast< const ::avmedia::MediaItem& >( *pItem ) );
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index 766575a007b3..9ea7238a0864 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -817,7 +817,7 @@ void ScFunctionDockWin::DoEnter()
{
ScModule* pScMod = SC_MOD();
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pCurSh);
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( pCurSh );
ScInputHandler* pHdl = pScMod->GetInputHdl( pViewSh );
if(!pScMod->IsEditMode())
{
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index b2ae1297d81e..4e51d2e1969d 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -84,7 +84,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
SfxViewFrame* pMyViewFrm = pMyDisp->GetFrame();
if (pMyViewFrm)
{
- pScViewShell = PTR_CAST( ScTabViewShell, pMyViewFrm->GetViewShell() );
+ pScViewShell = dynamic_cast<ScTabViewShell*>( pMyViewFrm->GetViewShell() );
if( pScViewShell )
pScViewShell->UpdateInputHandler(true);
}
@@ -265,13 +265,12 @@ bool ScFormulaDlg::IsInputHdl(ScInputHandler* pHdl)
// belongs InputHandler to a ViewShell?
- TypeId aScType = TYPE(ScTabViewShell);
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> );
while ( pSh && !bAlive )
{
if (static_cast<ScTabViewShell*>(pSh)->GetInputHandler() == pHdl)
bAlive = true;
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> );
}
return bAlive;
@@ -286,7 +285,7 @@ ScInputHandler* ScFormulaDlg::GetNextInputHandler(ScDocShell* pDocShell, ScTabVi
while( pFrame && pHdl==NULL)
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
if(pViewSh!=NULL)
{
pHdl=pViewSh->GetInputHandler();
@@ -560,7 +559,7 @@ void ScFormulaDlg::clear()
pScMod->SetRefInputHdl(NULL);
// force Enable() of edit line
- ScTabViewShell* pScViewShell = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ ScTabViewShell* pScViewShell = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
if ( pScViewShell )
pScViewShell->UpdateInputHandler();
}
@@ -577,7 +576,7 @@ void ScFormulaDlg::switchBack()
}
// restore current chart (cause mouse-RefInput)
- ScTabViewShell* pScViewShell = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ ScTabViewShell* pScViewShell = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
if ( pScViewShell )
{
ScViewData& rVD=pScViewShell->GetViewData();
diff --git a/sc/source/ui/inc/ChildWindowWrapper.hxx b/sc/source/ui/inc/ChildWindowWrapper.hxx
index aec24f93d6cd..bfedab53af8d 100644
--- a/sc/source/ui/inc/ChildWindowWrapper.hxx
+++ b/sc/source/ui/inc/ChildWindowWrapper.hxx
@@ -28,7 +28,7 @@ public:
{
ScTabViewShell* pViewShell = getTabViewShell( pBindings );
if (!pViewShell)
- pViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ pViewShell = dynamic_cast< ScTabViewShell *>( SfxViewShell::Current() );
OSL_ENSURE(pViewShell, "Missing view shell!");
if (pViewShell)
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 796c9594406e..43c8b1bfce97 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -36,7 +36,7 @@ struct ScHeaderFieldData;
class ScPreviewLocationData;
class CommandEvent;
-class ScPreviewShell: public SfxViewShell
+class SC_DLLPUBLIC ScPreviewShell: public SfxViewShell
{
ScDocShell* pDocShell;
@@ -75,7 +75,7 @@ protected:
virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, bool bBrowse = false ) SAL_OVERRIDE;
public:
- TYPEINFO_VISIBILITY_OVERRIDE( SC_DLLPUBLIC );
+ TYPEINFO_OVERRIDE();
SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL)
SFX_DECL_VIEWFACTORY(ScPreviewShell);
@@ -116,7 +116,7 @@ public:
const ScPreviewLocationData& GetLocationData();
ScDocument& GetDocument();
- SC_DLLPUBLIC ScPreview* GetPreview() { return pPreview; }
+ ScPreview* GetPreview() { return pPreview; }
};
#endif
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 9a0bf9f20437..f636120fe131 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -89,7 +89,7 @@ enum ObjectSelectionType
OST_Media
};
-class ScTabViewShell: public SfxViewShell, public ScDBFunc
+class SC_DLLPUBLIC ScTabViewShell: public SfxViewShell, public ScDBFunc
{
private:
SvxHtmlOptions aHTMLOpt;
@@ -220,7 +220,7 @@ protected:
virtual SdrView* GetDrawView() const SAL_OVERRIDE;
public:
- TYPEINFO_VISIBILITY_OVERRIDE(SC_DLLPUBLIC);
+ TYPEINFO_OVERRIDE();
SFX_DECL_INTERFACE(SCID_TABVIEW_SHELL)
SFX_DECL_VIEWFACTORY(ScTabViewShell);
@@ -236,7 +236,7 @@ public:
virtual ~ScTabViewShell();
- SC_DLLPUBLIC vcl::Window* GetDialogParent();
+ vcl::Window* GetDialogParent();
bool IsRefInputMode() const;
void ExecuteInputDirect();
@@ -252,8 +252,8 @@ public:
::editeng::SvxBorderLine* GetDefaultFrameLine() const { return pCurFrameLine; }
void SetDefaultFrameLine(const ::editeng::SvxBorderLine* pLine );
- SC_DLLPUBLIC void Execute( SfxRequest& rReq );
- SC_DLLPUBLIC void GetState( SfxItemSet& rSet );
+ void Execute( SfxRequest& rReq );
+ void GetState( SfxItemSet& rSet );
void ExecuteTable( SfxRequest& rReq );
void GetStateTable( SfxItemSet& rSet );
@@ -340,7 +340,7 @@ public:
void DeactivateOle();
- SC_DLLPUBLIC static ScTabViewShell* GetActiveViewShell();
+ static ScTabViewShell* GetActiveViewShell();
VclPtr<SfxModelessDialog> CreateRefDialog( SfxBindings* pB, SfxChildWindow* pCW,
SfxChildWinInfo* pInfo,
vcl::Window* pParent, sal_uInt16 nSlotId );
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 93232fde5e22..385537a20f26 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -92,8 +92,7 @@ void ScFormulaReferenceHelper::dispose()
void ScFormulaReferenceHelper::enableInput( bool bEnable )
{
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType));
+ ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -103,7 +102,7 @@ void ScFormulaReferenceHelper::enableInput( bool bEnable )
if ( !pFrame->GetFrame().IsInPlace() )
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
if(pViewSh!=NULL)
{
vcl::Window *pWin=pViewSh->GetWindow();
@@ -122,7 +121,7 @@ void ScFormulaReferenceHelper::enableInput( bool bEnable )
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType));
+ pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
}
}
@@ -655,8 +654,7 @@ void ScFormulaReferenceHelper::SetDispatcherLock( bool bLock )
{
// lock / unlock only the dispatchers of Calc documents
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType));
+ ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -668,7 +666,7 @@ void ScFormulaReferenceHelper::SetDispatcherLock( bool bLock )
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType));
+ pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
}
// if a new view is created while the dialog is open,
@@ -684,8 +682,7 @@ void ScFormulaReferenceHelper::ViewShellChanged()
}
void ScFormulaReferenceHelper::EnableSpreadsheets(bool bFlag, bool bChildren)
{
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType));
+ ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -695,7 +692,7 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(bool bFlag, bool bChildren)
if ( !pFrame->GetFrame().IsInPlace() )
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
if(pViewSh!=NULL)
{
vcl::Window *pWin=pViewSh->GetWindow();
@@ -714,14 +711,13 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(bool bFlag, bool bChildren)
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType));
+ pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
}
}
static void lcl_InvalidateWindows()
{
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType));
+ ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -731,7 +727,7 @@ static void lcl_InvalidateWindows()
if ( !pFrame->GetFrame().IsInPlace() )
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
if(pViewSh!=NULL)
{
vcl::Window *pWin=pViewSh->GetWindow();
@@ -746,18 +742,17 @@ static void lcl_InvalidateWindows()
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType));
+ pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
}
}
static void lcl_HideAllReferences()
{
- TypeId aScType = TYPE(ScTabViewShell);
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> );
while ( pSh )
{
static_cast<ScTabViewShell*>(pSh)->ClearHighlightRanges();
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> );
}
}
@@ -799,7 +794,7 @@ bool ScRefHandler::EnterRefMode()
SfxViewFrame* pMyViewFrm = pMyDisp->GetFrame();
if (pMyViewFrm)
{
- pScViewShell = PTR_CAST( ScTabViewShell, pMyViewFrm->GetViewShell() );
+ pScViewShell = dynamic_cast<ScTabViewShell*>( pMyViewFrm->GetViewShell() );
if( pScViewShell )
pScViewShell->UpdateInputHandler(true);
pParentDoc = pMyViewFrm->GetObjectShell();
@@ -875,8 +870,7 @@ void ScRefHandler::SwitchToDocument()
}
}
- TypeId aScType = TYPE(ScTabViewShell);
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> );
while ( pSh )
{
SfxObjectShell* pObjSh = pSh->GetObjectShell();
@@ -886,7 +880,7 @@ void ScRefHandler::SwitchToDocument()
static_cast<ScTabViewShell*>(pSh)->SetActive();
return;
}
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> );
}
}
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index a6f2f24620fe..e1f9226ae5d9 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -227,7 +227,7 @@ void ScMoveTableDlg::InitDocListBox()
while ( pSh )
{
- pScSh = PTR_CAST( ScDocShell, pSh );
+ pScSh = dynamic_cast<ScDocShell*>( pSh );
if ( pScSh )
{
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index b6c79df9dafb..9b03f5b0eff3 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -85,13 +85,12 @@ ScDocShell* ScContentTree::GetManualOrCurrent()
ScDocShell* pSh = NULL;
if ( !aManualDoc.isEmpty() )
{
- TypeId aScType = TYPE(ScDocShell);
- SfxObjectShell* pObjSh = SfxObjectShell::GetFirst( &aScType );
+ SfxObjectShell* pObjSh = SfxObjectShell::GetFirst( checkSfxObjectShell<ScDocShell> );
while ( pObjSh && !pSh )
{
if ( pObjSh->GetTitle() == aManualDoc )
- pSh = PTR_CAST( ScDocShell, pObjSh );
- pObjSh = SfxObjectShell::GetNext( *pObjSh, &aScType );
+ pSh = dynamic_cast<ScDocShell*>( pObjSh );
+ pObjSh = SfxObjectShell::GetNext( *pObjSh, checkSfxObjectShell<ScDocShell> );
}
}
else
@@ -103,7 +102,7 @@ ScDocShell* ScContentTree::GetManualOrCurrent()
if ( pViewSh )
{
SfxObjectShell* pObjSh = pViewSh->GetViewFrame()->GetObjectShell();
- pSh = PTR_CAST( ScDocShell, pObjSh );
+ pSh = dynamic_cast<ScDocShell*>( pObjSh );
}
}
@@ -593,11 +592,11 @@ void ScContentTree::Command( const CommandEvent& rCEvt )
sal_uInt16 i=0;
sal_uInt16 nPos=0;
// geladene Dokumente
- ScDocShell* pCurrentSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ ScDocShell* pCurrentSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
SfxObjectShell* pSh = SfxObjectShell::GetFirst();
while ( pSh )
{
- if ( pSh->ISA(ScDocShell) )
+ if ( dynamic_cast<const ScDocShell*>( pSh) != nullptr )
{
OUString aName = pSh->GetTitle();
OUString aEntry = aName;
@@ -1028,7 +1027,7 @@ void ScContentTree::GetLinkNames()
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
+ if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr)
InsertContent( ScContentId::AREALINK, static_cast<ScAreaLink*>(pBase)->GetSource() );
// in der Liste die Namen der Quellbereiche
@@ -1049,7 +1048,7 @@ const ScAreaLink* ScContentTree::GetLink( sal_uLong nIndex )
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
+ if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr)
{
if (nFound == nIndex)
return static_cast<const ScAreaLink*>(pBase);
@@ -1592,7 +1591,7 @@ void ScContentTree::SelectDoc(const OUString& rName) // rName wie im Menue/
SfxObjectShell* pSh = SfxObjectShell::GetFirst();
while ( pSh && !bLoaded )
{
- if ( pSh->ISA(ScDocShell) )
+ if ( dynamic_cast<const ScDocShell*>( pSh) != nullptr )
if ( pSh->GetTitle() == aRealName )
bLoaded = true;
pSh = SfxObjectShell::GetNext( *pSh );
diff --git a/sc/source/ui/navipi/navcitem.cxx b/sc/source/ui/navipi/navcitem.cxx
index ef981c99aaea..bfbf7fe90759 100644
--- a/sc/source/ui/navipi/navcitem.cxx
+++ b/sc/source/ui/navipi/navcitem.cxx
@@ -43,7 +43,7 @@ void ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, SfxItemStat
case SID_CURRENTCELL:
if ( pItem )
{
- const SfxStringItem* pCellPosItem = PTR_CAST(SfxStringItem, pItem);
+ const SfxStringItem* pCellPosItem = dynamic_cast<const SfxStringItem*>( pItem );
OSL_ENSURE( pCellPosItem, "SfxStringItem expected!" );
@@ -65,7 +65,7 @@ void ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, SfxItemStat
case SID_CURRENTTAB:
if ( pItem )
{
- const SfxUInt16Item* pTabItem = PTR_CAST(SfxUInt16Item, pItem);
+ const SfxUInt16Item* pTabItem = dynamic_cast< const SfxUInt16Item *>( pItem );
OSL_ENSURE( pTabItem, "SfxUInt16Item expected!" );
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 382488ba777b..0b564f1c93bd 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -990,7 +990,7 @@ void ScNavigatorDlg::SetCurrentDoc( const OUString& rDocName ) // activat
ScTabViewShell* ScNavigatorDlg::GetTabViewShell()
{
- return PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ return dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
}
ScNavigatorSettings* ScNavigatorDlg::GetNavigatorSettings()
@@ -1204,13 +1204,13 @@ void ScNavigatorDlg::GetDocNames( const OUString* pManualSel )
aLbDocuments->Clear();
aLbDocuments->SetUpdateMode( false );
- ScDocShell* pCurrentSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ ScDocShell* pCurrentSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
OUString aSelEntry;
SfxObjectShell* pSh = SfxObjectShell::GetFirst();
while ( pSh )
{
- if ( pSh->ISA(ScDocShell) )
+ if ( dynamic_cast<const ScDocShell*>( pSh) != nullptr )
{
OUString aName = pSh->GetTitle();
OUString aEntry = aName;
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index a8e53ab997a5..322a154c9965 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -252,7 +252,7 @@ void ScScenarioWindow::NotifyState( const SfxPoolItem* pState )
{
aLbScenario->Enable();
- if ( pState->ISA(SfxStringItem) )
+ if ( dynamic_cast<const SfxStringItem*>( pState) != nullptr )
{
OUString aNewEntry( static_cast<const SfxStringItem*>(pState)->GetValue() );
@@ -261,7 +261,7 @@ void ScScenarioWindow::NotifyState( const SfxPoolItem* pState )
else
aLbScenario->SetNoSelection();
}
- else if ( pState->ISA(SfxStringListItem) )
+ else if ( dynamic_cast<const SfxStringListItem*>( pState) != nullptr )
{
aLbScenario->UpdateEntries( static_cast<const SfxStringListItem*>(pState)->GetList() );
}
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index e2bea02f386c..5322adf821b5 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -124,7 +124,7 @@ bool ScRedlineOptionsTabPage::FillItemSet( SfxItemSet* /* rSet */ )
// Repaint (wenn alles ueber Items laufen wuerde, wie es sich gehoert,
// waere das nicht noetig...)
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
if (pDocSh)
pDocSh->PostPaintGridAll();
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 3b8de0f93041..2c96167fb022 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -109,7 +109,7 @@ void ScTpUserLists::dispose()
void ScTpUserLists::Init()
{
SfxViewShell* pSh = SfxViewShell::Current();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell, pSh);
+ ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( pSh );
mpLbLists->SetSelectHdl ( LINK( this, ScTpUserLists, LbSelectHdl ) );
mpBtnNew->SetClickHdl ( LINK( this, ScTpUserLists, BtnClickHdl ) );
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 4511ce716664..c2db50993c06 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -308,7 +308,7 @@ void ScTpContentOptions::InitGridOpt()
{
SfxObjectShell* pDocSh = SfxObjectShell::Current();
// there might be another DocShell here
- pDocSh = PTR_CAST(ScDocShell, pDocSh);
+ pDocSh = dynamic_cast<ScDocShell*>( pDocSh );
XColorListRef pColorList;
if ( pDocSh )
@@ -459,7 +459,7 @@ VclPtr<SfxTabPage> ScTpLayoutOptions::Create( vcl::Window* pParent,
const SfxItemSet* rCoreSet )
{
VclPtrInstance<ScTpLayoutOptions> pNew( pParent, *rCoreSet );
- ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell *>( SfxObjectShell::Current() );
if(pDocSh!=NULL)
pNew->SetDocument(&pDocSh->GetDocument());
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index 9db2934591f8..334a8d4b9882 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -119,8 +119,8 @@ ScPrintAreasDlg::ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Win
get(pBtnOk,"ok");
get(pBtnCancel,"cancel");
- ScTabViewShell* pScViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
- ScDocShell* pScDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ ScTabViewShell* pScViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
+ ScDocShell* pScDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
OSL_ENSURE( pScDocSh, "Current DocumentShell not found :-(" );
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 2f1cb0daafe6..2fb3a486d794 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -391,7 +391,7 @@ void ScHFEditPage::SetSelectDefinedList()
if(pFieldItem)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxTableField))
+ if(pField && dynamic_cast<const SvxTableField*>( pField) != nullptr)
{
eSelectEntry = eSheetEntry;
bFound = true;
@@ -530,7 +530,7 @@ bool ScHFEditPage::IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj)
if(pFieldItem)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxPageField))
+ if(pField && dynamic_cast<const SvxPageField*>( pField) != nullptr)
bReturn = true;
}
}
@@ -552,7 +552,7 @@ bool ScHFEditPage::IsDateEntry(EditTextObject* pTextObj)
if(pFieldItem)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxDateField))
+ if(pField && dynamic_cast<const SvxDateField*>( pField) != nullptr)
bReturn = true;
}
}
@@ -570,7 +570,7 @@ bool ScHFEditPage::IsExtFileNameEntry(EditTextObject* pTextObj)
if(pFieldItem)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxExtFileField))
+ if(pField && dynamic_cast<const SvxExtFileField*>( pField) != nullptr)
bReturn = true;
}
}
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index b8bb332aeee4..716e5238debd 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -54,7 +54,7 @@ ScHFPage::ScHFPage( vcl::Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSe
SetExchangeSupport();
SfxViewShell* pSh = SfxViewShell::Current();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,pSh);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( pSh );
m_pBtnEdit->Show();
aDataSet.Put( rSet );
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index a152453b8fbc..b1c833cb028a 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 )
SfxViewShell* pShell = SfxViewShell::Current();
if (pShell)
{
- if (pShell->ISA(ScTabViewShell))
+ if (dynamic_cast<const ScTabViewShell*>( pShell) != nullptr)
static_cast<ScTabViewShell*>(pShell)->FillFieldData(rData);
- else if (pShell->ISA(ScPreviewShell))
+ else if (dynamic_cast<const ScPreviewShell*>( pShell) != nullptr)
static_cast<ScPreviewShell*>(pShell)->FillFieldData(rData);
}
}
@@ -191,7 +191,7 @@ void ScEditWindow::SetCharAttributes()
SfxViewShell* pViewSh = SfxViewShell::Current();
- ScTabViewShell* pTabViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ ScTabViewShell* pTabViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
OSL_ENSURE( pDocSh, "Current DocShell not found" );
OSL_ENSURE( pViewSh, "Current ViewShell not found" );
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index 9ef96251d0e9..bbe7da3eb5cd 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -276,7 +276,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate(
case SID_H_ALIGNCELL:
{
SvxCellHorJustify meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
- if(eState >= SfxItemState::DEFAULT && pState && pState->ISA(SvxHorJustifyItem) )
+ if(eState >= SfxItemState::DEFAULT && pState && dynamic_cast<const SvxHorJustifyItem*>( pState) != nullptr )
{
const SvxHorJustifyItem* pItem = static_cast<const SvxHorJustifyItem*>(pState);
meHorAlignState = (SvxCellHorJustify)pItem->GetValue();
@@ -298,7 +298,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate(
}
break;
case SID_ATTR_ALIGN_INDENT:
- if(eState >= SfxItemState::DEFAULT && pState && pState->ISA(SfxUInt16Item) )
+ if(eState >= SfxItemState::DEFAULT && pState && dynamic_cast<const SfxUInt16Item*>( pState) != nullptr )
{
const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pState);
sal_uInt16 nVal = pItem->GetValue();
@@ -311,7 +311,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate(
}
break;
case FID_MERGE_TOGGLE:
- if(eState >= SfxItemState::DEFAULT && pState && pState->ISA(SfxBoolItem) )
+ if(eState >= SfxItemState::DEFAULT && pState && dynamic_cast<const SfxBoolItem*>( pState) != nullptr )
{
mpCBXMergeCell->Enable();
const SfxBoolItem* pItem = static_cast<const SfxBoolItem*>(pState);
@@ -334,7 +334,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate(
else
{
mpCBXWrapText->Enable();
- if(eState >= SfxItemState::DEFAULT && pState && pState->ISA(SfxBoolItem) )
+ if(eState >= SfxItemState::DEFAULT && pState && dynamic_cast<const SfxBoolItem*>( pState) != nullptr )
{
mpCBXWrapText->EnableTriState(false);
const SfxBoolItem* pItem = static_cast<const SfxBoolItem*>(pState);
diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx
index 1fba078c212b..8c2bd5d9b0d1 100644
--- a/sc/source/ui/undo/areasave.cxx
+++ b/sc/source/ui/undo/areasave.cxx
@@ -107,7 +107,7 @@ bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const
for (sal_uInt16 i=0; i<nLinkCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
+ if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr)
{
if ( nPos >= size() || !(*this)[nPos].IsEqual( *static_cast<ScAreaLink*>(pBase) ) )
return false;
@@ -128,7 +128,7 @@ static ScAreaLink* lcl_FindLink( const ::sfx2::SvBaseLinks& rLinks, const ScArea
for (sal_uInt16 i=0; i<nLinkCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if ( pBase->ISA(ScAreaLink) &&
+ if ( dynamic_cast<const ScAreaLink*>( pBase) != nullptr &&
rSaver.IsEqualSource( *static_cast<ScAreaLink*>(pBase) ) )
{
return static_cast<ScAreaLink*>(pBase); // found
@@ -173,7 +173,7 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum
for (sal_uInt16 i=0; i<nLinkCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
+ if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr)
{
if (!pColl)
pColl = new ScAreaLinkSaveCollection;
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index cecea867609f..522f64b2beb5 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -75,7 +75,7 @@ bool ScSimpleUndo::Merge( SfxUndoAction *pNextAction )
// AddUndoAction is only called with bTryMerg=sal_True
// for automatic update.
- if ( !pDetectiveUndo && pNextAction->ISA(ScUndoDraw) )
+ if ( !pDetectiveUndo && dynamic_cast<const ScUndoDraw*>( pNextAction) != nullptr )
{
// Take SdrUndoAction from ScUndoDraw Action,
// ScUndoDraw is later deleted by the UndoManager
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 3c88e4798d16..023f52971bd4 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -130,11 +130,11 @@ bool ScUndoInsertCells::Merge( SfxUndoAction* pNextAction )
if ( pPasteUndo )
return pPasteUndo->Merge( pNextAction );
- if ( bPartOfPaste && pNextAction->ISA( ScUndoWrapper ) )
+ if ( bPartOfPaste && dynamic_cast<const ScUndoWrapper*>( pNextAction) != nullptr )
{
ScUndoWrapper* pWrapper = static_cast<ScUndoWrapper*>(pNextAction);
SfxUndoAction* pWrappedAction = pWrapper->GetWrappedUndo();
- if ( pWrappedAction && pWrappedAction->ISA( ScUndoPaste ) )
+ if ( pWrappedAction && dynamic_cast<const ScUndoPaste*>( pWrappedAction) != nullptr )
{
// Store paste action if this is part of paste with inserting cells.
// A list action isn't used because Repeat wouldn't work (insert wrong cells).
@@ -311,7 +311,7 @@ void ScUndoInsertCells::Redo()
void ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
if ( pPasteUndo )
{
@@ -327,7 +327,7 @@ void ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoInsertCells::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoDeleteCells::ScUndoDeleteCells( ScDocShell* pNewDocShell,
@@ -555,13 +555,13 @@ void ScUndoDeleteCells::Redo()
void ScUndoDeleteCells::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DeleteCells( eCmd );
}
bool ScUndoDeleteCells::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
// delete cells in multiselection
@@ -734,13 +734,13 @@ void ScUndoDeleteMulti::Redo()
void ScUndoDeleteMulti::Repeat(SfxRepeatTarget& rTarget)
{
// if single selection
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DeleteCells( DEL_DELROWS );
}
bool ScUndoDeleteMulti::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoCut::ScUndoCut( ScDocShell* pNewDocShell,
@@ -835,13 +835,13 @@ void ScUndoCut::Redo()
void ScUndoCut::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->CutToClip( NULL, true );
}
bool ScUndoCut::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoPaste::ScUndoPaste( ScDocShell* pNewDocShell, const ScRangeList& rRanges,
@@ -1095,7 +1095,7 @@ void ScUndoPaste::Redo()
void ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell* pViewSh = static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pViewSh->GetActiveWin() );
@@ -1113,7 +1113,7 @@ void ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoPaste::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoDragDrop::ScUndoDragDrop( ScDocShell* pNewDocShell,
@@ -1498,13 +1498,13 @@ void ScUndoListNames::Redo()
void ScUndoListNames::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->InsertNameList();
}
bool ScUndoListNames::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoConditionalFormat::ScUndoConditionalFormat(ScDocShell* pNewDocShell,
@@ -1660,7 +1660,7 @@ void ScUndoUseScenario::Redo()
void ScUndoUseScenario::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
OUString aTemp = aName;
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->UseScenario(aTemp);
@@ -1669,7 +1669,7 @@ void ScUndoUseScenario::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoUseScenario::CanRepeat(SfxRepeatTarget& rTarget) const
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScViewData& rViewData = static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData();
return !rViewData.GetDocument()->IsScenario( rViewData.GetTabNo() );
@@ -1760,7 +1760,7 @@ void ScUndoSelectionStyle::Redo()
void ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScDocument& rDoc = pDocShell->GetDocument();
ScStyleSheetPool* pStlPool = rDoc.GetStyleSheetPool();
@@ -1779,7 +1779,7 @@ void ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoSelectionStyle::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
sal_uInt16 ScUndoSelectionStyle::GetId() const
@@ -1859,7 +1859,7 @@ void ScUndoEnterMatrix::Redo()
void ScUndoEnterMatrix::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
OUString aTemp = aFormula;
ScDocument& rDoc = pDocShell->GetDocument();
@@ -1869,7 +1869,7 @@ void ScUndoEnterMatrix::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoEnterMatrix::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
static ScRange lcl_GetMultiMarkRange( const ScMarkData& rMark )
@@ -1929,13 +1929,13 @@ void ScUndoIndent::Redo()
void ScUndoIndent::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->ChangeIndent( bIsIncrement );
}
bool ScUndoIndent::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoTransliterate::ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMarkData& rMark,
@@ -1985,13 +1985,13 @@ void ScUndoTransliterate::Redo()
void ScUndoTransliterate::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->TransliterateText( nTransliterationType );
}
bool ScUndoTransliterate::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoClearItems::ScUndoClearItems( ScDocShell* pNewDocShell, const ScMarkData& rMark,
@@ -2046,7 +2046,7 @@ void ScUndoClearItems::Redo()
void ScUndoClearItems::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScViewData& rViewData = static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData();
rViewData.GetDocFunc().ClearItems( rViewData.GetMarkData(), pWhich, false );
@@ -2055,7 +2055,7 @@ void ScUndoClearItems::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoClearItems::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
// remove all line breaks of a table
@@ -2110,7 +2110,7 @@ void ScUndoRemoveBreaks::Redo()
void ScUndoRemoveBreaks::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
rViewShell.RemoveManualBreaks();
@@ -2119,7 +2119,7 @@ void ScUndoRemoveBreaks::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoRemoveBreaks::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoRemoveMerge::ScUndoRemoveMerge( ScDocShell* pNewDocShell,
@@ -2221,13 +2221,13 @@ void ScUndoRemoveMerge::Redo()
void ScUndoRemoveMerge::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->RemoveMerge();
}
bool ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
void ScUndoRemoveMerge::SetCurTab()
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index dfd6242346a9..bf35142c4f6f 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -163,13 +163,13 @@ void ScUndoWidthOrHeight::Redo()
void ScUndoWidthOrHeight::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->SetMarkedWidthOrHeight( bWidth, eMode, nNewSize, true );
}
bool ScUndoWidthOrHeight::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 95b0077b7544..5ebdd63da6bd 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -214,13 +214,13 @@ void ScUndoDeleteContents::Redo()
void ScUndoDeleteContents::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DeleteContents( nFlags );
}
bool ScUndoDeleteContents::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoFillTable::ScUndoFillTable( ScDocShell* pNewDocShell,
@@ -347,13 +347,13 @@ void ScUndoFillTable::Redo()
void ScUndoFillTable::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->FillTab( nFlags, nFunction, bSkipEmpty, bAsLink );
}
bool ScUndoFillTable::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoSelectionAttr::ScUndoSelectionAttr( ScDocShell* pNewDocShell,
@@ -481,7 +481,7 @@ void ScUndoSelectionAttr::Redo()
void ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
if (pLineOuter)
@@ -493,7 +493,7 @@ void ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoSelectionAttr::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell,
@@ -628,7 +628,7 @@ void ScUndoAutoFill::Redo()
void ScUndoAutoFill::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
if (eFillCmd==FILL_SIMPLE)
@@ -641,7 +641,7 @@ void ScUndoAutoFill::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoMerge::ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption,
@@ -756,7 +756,7 @@ void ScUndoMerge::Redo()
void ScUndoMerge::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
bool bCont = false;
@@ -766,7 +766,7 @@ void ScUndoMerge::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoMerge::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoAutoFormat::ScUndoAutoFormat( ScDocShell* pNewDocShell,
@@ -909,13 +909,13 @@ void ScUndoAutoFormat::Redo()
void ScUndoAutoFormat::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->AutoFormat( nFormatNo );
}
bool ScUndoAutoFormat::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoReplace::ScUndoReplace( ScDocShell* pNewDocShell, const ScMarkData& rMark,
@@ -1088,13 +1088,13 @@ void ScUndoReplace::Redo()
void ScUndoReplace::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->SearchAndReplace( pSearchItem, true, false );
}
bool ScUndoReplace::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
// multi-operation (only simple blocks)
@@ -1270,13 +1270,13 @@ void ScUndoConversion::Redo()
void ScUndoConversion::Repeat( SfxRepeatTarget& rTarget )
{
- if( rTarget.ISA( ScTabViewTarget ) )
+ if( dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr )
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DoSheetConversion( maConvParam );
}
bool ScUndoConversion::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA( ScTabViewTarget );
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoRefConversion::ScUndoRefConversion( ScDocShell* pNewDocShell,
@@ -1356,13 +1356,13 @@ void ScUndoRefConversion::Redo()
void ScUndoRefConversion::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DoRefConversion();
}
bool ScUndoRefConversion::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoRefreshLink::ScUndoRefreshLink( ScDocShell* pNewDocShell,
@@ -1482,7 +1482,7 @@ static ScAreaLink* lcl_FindAreaLink( sfx2::LinkManager* pLinkManager, const OUSt
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
+ if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr)
if ( static_cast<ScAreaLink*>(pBase)->IsEqual( rDoc, rFlt, rOpt, rSrc, rDest ) )
return static_cast<ScAreaLink*>(pBase);
}
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index e90875be756c..d95a94422d9e 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -175,13 +175,13 @@ void ScUndoCursorAttr::Redo()
void ScUndoCursorAttr::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->ApplySelectionPattern( *pApplyPattern );
}
bool ScUndoCursorAttr::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoEnterData::Value::Value() : mnTab(-1), mbHasFormat(false), mnFormat(0) {}
@@ -313,7 +313,7 @@ void ScUndoEnterData::Redo()
void ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
OUString aTemp = maNewString;
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->EnterDataAtCursor( aTemp );
@@ -322,7 +322,7 @@ void ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoEnterData::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoEnterValue::ScUndoEnterValue(
@@ -559,7 +559,7 @@ void ScUndoPageBreak::Redo()
void ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
@@ -572,7 +572,7 @@ void ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoPageBreak::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoPrintZoom::ScUndoPrintZoom( ScDocShell* pNewDocShell,
@@ -632,7 +632,7 @@ void ScUndoPrintZoom::Redo()
void ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
ScViewData& rViewData = rViewShell.GetViewData();
@@ -642,7 +642,7 @@ void ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoPrintZoom::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoThesaurus::ScUndoThesaurus(
@@ -717,13 +717,13 @@ void ScUndoThesaurus::Redo()
void ScUndoThesaurus::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DoThesaurus();
}
bool ScUndoThesaurus::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rPos,
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index 849e9f764ab3..1e1775cf7e0a 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -221,7 +221,7 @@ void ScUndoMakeOutline::Redo()
void ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
@@ -234,7 +234,7 @@ void ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoMakeOutline::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoOutlineLevel::ScUndoOutlineLevel( ScDocShell* pNewDocShell,
@@ -314,13 +314,13 @@ void ScUndoOutlineLevel::Redo()
void ScUndoOutlineLevel::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->SelectLevel( bColumns, nLevel, true );
}
bool ScUndoOutlineLevel::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
/** show/hide outline over block marks */
@@ -410,7 +410,7 @@ void ScUndoOutlineBlock::Redo()
void ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
@@ -423,7 +423,7 @@ void ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoOutlineBlock::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoRemoveAllOutlines::ScUndoRemoveAllOutlines( ScDocShell* pNewDocShell,
@@ -502,13 +502,13 @@ void ScUndoRemoveAllOutlines::Redo()
void ScUndoRemoveAllOutlines::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->RemoveAllOutlines();
}
bool ScUndoRemoveAllOutlines::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoAutoOutline::ScUndoAutoOutline( ScDocShell* pNewDocShell,
@@ -605,13 +605,13 @@ void ScUndoAutoOutline::Redo()
void ScUndoAutoOutline::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->AutoOutline();
}
bool ScUndoAutoOutline::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoSubTotals::ScUndoSubTotals( ScDocShell* pNewDocShell, SCTAB nNewTab,
@@ -1239,7 +1239,7 @@ void ScUndoImportData::Redo()
void ScUndoImportData::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell& rViewShell = *static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
@@ -1257,7 +1257,7 @@ bool ScUndoImportData::CanRepeat(SfxRepeatTarget& rTarget) const
// Repeat only for import using a database range, then pUndoDBData is set
if (pUndoDBData)
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
else
return false; // Address book
}
@@ -1416,13 +1416,13 @@ void ScUndoRepeatDB::Redo()
void ScUndoRepeatDB::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->RepeatDB();
}
bool ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoDataPilot::ScUndoDataPilot( ScDocShell* pNewDocShell,
@@ -1877,7 +1877,7 @@ void ScUndoDataForm::Repeat(SfxRepeatTarget& /*rTarget*/)
bool ScUndoDataForm::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr);
}
void ScUndoDataForm::DoChange( const bool bUndo )
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 2b20217f53dc..044035d1a2cc 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -159,14 +159,14 @@ void ScUndoInsertTab::Redo()
void ScUndoInsertTab::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData().GetDispatcher().
Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD);
}
bool ScUndoInsertTab::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoInsertTables::ScUndoInsertTables( ScDocShell* pNewDocShell,
@@ -254,14 +254,14 @@ void ScUndoInsertTables::Redo()
void ScUndoInsertTables::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData().GetDispatcher().
Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD);
}
bool ScUndoInsertTables::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell, const vector<SCTAB> &aTab,
@@ -412,7 +412,7 @@ void ScUndoDeleteTab::Redo()
void ScUndoDeleteTab::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
ScTabViewShell* pViewShell = static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
pViewShell->DeleteTable( pViewShell->GetViewData().GetTabNo() );
@@ -421,7 +421,7 @@ void ScUndoDeleteTab::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoDeleteTab::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoRenameTab::ScUndoRenameTab( ScDocShell* pNewDocShell,
@@ -866,7 +866,7 @@ void ScUndoMakeScenario::Redo()
void ScUndoMakeScenario::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
{
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->MakeScenario( aName, aComment, aColor, nFlags );
}
@@ -874,7 +874,7 @@ void ScUndoMakeScenario::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoMakeScenario::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoImportTab::ScUndoImportTab( ScDocShell* pShell,
@@ -1023,14 +1023,14 @@ void ScUndoImportTab::Redo()
void ScUndoImportTab::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData().GetDispatcher().
Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD);
}
bool ScUndoImportTab::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
ScUndoRemoveLink::ScUndoRemoveLink( ScDocShell* pShell, const OUString& rDocName ) :
@@ -1156,7 +1156,7 @@ void ScUndoShowHideTab::Redo()
void ScUndoShowHideTab::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData().GetDispatcher().
Execute( bShow ? FID_TABLE_SHOW : FID_TABLE_HIDE,
SfxCallMode::SLOT | SfxCallMode::RECORD);
@@ -1164,7 +1164,7 @@ void ScUndoShowHideTab::Repeat(SfxRepeatTarget& rTarget)
bool ScUndoShowHideTab::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
OUString ScUndoShowHideTab::GetComment() const
@@ -1563,14 +1563,14 @@ void ScUndoLayoutRTL::Redo()
void ScUndoLayoutRTL::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ if (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr)
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->GetViewData().GetDispatcher().
Execute( FID_TAB_RTL, SfxCallMode::SLOT | SfxCallMode::RECORD);
}
bool ScUndoLayoutRTL::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA(ScTabViewTarget);
+ return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
}
OUString ScUndoLayoutRTL::GetComment() const
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 855d65983af6..f11d9edccc60 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -4778,7 +4778,7 @@ uno::Sequence<OUString> SAL_CALL ScCellRangesObj::getSupportedServiceNames()
uno::Reference<table::XCellRange> ScCellRangeObj::CreateRangeFromDoc( ScDocument* pDoc, const ScRange& rR )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr )
return new ScCellRangeObj( static_cast<ScDocShell*>(pObjSh), rR );
return NULL;
}
@@ -7683,7 +7683,7 @@ void SAL_CALL ScTableSheetObj::link( const OUString& aUrl, const OUString& aShee
for ( sal_uInt16 i=0; i<nCount; i++ )
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
- if (pBase->ISA(ScTableLink))
+ if (dynamic_cast<const ScTableLink*>( pBase) != nullptr)
{
ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase);
if ( aFileString.equals(pTabLink->GetFileName()) )
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index f9c7fdec8bbe..0c7954ea1496 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -719,16 +719,16 @@ OString ScModelObj::getTextSelection(const char* pMimeType, OString& rUsedMimeTy
ScViewData* pViewData = ScDocShell::GetViewData();
uno::Reference<datatransfer::XTransferable> xTransferable;
- if (( pShell = PTR_CAST( ScEditShell, pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) )))
+ if (( pShell = dynamic_cast<ScEditShell*>( pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) )) )
xTransferable = pShell->GetEditView()->GetTransferable();
- else if ((PTR_CAST( ScDrawTextObjectBar, pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) )))
+ else if ( 0 != dynamic_cast<ScDrawTextObjectBar*>( pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) ))
{
ScDrawView* pView = pViewData->GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
if (pOutView)
xTransferable = pOutView->GetEditView().GetTransferable();
}
- else if (( pDrawShell = PTR_CAST( ScDrawShell, pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) )))
+ else if (( pDrawShell = dynamic_cast<ScDrawShell*>( pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) )) )
xTransferable = pDrawShell->GetDrawView()->CopyToTransferable();
else
{
@@ -1571,7 +1571,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab );
long nTabStart = pPrintFuncCache->GetTabStart( nTab );
- vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pDev->GetExtOutDevData() );
+ vcl::PDFExtOutDevData* pPDFData = dynamic_cast< vcl::PDFExtOutDevData* >(pDev->GetExtOutDevData() );
if ( nRenderer == nTabStart )
{
// first page of a sheet: add outline item for the sheet name
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index eb2b8b9fb8f5..ed02a3f1f890 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -116,7 +116,7 @@ ScTableLink* ScSheetLinkObj::GetLink_Impl() const
for (size_t i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
- if (pBase->ISA(ScTableLink))
+ if (dynamic_cast<const ScTableLink*>( pBase) != nullptr)
{
ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase);
if ( pTabLink->GetFileName().equals(aFileName) )
@@ -587,7 +587,7 @@ static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, size_t nPos )
for (size_t i=0; i<nTotalCount; i++)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
- if (pBase->ISA(ScAreaLink))
+ if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr)
{
if ( nAreaCount == nPos )
return static_cast<ScAreaLink*>(pBase);
@@ -1011,7 +1011,7 @@ sal_Int32 SAL_CALL ScAreaLinksObj::getCount() throw(uno::RuntimeException, std::
for (size_t i=0; i<nTotalCount; i++)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
- if (pBase->ISA(ScAreaLink))
+ if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr)
++nAreaCount;
}
}
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index ed20b5b793a3..03716f8cfcac 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -344,7 +344,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
if ( pDoc )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr )
{
ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh);
@@ -479,7 +479,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
if ( pDoc )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr )
{
ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh);
uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
@@ -577,7 +577,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
if ( pDoc )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr )
{
ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh);
uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
@@ -676,7 +676,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
if ( lcl_GetPageNum( pPage, *pModel, nTab ) )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr )
{
ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh);
uno::Reference< uno::XInterface > xAnchor;
@@ -1033,7 +1033,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScShapeObj::getAnchor()
if ( pDoc )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr )
{
ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh);
@@ -1293,7 +1293,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScShapeObj::getParent() throw (uno::R
if ( pDoc )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) != nullptr )
{
ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh);
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index a810a5ff6cc2..556be91cba78 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -2229,11 +2229,11 @@ ScTabViewObj* ScTabViewObj::getImplementation(const uno::Reference<uno::XInterfa
std::exception)
{
SolarMutexGuard aGuard;
- ScEditShell* pShell = PTR_CAST( ScEditShell, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
+ ScEditShell* pShell = dynamic_cast<ScEditShell*>( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pShell)
return pShell->GetEditView()->GetTransferable();
- ScDrawTextObjectBar* pTextShell = PTR_CAST( ScDrawTextObjectBar, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
+ ScDrawTextObjectBar* pTextShell = dynamic_cast<ScDrawTextObjectBar*>( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pTextShell)
{
ScViewData& rViewData = GetViewShell()->GetViewData();
@@ -2243,7 +2243,7 @@ ScTabViewObj* ScTabViewObj::getImplementation(const uno::Reference<uno::XInterfa
return pOutView->GetEditView().GetTransferable();
}
- ScDrawShell* pDrawShell = PTR_CAST( ScDrawShell, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
+ ScDrawShell* pDrawShell = dynamic_cast<ScDrawShell*>( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pDrawShell)
return pDrawShell->GetDrawView()->CopyToTransferable();
@@ -2258,12 +2258,12 @@ void SAL_CALL ScTabViewObj::insertTransferable( const ::com::sun::star::uno::Ref
std::exception)
{
SolarMutexGuard aGuard;
- ScEditShell* pShell = PTR_CAST( ScEditShell, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
+ ScEditShell* pShell = dynamic_cast<ScEditShell*>( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pShell)
pShell->GetEditView()->InsertText( xTrans, OUString(), false );
else
{
- ScDrawTextObjectBar* pTextShell = PTR_CAST( ScDrawTextObjectBar, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
+ ScDrawTextObjectBar* pTextShell = dynamic_cast<ScDrawTextObjectBar*>( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pTextShell)
{
ScViewData& rViewData = GetViewShell()->GetViewData();
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index 5f6b24e73d29..0b6541ca8cb7 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -521,7 +521,7 @@ void ScVbaWorksheets::PrintPreview( const css::uno::Any& /*EnableChanges*/ ) thr
dispatchExecute( pViewShell, SID_VIEWSHELL1 );
SfxViewShell* pShell = SfxViewShell::Get( pViewFrame->GetFrame().GetFrameInterface()->getController() );
- if ( pShell->ISA( ScPreviewShell ) )
+ if ( dynamic_cast<const ScPreviewShell*>( pShell) != nullptr )
{
ScPreviewShell* pPrvShell = static_cast< ScPreviewShell* >( pShell );
ScPreview* pPrvView = pPrvShell->GetPreview();
diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx
index 4194841c025e..57a95438498f 100644
--- a/sc/source/ui/view/auditsh.cxx
+++ b/sc/source/ui/view/auditsh.cxx
@@ -95,7 +95,7 @@ void ScAuditingShell::Execute( SfxRequest& rReq )
if ( pReqArgs->GetItemState( SID_RANGE_COL, true, &pXItem ) == SfxItemState::SET
&& pReqArgs->GetItemState( SID_RANGE_ROW, true, &pYItem ) == SfxItemState::SET )
{
- OSL_ENSURE( pXItem->ISA(SfxInt16Item) && pYItem->ISA(SfxInt32Item),
+ OSL_ENSURE( dynamic_cast<const SfxInt16Item*>( pXItem) != nullptr && dynamic_cast<const SfxInt32Item*>( pYItem) != nullptr,
"wrong items" );
SCsCOL nCol = static_cast<SCsCOL>(static_cast<const SfxInt16Item*>(pXItem)->GetValue());
SCsROW nRow = static_cast<SCsROW>(static_cast<const SfxInt32Item*>(pYItem)->GetValue());
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 106bc5c2b307..954da76c3e49 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1286,7 +1286,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs &&
pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET &&
- pItem->ISA(SfxUInt32Item) )
+ dynamic_cast<const SfxUInt32Item*>( pItem) != nullptr )
{
nFormat = static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pItem)->GetValue());
}
@@ -1541,7 +1541,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
const SfxPoolItem* pItem=nullptr;
if ( pReqArgs &&
pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET &&
- pItem->ISA(SfxUInt32Item) )
+ dynamic_cast<const SfxUInt32Item*>( pItem) != nullptr )
{
SotClipboardFormatId nFormat = static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pItem)->GetValue());
bool bRet=true;
@@ -2309,12 +2309,12 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem);
if ( pItem )
{
- const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, pItem );
+ const SfxStringItem* pStringItem = dynamic_cast<const SfxStringItem*>( pItem );
if ( pStringItem )
aChars = pStringItem->GetValue();
const SfxPoolItem* pFtItem = nullptr;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
- const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem );
if ( pFontItem )
aFontName = pFontItem->GetValue();
}
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx