summaryrefslogtreecommitdiff
path: root/sd/source/ui/annotations
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2025-01-07 12:12:52 +0900
committerTomaž Vajngerl <quikee@gmail.com>2025-01-07 05:44:09 +0100
commit481e230e834c903e7ec0f045c20039910ad894ed (patch)
treed74dbbb8feb1a67e23f91d30f751289ad2e80aca /sd/source/ui/annotations
parentd3afb7acebc023340aef5d70d4f35cecb359cd54 (diff)
tdf#162246 use main ViewShell when synching the annotations
Current ViewShell is not always available, but we use the main ViewShell most of the time anyway in AnnotationManager, so use that when annotation synching. Use only the current ViewShell when opening the annotation pop-up window. Change-Id: Ibbc8e0859d0b91617577148e76e8293cb8015941 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179849 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins
Diffstat (limited to 'sd/source/ui/annotations')
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index 7c8de65421bd..cfcfa52ef971 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -1010,17 +1010,12 @@ void AnnotationManagerImpl::SyncAnnotationObjects()
if (!mxCurrentPage.is() || !mpDoc)
return;
- sd::DrawDocShell* pDocShell = dynamic_cast<sd::DrawDocShell*>(SfxObjectShell::Current());
- sd::ViewShell* pViewShell = pDocShell ? pDocShell->GetViewShell() : nullptr;
+ std::shared_ptr<DrawViewShell> pDrawViewShell = std::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell());
- if (!pViewShell)
- {
- pViewShell = mrBase.GetMainViewShell().get();
- if (!pViewShell)
- return;
- }
+ if (!pDrawViewShell)
+ return;
- auto* pView = pViewShell->GetView();
+ auto* pView = pDrawViewShell->GetView();
if (!pView)
return;