[Kst] [Bug 93021] equation names are quite insane

George Staikos staikos at kde.org
Mon Dec 6 06:48:49 CET 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
        
http://bugs.kde.org/show_bug.cgi?id=93021        
staikos kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From staikos kde org  2004-12-06 06:48 -------
CVS commit by staikos: 

Sanify generated equation names.  Thoughts on this?  Could be better maybe?

BUG: 93021


  M +8 -1      ksteqdialog_i.cpp   1.72


--- kdeextragear-2/kst/kst/ksteqdialog_i.cpp  #1.71:1.72
 @ -20,4 +20,5  @
 #include <qcheckbox.h>
 #include <qradiobutton.h>
+#include <qregexp.h>
 #include <qspinbox.h>
 
 @ -155,5 +156,11  @ bool KstEqDialogI::new_I() {
 
   QString tag_name = _tagName->text();
-  tag_name.replace("<New_Equation>", Equation->text());
+  QString etext = Equation->text();
+  etext.remove(QRegExp("[^a-zA-Z0-9\\(\\)\\+\\-\\*/\\%\\^\\|\\&\\!<>=_]"));
+  if (etext.length() > 12) {
+    etext.truncate(12);
+    etext += "...";
+  }
+  tag_name.replace("<New_Equation>", etext);
 
   /* verify that the curve name is unique */



More information about the Kst mailing list