summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-12-12 20:24:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-12-13 10:01:30 +0100
commit604c3140d1efe58177468e96d69e8a1d09d94da5 (patch)
treea1b006a294876adb64712522e6105bed8c811c8f
parent5cbddfc617699e91673ca9a006fc427a37a03a94 (diff)
prefer css::awt::XPopupMenu api
Change-Id: Ibf34e33715a86a09ec49495b1049a60e1403a6af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126705 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--framework/source/uielement/thesaurusmenucontroller.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/framework/source/uielement/thesaurusmenucontroller.cxx b/framework/source/uielement/thesaurusmenucontroller.cxx
index da5629d79d5b..0826d1c1582a 100644
--- a/framework/source/uielement/thesaurusmenucontroller.cxx
+++ b/framework/source/uielement/thesaurusmenucontroller.cxx
@@ -92,26 +92,27 @@ void ThesaurusMenuController::fillPopupMenu()
if ( !aThesImplName.isEmpty() && !aSynonymsImageUrl.isEmpty() )
aImage = Image( aSynonymsImageUrl );
- VCLXMenu* pAwtMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu );
- Menu* pVCLMenu = pAwtMenu->GetMenu();
-
sal_uInt16 nId = 1;
for ( const auto& aSynonym : aSynonyms )
{
OUString aItemText( linguistic::GetThesaurusReplaceText( aSynonym ) );
- pVCLMenu->InsertItem( nId, aItemText );
- pVCLMenu->SetItemCommand( nId, ".uno:ThesaurusFromContext?WordReplace:string=" + aItemText );
+ m_xPopupMenu->insertItem(nId, aItemText, 0, -1);
+ m_xPopupMenu->setCommand(nId, ".uno:ThesaurusFromContext?WordReplace:string=" + aItemText);
- if ( !aSynonymsImageUrl.isEmpty() )
+ if (!aSynonymsImageUrl.isEmpty())
+ {
+ VCLXMenu* pAwtMenu = comphelper::getFromUnoTunnel<VCLXMenu>(m_xPopupMenu);
+ Menu* pVCLMenu = pAwtMenu->GetMenu();
pVCLMenu->SetItemImage( nId, aImage );
+ }
nId++;
}
- pVCLMenu->InsertSeparator();
+ m_xPopupMenu->insertSeparator(-1);
OUString aThesaurusDialogCmd( ".uno:ThesaurusDialog" );
auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aThesaurusDialogCmd, m_aModuleName);
- pVCLMenu->InsertItem( nId, vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties) );
- pVCLMenu->SetItemCommand( nId, aThesaurusDialogCmd );
+ m_xPopupMenu->insertItem(nId, vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties), 0, -1);
+ m_xPopupMenu->setCommand(nId, aThesaurusDialogCmd);
}
void ThesaurusMenuController::getMeanings( std::vector< OUString >& rSynonyms, const OUString& rWord,