sw/qa/extras/uiwriter/uiwriter9.cxx | 2 +- sw/source/core/crsr/crsrsh.cxx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
New commits: commit 242f6985556af7aac77b68c6dfea20d4b32c5f52 Author: Justin Luth <jl...@mail.com> AuthorDate: Sat Dec 23 13:41:20 2023 -0500 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Jan 3 08:46:33 2024 +0100 tdf#111969 sw: acknowledge that last half-character for context menu This patch depends on the previous one. This fixes the right-click menu building features half-a-character too early (redlines, smarttag) and ending half-a-character too early. Note that hyperlinks already started half-a-char too late, now they start a whole character too late. See follow-up Note that fields ended OK, but still started too early until this patch. make CppunitTest_sw_uiwriter9 CPPUNIT_TEST_NAME=testTdf111969B Change-Id: I90fbbb776667afc6021f8d0b3771f2cef1c72365 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161258 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index 8febc2f2145e..a22ce3df306e 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -151,7 +151,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf111969B) // the test: simulate a right-click of a mouse (at the end-edge of the second N-dash) // which sets the cursor and then acts on that pos. pWrtShell->SwCursorShell::SetCursor(aLogicL, false, /*Block=*/false, /*FieldInfo=*/true); - //CPPUNIT_ASSERT(!pWrtShell->GetCurField(true)); + CPPUNIT_ASSERT(!pWrtShell->GetCurField(true)); } } // end of anonymous namespace diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index ed9f47dc81c5..9448533ff75d 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1057,6 +1057,7 @@ int SwCursorShell::SetCursor(const Point& rLPt, bool bOnlyText, bool bBlock, boo bOnlyText ? CursorMoveState::SetOnlyText : CursorMoveState::NONE ); aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); aTmpState.m_bFieldInfo = bFieldInfo; // always set cursor at field-start if point is over field + aTmpState.m_bPosMatchesBounds = bFieldInfo; // always set cursor at character-start if over char SwTextNode const*const pTextNd = sw::GetParaPropsNode(*GetLayout(), pCursor->GetPoint()->GetNode());