summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-30 16:06:44 +0100
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-08-30 20:00:49 +0000
commit47134ddc12e130ff65848cb8faa72fa3a4a61c77 (patch)
treef7def592eb08904b0c22c784633d0f953da0c8a7
parent1a03ecaf22843345849db7ba3e25ac9cbdd10dbf (diff)
Related: fdo#66700 don't crash on setting zoom state with no SfxObjectShell
(cherry picked from commit dd0f6c737b6af659389e473296e939ec6cfa5f4e) Conflicts: sfx2/source/appl/appserv.cxx Change-Id: Id2943c92ce6deaae3e4d507a35c08466db21cece Reviewed-on: https://gerrit.libreoffice.org/5697 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r--sfx2/source/appl/appserv.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 92ac7afe2159..d4d8fff69c71 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -601,6 +601,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 );
@@ -633,7 +637,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;
}