summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2023-12-22 14:59:47 -0500
committerJustin Luth <jluth@mail.com>2023-12-23 00:51:52 +0100
commit90b12c9bad55e8f50b75a6d7b68caa27d82cc2b9 (patch)
tree4f9398f2636f3a6d2abb3c36dc630672a9f9c705
parent73102542754189e3140f40f8cf02b60d6268dc0a (diff)
tdf#111969 sw: add selected smarttag to context menu
If the smart tag was selected (from start to end), then GetPoint() was returning the end position which is considered to be outside of the smarttag. Instead, use Start(), which doesn't care which direction the selection happened in. Smart tags REQUIRE an extension, so no unit test possible. Change-Id: I3ad2f686a9f5d6accb0d1ac2ffbf272260249223 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161194 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
-rw-r--r--sw/source/core/crsr/crsrsh.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index e910a3aa92fa..449b074194bc 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -4109,7 +4109,7 @@ void SwCursorShell::GetSmartTagTerm( std::vector< OUString >& rSmartTagTypes,
return;
SwPaM* pCursor = GetCursor();
- SwPosition aPos( *pCursor->GetPoint() );
+ SwPosition aPos(*pCursor->Start());
SwTextNode *pNode = aPos.GetNode().GetTextNode();
if ( !pNode || pNode->IsInProtectSect() )
return;