summaryrefslogtreecommitdiff
path: root/src/interface/Textbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface/Textbox.cpp')
-rw-r--r--src/interface/Textbox.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/interface/Textbox.cpp b/src/interface/Textbox.cpp
index 603fa23..ab4d907 100644
--- a/src/interface/Textbox.cpp
+++ b/src/interface/Textbox.cpp
@@ -191,6 +191,21 @@ void Textbox::pasteIntoSelection()
backingText.erase(backingText.begin()+getLowerSelectionBound(), backingText.begin()+getHigherSelectionBound());
cursor = getLowerSelectionBound();
}
+ for(std::string::iterator iter = newText.begin(), end = newText.end(); iter != end; ++iter)
+ {
+ if(!CharacterValid(*iter))
+ {
+ if(inputType == All)
+ {
+ if(*iter == '\n' || *iter == '\r')
+ *iter = ' ';
+ else
+ *iter = '?';
+ }
+ else
+ *iter = '0';
+ }
+ }
backingText.insert(cursor, newText);
cursor = cursor+newText.length();
ClearSelection();