]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
more warning fixes
[wxWidgets.git] / src / generic / grid.cpp
index 45562e16be4ebb0058a563a9c7a8b5635ba4d314..c7bb960e079f40ab26963da030f8274f2e816206 100644 (file)
@@ -69,7 +69,7 @@
 // array classes
 // ----------------------------------------------------------------------------
 
-WX_DEFINE_EXPORTED_ARRAY(wxGridCellAttr *, wxArrayAttrs);
+WX_DEFINE_EXPORTED_ARRAY_NO_PTR(wxGridCellAttr *, wxArrayAttrs);
 
 struct wxGridCellWithAttr
 {
@@ -332,7 +332,7 @@ struct wxGridDataTypeInfo
 };
 
 
-WX_DEFINE_EXPORTED_ARRAY(wxGridDataTypeInfo*, wxGridDataTypeInfoArray);
+WX_DEFINE_EXPORTED_ARRAY_NO_PTR(wxGridDataTypeInfo*, wxGridDataTypeInfoArray);
 
 
 class WXDLLEXPORT wxGridTypeRegistry
@@ -717,7 +717,7 @@ bool wxGridCellTextEditor::IsAcceptedKey(wxKeyEvent& event)
 
             default:
                 // accept 8 bit chars too if isprint() agrees
-                if ( (keycode < 255) && (isprint(keycode)) )
+                if ( (keycode < 255) && (wxIsprint(keycode)) )
                     return TRUE;
         }
     }
@@ -911,7 +911,7 @@ bool wxGridCellNumberEditor::IsAcceptedKey(wxKeyEvent& event)
                 return TRUE;
 
             default:
-                if ( (keycode < 128) && isdigit(keycode) )
+                if ( (keycode < 128) && wxIsdigit(keycode) )
                     return TRUE;
         }
     }
@@ -924,7 +924,7 @@ void wxGridCellNumberEditor::StartingKey(wxKeyEvent& event)
     if ( !HasRange() )
     {
         int keycode = event.GetKeyCode();
-        if ( isdigit(keycode) || keycode == '+' || keycode == '-'
+        if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-'
             || keycode ==  WXK_NUMPAD0
             || keycode ==  WXK_NUMPAD1
             || keycode ==  WXK_NUMPAD2
@@ -1064,7 +1064,7 @@ void wxGridCellFloatEditor::Reset()
 void wxGridCellFloatEditor::StartingKey(wxKeyEvent& event)
 {
     int keycode = event.GetKeyCode();
-        if ( isdigit(keycode) || keycode == '+' || keycode == '-' || keycode == '.'
+        if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-' || keycode == '.'
             || keycode ==  WXK_NUMPAD0
             || keycode ==  WXK_NUMPAD1
             || keycode ==  WXK_NUMPAD2
@@ -1166,7 +1166,7 @@ bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event)
             default:
                 // additionally accept 'e' as in '1e+6'
                 if ( (keycode < 128) &&
-                     (isdigit(keycode) || tolower(keycode) == 'e') )
+                     (wxIsdigit(keycode) || tolower(keycode) == 'e') )
                     return TRUE;
         }
     }
@@ -3913,14 +3913,19 @@ bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership,
 {
     if ( m_created )
     {
-        if (m_ownTable) 
-            delete m_table; 
+        // stop all processing 
+        m_created = FALSE; 
+
+        if (m_ownTable)
+        {
+            wxGridTableBase *t=m_table;
+            m_table=0;
+            delete t; 
+        }
         delete m_selection; 
  
-        // stop all processing 
         m_table=0; 
         m_selection=0; 
-        m_created = FALSE; 
         m_numRows=0; 
         m_numCols=0; 
     }
@@ -9372,27 +9377,27 @@ void wxGrid::SetColSize( int col, int width )
 void wxGrid::SetColMinimalWidth( int col, int width )
 {
     if (width > GetColMinimalAcceptableWidth()) {
-        m_colMinWidths.Put(col, width);
+        m_colMinWidths[col] = width;
     }
 }
 
 void wxGrid::SetRowMinimalHeight( int row, int width )
 {
     if (width > GetRowMinimalAcceptableHeight()) {
-       m_rowMinHeights.Put(row, width);
+       m_rowMinHeights[row] = width;
     }
 }
 
 int wxGrid::GetColMinimalWidth(int col) const
 {
-    long value = m_colMinWidths.Get(col);
-    return value != wxNOT_FOUND ? (int)value : m_minAcceptableColWidth;
+    wxLongToLongHashMap::const_iterator it = m_colMinWidths.find(col);
+    return it != m_colMinWidths.end() ? (int)it->second : m_minAcceptableColWidth;
 }
 
 int wxGrid::GetRowMinimalHeight(int row) const
 {
-    long value = m_rowMinHeights.Get(row);
-    return value != wxNOT_FOUND ? (int)value : m_minAcceptableRowHeight;
+    wxLongToLongHashMap::const_iterator it = m_rowMinHeights.find(row);
+    return it != m_rowMinHeights.end() ? (int)it->second : m_minAcceptableRowHeight;
 }
 
 void wxGrid::SetColMinimalAcceptableWidth( int width )