summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-05-11 13:14:37 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-05-11 13:14:59 (GMT)
commit9080e2b826e8cffaa56af96d6b670c219e78424f (patch)
treed65ef12a6987e3dc32331a75f9e3ab01fdfc3de9 /Swift/QtUI/QtFormWidget.cpp
parent73ae80d0ed8895bb2bad7b9f627d0921ddb2ecb2 (diff)
downloadswift-contrib-9080e2b826e8cffaa56af96d6b670c219e78424f.zip
swift-contrib-9080e2b826e8cffaa56af96d6b670c219e78424f.tar.bz2
Don't allow form results to get interpreted as HTML
Diffstat (limited to 'Swift/QtUI/QtFormWidget.cpp')
-rw-r--r--Swift/QtUI/QtFormWidget.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Swift/QtUI/QtFormWidget.cpp b/Swift/QtUI/QtFormWidget.cpp
index 1307735..4216863 100644
--- a/Swift/QtUI/QtFormWidget.cpp
+++ b/Swift/QtUI/QtFormWidget.cpp
@@ -96,7 +96,9 @@ QWidget* QtFormWidget::createWidget(FormField::ref field) {
boost::shared_ptr<TextMultiFormField> textMultiField = boost::dynamic_pointer_cast<TextMultiFormField>(field);
if (textMultiField) {
QString value = textMultiField->getValue().c_str();
- widget = new QTextEdit(value, this);
+ QTextEdit* textWidget = new QTextEdit(this);
+ textWidget->setPlainText(value);
+ widget = textWidget;
}
boost::shared_ptr<TextPrivateFormField> textPrivateField = boost::dynamic_pointer_cast<TextPrivateFormField>(field);
if (textPrivateField) {
@@ -126,7 +128,9 @@ QWidget* QtFormWidget::createWidget(FormField::ref field) {
prev = true;
text += line.toString().c_str();
}
- widget = new QTextEdit(text, this);
+ QTextEdit* textWidget = new QTextEdit(this);
+ textWidget->setPlainText(text);
+ widget = textWidget;
}
boost::shared_ptr<ListMultiFormField> listMultiField = boost::dynamic_pointer_cast<ListMultiFormField>(field);
if (listMultiField) {