sw/source/uibase/dochdl/gloshdl.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 9b264707ec9da318da9344a139b810755020aa69
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Oct 8 05:08:36 2019 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Tue Oct 8 10:16:04 2019 +0200

    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: https://gerrit.libreoffice.org/80419
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    (cherry picked from commit 810cddee6d2ef0f4057337d699a1a55323faa1ba)
    Reviewed-on: https://gerrit.libreoffice.org/80420
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sw/source/uibase/dochdl/gloshdl.cxx 
b/sw/source/uibase/dochdl/gloshdl.cxx
index a52a59f38f30..df6ea46eedef 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -372,8 +372,9 @@ bool SwGlossaryHdl::ExpandGlossary(weld::Window* pParent)
             pWrtShell->LeaveBlockMode();
         else if(pWrtShell->IsExtMode())
             pWrtShell->LeaveExtMode();
-        // 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
         if(pWrtShell->IsSelection())
             aShortName = pWrtShell->GetSelText();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to