diff options
author | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-24 09:08:52 +0200 |
---|---|---|
committer | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-24 09:08:52 +0200 |
commit | 35f02192db00361fc547b6a18bd78a49fbe9b4f2 (patch) | |
tree | 6f1c904fc561fe57a0a4b5f59dc27dd4fd969fa9 /editeng | |
parent | 99e133f3abede854db3c78e1aca60fa16ffa412b (diff) |
cws tl81: #i112179# dictionary issue with context menus fixed
Diffstat (limited to 'editeng')
-rwxr-xr-x | editeng/source/editeng/editview.cxx | 11 | ||||
-rwxr-xr-x[-rw-r--r--] | editeng/source/misc/unolingu.cxx | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index c892117d0b..9a347fc7fc 100755 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1044,7 +1044,8 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) { PopupMenu aPopupMenu( EditResId( RID_MENU_SPELL ) ); PopupMenu *pAutoMenu = aPopupMenu.GetPopupMenu( MN_AUTOCORR ); - PopupMenu *pInsertMenu = aPopupMenu.GetPopupMenu( MN_INSERT ); + PopupMenu *pInsertMenu = aPopupMenu.GetPopupMenu( MN_INSERT ); // add word to user-dictionaries + pInsertMenu->SetMenuFlags( MENU_FLAG_NOAUTOMNEMONICS ); //! necessary to retrieve the correct dictionary names later EditPaM aPaM2( aPaM ); aPaM2.GetIndex()++; @@ -1261,7 +1262,13 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) } else if ( nId >= MN_DICTSTART ) { - Reference< XDictionary > xDic( pDic[nId - MN_DICTSTART], UNO_QUERY ); + String aDicName ( pInsertMenu->GetItemText(nId) ); + + uno::Reference< linguistic2::XDictionary > xDic; + uno::Reference< linguistic2::XDictionaryList > xDicList( SvxGetDictionaryList() ); + if (xDicList.is()) + xDic = xDicList->getDictionaryByName( aDicName ); + if (xDic.is()) xDic->add( aSelected, sal_False, String() ); // save modified user-dictionary if it is persistent diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx index 7aefa78f98..60ef854c56 100644..100755 --- a/editeng/source/misc/unolingu.cxx +++ b/editeng/source/misc/unolingu.cxx @@ -1197,7 +1197,10 @@ uno::Reference< XDictionary > LinguMgr::GetStandard() // add new dictionary to list if (xTmp.is()) + { xTmpDicList->addDictionary( xTmp ); + xTmp->setActive( sal_True ); + } xDic = uno::Reference< XDictionary > ( xTmp, UNO_QUERY ); } #if OSL_DEBUG_LEVEL > 1 |