path: root/sw/source
diff options
authorMike Kaganski <>2019-10-08 05:08:36 +0200
committerMike Kaganski <>2019-10-09 13:11:02 +0200
commit7ab86555c5bca3cdc3aee6ac5fcc348956f444f0 (patch)
tree5681f3541dada5e7ebb3932535ceff625e1b82c3 /sw/source
parent400cc072ab8498048aad7d07930e1503bb1a0406 (diff)
tdf#126589: only consider text to the left of cursor as AutoText short name
Given a text "This is a dtfoo bar", and cursor inside "dtfoo" between "t" and "f", invoking AutoText function (F3) currently considers the whole word "dtfoo" as autotext short name. This changes it to only consider the part of the word to the left of cursor, i.e. only "dt" in the example. This removes the requirement to have a word boundary after the autotext short name. Change-Id: I6ba28e63fe25664131b7e03dda39ae997dffa464 Reviewed-on: Tested-by: Jenkins Reviewed-by: Mike Kaganski <> (cherry picked from commit 810cddee6d2ef0f4057337d699a1a55323faa1ba) Reviewed-on: Tested-by: Jenkins CollaboraOffice <> (cherry picked from commit 9b264707ec9da318da9344a139b810755020aa69) Reviewed-on:
Diffstat (limited to 'sw/source')
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index 85964f4c1f0c..e2585ff6cc03 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -374,8 +374,9 @@ bool SwGlossaryHdl::ExpandGlossary()
else if(pWrtShell->IsExtMode())
- // select word
- pWrtShell->SelNearestWrd();
+ // select word (tdf#126589: part to the left of cursor)
+ if (pWrtShell->IsInWord() || pWrtShell->IsEndWrd())
+ pWrtShell->PrvWrd(true);
// ask for word
aShortName = pWrtShell->GetSelText();