#i112337# text edit outliner may be null on status update, prevent crash
This commit is contained in:
parent
f3b2db1efb
commit
2230b3c83b
1 changed files with 17 additions and 11 deletions
|
@ -384,19 +384,25 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
|
|||
|
||||
case SID_THES:
|
||||
{
|
||||
EditView & rEditView = mpView->GetTextEditOutlinerView()->GetEditView();;
|
||||
String aStatusVal;
|
||||
LanguageType nLang = LANGUAGE_NONE;
|
||||
bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, rEditView );
|
||||
rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
|
||||
if( mpView && mpView->GetTextEditOutlinerView() )
|
||||
{
|
||||
EditView & rEditView = mpView->GetTextEditOutlinerView()->GetEditView();;
|
||||
String 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
|
||||
lang::Locale aLocale( SvxCreateLocale( nLang ) );
|
||||
uno::Reference< linguistic2::XThesaurus > xThes( LinguMgr::GetThesaurus() );
|
||||
if (!bIsLookUpWord ||
|
||||
!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
|
||||
// disable "Thesaurus" context menu entry if there is nothing to look up
|
||||
lang::Locale aLocale( SvxCreateLocale( nLang ) );
|
||||
uno::Reference< linguistic2::XThesaurus > xThes( LinguMgr::GetThesaurus() );
|
||||
if (!bIsLookUpWord ||
|
||||
!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
|
||||
rSet.DisableItem( SID_THES );
|
||||
}
|
||||
else
|
||||
{
|
||||
rSet.DisableItem( SID_THES );
|
||||
|
||||
}
|
||||
//! avoid puting the same item as SfxBoolItem at the end of this function
|
||||
nSlotId = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue