renaissance1: #i112337# Included fix from other CWS.
This commit is contained in:
@@ -384,19 +384,25 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
|
|||||||
|
|
||||||
case SID_THES:
|
case SID_THES:
|
||||||
{
|
{
|
||||||
EditView & rEditView = mpView->GetTextEditOutlinerView()->GetEditView();;
|
if( mpView && mpView->GetTextEditOutlinerView() )
|
||||||
String aStatusVal;
|
{
|
||||||
LanguageType nLang = LANGUAGE_NONE;
|
EditView & rEditView = mpView->GetTextEditOutlinerView()->GetEditView();;
|
||||||
bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, rEditView );
|
String aStatusVal;
|
||||||
rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
|
LanguageType nLang = LANGUAGE_NONE;
|
||||||
|
bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, rEditView );
|
||||||
|
rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
|
||||||
|
|
||||||
// disable "Thesaurus" context menu entry if there is nothing to look up
|
// disable "Thesaurus" context menu entry if there is nothing to look up
|
||||||
lang::Locale aLocale( SvxCreateLocale( nLang ) );
|
lang::Locale aLocale( SvxCreateLocale( nLang ) );
|
||||||
uno::Reference< linguistic2::XThesaurus > xThes( LinguMgr::GetThesaurus() );
|
uno::Reference< linguistic2::XThesaurus > xThes( LinguMgr::GetThesaurus() );
|
||||||
if (!bIsLookUpWord ||
|
if (!bIsLookUpWord ||
|
||||||
!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
|
!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
|
||||||
|
rSet.DisableItem( SID_THES );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
rSet.DisableItem( SID_THES );
|
rSet.DisableItem( SID_THES );
|
||||||
|
}
|
||||||
//! avoid puting the same item as SfxBoolItem at the end of this function
|
//! avoid puting the same item as SfxBoolItem at the end of this function
|
||||||
nSlotId = 0;
|
nSlotId = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user