[Kst]  branches/work/kst/portto4/kst/src/libkst
    Nicolas Brisset 
    nicolas.brisset at eurocopter.com
       
    Sat Feb  5 23:34:29 CET 2011
    
    
  
SVN commit 1219047 by brisset:
Avoid adding square brackets around the unit if it already has some
 M  +5 -0      datavector.cpp  
--- branches/work/kst/portto4/kst/src/libkst/datavector.cpp #1219046:1219047
@@ -315,9 +315,14 @@
   if (_fieldStrings.contains("units")) {
     QString units = _fieldStrings.value("units")->value();
     if (!units.isEmpty()) {
+      // Apparently some people already add the square brackets in the unit name - avoid having two brackets
+      if (units.startsWith("[")) {
+        label += " " + units;
+      } else {
       label += " \\[" + units + "\\]";
     }
   }
+  }
 
   // un-escape escaped special characters so they aren't escaped 2x.
   label.replace("\\_", "_").replace("\\^","^").replace("\\[", "[").replace("\\]", "]");
    
    
More information about the Kst
mailing list