summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-05-22 19:23:14 +0200
committerEike Rathke <erack@redhat.com>2014-05-22 19:35:37 +0200
commitfe2b8ef18b11b226fddd1cf3fc7f9133426a1b1a (patch)
treec317ab68afda978668874b4288a3cbe9169615d9 /svx
parentdbe8b3b6d4f2d2cc2e8c702b78034e9013f71e8f (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.cxx17
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;