diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-12-12 20:53:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-12-13 10:02:29 +0100 |
commit | 5ae0a6026c66632e3f6958dd70d785865be2f81c (patch) | |
tree | f8efbeb48db4bd8c5e8ec8dd4a9db8814643fc48 /framework | |
parent | 843f140289f46bb702674a3875311ef6189d22cb (diff) |
prefer css::awt::XPopupMenu api
Change-Id: I81c892d946965f779d982194efd6b32d6493143e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126708
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/recentfilesmenucontroller.cxx | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 6fe4a8f7286f..2fed76c36fc1 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -191,30 +191,27 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > aMenuShortCut.append( aMenuTitle ); - pVCLPopupMenu->InsertItem( sal_uInt16( i+1 ), aMenuShortCut.makeStringAndClear() ); + rPopupMenu->insertItem(sal_uInt16( i+1 ), aMenuShortCut.makeStringAndClear(), 0, -1); if ( bIsIconsAllowed ) { Image aThumbnail = SvFileInformationManager::GetImage(aURL, false, {}); pVCLPopupMenu->SetItemImage(sal_uInt16 ( i+1 ), aThumbnail); } - pVCLPopupMenu->SetTipHelpText( sal_uInt16( i+1 ), aTipHelpText ); - pVCLPopupMenu->SetItemCommand( sal_uInt16( i+1 ), aURLString ); + rPopupMenu->setTipHelpText(sal_uInt16(i + 1), aTipHelpText); + rPopupMenu->setCommand(sal_uInt16(i + 1), aURLString); } - pVCLPopupMenu->InsertSeparator(); + rPopupMenu->insertSeparator(-1); // Clear List menu entry - pVCLPopupMenu->InsertItem( sal_uInt16( nCount + 1 ), - FwkResId(STR_CLEAR_RECENT_FILES) ); - pVCLPopupMenu->SetItemCommand( sal_uInt16( nCount + 1 ), - CMD_CLEAR_LIST ); - pVCLPopupMenu->SetHelpText( sal_uInt16( nCount + 1 ), - FwkResId(STR_CLEAR_RECENT_FILES_HELP) ); + rPopupMenu->insertItem(sal_uInt16(nCount + 1), FwkResId(STR_CLEAR_RECENT_FILES), 0, -1); + rPopupMenu->setCommand(sal_uInt16(nCount + 1), CMD_CLEAR_LIST); + rPopupMenu->setHelpText(sal_uInt16(nCount + 1), FwkResId(STR_CLEAR_RECENT_FILES_HELP)); // Open remote menu entry if ( m_bShowToolbarEntries ) { - pVCLPopupMenu->InsertSeparator(); + rPopupMenu->insertSeparator(-1); pVCLPopupMenu->InsertItem( CMD_OPEN_AS_TEMPLATE, m_xFrame ); pVCLPopupMenu->InsertItem( CMD_OPEN_REMOTE, m_xFrame ); } @@ -230,12 +227,11 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > { // Add InsertSeparator(), otherwise it will display // the first item icon of recent files instead of displaying no icon. - pVCLPopupMenu->InsertSeparator(); + rPopupMenu->insertSeparator(-1); // No recent documents => insert "no documents" string - pVCLPopupMenu->InsertItem( 1, FwkResId(STR_NODOCUMENT) ); // Do not disable it, otherwise the Toolbar controller and MenuButton // will display SV_RESID_STRING_NOSELECTIONPOSSIBLE instead of STR_NODOCUMENT - pVCLPopupMenu->SetItemBits( 1, pVCLPopupMenu->GetItemBits( 1 ) | MenuItemBits::NOSELECT ); + rPopupMenu->insertItem(1, FwkResId(STR_NODOCUMENT), static_cast<sal_Int16>(MenuItemBits::NOSELECT), -1); } } } |