This was SVN commit r10011.
This commit is contained in:
Chakakhan
2011-08-16 01:01:39 +00:00
parent cda5dfbf12
commit 0f0ac2bcd5
+16
View File
@@ -789,8 +789,17 @@ void CInput::HandleMessage(SGUIMessage &Message)
case GUIM_MOUSE_DBLCLICK_LEFT:
{
CStrW *pCaption = (CStrW*)m_Settings["caption"].m_pSetting;
if (pCaption->length() == 0)
break;
m_iBufferPos = m_iBufferPos_Tail = GetMouseHoveringTextPosition();
if (m_iBufferPos >= pCaption->length())
m_iBufferPos = m_iBufferPos_Tail = pCaption->length() - 1;
// See if we are clicking over whitespace
if (iswspace((*pCaption)[m_iBufferPos]))
{
@@ -830,6 +839,10 @@ void CInput::HandleMessage(SGUIMessage &Message)
if (!iswspace((*pCaption)[m_iBufferPos_Tail]))
break;
}
if (m_iBufferPos_Tail == pCaption->length())
break;
// now go to the right until we hit whitespace or punctuation
while (++m_iBufferPos_Tail < (int)pCaption->length())
{
@@ -846,6 +859,9 @@ void CInput::HandleMessage(SGUIMessage &Message)
break;
}
if (m_iBufferPos_Tail == pCaption->length())
break;
// Don't include the leading whitespace
m_iBufferPos = m_iBufferPos_Tail;