extensions/source/propctrlr/propcontroller.cxx | 17 +++++++++-------- extensions/source/propctrlr/propcontroller.hxx | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-)
New commits: commit afb89406b86102209da201757d8a43d58e0f0e93 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Feb 25 01:20:59 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Wed Feb 25 09:04:16 2026 +0100 propctrlr: Return instead of using out param Change-Id: I279e29f733237945bba57c674c0f5dae54cabf7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200281 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index f97ac4208e41..32a46510b38f 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -941,8 +941,7 @@ void OPropertyBrowserController::doInspection() // obtain the properties of the object std::vector<Property> aProperties; - PropertyHandlerArray aPropertyHandlers; - getPropertyHandlers(m_aInspectedObjects, aPropertyHandlers); + PropertyHandlerArray aPropertyHandlers = getPropertyHandlers(m_aInspectedObjects); PropertyHandlerArray::iterator aHandler(aPropertyHandlers.begin()); while (aHandler != aPropertyHandlers.end()) @@ -1387,12 +1386,12 @@ Reference<XPropertyHandler> lcl_createHandler(const Reference<XComponentContext> } } -void OPropertyBrowserController::getPropertyHandlers(const InterfaceArray& _rObjects, - PropertyHandlerArray& _rHandlers) +OPropertyBrowserController::PropertyHandlerArray +OPropertyBrowserController::getPropertyHandlers(const InterfaceArray& _rObjects) { - _rHandlers.resize(0); + PropertyHandlerArray aHandlers; if (_rObjects.empty()) - return; + return aHandlers; Sequence<Any> aHandlerFactories; if (m_xModel.is()) @@ -1406,7 +1405,7 @@ void OPropertyBrowserController::getPropertyHandlers(const InterfaceArray& _rObj if (xHandler.is()) { xHandler->inspect(_rObjects[0]); - _rHandlers.push_back(xHandler); + aHandlers.push_back(xHandler); } } else @@ -1428,12 +1427,14 @@ void OPropertyBrowserController::getPropertyHandlers(const InterfaceArray& _rObj // then create a handler which composes information out of those single handlers if (!aSingleHandlers.empty()) - _rHandlers.push_back(new PropertyComposer(std::move(aSingleHandlers))); + aHandlers.push_back(new PropertyComposer(std::move(aSingleHandlers))); } } // note that the handlers will not be used by our caller, if they indicate that there are no // properties they feel responsible for + + return aHandlers; } bool OPropertyBrowserController::impl_findObjectProperty_nothrow( diff --git a/extensions/source/propctrlr/propcontroller.hxx b/extensions/source/propctrlr/propcontroller.hxx index baaa7aca1674..8def42fd1251 100644 --- a/extensions/source/propctrlr/propcontroller.hxx +++ b/extensions/source/propctrlr/propcontroller.hxx @@ -233,7 +233,7 @@ private: /** retrieves special property handlers for our introspectee */ - void getPropertyHandlers(const InterfaceArray& _rObjects, PropertyHandlerArray& _rHandlers); + PropertyHandlerArray getPropertyHandlers(const InterfaceArray& _rObjects); /** called when a property changed, to broadcast any handlers which might have registered for this property
