tdf#167883 avoid some throw/catch work

which is expensive in high volumes. shaves 5% off save time.

Change-Id: I512e3b0ecf8c8f27dfc549ec9d2c2ad7f5873561
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197708
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2026-01-21 12:26:41 +01:00
parent 9d6fa61791
commit 386e7a4fff
+4 -10
View File
@@ -47,12 +47,13 @@ void PropertyMapper::setMappedProperties(
auto pNames = aNames.getArray();
auto pValues = aValues.getArray();
sal_Int32 nN=0;
uno::Reference< css::beans::XPropertySetInfo > xInfo = xSource->getPropertySetInfo();
for (auto const& elem : rMap)
{
const OUString & rTarget = elem.first;
const OUString & rSource = elem.second;
try
if (xInfo->hasPropertyByName(rSource))
{
uno::Any aAny( xSource->getPropertyValue(rSource) );
if( aAny.hasValue() )
@@ -63,10 +64,6 @@ void PropertyMapper::setMappedProperties(
++nN;
}
}
catch( const uno::Exception& )
{
TOOLS_WARN_EXCEPTION("chart2", "" );
}
}
if (nN == 0)
return;
@@ -101,12 +98,13 @@ void PropertyMapper::setMappedProperties(
auto pNames = aNames.getArray();
aValues.realloc(nPropertyCount);
auto pValues = aValues.getArray();
uno::Reference< css::beans::XPropertySetInfo > xInfo = xSource->getPropertySetInfo();
for (auto const& elem : rMap)
{
const OUString & rTarget = elem.first;
const OUString & rSource = elem.second;
try
if (xInfo->hasPropertyByName(rSource))
{
uno::Any aAny( xSource->getPropertyValue(rSource) );
if( aAny.hasValue() )
@@ -117,10 +115,6 @@ void PropertyMapper::setMappedProperties(
++nN;
}
}
catch( const uno::Exception& )
{
TOOLS_WARN_EXCEPTION("chart2", "exception mapping property from " << rSource << " to " << rTarget);
}
}
if (nN == 0)
return;