diff options
author | Eike Rathke <erack@redhat.com> | 2014-05-22 19:23:14 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-05-22 19:35:37 +0200 |
commit | fe2b8ef18b11b226fddd1cf3fc7f9133426a1b1a (patch) | |
tree | c317ab68afda978668874b4288a3cbe9169615d9 /svx | |
parent | dbe8b3b6d4f2d2cc2e8c702b78034e9013f71e8f (diff) |
advance start of edit selection on a matching entry
... to allow continuous typing.
Change-Id: I4717e72e422037a441e582004bc87689ea7bc455
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/langbox.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 77ec1547b52d..028e33df15ba 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -711,7 +711,24 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ ) { const sal_Int32 nPos = GetEntryPos( aStr); if (nPos != COMBOBOX_ENTRY_NOTFOUND) + { + // Advance start of full selection by one so the next character + // will already continue the string instead of having to type the + // same character again to start a new string. The selection + // includes formatting characters and is reverse when obtained from + // the Edit control. + Selection aSel( GetSelection()); + if (aSel.Max() == 1) + { + OUString aText( GetText()); + if (aSel.Min() == aText.getLength()) + { + ++aSel.Max(); + SetSelection( aSel); + } + } meEditedAndValid = EDITED_NO; + } else { OUString aCanonicalized; |