Open menu: Simplify inserting menu entries

Change-Id: Ia75f2fe349580003b16735fccf429392d0cf8363
Reviewed-on: https://gerrit.libreoffice.org/30082
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
Samuel Mehrbrodt
2016-10-20 11:53:08 +02:00
parent e39983fdaf
commit 4846c0fed9
3 changed files with 5 additions and 23 deletions

View File

@@ -50,8 +50,7 @@
#define STR_CLEAR_RECENT_FILES (RID_STR_START+23) #define STR_CLEAR_RECENT_FILES (RID_STR_START+23)
#define STR_CLEAR_RECENT_FILES_HELP (RID_STR_START+24) #define STR_CLEAR_RECENT_FILES_HELP (RID_STR_START+24)
#define STR_LANGSTATUS_HINT (RID_STR_START+25) #define STR_LANGSTATUS_HINT (RID_STR_START+25)
#define STR_OPEN_REMOTE (RID_STR_START+26) #define STR_REMOTE_TITLE (RID_STR_START+26)
#define STR_REMOTE_TITLE (RID_STR_START+27)
#define IMG_SAVEMODIFIED_SMALL (RID_IMAGE_START+0) #define IMG_SAVEMODIFIED_SMALL (RID_IMAGE_START+0)
#define IMG_SAVEMODIFIED_LARGE (RID_IMAGE_START+1) #define IMG_SAVEMODIFIED_LARGE (RID_IMAGE_START+1)

View File

@@ -113,11 +113,6 @@ String STR_CLEAR_RECENT_FILES_HELP
Text [ en-US ] = "Clears the list with the most recently opened files. This action can not be undone."; Text [ en-US ] = "Clears the list with the most recently opened files. This action can not be undone.";
}; };
String STR_OPEN_REMOTE
{
Text [ en-US ] = "Open Remote File";
};
String STR_REMOTE_TITLE String STR_REMOTE_TITLE
{ {
Text [ en-US ] = " (Remote)"; Text [ en-US ] = " (Remote)";

View File

@@ -243,28 +243,16 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
if ( m_bShowToolbarEntries ) if ( m_bShowToolbarEntries )
{ {
pVCLPopupMenu->InsertSeparator(); pVCLPopupMenu->InsertSeparator();
pVCLPopupMenu->InsertItem( sal_uInt16( nCount + 2 ), pVCLPopupMenu->InsertItem( CMD_OPEN_AS_TEMPLATE, m_xFrame );
vcl::CommandInfoProvider::Instance().GetMenuLabelForCommand( pVCLPopupMenu->InsertItem( CMD_OPEN_REMOTE, m_xFrame );
CMD_OPEN_AS_TEMPLATE, m_xFrame) );
pVCLPopupMenu->SetItemCommand( sal_uInt16( nCount + 2 ),
CMD_OPEN_AS_TEMPLATE );
pVCLPopupMenu->InsertItem( sal_uInt16( nCount + 3 ),
FWK_RESSTR(STR_OPEN_REMOTE) );
pVCLPopupMenu->SetItemCommand( sal_uInt16( nCount + 3 ),
CMD_OPEN_REMOTE );
} }
} }
else else
{ {
if ( m_bShowToolbarEntries ) if ( m_bShowToolbarEntries )
{ {
// Open as template menu entry pVCLPopupMenu->InsertItem( CMD_OPEN_AS_TEMPLATE, m_xFrame );
pVCLPopupMenu->InsertItem( 1, vcl::CommandInfoProvider::Instance().GetMenuLabelForCommand( pVCLPopupMenu->InsertItem( CMD_OPEN_REMOTE, m_xFrame );
CMD_OPEN_AS_TEMPLATE, m_xFrame) );
pVCLPopupMenu->SetItemCommand( 1, CMD_OPEN_AS_TEMPLATE );
// Open remote menu entry
pVCLPopupMenu->InsertItem( 2, FWK_RESSTR(STR_OPEN_REMOTE) );
pVCLPopupMenu->SetItemCommand( 2, CMD_OPEN_REMOTE );
} }
else else
{ {