diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-05-04 21:04:40 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-05-06 16:40:08 +0200 |
commit | dc12911be2234b9bb530e2064f5b913798bdcae1 (patch) | |
tree | dc5449b7c0b00ad01427c2aae48632fbca34b1bb | |
parent | cfc3832e81280123931d8fb8785cbed8bc8f797e (diff) |
rhbz#1956977 crash on switch from active comment to slide sorter
Change-Id: I2b5a5cb8b0631971b775a70d96f2cbf0c118c090
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115076
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
-rw-r--r-- | sd/source/ui/annotations/annotationmanager.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index f3d3dea3603c..628681977bb5 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -948,10 +948,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; @@ -964,7 +967,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 ) |