Patch #3177 2011-06-24 14:28

gerddie99

Proposed fix for Bug #18182
Download
3177-Proposed_fix_f.patch (1.1 KB)
Category
Plugin::Bugfix
Status
Accepted
Close date
2011-06-30 06:38
Assigned to
mortenmacfly
diff -ru codeblocks-10.05-release/src/plugins/contrib/wxSmithContribItems/wxchart/wxchart-1.0/src/chartwindow.cpp codeblocks-10.05-release.new/src/plugins/contrib/wxSmithContribItems/wxchart/wxchart-1.0/src/chartwindow.cpp
--- codeblocks-10.05-release/src/plugins/contrib/wxSmithContribItems/wxchart/wxchart-1.0/src/chartwindow.cpp    2010-05-22 12:17:06.000000000 +0200
+++ codeblocks-10.05-release.new/src/plugins/contrib/wxSmithContribItems/wxchart/wxchart-1.0/src/chartwindow.cpp    2011-06-24 14:21:02.207999852 +0200
@@ -156,7 +156,13 @@
         }
         
         wxChartSizes *sizes = GetSizes();
-        
+
+    // sizes may be NULL, in this case do nothing 
+    // not sure if this is the right way to do things 
+    //  gw.fossdev@gmail.com 
+    if (!sizes) 
+        return; 
+
         hp->SetPen( *wxBLACK_DASHED_PEN );
         
         double current = lower;
@@ -188,6 +194,10 @@
     int iNodes = static_cast<int>(ceil( GetVirtualMaxX() ));
     wxChartSizes *sizes = GetSizes();
     
+    /// sizes may be NULL, in this case return a fixes value 
+    if (!sizes) 
+        return 1; 
+    
     ChartValue x = 0;
 
     for ( int iNode = 0; iNode <= iNodes; ++ iNode )
mortenmacfly 2011-06-30 06:38

Applied partially in HEAD (of wxsmith branch). Thank you!