sd/source/ui/annotations/annotationmanager.cxx | 5 +++++ sd/source/ui/annotations/annotationwindow.cxx | 5 ++++- sd/source/ui/func/fusel.cxx | 8 ++++++++ sd/source/ui/inc/DrawViewShell.hxx | 2 ++ sd/source/ui/inc/annotationmanager.hxx | 6 ++++++ 5 files changed, 25 insertions(+), 1 deletion(-)
New commits: commit 3f7d0f79f1c43222bd160cffd9e443bb5fc91c99 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sun Jul 14 00:02:31 2024 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sun Jul 14 05:20:49 2024 +0200 annot: make all keys work when writing in annotation window We did not call the method on the superclass when we don't handle the key ourselves, but we should. Change-Id: I67d55773b7e86297c00727b4791c16a1adcc37f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170430 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index 14952248f5e6..1de79f30cb2c 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -147,7 +147,10 @@ bool AnnotationTextWindow::KeyInput(const KeyEvent& rKeyEvt) } } - return bDone; + if (bDone) + return true; + + return WeldEditView::KeyInput(rKeyEvt); } AnnotationTextWindow::AnnotationTextWindow(AnnotationWindow& rContents) commit aff09d7cb464af3223ee43cac0483ae3bf22fddd Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sat Jul 13 23:58:49 2024 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sun Jul 14 05:20:41 2024 +0200 tdf#161994 annot: trigger selection of the current annotation Delete annotation isn't active if no annotation is selected, but we do not report a new selection anymore, so fix this. Change-Id: Idb455d0c0d42412c55de4a7ca037342b58da548b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170429 Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Tested-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 000ef254b23e..e547521bdb49 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -1288,6 +1288,11 @@ void AnnotationManager::GetAnnotationState(SfxItemSet& rItemSet) mxImpl->GetAnnotationState(rItemSet); } +void AnnotationManager::SelectAnnotation(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation) +{ + mxImpl->SelectAnnotation(xAnnotation); } +} // end sd + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 0b4def5bb2b0..efc1c6ea262d 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -51,6 +51,7 @@ #include <DrawViewShell.hxx> #include <ToolBarManager.hxx> #include <Client.hxx> +#include <annotationmanager.hxx> #include <svx/svdundo.hxx> @@ -865,7 +866,14 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) { auto& pAnnotationData = pSingleObj->getAnnotationData(); if (pAnnotationData) + { + auto* pDrawViewShell = dynamic_cast<DrawViewShell*>(mpViewShell); + if (pDrawViewShell && pDrawViewShell->getAnnotationManagerPtr()) + { + pDrawViewShell->getAnnotationManagerPtr()->SelectAnnotation(pAnnotationData->mxAnnotation); + } pAnnotationData->openPopup(); + } return true; } diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index ce1e7c74cea3..f18d7913294a 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -235,6 +235,8 @@ public: void ExecuteAnnotation (SfxRequest const & rRequest); void GetAnnotationState (SfxItemSet& rItemSet); + AnnotationManager* getAnnotationManagerPtr() { return mpAnnotationManager.get(); } + void StartRulerDrag (const Ruler& rRuler, const MouseEvent& rMEvt); virtual bool PrepareClose( bool bUI = true ) override; diff --git a/sd/source/ui/inc/annotationmanager.hxx b/sd/source/ui/inc/annotationmanager.hxx index 6f47efd1fc06..25bf5503384e 100644 --- a/sd/source/ui/inc/annotationmanager.hxx +++ b/sd/source/ui/inc/annotationmanager.hxx @@ -24,6 +24,11 @@ class SfxRequest; class SfxItemSet; +namespace sdr::annotation +{ +class Annotation; +} + namespace sd { class ViewShellBase; @@ -37,6 +42,7 @@ public: void ExecuteAnnotation(SfxRequest const& rRequest); void GetAnnotationState(SfxItemSet& rItemSet); + void SelectAnnotation(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation); private: ::rtl::Reference<AnnotationManagerImpl> mxImpl;