tdf#158773 do the cheap checks first
the HasText() call inside TextProperties::Notify is surprisingly
expensive, so only do it when we know we are interested.
Shaves 25% off the load time here
Change-Id: Iab257add7fd56bf405678944ca8a3482c8f7b142
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164596
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index 220d6a5..90c68df 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -550,15 +550,15 @@ namespace sdr::properties
// call parent
AttributeProperties::Notify(rBC, rHint);
SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject());
if(!rObj.HasText())
return;
SfxHintId nId(rHint.GetId());
const svx::ITextProvider& rTextProvider(getTextProvider());
if(SfxHintId::DataChanged == nId && rBC.IsSfxStyleSheet())
{
SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject());
if(!rObj.HasText())
return;
const svx::ITextProvider& rTextProvider(getTextProvider());
sal_Int32 nText = rTextProvider.getTextCount();
while (nText--)
{
@@ -580,6 +580,11 @@ namespace sdr::properties
}
else if(SfxHintId::Dying == nId && rBC.IsSfxStyleSheet())
{
SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject());
if(!rObj.HasText())
return;
const svx::ITextProvider& rTextProvider(getTextProvider());
sal_Int32 nText = rTextProvider.getTextCount();
while (nText--)
{
@@ -598,6 +603,7 @@ namespace sdr::properties
if(aOldName != aNewName)
{
const svx::ITextProvider& rTextProvider(getTextProvider());
sal_Int32 nText = rTextProvider.getTextCount();
while (nText--)
{