summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/gtksalframe.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/gtk/gtksalframe.cxx')
-rw-r--r--vcl/unx/gtk/gtksalframe.cxx19
1 files changed, 7 insertions, 12 deletions
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 195093551d81..760744b0a80b 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -3396,19 +3396,14 @@ bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent )
m_bPreeditJustChanged = false;
- std::list<PreviousKeyPress>::iterator iter = m_aPrevKeyPresses.begin();
- std::list<PreviousKeyPress>::iterator iter_end = m_aPrevKeyPresses.end();
- while (iter != iter_end)
+ auto iter = std::find(m_aPrevKeyPresses.begin(), m_aPrevKeyPresses.end(), pEvent);
+ // If we found a corresponding previous key press event, swallow the release
+ // and remove the earlier key press from our list
+ if (iter != m_aPrevKeyPresses.end())
{
- // If we found a corresponding previous key press event, swallow the release
- // and remove the earlier key press from our list
- if (*iter == pEvent)
- {
- m_aPrevKeyPresses.erase(iter);
- m_nPrevKeyPresses--;
- return true;
- }
- ++iter;
+ m_aPrevKeyPresses.erase(iter);
+ m_nPrevKeyPresses--;
+ return true;
}
if( bResult )