Kaydet (Commit) a448f1bb authored tarafından Eike Rathke's avatar Eike Rathke

Resolves: tdf#81429 select corresponding listbox entry if not current

Change-Id: Ib475a43601ee22d33677ac45cd6ef9dba7e7c431
üst ba686b9b
...@@ -713,21 +713,29 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ ) ...@@ -713,21 +713,29 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ )
const sal_Int32 nPos = GetEntryPos( aStr); const sal_Int32 nPos = GetEntryPos( aStr);
if (nPos != COMBOBOX_ENTRY_NOTFOUND) 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()); Selection aSel( GetSelection());
// Select the corresponding listbox entry if not current. This
// invalidates the Edit Selection thus has to happen between
// obtaining the Selection and setting the new Selection.
sal_Int32 nSelPos = ImplGetSelectEntryPos();
if (nSelPos != nPos)
ImplSelectEntryPos( nPos, true);
// If typing into the Edit control led us here, advance start of a
// 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.
if (aSel.Max() == 1) if (aSel.Max() == 1)
{ {
OUString aText( GetText()); OUString aText( GetText());
if (aSel.Min() == aText.getLength()) if (aSel.Min() == aText.getLength())
{
++aSel.Max(); ++aSel.Max();
SetSelection( aSel);
}
} }
SetSelection( aSel);
meEditedAndValid = EDITED_NO; meEditedAndValid = EDITED_NO;
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment