summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/docshell/docsh4.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 14f0bc4a4615..8b8220106b35 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1177,11 +1177,15 @@ void ScDocShell::Execute( SfxRequest& rReq )
#endif
case SID_OPEN_CALC:
{
- SfxStringItem aApp(SID_DOC_SERVICE, "com.sun.star.sheet.SpreadsheetDocument");
- SfxStringItem aTarget(SID_TARGETNAME, "_blank");
- GetViewData()->GetDispatcher().ExecuteList(
- SID_OPENDOC, SfxCallMode::API|SfxCallMode::SYNCHRON,
- { &aApp, &aTarget });
+ ScViewData* pViewData = GetViewData();
+ if (pViewData)
+ {
+ SfxStringItem aApp(SID_DOC_SERVICE, "com.sun.star.sheet.SpreadsheetDocument");
+ SfxStringItem aTarget(SID_TARGETNAME, "_blank");
+ pViewData->GetDispatcher().ExecuteList(
+ SID_OPENDOC, SfxCallMode::API|SfxCallMode::SYNCHRON,
+ { &aApp, &aTarget });
+ }
}
break;
case SID_NOTEBOOKBAR: