sd/source/ui/view/drviewse.cxx | 7 +++++++ 1 file changed, 7 insertions(+)
New commits: commit 70111311f39b52858f7de8b5adb764db9d28a46e Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Dec 19 08:53:09 2024 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Dec 20 09:48:36 2024 +0100 cool#10630 lok doc sign: fix Impress sign line when creating directly Once .uno:InsertSignatureLine gets dispatched, FuConstructRectangle gets activated, the signature line (a graphic shape) gets inserted, but then FuConstructRectangle is not deactivated in the "create directly" case, so next clicks keep inserting new signature lines, while the expectation is that "create directly" inserts one shape and selects it. The "create directly" mode is the default for LOK, but you can trigger it on the desktop with the KeyModifier=8192 (KEY_MOD1, i.e. Ctrl) UNO command parameter, too. The normal mode would send the mouse button down/up events to FuConstructRectangle and sd::FuConstructRectangle::MouseButtonUp() would select the shape after a drag to determine the position/size. The "create directly" mode will insert instantly, so sd::FuConstructRectangle::MouseButtonUp() is not called, so the shape is not selected, so the shape insert mode is not deactivated. Fix this by selecting the object for the create direct mode the same say as FuConstructRectangle would do, at the place where e.g. text editing is started for Impress textboxes. Do this for rectangle shapes for now, but later other shapes might want to do the same: e.g. curve insert doesn't have this problem, but it seems line insert has the same problem -- that's not changed here. Change-Id: I3ae85a07010f95b80a862e0cc631994113613eda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178865 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 2b354a104556..9a7c8df31f7a 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -228,6 +228,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) // for LibreOfficeKit - choosing a shape should construct it directly bool bCreateDirectly = false; + bool bRectangle = false; switch ( nSId ) { @@ -455,6 +456,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) case SID_INSERT_SIGNATURELINE: { bCreateDirectly = comphelper::LibreOfficeKit::isActive(); + bRectangle = true; SetCurrentFunction( FuConstructRectangle::Create( this, GetActiveWindow(), mpDrawView.get(), GetDoc(), rReq, bPermanent ) ); rReq.Done(); } @@ -674,6 +676,11 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) break; } } + + if (bRectangle && !bPermanent) + { + GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON); + } } void DrawViewShell::FuDeleteSelectedObjects()