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

set edit selection only if necessary

No visible effect, just that it's unnecessary in other cases.

Change-Id: I4f40dbaea5ea647347f7e20f8e233837f7dbd8cb
üst f4f064da
...@@ -719,8 +719,14 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ ) ...@@ -719,8 +719,14 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ )
// invalidates the Edit Selection thus has to happen between // invalidates the Edit Selection thus has to happen between
// obtaining the Selection and setting the new Selection. // obtaining the Selection and setting the new Selection.
sal_Int32 nSelPos = ImplGetSelectEntryPos(); sal_Int32 nSelPos = ImplGetSelectEntryPos();
if (nSelPos != nPos) bool bSetEditSelection;
if (nSelPos == nPos)
bSetEditSelection = false;
else
{
ImplSelectEntryPos( nPos, true); ImplSelectEntryPos( nPos, true);
bSetEditSelection = true;
}
// If typing into the Edit control led us here, advance start of a // If typing into the Edit control led us here, advance start of a
// full selection by one so the next character will already // full selection by one so the next character will already
...@@ -731,10 +737,14 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ ) ...@@ -731,10 +737,14 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ )
{ {
OUString aText( GetText()); OUString aText( GetText());
if (aSel.Min() == aText.getLength()) if (aSel.Min() == aText.getLength())
{
++aSel.Max(); ++aSel.Max();
bSetEditSelection = true;
}
} }
SetSelection( aSel); if (bSetEditSelection)
SetSelection( aSel);
meEditedAndValid = EDITED_NO; meEditedAndValid = EDITED_NO;
} }
......
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