[Libreoffice-commits] core.git: sfx2/source
Caolán McNamara
caolanm at redhat.com
Fri Aug 30 08:07:44 PDT 2013
sfx2/source/appl/appserv.cxx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
New commits:
commit dd0f6c737b6af659389e473296e939ec6cfa5f4e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 30 16:06:44 2013 +0100
Resolves: fdo#66700 don't crash on querying zoom state with no SfxObjectShell
Change-Id: Id2943c92ce6deaae3e4d507a35c08466db21cece
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index d84fb82..e4c77c1 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -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 );
}
More information about the Libreoffice-commits
mailing list