[qet] qet/qet: [5817] Really fix the removing of carriage return and line feed.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 5817
Author:   blacksun
Date:     2019-03-31 20:43:45 +0200 (Sun, 31 Mar 2019)
Log Message:
-----------
Really fix the removing of carriage return and line feed.

Modified Paths:
--------------
    trunk/sources/editor/ui/elementpropertieseditorwidget.cpp
    trunk/sources/ui/elementinfowidget.cpp

Modified: trunk/sources/editor/ui/elementpropertieseditorwidget.cpp
===================================================================
--- trunk/sources/editor/ui/elementpropertieseditorwidget.cpp	2019-03-31 13:49:07 UTC (rev 5816)
+++ trunk/sources/editor/ui/elementpropertieseditorwidget.cpp	2019-03-31 18:43:45 UTC (rev 5817)
@@ -182,12 +182,9 @@
 	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);
 	}

Modified: trunk/sources/ui/elementinfowidget.cpp
===================================================================
--- trunk/sources/ui/elementinfowidget.cpp	2019-03-31 13:49:07 UTC (rev 5816)
+++ trunk/sources/ui/elementinfowidget.cpp	2019-03-31 18:43:45 UTC (rev 5817)
@@ -237,12 +237,9 @@
 		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);
 		}
 	}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/