svx/source/sdr/properties/customshapeproperties.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
New commits: commit f1552be34859d92865067c296b328770c83580e7 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Mar 6 15:09:44 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Mar 6 19:27:52 2024 +0100 tdf#158773 reduce dynamic_cast'ing in CustomShapeProperties::Notify shaves 2% off the load time Change-Id: Ia7e4747711948ccfeb274cf32028d03486cc14a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164476 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/svx/source/sdr/properties/customshapeproperties.cxx b/svx/source/sdr/properties/customshapeproperties.cxx index cbad73ab78c2..c48e4d3833d4 100644 --- a/svx/source/sdr/properties/customshapeproperties.cxx +++ b/svx/source/sdr/properties/customshapeproperties.cxx @@ -205,18 +205,12 @@ namespace sdr::properties TextProperties::Notify( rBC, rHint ); bool bRemoveRenderGeometry = false; - const SfxStyleSheetHint* pStyleHint = dynamic_cast<const SfxStyleSheetHint*>(&rHint); - if ( pStyleHint && pStyleHint->GetStyleSheet() == GetStyleSheet() ) + if (rHint.GetId() == SfxHintId::StyleSheetModified || rHint.GetId() == SfxHintId::StyleSheetChanged) { - switch( pStyleHint->GetId() ) - { - case SfxHintId::StyleSheetModified : - case SfxHintId::StyleSheetChanged : - bRemoveRenderGeometry = true; - break; - default: break; - } + const SfxStyleSheetHint* pStyleHint = static_cast<const SfxStyleSheetHint*>(&rHint); + if ( pStyleHint->GetStyleSheet() == GetStyleSheet() ) + bRemoveRenderGeometry = true; } else if ( rHint.GetId() == SfxHintId::DataChanged ) {