This is an automated email from the ASF dual-hosted git repository.
jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new c30d849359 comphelper: don't use the property helper after addProperty
resets it
c30d849359 is described below
commit c30d8493592fb4f4e6483b21039292eea7cb70fb
Author: Jim Jagielski <[email protected]>
AuthorDate: Sat Nov 7 05:29:18 2026 -0500
comphelper: don't use the property helper after addProperty resets it
impl_setPropertyValues_throw held a reference to it across addProperty.
Loading a Base file from disk crashed a fresh office on Linux aarch64.
---
main/comphelper/source/property/opropertybag.cxx | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/main/comphelper/source/property/opropertybag.cxx
b/main/comphelper/source/property/opropertybag.cxx
index 995ae3fbff..dbb998f2fc 100644
--- a/main/comphelper/source/property/opropertybag.cxx
+++ b/main/comphelper/source/property/opropertybag.cxx
@@ -486,8 +486,6 @@ namespace comphelper
try
{
- ::cppu::IPropertyArrayHelper& rPropInfo = getInfoHelper();
-
// check for unknown properties
// we cannot simply rely on the
XMultiPropertySet::setPropertyValues
// implementation of our base class, since it does not throw
@@ -504,7 +502,7 @@ namespace comphelper
++pName, ++pHandle, ++pProperty
)
{
- *pHandle = rPropInfo.getHandleByName( *pName );
+ *pHandle = getInfoHelper().getHandleByName( *pName );
if ( *pHandle != -1 )
continue;
@@ -514,9 +512,7 @@ namespace comphelper
// add the property
sal_Int16 nAttributes = PropertyAttribute::BOUND |
PropertyAttribute::REMOVEABLE | PropertyAttribute::MAYBEDEFAULT;
addProperty( *pName, nAttributes, pProperty->Value );
- // rPropInfo is invalid, refetch
- rPropInfo = getInfoHelper();
- *pHandle = rPropInfo.getHandleByName( *pName );
+ *pHandle = getInfoHelper().getHandleByName( *pName );
continue;
}