sw/source/core/frmedt/feshview.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+)
New commits: commit 6b6776070b12815430b2f849a05349de921ee098 Author: Michael Stahl <[email protected]> AuthorDate: Fri May 16 12:39:26 2025 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Fri May 16 18:10:59 2025 +0200 LOCRDT sw: deactivate active comment when fly is selected CppunitTest_sw_uiwriter5 CPPUNIT_TEST_NAME="testImageComment" fails because it inserts a comment, putting the cursor into the comment, then selecting an image, putting the sw cursor onto the SwGrfNode, but the active comment remains active, hence later the selection type is PostIt, not anything fly related as it should be. This appears to be a general problem and the test worked by accident before. Change-Id: Ic49b46d16cd2412e379015f10fe4fc7224efbd80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185409 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 02f3d8b5e27e..0ec0634b4b0f 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -92,6 +92,8 @@ #include <sfx2/lokhelper.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <calbck.hxx> +#include <PostItMgr.hxx> +#include <AnnotationWin.hxx> #include <flyfrms.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <svx/svxids.hrc> @@ -269,6 +271,14 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj ) { KillPams(); ClearMark(); + if (pObj && dynamic_cast<SwWrtShell*>(this)) // ensure it's own mgr + { + if (::sw::annotation::SwAnnotationWin *const pAnnotation{ + GetPostItMgr()->GetActiveSidebarWin()}) + { + pAnnotation->UnsetActiveSidebarWin(); + } + } } if ( pObj )
