Fix pasting long strings in wxTextCtrl under MSW
Adjust the length limit before pasting to ensure that all text on clipboard will be successfully pasted, instead of only pasting the part of it which fits. Add a unit test checking that this works. Closes #4646.
This commit is contained in:
@@ -60,6 +60,8 @@ public:
|
||||
|
||||
virtual void GetSelection(long *from, long *to) const wxOVERRIDE;
|
||||
|
||||
virtual void Paste() wxOVERRIDE;
|
||||
|
||||
virtual void Redo() wxOVERRIDE;
|
||||
virtual bool CanRedo() const wxOVERRIDE;
|
||||
|
||||
@@ -292,6 +294,11 @@ private:
|
||||
// false if we hit the limit set by SetMaxLength() and so didn't change it.
|
||||
bool AdjustSpaceLimit();
|
||||
|
||||
// Called before pasting to ensure that the limit is at big enough to allow
|
||||
// pasting the entire text on the clipboard.
|
||||
void AdjustMaxLengthBeforePaste();
|
||||
|
||||
|
||||
wxMenu* m_privateContextMenu;
|
||||
|
||||
bool m_isNativeCaretShown;
|
||||
|
Reference in New Issue
Block a user