renaissance1: #i107215# Added guard against missing dispatcher.

This commit is contained in:
Andre Fischer<Andre.W.Fischer 2010-06-17 15:58:11 +02:00
parent d57de36d81
commit 11ce307732

View file

@ -1402,10 +1402,15 @@ StartShowButton::StartShowButton (SlideSorter& rSlideSorter)
bool StartShowButton::IsEnabled (void) const
{
ViewShell* pViewShell = mrSlideSorter.GetViewShell();
if (pViewShell == NULL)
return false;
SfxDispatcher* pDispatcher = pViewShell->GetDispatcher();
if (pDispatcher == NULL)
return NULL;
const SfxPoolItem* pState = NULL;
const SfxItemState eState (mrSlideSorter.GetViewShell()->GetDispatcher()->QueryState(
SID_PRESENTATION,
pState));
const SfxItemState eState (pDispatcher->QueryState(SID_PRESENTATION, pState));
return (eState & SFX_ITEM_DISABLED) == 0;
}