diff options
author | Rob Snelders <programming@ertai.nl> | 2012-05-17 17:47:20 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-18 16:31:01 +0100 |
commit | a78ee84360cd3bb9c806ceb8a5fc0794971334d4 (patch) | |
tree | fcbde0d287c24618956ee8f0bb603344d6ccb76b /editeng | |
parent | c867a3037dbe01eeecdd7512e3a02249231cbacd (diff) |
fd0#40778 - Remove dictionary choice when adding new entry
Change-Id: Id7bd039b505d30e71065c2cdf27eba1cb466be56
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/inc/editeng.hrc | 1 | ||||
-rw-r--r-- | editeng/inc/editeng/editview.hxx | 1 | ||||
-rw-r--r-- | editeng/source/editeng/editeng.src | 6 | ||||
-rw-r--r-- | editeng/source/editeng/editview.cxx | 14 |
4 files changed, 18 insertions, 4 deletions
diff --git a/editeng/inc/editeng.hrc b/editeng/inc/editeng.hrc index cc1f45c06da3..453bf5cabc43 100644 --- a/editeng/inc/editeng.hrc +++ b/editeng/inc/editeng.hrc @@ -35,6 +35,7 @@ #define MN_AUTOCORR 4 #define MN_WORDLANGUAGE 5 #define MN_PARALANGUAGE 6 +#define MN_INSERT_SINGLE 7 #define MN_ALTSTART 1000 #define MN_AUTOSTART 2000 diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx index 8e034c84c83b..92b6d3006d26 100644 --- a/editeng/inc/editeng/editview.hxx +++ b/editeng/inc/editeng/editview.hxx @@ -82,6 +82,7 @@ public: // Needed for Undo private: ImpEditView* pImpEditView; + String aDicNameSingle; EDITENG_DLLPRIVATE EditView( const EditView& ); EDITENG_DLLPRIVATE EditView& operator=( const EditView& ); diff --git a/editeng/source/editeng/editeng.src b/editeng/source/editeng/editeng.src index add1054fbb10..896f66fa2f52 100644 --- a/editeng/source/editeng/editeng.src +++ b/editeng/source/editeng/editeng.src @@ -95,6 +95,12 @@ Menu RID_MENU_SPELL }; MenuItem { + Identifier = MN_INSERT_SINGLE ; + HelpId = HID_EDITENG_SPELLER_ADDWORD; + Text [ en-US ] = "~Add" ; + }; + MenuItem + { Identifier = MN_IGNORE ; HelpId = HID_EDITENG_SPELLER_IGNORE; Text [ en-US ] = "Ignore All" ; diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 9e0fd274ec14..8ff692ff8b43 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1037,6 +1037,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) // linguistic entry above sal_uInt16 nPos = MN_DICTSTART + i; pInsertMenu->InsertItem( nPos, xDicTmp->getName() ); + aDicNameSingle = xDicTmp->getName(); uno::Reference< lang::XServiceInfo > xSvcInfo( xDicTmp, uno::UNO_QUERY ); if (xSvcInfo.is()) @@ -1052,8 +1053,9 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) } } } - - if ( !pInsertMenu->GetItemCount() ) + if ( pInsertMenu->GetItemCount() != 1) + aPopupMenu.EnableItem( MN_INSERT_SINGLE, sal_False ); + if ( pInsertMenu->GetItemCount() < 2 ) aPopupMenu.EnableItem( MN_INSERT, sal_False ); aPopupMenu.RemoveDisabledEntries( sal_True, sal_True ); @@ -1121,9 +1123,13 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) pCallBack->Call( &aInf ); } } - else if ( nId >= MN_DICTSTART ) + else if ( nId >= MN_DICTSTART || nId == MN_INSERT_SINGLE ) { - String aDicName ( pInsertMenu->GetItemText(nId) ); + String aDicName; + if (nId >= MN_DICTSTART) + aDicName = pInsertMenu->GetItemText(nId); + else + aDicName = aDicNameSingle; uno::Reference< linguistic2::XDictionary > xDic; if (xDicList.is()) |