summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2020-02-12 22:48:45 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-02-13 07:20:20 +0100
commitd75781dcd619a747b17b6c897ba44dc6ff8b5c7e (patch)
tree91579203125fb32812d75600c4c02a84760ae704 /basctl
parent7a27ac1060fcf8a6bbf9e03ad1457633dcd1ad06 (diff)
tdf#57307 - Expand word boundaries to include connector punctuations
Include connector punctuations when adding a variable to the watch window using "Enable Watch (F7)" in order to add the correct variable name. Change-Id: Idaf7699dde3f4147d603c6aea4b2381e2af497a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88575 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 5d3bb561b275..85db57dfbfdd 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -695,14 +695,11 @@ void ModulWindow::BasicAddWatch()
bool bAdd = true;
if ( !GetEditView()->HasSelection() )
{
- TextPaM aWordStart;
- OUString aWord = GetEditEngine()->GetWord( GetEditView()->GetSelection().GetEnd(), &aWordStart );
+ // tdf#57307 - expand selection to include connector punctuations
+ TextSelection aSel;
+ OUString aWord = GetEditEngine()->GetWord( GetEditView()->GetSelection().GetEnd(), &aSel.GetStart(), &aSel.GetEnd() );
if ( !aWord.isEmpty() )
- {
- TextSelection aSel( aWordStart );
- aSel.GetEnd().GetIndex() += aWord.getLength();
GetEditView()->SetSelection( aSel );
- }
else
bAdd = false;
}