]> git.saurik.com Git - wxWidgets.git/commitdiff
Have wxPropertyGrid::DoubleToString() to also take comma into account as a decimal...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 13 Dec 2010 16:07:49 +0000 (16:07 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 13 Dec 2010 16:07:49 +0000 (16:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66367 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgrid.h
src/propgrid/props.cpp

index 45691311fa0498b4ca792e484f24a467354450ea..874c576b091d19f945b8c00e2edad3164d5dde5a 100644 (file)
@@ -1547,11 +1547,11 @@ public:
 
     /** Standardized double-to-string conversion.
     */
-    static void DoubleToString( wxString& target,
-                                double value,
-                                int precision,
-                                bool removeZeroes,
-                                wxString* precTemplate );
+    static const wxString& DoubleToString( wxString& target,
+                                           double value,
+                                           int precision,
+                                           bool removeZeroes,
+                                           wxString* precTemplate = NULL );
 
     /**
         Call this from wxPGProperty::OnEvent() to cause property value to be
index 27cb58494921d601ba453f063ef05b9e768c3001..f8357d44080a76d27d6f79bc157ae486623f1625 100644 (file)
@@ -666,11 +666,11 @@ wxFloatProperty::~wxFloatProperty() { }
 
 // This helper method provides standard way for floating point-using
 // properties to convert values to string.
-void wxPropertyGrid::DoubleToString(wxString& target,
-                                    double value,
-                                    int precision,
-                                    bool removeZeroes,
-                                    wxString* precTemplate)
+const wxString& wxPropertyGrid::DoubleToString(wxString& target,
+                                               double value,
+                                               int precision,
+                                               bool removeZeroes,
+                                               wxString* precTemplate)
 {
     if ( precision >= 0 )
     {
@@ -722,7 +722,7 @@ void wxPropertyGrid::DoubleToString(wxString& target,
 
         for ( ; i != target.end(); i++ )
         {
-            if ( *i != wxS('0') && *i != wxS('.') )
+            if ( *i != wxS('0') && *i != wxS('.') && *i != wxS(',') )
             {
                 isZero = false;
                 break;
@@ -732,6 +732,8 @@ void wxPropertyGrid::DoubleToString(wxString& target,
         if ( isZero )
             target.erase(target.begin());
     }
+
+    return target;
 }
 
 wxString wxFloatProperty::ValueToString( wxVariant& value,