diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-01-07 12:04:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-01-07 16:17:52 +0000 |
commit | 6773db03a657413a24b87e9ef3a6c68020936e0e (patch) | |
tree | 9944195abaf8ce6b344a172edae69d14bf1b0ffb /sw | |
parent | b2a106249f1624a61a9453bf50f1a17d75ea1825 (diff) |
allow menu items to be referred to by a name
Change-Id: I8bb1c082e3948f919232b81e0f1f869b88fcd852
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/lingu/olmenu.cxx | 22 | ||||
-rw-r--r-- | sw/source/ui/smartmenu/stmenu.cxx | 8 |
2 files changed, 15 insertions, 15 deletions
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 6cb971916710..3686f97f3237 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -416,8 +416,8 @@ SwSpellPopup::SwSpellPopup( sal_uInt16 nItemId = MN_SUGGESTION_START; for (sal_uInt16 i = 0; i < nStringCount; ++i) { - const String aEntry = aSuggestions[ i ]; - InsertItem( nItemId, aEntry, 0, i ); + const OUString aEntry = aSuggestions[ i ]; + InsertItem(nItemId, aEntry, 0, OString(), i); SetHelpId( nItemId, HID_LINGU_REPLACE); if (!aSuggestionImageUrl.isEmpty()) SetItemImage( nItemId, aImage ); @@ -434,7 +434,7 @@ SwSpellPopup::SwSpellPopup( OUString aSpellingAndGrammar = RetrieveLabelFromCommand( ".uno:SpellingAndGrammarDialog" ); SetItemText( MN_SPELLING_DLG, aSpellingAndGrammar ); sal_uInt16 nItemPos = GetItemPos( MN_IGNORE_WORD ); - InsertItem( MN_IGNORE_SELECTION, aIgnoreSelection, 0, nItemPos ); + InsertItem(MN_IGNORE_SELECTION, aIgnoreSelection, 0, OString(), nItemPos); SetHelpId( MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION); EnableItem( MN_AUTOCORR, bEnable ); @@ -581,8 +581,8 @@ aInfo16( SW_RES(IMG_INFO_16) ) sal_uInt16 nPos = 0; OUString aMessageText( rResult.aErrors[ nErrorInResult ].aShortComment ); - InsertSeparator( nPos++ ); - InsertItem( MN_SHORT_COMMENT, aMessageText, MIB_NOSELECT, nPos++ ); + InsertSeparator(OString(), nPos++); + InsertItem(MN_SHORT_COMMENT, aMessageText, MIB_NOSELECT, OString(), nPos++); if (bUseImagesInMenus) SetItemImage( MN_SHORT_COMMENT, aInfo16 ); @@ -603,12 +603,12 @@ aInfo16( SW_RES(IMG_INFO_16) ) if ( !sExplanationLink.isEmpty( ) ) { - InsertItem( MN_EXPLANATION_LINK, String( SW_RES( STR_EXPLANATION_LINK ) ), MIB_TEXT | MIB_HELP, nPos++ ); + InsertItem(MN_EXPLANATION_LINK, SW_RESSTR(STR_EXPLANATION_LINK), MIB_TEXT | MIB_HELP, OString(), nPos++); } SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS); - InsertSeparator( nPos++ ); + InsertSeparator(OString(), nPos++); sal_Int32 nStringCount = aSuggestions.getLength(); if ( nStringCount ) // suggestions available... { @@ -628,22 +628,22 @@ aInfo16( SW_RES(IMG_INFO_16) ) sal_uInt16 nItemId = MN_SUGGESTION_START; for (sal_uInt16 i = 0; i < nStringCount; ++i) { - const String aEntry = aSuggestions[ i ]; - InsertItem( nItemId, aEntry, 0, nPos++ ); + const OUString aEntry = aSuggestions[ i ]; + InsertItem(nItemId, aEntry, 0, OString(), nPos++); SetHelpId( nItemId, HID_LINGU_REPLACE ); if (!aSuggestionImageUrl.isEmpty()) SetItemImage( nItemId, aImage ); ++nItemId; } - InsertSeparator( nPos++ ); + InsertSeparator(OString(), nPos++); } OUString aIgnoreSelection( String( SW_RES( STR_IGNORE_SELECTION ) ) ); OUString aSpellingAndGrammar = RetrieveLabelFromCommand( ".uno:SpellingAndGrammarDialog" ); SetItemText( MN_SPELLING_DLG, aSpellingAndGrammar ); sal_uInt16 nItemPos = GetItemPos( MN_IGNORE_WORD ); - InsertItem( MN_IGNORE_SELECTION, aIgnoreSelection, 0, nItemPos ); + InsertItem( MN_IGNORE_SELECTION, aIgnoreSelection, 0, OString(), nItemPos ); SetHelpId( MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION); EnableItem( MN_AUTOCORR, false ); diff --git a/sw/source/ui/smartmenu/stmenu.cxx b/sw/source/ui/smartmenu/stmenu.cxx index 64d1cce16a6d..e95167c860f8 100644 --- a/sw/source/ui/smartmenu/stmenu.cxx +++ b/sw/source/ui/smartmenu/stmenu.cxx @@ -88,7 +88,7 @@ SwSmartTagPopup::SwSmartTagPopup( SwView* pSwView, PopupMenu* pSbMenu = this; if ( 1 < aActionComponentsSequence.getLength() ) { - InsertItem( nMenuId, aSmartTagCaption, 0, nMenuPos++); + InsertItem(nMenuId, aSmartTagCaption, 0, OString(), nMenuPos++); pSbMenu = new PopupMenu; SetPopupMenu( nMenuId++, pSbMenu ); } @@ -96,8 +96,8 @@ SwSmartTagPopup::SwSmartTagPopup( SwView* pSwView, // sub-menu starts with smart tag caption and separator const rtl::OUString aSmartTagCaption2 = aSmartTagCaption + ": " + aRangeText; nSubMenuPos = 0; - pSbMenu->InsertItem( nMenuId++, aSmartTagCaption2, MIB_NOSELECT, nSubMenuPos++ ); - pSbMenu->InsertSeparator( nSubMenuPos++ ); + pSbMenu->InsertItem(nMenuId++, aSmartTagCaption2, MIB_NOSELECT, OString(), nSubMenuPos++); + pSbMenu->InsertSeparator(OString(), nSubMenuPos++); // Add subitem for every action reference for the current smart tag type: for ( sal_uInt16 i = 0; i < rActionComponents.getLength(); ++i ) @@ -116,7 +116,7 @@ SwSmartTagPopup::SwSmartTagPopup( SwView* pSwView, xController, mxTextRange ); - pSbMenu->InsertItem( nSubMenuId++, aActionCaption, 0, nSubMenuPos++ ); + pSbMenu->InsertItem(nSubMenuId++, aActionCaption, 0, OString(), nSubMenuPos++); InvokeAction aEntry( xAction, xSmartTagProperties, nActionID ); maInvokeActions.push_back( aEntry ); } |