summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-05-04 21:04:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-05-05 09:45:52 +0200
commit75b3cf4ee12f9552e47b1f4ce87a642a4a3d7d25 (patch)
tree28535347b0a5a4de35eddfa06861cd3b835e160c
parent1a99b4e44190e182d56a04678850d62635d74c65 (diff)
rhbz#1956977 crash on switch from active comment to slide sorter
Change-Id: I2b5a5cb8b0631971b775a70d96f2cbf0c118c090 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115115 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index 4f7612af6d47..a5892787be85 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -947,10 +947,13 @@ IMPL_LINK_NOARG(AnnotationManagerImpl, UpdateTagsHdl, void*, void)
void AnnotationManagerImpl::CreateTags()
{
-
if( !(mxCurrentPage.is() && mpDoc) )
return;
+ auto xViewShell = mrBase.GetMainViewShell();
+ if (!xViewShell)
+ return;
+
try
{
int nIndex = 1;
@@ -963,7 +966,7 @@ void AnnotationManagerImpl::CreateTags()
{
Reference< XAnnotation > xAnnotation( xEnum->nextElement() );
Color aColor( GetColorLight( mpDoc->GetAnnotationAuthorIndex( xAnnotation->getAuthor() ) ) );
- rtl::Reference< AnnotationTag > xTag( new AnnotationTag( *this, *mrBase.GetMainViewShell()->GetView(), xAnnotation, aColor, nIndex++, maFont ) );
+ rtl::Reference< AnnotationTag > xTag( new AnnotationTag( *this, *xViewShell->GetView(), xAnnotation, aColor, nIndex++, maFont ) );
maTagVector.push_back(xTag);
if( xAnnotation == mxSelectedAnnotation )