framework/source/fwe/helper/actiontriggerhelper.cxx | 27 +++++--------------- 1 file changed, 8 insertions(+), 19 deletions(-)
New commits: commit d46175b4ff98a83be1bff1aab486854f2341ed78 Author: Mike Kaganski <[email protected]> AuthorDate: Wed Oct 29 21:27:16 2025 +0200 Commit: Mike Kaganski <[email protected]> CommitDate: Thu Oct 30 05:16:55 2025 +0100 Move variables where they are used Change-Id: I4db201fad61e690000b78049c47b5457cf795658 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193165 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/framework/source/fwe/helper/actiontriggerhelper.cxx b/framework/source/fwe/helper/actiontriggerhelper.cxx index 5caa147f17e3..c84ea031c11b 100644 --- a/framework/source/fwe/helper/actiontriggerhelper.cxx +++ b/framework/source/fwe/helper/actiontriggerhelper.cxx @@ -196,14 +196,11 @@ static Reference< XPropertySet > CreateActionTrigger(sal_uInt16 nItemId, xPropSet.set( xMultiServiceFactory->createInstance( u"com.sun.star.ui.ActionTrigger"_ustr ), UNO_QUERY ); - Any a; - try { // Retrieve the menu attributes and set them in our PropertySet OUString aLabel = rMenu->getItemText(nItemId); - a <<= aLabel; - xPropSet->setPropertyValue(u"Text"_ustr, a ); + xPropSet->setPropertyValue(u"Text"_ustr, Any(aLabel)); OUString aCommandURL = rMenu->getCommand(nItemId); @@ -212,14 +209,12 @@ static Reference< XPropertySet > CreateActionTrigger(sal_uInt16 nItemId, aCommandURL = "slot:" + OUString::number( nItemId ); } - a <<= aCommandURL; - xPropSet->setPropertyValue(u"CommandURL"_ustr, a ); + xPropSet->setPropertyValue(u"CommandURL"_ustr, Any(aCommandURL)); Reference<XBitmap> xBitmap(rMenu->getItemImage(nItemId), UNO_QUERY); if (xBitmap.is()) { - a <<= xBitmap; - xPropSet->setPropertyValue(u"Image"_ustr, a ); + xPropSet->setPropertyValue(u"Image"_ustr, Any(xBitmap)); } } catch (const Exception&) @@ -268,22 +263,17 @@ static void FillActionTriggerContainerWithMenu(const Reference<XPopupMenu>& rMen try { - Any a; - Reference< XPropertySet > xPropSet; - if (nType == css::awt::MenuItemType_SEPARATOR) { - xPropSet = CreateActionTriggerSeparator( rActionTriggerContainer ); + Reference< XPropertySet > xPropSet = CreateActionTriggerSeparator( rActionTriggerContainer ); - a <<= xPropSet; - rActionTriggerContainer->insertByIndex( nPos, a ); + rActionTriggerContainer->insertByIndex(nPos, Any(xPropSet)); } else { - xPropSet = CreateActionTrigger(nItemId, rMenu, rActionTriggerContainer); + Reference< XPropertySet > xPropSet = CreateActionTrigger(nItemId, rMenu, rActionTriggerContainer); - a <<= xPropSet; - rActionTriggerContainer->insertByIndex( nPos, a ); + rActionTriggerContainer->insertByIndex(nPos, Any(xPropSet)); css::uno::Reference<XPopupMenu> xPopupMenu = rMenu->getPopupMenu(nItemId); if (xPopupMenu.is()) @@ -291,8 +281,7 @@ static void FillActionTriggerContainerWithMenu(const Reference<XPopupMenu>& rMen // recursive call to build next sub menu Reference< XIndexContainer > xSubContainer = CreateActionTriggerContainer( rActionTriggerContainer ); - a <<= xSubContainer; - xPropSet->setPropertyValue(u"SubContainer"_ustr, a ); + xPropSet->setPropertyValue(u"SubContainer"_ustr, Any(xSubContainer)); FillActionTriggerContainerWithMenu(xPopupMenu, xSubContainer); } }
