summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2010-06-17 13:53:48 +0200
committerChristian Lippka <cl@openoffice.org>2010-06-17 13:53:48 +0200
commit2230b3c83b46a425295d7a2f23e7fac7fec94add (patch)
treef3798b8f1583a6f1e05891461545cc269646d0fe /sd
parentf3b2db1efb379596f0269e439a35b5575b616b2c (diff)
#i112337# text edit outliner may be null on status update, prevent crash
Diffstat (limited to 'sd')
-rwxr-xr-xsd/source/ui/view/drtxtob.cxx30
1 files changed, 18 insertions, 12 deletions
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 8b88be3682e3..9eb0a3b2ff8c 100755
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -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 ) );
-
- // 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 ))
+ 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 ))
+ rSet.DisableItem( SID_THES );
+ }
+ else
+ {
rSet.DisableItem( SID_THES );
-
+ }
//! avoid puting the same item as SfxBoolItem at the end of this function
nSlotId = 0;
}