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>
This commit is contained in:
committed by
Noel Grandin
parent
7a27ac1060
commit
d75781dcd6
@@ -695,14 +695,11 @@ void ModulWindow::BasicAddWatch()
|
|||||||
bool bAdd = true;
|
bool bAdd = true;
|
||||||
if ( !GetEditView()->HasSelection() )
|
if ( !GetEditView()->HasSelection() )
|
||||||
{
|
{
|
||||||
TextPaM aWordStart;
|
// tdf#57307 - expand selection to include connector punctuations
|
||||||
OUString aWord = GetEditEngine()->GetWord( GetEditView()->GetSelection().GetEnd(), &aWordStart );
|
TextSelection aSel;
|
||||||
|
OUString aWord = GetEditEngine()->GetWord( GetEditView()->GetSelection().GetEnd(), &aSel.GetStart(), &aSel.GetEnd() );
|
||||||
if ( !aWord.isEmpty() )
|
if ( !aWord.isEmpty() )
|
||||||
{
|
|
||||||
TextSelection aSel( aWordStart );
|
|
||||||
aSel.GetEnd().GetIndex() += aWord.getLength();
|
|
||||||
GetEditView()->SetSelection( aSel );
|
GetEditView()->SetSelection( aSel );
|
||||||
}
|
|
||||||
else
|
else
|
||||||
bAdd = false;
|
bAdd = false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user