summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-29 10:17:28 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-29 17:46:05 +0100
commitcdbfb27c5e96c08deb8757f33ac2885b24be303f (patch)
tree469191a734484e8038d6d394b3cfac3e6deaded5 /framework
parent896c2d247d43135c12f5bb0d3921ae741f1c5960 (diff)
use css::awt::XPopupMenu api, don't need to tunnel to get VCLXPopupMenu*
Change-Id: I6b6b09ded063a5c1f2e561fffcb8fb2214d35a56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126028 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/langselectionmenucontroller.cxx21
1 files changed, 9 insertions, 12 deletions
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index 7e6604e8fb21..94918c02179a 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -25,7 +25,6 @@
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
-#include <toolkit/awt/vclxmenu.hxx>
#include <vcl/svapp.hxx>
#include <svl/languageoptions.hxx>
@@ -165,8 +164,6 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
if (!m_bShowMenu)
return;
- VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu ));
-
OUString aCmd_Dialog;
OUString aCmd_Language;
if( eMode == MODE_SetLanguageSelectionMenu )
@@ -203,31 +200,31 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
!langItem.isEmpty()) // 'no language found' from language guessing
{
++nItemId;
- pVCLPopupMenu->insertItem(nItemId, langItem, css::awt::MenuItemStyle::CHECKABLE, nItemId - 1);
+ rPopupMenu->insertItem(nItemId, langItem, css::awt::MenuItemStyle::CHECKABLE, nItemId - 1);
OUString aCmd = aCmd_Language + langItem;
- pVCLPopupMenu->setCommand(nItemId, aCmd);
+ rPopupMenu->setCommand(nItemId, aCmd);
bool bChecked = langItem == m_aCurLang && eMode == MODE_SetLanguageSelectionMenu;
//make a sign for the current language
- pVCLPopupMenu->checkItem(nItemId, bChecked);
+ rPopupMenu->checkItem(nItemId, bChecked);
}
}
// entry for LANGUAGE_NONE
++nItemId;
- pVCLPopupMenu->insertItem(nItemId, FwkResId(STR_LANGSTATUS_NONE), 0, nItemId - 1);
+ rPopupMenu->insertItem(nItemId, FwkResId(STR_LANGSTATUS_NONE), 0, nItemId - 1);
OUString aCmd = aCmd_Language + "LANGUAGE_NONE";
- pVCLPopupMenu->setCommand(nItemId, aCmd);
+ rPopupMenu->setCommand(nItemId, aCmd);
// entry for 'Reset to default language'
++nItemId;
- pVCLPopupMenu->insertItem(nItemId, FwkResId(STR_RESET_TO_DEFAULT_LANGUAGE), 0, nItemId - 1);
+ rPopupMenu->insertItem(nItemId, FwkResId(STR_RESET_TO_DEFAULT_LANGUAGE), 0, nItemId - 1);
aCmd = aCmd_Language + "RESET_LANGUAGES";
- pVCLPopupMenu->setCommand(nItemId, aCmd);
+ rPopupMenu->setCommand(nItemId, aCmd);
// entry for opening the Format/Character dialog
++nItemId;
- pVCLPopupMenu->insertItem(nItemId, FwkResId(STR_LANGSTATUS_MORE), 0, nItemId - 1);
- pVCLPopupMenu->setCommand(nItemId, aCmd_Dialog);
+ rPopupMenu->insertItem(nItemId, FwkResId(STR_LANGSTATUS_MORE), 0, nItemId - 1);
+ rPopupMenu->setCommand(nItemId, aCmd_Dialog);
}
void SAL_CALL LanguageSelectionMenuController::updatePopupMenu()