summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-08-27 11:06:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-27 18:42:13 +0200
commit9e0b3423f21c23a8ef2fe749ea7dd7c1194c2f9a (patch)
tree26f2674f88359c5e6c3e1d0f888c7b31836c36ee /svx
parentbbd500e14fce92b27cfc09e7cffd346e36eb5fb0 (diff)
loplugin:referencecasting find more redundant static_cast
Change-Id: I3a51812bbd3fcdc6b11e47cb12962f0d4fa7a2ae Reviewed-on: https://gerrit.libreoffice.org/78191 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/imapwnd.cxx20
-rw-r--r--svx/source/gallery2/galbrws2.cxx6
-rw-r--r--svx/source/table/tablecontroller.cxx2
-rw-r--r--svx/source/unodraw/unomtabl.cxx4
4 files changed, 13 insertions, 19 deletions
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 3cc57494dc0a..3a5d0b4ea6b4 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -193,10 +193,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// clipped on CanvasPane
aDrawRect.Intersection( aClipRect );
- pSdrObj = static_cast<SdrObject*>(
- new SdrRectObj(
- *pModel,
- aDrawRect));
+ pSdrObj = new SdrRectObj(*pModel, aDrawRect);
pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapRectangleObject( *pIMapRectObj )));
}
break;
@@ -212,13 +209,12 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// limited to CanvasPane
aCircle.Intersection( aClipRect );
- pSdrObj = static_cast<SdrObject*>(
- new SdrCircObj(
+ pSdrObj = new SdrCircObj(
*pModel,
SdrCircKind::Full,
aCircle,
0,
- 36000));
+ 36000);
pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapCircleObject( *pIMapCircleObj )));
}
break;
@@ -235,13 +231,12 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// clipped on CanvasPane
aDrawRect.Intersection( aClipRect );
- pSdrObj = static_cast<SdrObject*>(
- new SdrCircObj(
+ pSdrObj = new SdrCircObj(
*pModel,
SdrCircKind::Full,
aDrawRect,
0,
- 36000));
+ 36000);
}
else
{
@@ -253,11 +248,10 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
basegfx::B2DPolygon aPolygon;
aPolygon.append(aDrawPoly.getB2DPolygon());
- pSdrObj = static_cast<SdrObject*>(
- new SdrPathObj(
+ pSdrObj = new SdrPathObj(
*pModel,
OBJ_POLY,
- basegfx::B2DPolyPolygon(aPolygon)));
+ basegfx::B2DPolyPolygon(aPolygon));
}
pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapPolygonObject( *pIMapPolyObj )));
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 88e95b540f93..9109b81ad4c7 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -1139,9 +1139,9 @@ void GalleryBrowser2::Execute(const OString &rIdent)
switch( GetMode() )
{
- case GALLERYBROWSERMODE_ICON: pWindow = static_cast<vcl::Window*>(mpIconView); break;
- case GALLERYBROWSERMODE_LIST: pWindow = static_cast<vcl::Window*>(mpListView); break;
- case GALLERYBROWSERMODE_PREVIEW: pWindow = static_cast<vcl::Window*>(mpPreview); break;
+ case GALLERYBROWSERMODE_ICON: pWindow = mpIconView; break;
+ case GALLERYBROWSERMODE_LIST: pWindow = mpListView; break;
+ case GALLERYBROWSERMODE_PREVIEW: pWindow = mpPreview; break;
default:
pWindow = nullptr;
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 2389afe1f6da..5296797e0954 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -2779,7 +2779,7 @@ bool SvxTableController::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNo
{
if (bUndo)
xCell->AddUndo();
- SdrText* pText = static_cast< SdrText* >( xCell.get() );
+ SdrText* pText = xCell.get();
SdrObjEditView::ApplyFormatPaintBrushToText( rFormatSet, rTableObj, pText, bNoCharacterFormats, bNoParagraphFormats );
}
}
diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx
index 227433a792ed..a6d56f20d479 100644
--- a/svx/source/unodraw/unomtabl.cxx
+++ b/svx/source/unodraw/unomtabl.cxx
@@ -188,7 +188,7 @@ void SAL_CALL SvxUnoMarkerTable::removeByName( const OUString& aApiName )
auto aIter = std::find_if(maItemSetVector.begin(), maItemSetVector.end(),
[&aName](const std::unique_ptr<SfxItemSet>& rpItem) {
- const NameOrIndex *pItem = static_cast<const NameOrIndex *>(&(rpItem->Get( XATTR_LINEEND ) ));
+ const NameOrIndex *pItem = &(rpItem->Get( XATTR_LINEEND ) );
return pItem->GetName() == aName;
});
if (aIter != maItemSetVector.end())
@@ -210,7 +210,7 @@ void SAL_CALL SvxUnoMarkerTable::replaceByName( const OUString& aApiName, const
auto aIter = std::find_if(maItemSetVector.begin(), maItemSetVector.end(),
[&aName](const std::unique_ptr<SfxItemSet>& rpItem) {
- const NameOrIndex *pItem = static_cast<const NameOrIndex *>(&(rpItem->Get( XATTR_LINEEND ) ));
+ const NameOrIndex *pItem = &(rpItem->Get( XATTR_LINEEND ) );
return pItem->GetName() == aName;
});
if (aIter != maItemSetVector.end())