svx/source/mnuctrls/smarttagmenu.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
New commits: commit 7390401fa21d9ebf35d9473bef6b44b42ea7475d Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Dec 12 12:42:57 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Dec 12 15:59:14 2021 +0100 prefer css::awt::XPopupMenu api Change-Id: I29b91b97e36682473241f3d7ab9cde46765830f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126700 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/svx/source/mnuctrls/smarttagmenu.cxx b/svx/source/mnuctrls/smarttagmenu.cxx index a918418cda78..7408bd09d966 100644 --- a/svx/source/mnuctrls/smarttagmenu.cxx +++ b/svx/source/mnuctrls/smarttagmenu.cxx @@ -182,13 +182,15 @@ void SmartTagMenuController::FillMenu() } } - if ( 0 < pVCLMenu->GetItemCount() ) + sal_Int16 nItemCount = m_xPopupMenu->getItemCount(); + if (nItemCount > 0) { static const OUStringLiteral aCommand = u".uno:AutoCorrectDlg?OpenSmartTag:bool=true"; - pVCLMenu->InsertSeparator(); + m_xPopupMenu->insertSeparator(nItemCount++); auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommand, m_aModuleName); - pVCLMenu->InsertItem( nMenuId, vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties) ); - pVCLMenu->SetItemCommand( nMenuId, aCommand ); + m_xPopupMenu->insertItem(nMenuId, vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties), + 0, nItemCount); + m_xPopupMenu->setCommand(nMenuId, aCommand); } }