summaryrefslogtreecommitdiff
path: root/sw/source/uibase/app/docsh.cxx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-10-28 16:01:15 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-10-28 17:17:08 +0100
commitd1b9267a646983ca9f301871056ae611d27be171 (patch)
treec74a30d15c8327a6be1d07494f7ad34a69965f1a /sw/source/uibase/app/docsh.cxx
parentbf180165b07d6592f23b0bdda8e66fff4fa57eab (diff)
tdf#128418 Fix crash in print preview
Change-Id: I2a8c5511563ac3205722d63f22cde472a8aaddde Reviewed-on: https://gerrit.libreoffice.org/81610 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sw/source/uibase/app/docsh.cxx')
-rw-r--r--sw/source/uibase/app/docsh.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 08cdb0ca6245..1e0f4ac20a12 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -1062,7 +1062,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
case FN_OUTLINE_TO_IMPRESS:
{
SvtModuleOptions aMOpt;
- if ( !aMOpt.IsImpress() || GetViewShell()->isExportLocked() )
+ if (!aMOpt.IsImpress() || (GetViewShell() && GetViewShell()->isExportLocked()))
rSet.DisableItem( nWhich );
}
[[fallthrough]];
@@ -1084,12 +1084,14 @@ void SwDocShell::GetState(SfxItemSet& rSet)
break;
case FN_NEW_GLOBAL_DOC:
- if ( dynamic_cast< const SwGlobalDocShell *>( this ) != nullptr || GetViewShell()->isExportLocked() )
+ if (dynamic_cast<const SwGlobalDocShell*>(this) != nullptr
+ || (GetViewShell() && GetViewShell()->isExportLocked()))
rSet.DisableItem( nWhich );
break;
case FN_NEW_HTML_DOC:
- if( dynamic_cast< const SwWebDocShell *>( this ) != nullptr || GetViewShell()->isExportLocked() )
+ if (dynamic_cast<const SwWebDocShell*>(this) != nullptr
+ || (GetViewShell() && GetViewShell()->isExportLocked()))
rSet.DisableItem( nWhich );
break;