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 | 271727322f844a8b56d5f3054f0eb61a7e1484a9 (patch) | |
tree | 28351afeb6c1f9aad1d2955497a79a449ccf4159 /editeng | |
parent | 34dd33af79caf3a13ec3a4e7098616ac0b16cf50 (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 642b5e0d9f17..c07b84d0d0f2 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 e95ce560023b..ae92fd1a01b8 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 |