[Commits] (davids) colheader - another wx coding guidelines conformance tweak

commits at osafoundation.org commits at osafoundation.org
Sat Apr 9 10:31:22 PDT 2005


Commit by: davids
Modified files:
internal/wxPython-2.5/src/generic/colheader.cpp 1.55 1.56

Log message:

colheader - another wx coding guidelines conformance tweak
r=TBD



ViewCVS links:
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/src/generic/colheader.cpp.diff?r1=text&tr1=1.55&r2=text&tr2=1.56

Index: internal/wxPython-2.5/src/generic/colheader.cpp
diff -u internal/wxPython-2.5/src/generic/colheader.cpp:1.55 internal/wxPython-2.5/src/generic/colheader.cpp:1.56
--- internal/wxPython-2.5/src/generic/colheader.cpp:1.55	Sat Apr  9 00:30:32 2005
+++ internal/wxPython-2.5/src/generic/colheader.cpp	Sat Apr  9 10:31:20 2005
@@ -271,6 +271,7 @@
 bool wxColumnHeader::Enable(
 	bool		bEnable )
 {
+long		i;
 bool		bResultV;
 
 	if (bEnable == IsEnabled())
@@ -278,7 +279,7 @@
 
 	bResultV = wxControl::Enable( bEnable );
 
-	for (long i=0; i<m_ItemCount; i++)
+	for (i=0; i<m_ItemCount; i++)
 	{
 		if ((m_ItemList != NULL) && (m_ItemList[i] != NULL))
 			m_ItemList[i]->SetFlagAttribute( wxCOLUMNHEADER_FLAGATTR_Enabled, bEnable );
@@ -774,11 +775,12 @@
 void wxColumnHeader::SetSelectedItem(
 	long			itemIndex )
 {
+long		i;
 bool		bSelected;
 
 	if (m_ItemSelected != itemIndex)
 	{
-		for (long i=0; i<m_ItemCount; i++)
+		for (i=0; i<m_ItemCount; i++)
 		{
 			bSelected = (i == itemIndex);
 			if ((m_ItemList != NULL) && (m_ItemList[i] != NULL))
@@ -808,6 +810,8 @@
 void wxColumnHeader::DeleteItem(
 	long			itemIndex )
 {
+long		i;
+
 	if ((itemIndex >= 0) && (itemIndex < m_ItemCount))
 	{
 #if defined(__WXMSW__)
@@ -822,7 +826,7 @@
 				delete m_ItemList[itemIndex];
 
 				// close the list hole
-				for (long i=itemIndex; i<m_ItemCount-1; i++)
+				for (i=itemIndex; i<m_ItemCount-1; i++)
 					m_ItemList[i] = m_ItemList[i + 1];
 
 				// leave a NULL spot at the end
@@ -975,9 +979,11 @@
 
 void wxColumnHeader::DisposeItemList( void )
 {
+long		i;
+
 	if (m_ItemList != NULL)
 	{
-		for (long i=0; i<m_ItemCount; i++)
+		for (i=0; i<m_ItemCount; i++)
 			delete m_ItemList[i];
 
 		free( m_ItemList );
@@ -1250,7 +1256,7 @@
 #if defined(__WXMSW__)
 RECT		boundsR;
 HWND		targetViewRef;
-long		itemCount, i;
+long			itemCount, i;
 
 	targetViewRef = GetHwnd();
 	if (targetViewRef == NULL)
@@ -1271,8 +1277,9 @@
 		}
 	}
 #else
+long		i;
 
-	for (long i=0; i<m_ItemCount; i++)
+	for (i=0; i<m_ItemCount; i++)
 		if (m_ItemList[i] != NULL)
 			if (m_ItemList[i]->HitTest( locationPt ) != 0)
 			{
@@ -1297,21 +1304,20 @@
 
 	// Win32 case - add selection indicator - no native mechanism exists
 	if (m_BVisibleSelection && (m_ItemSelected >= 0))
-	{
 		if (GetItemBounds( m_ItemSelected, &boundsR ))
 		{
 		wxClientDC		dc( this );
 
 			wxColumnHeaderItem::GenericDrawSelection( &dc, &boundsR, m_SelectionDrawStyle );
 		}
-	}
 
 #else
 wxClientDC	dc( this );
+long			i;
 
 	dc.SetFont( m_Font );
 
-	for (long i=0; i<m_ItemCount; i++)
+	for (i=0; i<m_ItemCount; i++)
 		if (GetItemBounds( i, &boundsR ))
 		{
 			dc.SetClippingRegion( boundsR.x, boundsR.y, boundsR.width, boundsR.height );



More information about the Commits mailing list