git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46354
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxRichTextObject* child = node->GetData();
if (!child->GetRange().IsOutside(range))
{
wxRichTextObject* child = node->GetData();
if (!child->GetRange().IsOutside(range))
{
-// if (lineCount > 0)
-// text += wxT("\n");
wxRichTextRange childRange = range;
childRange.LimitTo(child->GetRange());
wxRichTextRange childRange = range;
childRange.LimitTo(child->GetRange());
- if (childRange.GetEnd() == child->GetRange().GetEnd())
+ if ((childRange.GetEnd() == child->GetRange().GetEnd()) && node->GetNext())
text += wxT("\n");
lineCount ++;
text += wxT("\n");
lineCount ++;
if (!urlTarget.IsEmpty())
{
wxMouseEvent mouseEvent(event);
if (!urlTarget.IsEmpty())
{
wxMouseEvent mouseEvent(event);
long startPos = 0, endPos = 0;
wxRichTextObject* obj = GetBuffer().GetLeafObjectAtPosition(position);
if (obj)
long startPos = 0, endPos = 0;
wxRichTextObject* obj = GetBuffer().GetLeafObjectAtPosition(position);
if (obj)
startPos = obj->GetRange().GetStart();
endPos = obj->GetRange().GetEnd();
}
startPos = obj->GetRange().GetStart();
endPos = obj->GetRange().GetEnd();
}
wxTextUrlEvent urlEvent(GetId(), mouseEvent, startPos, endPos);
InitCommandEvent(urlEvent);
wxTextUrlEvent urlEvent(GetId(), mouseEvent, startPos, endPos);
InitCommandEvent(urlEvent);
urlEvent.SetString(urlTarget);
urlEvent.SetString(urlTarget);
GetEventHandler()->ProcessEvent(urlEvent);
}
}
GetEventHandler()->ProcessEvent(urlEvent);
}
}
GetId());
cmdEvent.SetEventObject(this);
cmdEvent.SetPosition(m_caretPosition+1);
GetId());
cmdEvent.SetEventObject(this);
cmdEvent.SetPosition(m_caretPosition+1);
GetEventHandler()->ProcessEvent(cmdEvent);
}
GetEventHandler()->ProcessEvent(cmdEvent);
}
GetId());
cmdEvent.SetEventObject(this);
cmdEvent.SetPosition(m_caretPosition+1);
GetId());
cmdEvent.SetEventObject(this);
cmdEvent.SetPosition(m_caretPosition+1);
if (!GetEventHandler()->ProcessEvent(cmdEvent))
{
SelectWord(GetCaretPosition()+1);
if (!GetEventHandler()->ProcessEvent(cmdEvent))
{
SelectWord(GetCaretPosition()+1);
GetId());
cmdEvent.SetEventObject(this);
cmdEvent.SetPosition(m_caretPosition+1);
GetId());
cmdEvent.SetEventObject(this);
cmdEvent.SetPosition(m_caretPosition+1);
if (!GetEventHandler()->ProcessEvent(cmdEvent))
event.Skip();
}
if (!GetEventHandler()->ProcessEvent(cmdEvent))
event.Skip();
}
- // if the text is long enough, it's faster to just set it instead of first
- // comparing it with the old one (chances are that it will be different
- // anyhow, this comparison is there to avoid flicker for small single-line
- // edit controls mostly)
- if ( (value.length() > 0x400) || (value != GetValue()) )
+ // Remove empty paragraph
+ GetBuffer().Clear();
DoWriteText(value);
// for compatibility, don't move the cursor when doing SetValue()
SetInsertionPoint(0);
}
DoWriteText(value);
// for compatibility, don't move the cursor when doing SetValue()
SetInsertionPoint(0);
}
- if ( flags & SetValue_SendEvent )
- {
- // still send an event for consistency
+ // still send an event for consistency
+ if (flags & SetValue_SendEvent)
-
- // we should reset the modified flag even if the value didn't really change
-
- // mark the control as being not dirty - we changed its text, not the
- // user