From 9189993c1729c86362fb455f16c42ac2eb29e879 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Fri, 16 Jul 2010 10:08:59 +0200 Subject: [PATCH] renaissance1: #i112337# Included fix from other CWS. --- sd/source/ui/view/drtxtob.cxx | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 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 ) ); + 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; }