diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-12-11 12:55:41 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-12-11 15:25:05 +0100 |
commit | 49528082f2070268c0b1507ce6e63aa7e5794467 (patch) | |
tree | 65f1598b3b0a5a35e7050fb1d6353b440ed46507 /sw/source/uibase/utlui/uitool.cxx | |
parent | 21154ea8c450f9f5568b32123d34a20e498a9290 (diff) |
keep as css::awt::XPopupMenu through another layer of api
Change-Id: I36e98e45d7d8ea092b1c58aea83652fe5df7bb17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126660
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase/utlui/uitool.cxx')
-rw-r--r-- | sw/source/uibase/utlui/uitool.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index 5c34b89ca0a7..ff11dc23eae7 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -36,6 +36,7 @@ #include <editeng/lrspitem.hxx> #include <svl/style.hxx> #include <unotools/localedatawrapper.hxx> +#include <com/sun/star/awt/XPopupMenu.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XFrame.hpp> @@ -887,17 +888,18 @@ void SetApplyCharUnit(bool bApplyChar, bool bWeb) SW_MOD()->ApplyUserCharUnit(bApplyChar, bWeb); } -bool ExecuteMenuCommand( PopupMenu const & rMenu, SfxViewFrame const & rViewFrame, sal_uInt16 nId ) +bool ExecuteMenuCommand(const css::uno::Reference<css::awt::XPopupMenu>& rMenu, const SfxViewFrame& rViewFrame, sal_uInt16 nId) { bool bRet = false; - const sal_uInt16 nItemCount = rMenu.GetItemCount(); + const sal_uInt16 nItemCount = rMenu->getItemCount(); OUString sCommand; - for( sal_uInt16 nItem = 0; nItem < nItemCount; ++nItem) + for (sal_uInt16 nItem = 0; nItem < nItemCount; ++nItem) { - PopupMenu* pPopup = rMenu.GetPopupMenu( rMenu.GetItemId( nItem ) ); - if(pPopup) + sal_Int16 nItemId = rMenu->getItemId(nItem); + css::uno::Reference<css::awt::XPopupMenu> xPopup = rMenu->getPopupMenu(nItemId); + if (xPopup.is()) { - sCommand = pPopup->GetItemCommand(nId); + sCommand = xPopup->getCommand(nId); if(!sCommand.isEmpty()) break; } |