From acab6f3dc3556ccf3d7295aae968637f6a954d81 Mon Sep 17 00:00:00 2001 From: blacksun Date: Sun, 31 Mar 2019 18:43:45 +0000 Subject: [PATCH] Really fix the removing of carriage return and line feed. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5817 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/editor/ui/elementpropertieseditorwidget.cpp | 9 +++------ sources/ui/elementinfowidget.cpp | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index d066fc5ec..a779095b9 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -182,12 +182,9 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted() for (QTreeWidgetItem *qtwi : ui->m_tree->invisibleRootItem()->takeChildren()) { QString txt = qtwi->text(1); - //Replace html line feed - txt.replace(" ", " "); //hexa - txt.replace(" ", " "); //decimal - //Replace html carriage return - txt.replace(" ", " "); //hexa - txt.replace(" ", " "); //decimal + //remove line feed and carriage return + txt.remove("\r"); + txt.remove("\n"); m_elmt_info.addValue(qtwi->data(0, Qt::UserRole).toString(), txt); } diff --git a/sources/ui/elementinfowidget.cpp b/sources/ui/elementinfowidget.cpp index 8f40c11d8..8475be5e7 100644 --- a/sources/ui/elementinfowidget.cpp +++ b/sources/ui/elementinfowidget.cpp @@ -237,12 +237,9 @@ DiagramContext ElementInfoWidget::currentInfo() const if (!eipw->text().isEmpty()) { QString txt = eipw->text(); - //Replace html line feed - txt.replace(" ", " "); //hexa - txt.replace(" ", " "); //decimal - //Replace html carriage return - txt.replace(" ", " "); //hexa - txt.replace(" ", " "); //decimal + //remove line feed and carriage return + txt.remove("\r"); + txt.remove("\n"); info_.addValue(eipw->key(), txt); } }