Header/Footer: adjusted popup menu texts

This commit is contained in:
Cédric Bosdonnat 2011-09-09 21:23:11 +02:00
parent 16400db462
commit 7bdee3289a
4 changed files with 29 additions and 3 deletions

View file

@ -1442,13 +1442,13 @@ Menu MN_HEADERFOOTER_BUTTON
{
Identifier = FN_HEADERFOOTER_EDIT ;
HelpID = CMD_FN_HEADERFOOTER_EDIT ;
Text [ en-US ] = "Edit" ;
Text [ en-US ] = "Format $1..." ;
};
MenuItem
{
Identifier = FN_HEADERFOOTER_DELETE ;
HelpID = CMD_FN_HEADERFOOTER_DELETE ;
Text [ en-US ] = "Remove" ;
Text [ en-US ] = "Delete $1" ;
};
};
};

View file

@ -38,6 +38,7 @@
#include <fmthdft.hxx>
#include <HeaderFooterWin.hxx>
#include <pagefrm.hxx>
#include <SwRewriter.hxx>
#include <view.hxx>
#include <viewopt.hxx>
#include <wrtsh.hxx>
@ -293,7 +294,20 @@ SwHeaderFooterButton::SwHeaderFooterButton( SwHeaderFooterWin* pWindow ) :
{
// Create and set the PopupMenu
m_pPopupMenu = new PopupMenu( SW_RES( MN_HEADERFOOTER_BUTTON ) );
// TODO Potentially rewrite the menu entries' text
// Rewrite the menu entries' text
String sType = SW_RESSTR( STR_FOOTER );
if ( m_pWindow->IsHeader() )
sType = SW_RESSTR( STR_HEADER );
SwRewriter aRewriter;
aRewriter.AddRule( String::CreateFromAscii( "$1" ), sType );
String aText = m_pPopupMenu->GetItemText( FN_HEADERFOOTER_EDIT );
m_pPopupMenu->SetItemText( FN_HEADERFOOTER_EDIT, aRewriter.Apply( aText ) );
aText = m_pPopupMenu->GetItemText( FN_HEADERFOOTER_DELETE );
m_pPopupMenu->SetItemText( FN_HEADERFOOTER_DELETE, aRewriter.Apply( aText ) );
SetPopupMenu( m_pPopupMenu );
}

View file

@ -83,6 +83,8 @@
#define STR_HEADER_TITLE (RC_DOCVW_BEGIN + 22)
#define STR_FOOTER_TITLE (RC_DOCVW_BEGIN + 23)
#define STR_HEADER (RC_DOCVW_BEGIN + 24)
#define STR_FOOTER (RC_DOCVW_BEGIN + 25)
#define MSG_READONLY_CONTENT (RC_DOCVW_BEGIN + 1)

View file

@ -301,3 +301,13 @@ String STR_FOOTER_TITLE
Text [ en-US ] = "Footer (%1)" ;
};
String STR_HEADER
{
Text [ en-US ] = "Header" ;
};
String STR_FOOTER
{
Text [ en-US ] = "Footer" ;
};