Kaydet (Commit) dd0f6c73 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#66700 don't crash on querying zoom state with no SfxObjectShell

Change-Id: Id2943c92ce6deaae3e4d507a35c08466db21cece
üst 0f3895a7
......@@ -602,6 +602,10 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_ZOOM_ENTIRE_PAGE:
case SID_ZOOM_PAGE_WIDTH:
{
SfxObjectShell* pCurrentShell = SfxObjectShell::Current();
if (!pCurrentShell)
return;
// make sure aZoom is initialized with a proper value if SetType
// doesn't work
SvxZoomItem aZoom( SVX_ZOOM_PERCENT, 100 );
......@@ -634,7 +638,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
break;
}
SfxViewFrame::Current()->GetDispatcher()->Execute(SID_ATTR_ZOOM, SFX_CALLMODE_ASYNCHRON, &aZoom, 0L);
pCurrentShell->GetDispatcher()->Execute(SID_ATTR_ZOOM, SFX_CALLMODE_ASYNCHRON, &aZoom, 0L);
break;
}
......@@ -818,8 +822,11 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
case SID_ZOOM_ENTIRE_PAGE:
case SID_ZOOM_PAGE_WIDTH:
{
SfxObjectShell* pCurrentShell = SfxObjectShell::Current();
const SfxPoolItem *pItem;
SfxItemState aState = SfxViewFrame::Current()->GetDispatcher()->QueryState(SID_ATTR_ZOOM, pItem);
SfxItemState aState = pCurrentShell ?
pCurrentShell->GetDispatcher()->QueryState(SID_ATTR_ZOOM, pItem) : SFX_ITEM_DISABLED;
if ( aState == SFX_ITEM_DISABLED )
rSet.DisableItem( nWhich );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment