summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells
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 /sw/source/uibase/shells
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 'sw/source/uibase/shells')
-rw-r--r--sw/source/uibase/shells/annotsh.cxx12
-rw-r--r--sw/source/uibase/shells/basesh.cxx4
-rw-r--r--sw/source/uibase/shells/drawsh.cxx4
-rw-r--r--sw/source/uibase/shells/drformsh.cxx4
-rw-r--r--sw/source/uibase/shells/drwbassh.cxx4
-rw-r--r--sw/source/uibase/shells/drwtxtex.cxx8
-rw-r--r--sw/source/uibase/shells/drwtxtsh.cxx4
-rw-r--r--sw/source/uibase/shells/frmsh.cxx2
-rw-r--r--sw/source/uibase/shells/grfshex.cxx3
-rw-r--r--sw/source/uibase/shells/mediash.cxx4
-rw-r--r--sw/source/uibase/shells/tabsh.cxx4
-rw-r--r--sw/source/uibase/shells/textdrw.cxx2
-rw-r--r--sw/source/uibase/shells/textsh.cxx4
-rw-r--r--sw/source/uibase/shells/textsh1.cxx6
-rw-r--r--sw/source/uibase/shells/txtnum.cxx2
15 files changed, 33 insertions, 34 deletions
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index bcfae7d184ba..7e052fbeeaf5 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -395,7 +395,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
- if (pFieldItem && pFieldItem->GetField()->ISA(SvxURLField))
+ if (pFieldItem && dynamic_cast< const SvxURLField *>( pFieldItem->GetField() ) != nullptr )
{
// Select the field so that it will be deleted during insert
ESelection aSel = pOLV->GetSelection();
@@ -476,7 +476,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
{
/* mod
SwView* pView = &GetView();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
+ FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric));
*/
SfxItemSet aDlgAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END);
@@ -521,7 +521,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
{
/* mod todo ???
SwView* pView = &GetView();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
+ FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric));
*/
SfxItemSet aDlgAttr(GetPool(),
@@ -935,7 +935,7 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq)
SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
const SfxPoolItem* pItem;
if ( rReq.GetArgs() && rReq.GetArgs()->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());
}
@@ -1059,7 +1059,7 @@ void SwAnnotationShell::StateInsert(SfxItemSet &rSet)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if (pField->ISA(SvxURLField))
+ if (dynamic_cast< const SvxURLField *>( pField ) != nullptr)
{
aHLinkItem.SetName(static_cast<const SvxURLField*>( pField)->GetRepresentation());
aHLinkItem.SetURL(static_cast<const SvxURLField*>( pField)->GetURL());
@@ -1665,7 +1665,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq)
sSym = 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 )
sFontName = pFontItem->GetValue();
}
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 0fa96789c298..0262329fc56d 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1117,7 +1117,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
if( pArgs != NULL
&& pArgs->GetItemState( nSlot, true, &pItem ) == SfxItemState::SET
&& pItem != NULL
- && pItem->ISA( SfxBoolItem ) )
+ && dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr )
{
bool bDesignMode =
static_cast<const SfxBoolItem*>( pItem )->GetValue();
@@ -2109,7 +2109,7 @@ void SwBaseShell::GetTextFontCtrlState( SfxItemSet& rSet )
if(RES_CHRATR_FONT == nWhich)
{
vcl::Font aFont;
- if(pI && pI->ISA(SvxFontItem))
+ if(pI && dynamic_cast< const SvxFontItem *>( pI ) != nullptr)
{
aFont.SetName( static_cast<const SvxFontItem*>(pI)->GetFamilyName());
aFont.SetStyleName(static_cast<const SvxFontItem*>(pI)->GetStyleName());
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index 434dcfc82c2a..4cca4f1a4833 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -281,7 +281,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
case SID_FONTWORK:
{
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rSh.GetView()));
+ FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>( &rSh.GetView()) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
SfxViewFrame* pVFrame = GetView().GetViewFrame();
if (pArgs)
@@ -497,7 +497,7 @@ void SwDrawShell::GetState(SfxItemSet& rSet)
// Allow creating a TextBox only in case this is a draw format without a TextBox so far.
if (pFrameFormat && pFrameFormat->Which() == RES_DRAWFRMFMT && !SwTextBoxHelper::findTextBox(pFrameFormat))
{
- if (SdrObjCustomShape* pCustomShape = PTR_CAST(SdrObjCustomShape, pObj))
+ if (SdrObjCustomShape* pCustomShape = dynamic_cast<SdrObjCustomShape*>( pObj) )
{
const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(pCustomShape->GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY));
if (const uno::Any* pAny = rGeometryItem.GetPropertyValueByName("Type"))
diff --git a/sw/source/uibase/shells/drformsh.cxx b/sw/source/uibase/shells/drformsh.cxx
index 1f8157fa212a..c4f36db3dd20 100644
--- a/sw/source/uibase/shells/drformsh.cxx
+++ b/sw/source/uibase/shells/drformsh.cxx
@@ -89,7 +89,7 @@ void SwDrawFormShell::Execute(SfxRequest &rReq)
const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
if (rMarkList.GetMark(0))
{
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
+ SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( rMarkList.GetMark(0)->GetMarkedSdrObj() );
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
if(bConvertToText)
@@ -177,7 +177,7 @@ void SwDrawFormShell::GetState(SfxItemSet& rSet)
SvxHyperlinkItem aHLinkItem;
if (rMarkList.GetMark(0))
{
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
+ SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( rMarkList.GetMark(0)->GetMarkedSdrObj() );
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel();
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx
index 51707f677cd3..eca6b0489467 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -111,7 +111,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
//Special case align by menu
if(pItem && nSlotId == SID_OBJECT_ALIGN)
{
- OSL_ENSURE(PTR_CAST(SfxEnumItem, pItem),"SfxEnumItem expected");
+ OSL_ENSURE(dynamic_cast<const SfxEnumItem*>( pItem),"SfxEnumItem expected" );
nSlotId = nSlotId + static_cast<const SfxEnumItem*>(pItem)->GetValue();
nSlotId++;
}
@@ -217,7 +217,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
const sal_uInt16* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() );
SfxItemSet aSet( *aNewAttr.GetPool(), pRange );
- FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast<SwWebView*>(&GetView()));
+ FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>(&GetView()) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
aSet.Put( aNewAttr, false );
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index 0a9892e96c29..4c6cabb17fe2 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -332,7 +332,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
}
SwView* pView = &GetView();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
+ FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
SfxItemSet aDlgAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END);
@@ -400,7 +400,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
if (!pArgs)
{
SwView* pView = &GetView();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
+ FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
SfxItemSet aDlgAttr(GetPool(),
EE_ITEMS_START, EE_ITEMS_END,
@@ -468,7 +468,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
- if (pFieldItem && pFieldItem->GetField()->ISA(SvxURLField))
+ if (pFieldItem && dynamic_cast< const SvxURLField *>( pFieldItem->GetField() ) != nullptr )
{
// Select field so that it will be deleted during insert
ESelection aSel = pOLV->GetSelection();
@@ -1043,7 +1043,7 @@ void SwDrawTextShell::StateInsert(SfxItemSet &rSet)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if (pField->ISA(SvxURLField))
+ if (dynamic_cast< const SvxURLField *>( pField ) != nullptr)
{
aHLinkItem.SetName(static_cast<const SvxURLField*>( pField)->GetRepresentation());
aHLinkItem.SetURL(static_cast<const SvxURLField*>( pField)->GetURL());
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index df42de322d73..f42477ab59de 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -182,7 +182,7 @@ bool SwDrawTextShell::IsTextEdit()
void SwDrawTextShell::ExecFontWork(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rSh.GetView()));
+ FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>( &rSh.GetView()) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
SfxViewFrame* pVFrame = GetView().GetViewFrame();
if ( rReq.GetArgs() )
@@ -706,7 +706,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
sSym = 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 )
sFontName = pFontItem->GetValue();
}
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 6adba620f093..ca15226035ce 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -459,7 +459,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
sDefPage = OUStringToOString(static_cast<const SfxStringItem *>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8);
aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame()));
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &GetView()) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric) ));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
assert(pFact);
diff --git a/sw/source/uibase/shells/grfshex.cxx b/sw/source/uibase/shells/grfshex.cxx
index db0694e9a12a..69a18da6a07b 100644
--- a/sw/source/uibase/shells/grfshex.cxx
+++ b/sw/source/uibase/shells/grfshex.cxx
@@ -70,8 +70,7 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq )
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 )
{
aURL = pStringItem->GetValue();
diff --git a/sw/source/uibase/shells/mediash.cxx b/sw/source/uibase/shells/mediash.cxx
index c4326e11fe9c..415f6cbd5524 100644
--- a/sw/source/uibase/shells/mediash.cxx
+++ b/sw/source/uibase/shells/mediash.cxx
@@ -124,7 +124,7 @@ void SwMediaShell::ExecMedia(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 ) );
@@ -167,7 +167,7 @@ void SwMediaShell::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 );
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 228b86583437..2532a7aa9854 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -559,7 +559,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
SfxBindings& rBindings = GetView().GetViewFrame()->GetBindings();
SfxItemSet aCoreSet( GetPool(), aUITableAttrRange);
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rSh.GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &rSh.GetView()) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
std::unique_ptr<SwTableRep> pTableRep(::lcl_TableParamToItemSet( aCoreSet, rSh ));
@@ -616,7 +616,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
SwView* pView = GetActiveView();
if(pView)
{
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
+ FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SvNumberFormatter* pFormatter = rSh.GetNumberFormatter();
SfxItemSet aCoreSet( GetPool(),
diff --git a/sw/source/uibase/shells/textdrw.cxx b/sw/source/uibase/shells/textdrw.cxx
index dc833d3131eb..6d3115710e58 100644
--- a/sw/source/uibase/shells/textdrw.cxx
+++ b/sw/source/uibase/shells/textdrw.cxx
@@ -72,7 +72,7 @@ void SwBaseShell::InsertURLButton(const OUString& rURL, const OUString& rTarget,
const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
if (rMarkList.GetMark(0))
{
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
+ SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( rMarkList.GetMark(0)->GetMarkedSdrObj() );
OSL_ENSURE( pUnoCtrl, "not an SdrUnoObj" );
if (!pUnoCtrl)
return;
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 49a7df724184..c9b9aadb5b20 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -573,7 +573,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
{
SfxItemSet aSet = CreateInsertFrameItemSet(aMgr);
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, GetView().GetDocShell()));
+ FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebDocShell*>( GetView().GetDocShell()) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialog creation failed!");
@@ -989,7 +989,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
aChars = 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 )
aFontName = pFontItem->GetValue();
}
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 6b816cee86a3..b8097987e7d6 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -126,7 +126,7 @@ using namespace svx::sidebar;
void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const SfxItemSet *pArgs, SfxRequest *pReq )
{
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rWrtSh.GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &rWrtSh.GetView()) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SfxItemSet aCoreSet( rWrtSh.GetView().GetPool(),
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
@@ -912,10 +912,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
if ( !pPaM )
pPaM = rWrtSh.GetCrsr();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
+ FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>( &GetView()) != nullptr );
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
- bool bApplyCharUnit = ::HasCharUnit(0 != PTR_CAST(SwWebView, &GetView()));
+ bool bApplyCharUnit = ::HasCharUnit( dynamic_cast<SwWebView*>( &GetView()) != nullptr );
SW_MOD()->PutItem(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bApplyCharUnit));
SfxItemSet aCoreSet( GetPool(), //UUUU sorted by indices, one group of three concatenated
diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx
index 626488e37e00..8651adc994be 100644
--- a/sw/source/uibase/shells/txtnum.cxx
+++ b/sw/source/uibase/shells/txtnum.cxx
@@ -114,7 +114,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
0 );
SwDocShell* pDocSh = GetView().GetDocShell();
- const bool bHtml = 0 != PTR_CAST( SwWebDocShell, pDocSh );
+ const bool bHtml = dynamic_cast<SwWebDocShell*>( pDocSh ) != nullptr;
const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection();
if ( pNumRuleAtCurrentSelection != NULL )
{