From 068d4108e5ae41ca5bc2bcf22277e6235c6bdd0b Mon Sep 17 00:00:00 2001 From: Noel Date: Tue, 2 Feb 2021 09:41:52 +0200 Subject: loplugin:redundantcast catch more dynamic_cast Change-Id: Ia28e58217cefa306567b53688d851fa210b7821c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110287 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/sdr/properties/attributeproperties.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'svx/source/sdr/properties') diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index 55dbf646210e..5ed41b9c4c99 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -99,7 +99,7 @@ namespace sdr::properties void AttributeProperties::ImpRemoveStyleSheet() { // Check type since it is destroyed when the type is deleted - if(GetStyleSheet() && dynamic_cast(mpStyleSheet) != nullptr) + if(GetStyleSheet() && mpStyleSheet) { EndListening(*mpStyleSheet); if (auto const pool = mpStyleSheet->GetPool()) { // TTTT @@ -378,7 +378,7 @@ namespace sdr::properties void AttributeProperties::ForceStyleToHardAttributes() { - if(!GetStyleSheet() || dynamic_cast(mpStyleSheet) == nullptr) + if(!GetStyleSheet() || mpStyleSheet == nullptr) return; // guarantee SfxItemSet existence @@ -457,10 +457,10 @@ namespace sdr::properties // to register as listener to that new StyleSheet. if(!rObj.IsInDestruction()) { - if(dynamic_cast(GetStyleSheet()) != nullptr) + if(SfxStyleSheet* pStyleSheet = GetStyleSheet()) { pNewStSh = static_cast(rModel.GetStyleSheetPool()->Find( - GetStyleSheet()->GetParent(), GetStyleSheet()->GetFamily())); + pStyleSheet->GetParent(), pStyleSheet->GetFamily())); } if(!pNewStSh) -- cgit