diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2016-10-20 15:28:59 +0200 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2016-10-20 13:43:19 +0000 |
commit | 98c8d1beb5933c7c2f04f6a0ede0d10605262cf6 (patch) | |
tree | 4868fce590bec7822736f5a026496362c1cd8c7e | |
parent | d7fde891671ce68dee663af5f9664c20dbc5c828 (diff) |
Calc: fix seg fault due to commit 483a866b
Change-Id: Ifd49fb3fce2b49a70db6be99e20590323e3dc518
Reviewed-on: https://gerrit.libreoffice.org/30105
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun6.cxx | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 5305b7483365..38790abaec67 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1226,7 +1226,16 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow ) if (rDoc.IsStreamValid(rPos.Tab())) rDoc.SetStreamValid(rPos.Tab(), false); - rDocShell.GetViewData()->GetViewShell()->OnLOKNoteStateChanged(rPos); + + ScViewData* pViewData = rDocShell.GetViewData(); + if (pViewData) + { + ScTabViewShell* pViewShell = pViewData->GetViewShell(); + if (pViewShell) + { + pViewShell->OnLOKNoteStateChanged(rPos); + } + } rDocShell.SetDocumentModified(); return true; diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index d5513cf90479..20418eca5f98 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -509,7 +509,11 @@ void ScViewFunc::EditNote() { ScrollToObject( pCaption ); // make object fully visible static_cast< FuText* >( pPoor )->SetInEditMode( pCaption ); - GetViewData().GetViewShell()->OnLOKNoteStateChanged(aPos); + ScTabViewShell* pViewShell = GetViewData().GetViewShell(); + if (pViewShell) + { + pViewShell->OnLOKNoteStateChanged(aPos); + } } } } |