chart2/source/view/main/PropertyMapper.cxx |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 386e7a4fffbeb40e7f4105923ddb2e210c0a2486
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Jan 21 08:34:50 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Jan 21 12:26:41 2026 +0100

    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 <[email protected]>

diff --git a/chart2/source/view/main/PropertyMapper.cxx 
b/chart2/source/view/main/PropertyMapper.cxx
index 4bbf72755608..97a9a0466e7c 100644
--- a/chart2/source/view/main/PropertyMapper.cxx
+++ b/chart2/source/view/main/PropertyMapper.cxx
@@ -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;

Reply via email to