summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-12-07 12:48:43 +0100
committerEike Rathke <erack@redhat.com>2017-12-07 12:48:54 +0100
commit0d1e0bda6a59f8c87981f87ebc7b89876a00cfb5 (patch)
tree85c96a12566fbcbd88c01212b7da2ab8c8cb8b7d /sc/source
parent7bcb9a8416d61bdd3c7fc345f87de5aa8c3054f9 (diff)
Remember ScViewData* and further check ScDrawView*
Follow-up on commit 3809655e6d554dbc6c74b11597c540c4a62d4c09 Date: Thu Dec 7 00:06:36 2017 +0100 sc: don't crash on loading comments Seems filters call ShowNote before a view is set or something. Fixup for 25555c50ad2a57c1b2313f39b8132ac5e80a45fd. This "best current view" looks a bit fragile anyway.. Change-Id: I7012e4d0e10128b21ece304507b204976a9e03db
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/docshell/docfunc.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 939c54614d78..430da19d4fa8 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1216,8 +1216,12 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow )
ScTabView::OnLOKNoteStateChanged(pNote);
- if (ScDocShell::GetViewData())
- ScDocShell::GetViewData()->GetScDrawView()->SyncForGrid(pNote->GetCaption());
+ if (ScViewData* pViewData = ScDocShell::GetViewData())
+ {
+ if (ScDrawView* pDrawView = pViewData->GetScDrawView())
+ pDrawView->SyncForGrid( pNote->GetCaption());
+ }
+
rDocShell.SetDocumentModified();
return true;