cleanup: unreachable code, unused variables, indentation, etc

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2008-11-16 18:20:46 +00:00
parent 470f357fd2
commit b7bc9d806b
9 changed files with 69 additions and 105 deletions

View File

@@ -17,7 +17,6 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#include "wx/display.h"
#include "wx/sizer.h" #include "wx/sizer.h"
#include "wx/private/flagscheck.h" #include "wx/private/flagscheck.h"
@@ -32,6 +31,7 @@
#include "wx/toplevel.h" #include "wx/toplevel.h"
#endif // WX_PRECOMP #endif // WX_PRECOMP
#include "wx/display.h"
#include "wx/listimpl.cpp" #include "wx/listimpl.cpp"
@@ -1631,11 +1631,9 @@ wxSize wxFlexGridSizer::CalcMin()
m_rowHeights.assign(nrows, -1); m_rowHeights.assign(nrows, -1);
m_colWidths.assign(ncols, -1); m_colWidths.assign(ncols, -1);
// n is the index of the item in left-to-right top-to-bottom order
size_t n = 0;
for ( wxSizerItemList::iterator i = m_children.begin(); for ( wxSizerItemList::iterator i = m_children.begin();
i != m_children.end(); i != m_children.end();
++i, ++n ) ++i)
{ {
wxSizerItem * const item = *i; wxSizerItem * const item = *i;
if ( item->IsShown() ) if ( item->IsShown() )
@@ -1803,7 +1801,7 @@ void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz)
: NULL : NULL
); );
} }
} }
if ( (m_flexDirection & wxVERTICAL) || (m_growMode != wxFLEX_GROWMODE_NONE) ) if ( (m_flexDirection & wxVERTICAL) || (m_growMode != wxFLEX_GROWMODE_NONE) )
{ {

View File

@@ -719,7 +719,7 @@ void wxSplitterWindow::SizeWindows()
// Set pane for unsplit window // Set pane for unsplit window
void wxSplitterWindow::Initialize(wxWindow *window) void wxSplitterWindow::Initialize(wxWindow *window)
{ {
wxASSERT_MSG( (!window || (window && window->GetParent() == this)), wxASSERT_MSG( (!window || window->GetParent() == this),
_T("windows in the splitter should have it as parent!") ); _T("windows in the splitter should have it as parent!") );
if (window && !window->IsShown()) if (window && !window->IsShown())

View File

@@ -453,14 +453,7 @@ wxFontProperty::wxFontProperty( const wxString& label, const wxString& name,
// Initialize font family choices list // Initialize font family choices list
if ( !wxPGGlobalVars->m_fontFamilyChoices ) if ( !wxPGGlobalVars->m_fontFamilyChoices )
{ {
wxFontEnumerator enumerator; wxArrayString faceNames = wxFontEnumerator::GetFacenames();
enumerator.EnumerateFacenames();
#if wxMINOR_VERSION > 6
wxArrayString faceNames = enumerator.GetFacenames();
#else
wxArrayString& faceNames = *enumerator.GetFacenames();
#endif
faceNames.Sort(); faceNames.Sort();
@@ -897,7 +890,6 @@ int wxSystemColourProperty::ColToInd( const wxColour& colour ) const
return wxNOT_FOUND; return wxNOT_FOUND;
} }
void wxSystemColourProperty::OnSetValue() void wxSystemColourProperty::OnSetValue()
{ {
// Convert from generic wxobject ptr to wxPGVariantDataColour // Convert from generic wxobject ptr to wxPGVariantDataColour
@@ -1576,7 +1568,7 @@ const wxString& wxPGGetDefaultImageWildcard()
// Let's iterate over the image handler list. // Let's iterate over the image handler list.
//for ( wxList::Node *node = handlers.GetFirst(); node; node = node->GetNext() ) //for ( wxList::Node *node = handlers.GetFirst(); node; node = node->GetNext() )
for ( node = handlers.begin(); node != handlers.end(); node++ ) for ( node = handlers.begin(); node != handlers.end(); ++node )
{ {
wxImageHandler *handler = (wxImageHandler*)*node; wxImageHandler *handler = (wxImageHandler*)*node;

View File

@@ -235,7 +235,7 @@ IMPLEMENT_CLASS(wxPropertyGridManager, wxPanel)
#define ID_ADVTOOLBAR_OFFSET 1 #define ID_ADVTOOLBAR_OFFSET 1
#define ID_ADVHELPCAPTION_OFFSET 2 #define ID_ADVHELPCAPTION_OFFSET 2
#define ID_ADVHELPCONTENT_OFFSET 3 #define ID_ADVHELPCONTENT_OFFSET 3
#define ID_ADVBUTTON_OFFSET 4 //#define ID_ADVBUTTON_OFFSET 4
#define ID_ADVTBITEMSBASE_OFFSET 5 // Must be last. #define ID_ADVTBITEMSBASE_OFFSET 5 // Must be last.
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------

View File

@@ -227,15 +227,7 @@ void wxPGDefaultRenderer::Render( wxDC& dc, const wxRect& rect,
paintdata.m_drawnWidth = imageSize.x; paintdata.m_drawnWidth = imageSize.x;
paintdata.m_drawnHeight = imageSize.y; paintdata.m_drawnHeight = imageSize.y;
if ( !isUnspecified )
{
property->OnCustomPaint( dc, imageRect, paintdata ); property->OnCustomPaint( dc, imageRect, paintdata );
}
else
{
dc.SetBrush(*wxWHITE_BRUSH);
dc.DrawRectangle(imageRect);
}
imageOffset = paintdata.m_drawnWidth; imageOffset = paintdata.m_drawnWidth;
} }
@@ -796,7 +788,7 @@ void wxPGProperty::DoGenerateComposedValue( wxString& text,
childValue = overrideValue; childValue = overrideValue;
else else
childValue = curChild->GetValue(); childValue = curChild->GetValue();
node++; ++node;
if ( node != valueOverrides->end() ) if ( node != valueOverrides->end() )
overrideValue = *node; overrideValue = *node;
else else
@@ -1047,7 +1039,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
{ {
int depth = 1; int depth = 1;
if ( it != text.end() ) it++; if ( it != text.end() ) ++it;
pos++; pos++;
size_t startPos = pos; size_t startPos = pos;
@@ -1055,7 +1047,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
while ( it != text.end() && depth > 0 ) while ( it != text.end() && depth > 0 )
{ {
a = *it; a = *it;
it++; ++it;
pos++; pos++;
if ( a == wxS(']') ) if ( a == wxS(']') )
@@ -1109,7 +1101,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
if ( a == delimeter ) if ( a == delimeter )
{ {
pos--; pos--;
it--; --it;
} }
} }
} }
@@ -1118,7 +1110,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
if ( a == 0 ) if ( a == 0 )
break; break;
it++; ++it;
if ( it != text.end() ) if ( it != text.end() )
{ {
a = *it; a = *it;
@@ -1243,7 +1235,7 @@ void wxPGProperty::SetValue( wxVariant value, wxVariant* pList, int flags )
// Children in list can be in any order, but we will give hint to // Children in list can be in any order, but we will give hint to
// GetPropertyByNameWH(). This optimizes for full list parsing. // GetPropertyByNameWH(). This optimizes for full list parsing.
for ( node = list.begin(); node != list.end(); node++ ) for ( node = list.begin(); node != list.end(); ++node )
{ {
wxVariant& childValue = *((wxVariant*)*node); wxVariant& childValue = *((wxVariant*)*node);
wxPGProperty* child = GetPropertyByNameWH(childValue.GetName(), i); wxPGProperty* child = GetPropertyByNameWH(childValue.GetName(), i);
@@ -2311,7 +2303,7 @@ bool wxPGProperty::AreAllChildrenSpecified( wxVariant* pendingList ) const
{ {
const wxString& childName = child->GetBaseName(); const wxString& childName = child->GetBaseName();
for ( ; node != pList->end(); node++ ) for ( ; node != pList->end(); ++node )
{ {
const wxVariant& item = *((const wxVariant*)*node); const wxVariant& item = *((const wxVariant*)*node);
if ( item.GetName() == childName ) if ( item.GetName() == childName )
@@ -2500,7 +2492,7 @@ wxPGAttributeStorage::~wxPGAttributeStorage()
{ {
wxPGHashMapS2P::iterator it; wxPGHashMapS2P::iterator it;
for ( it = m_map.begin(); it != m_map.end(); it++ ) for ( it = m_map.begin(); it != m_map.end(); ++it )
{ {
wxVariantData* data = (wxVariantData*) it->second; wxVariantData* data = (wxVariantData*) it->second;
data->DecRef(); data->DecRef();

View File

@@ -92,16 +92,16 @@
//#define wxPG_TEXT_INDENT 4 // For the wxComboControl //#define wxPG_TEXT_INDENT 4 // For the wxComboControl
#define wxPG_ALLOW_CLIPPING 1 // If 1, GetUpdateRegion() in OnPaint event handler is not ignored //#define wxPG_ALLOW_CLIPPING 1 // If 1, GetUpdateRegion() in OnPaint event handler is not ignored
#define wxPG_GUTTER_DIV 3 // gutter is max(iconwidth/gutter_div,gutter_min) #define wxPG_GUTTER_DIV 3 // gutter is max(iconwidth/gutter_div,gutter_min)
#define wxPG_GUTTER_MIN 3 // gutter before and after image of [+] or [-] #define wxPG_GUTTER_MIN 3 // gutter before and after image of [+] or [-]
#define wxPG_YSPACING_MIN 1 #define wxPG_YSPACING_MIN 1
#define wxPG_DEFAULT_VSPACING 2 // This matches .NET propertygrid's value, #define wxPG_DEFAULT_VSPACING 2 // This matches .NET propertygrid's value,
// but causes normal combobox to spill out under MSW // but causes normal combobox to spill out under MSW
#define wxPG_OPTIMAL_WIDTH 200 // Arbitrary //#define wxPG_OPTIMAL_WIDTH 200 // Arbitrary
#define wxPG_MIN_SCROLLBAR_WIDTH 10 // Smallest scrollbar width on any platform //#define wxPG_MIN_SCROLLBAR_WIDTH 10 // Smallest scrollbar width on any platform
// Must be larger than largest control border // Must be larger than largest control border
// width * 2. // width * 2.
@@ -111,7 +111,7 @@
//#define wxPG_NAT_CHOICE_BORDER_ANY 0 //#define wxPG_NAT_CHOICE_BORDER_ANY 0
#define wxPG_HIDER_BUTTON_HEIGHT 25 //#define wxPG_HIDER_BUTTON_HEIGHT 25
#define wxPG_PIXELS_PER_UNIT m_lineHeight #define wxPG_PIXELS_PER_UNIT m_lineHeight
@@ -119,7 +119,7 @@
#define m_iconHeight m_iconWidth #define m_iconHeight m_iconWidth
#endif #endif
#define wxPG_TOOLTIP_DELAY 1000 //#define wxPG_TOOLTIP_DELAY 1000
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -959,8 +959,6 @@ static int wxPGGetColAvg( const wxColour& col )
void wxPropertyGrid::RegainColours() void wxPropertyGrid::RegainColours()
{ {
wxColour def_bgcol = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
if ( !(m_coloursCustomized & 0x0002) ) if ( !(m_coloursCustomized & 0x0002) )
{ {
wxColour col = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ); wxColour col = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
@@ -1324,7 +1322,7 @@ wxString& wxPropertyGrid::ExpandEscapeSequences( wxString& dst_str, wxString& sr
dst_str.clear(); dst_str.clear();
for ( ; i != src_str.end(); i++ ) for ( ; i != src_str.end(); ++i )
{ {
wxUniChar a = *i; wxUniChar a = *i;
@@ -1382,7 +1380,7 @@ wxString& wxPropertyGrid::CreateEscapeSequences( wxString& dst_str, wxString& sr
dst_str.clear(); dst_str.clear();
for ( ; i != src_str.end(); i++ ) for ( ; i != src_str.end(); ++i )
{ {
wxChar a = *i; wxChar a = *i;
@@ -1683,13 +1681,10 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
// //
// clipRect conversion // clipRect conversion
if ( clipRect )
{
cr2 = *clipRect; cr2 = *clipRect;
cr2.x -= xRelMod; cr2.x -= xRelMod;
cr2.y -= yRelMod; cr2.y -= yRelMod;
clipRect = &cr2; clipRect = &cr2;
}
firstItemTopY -= yRelMod; firstItemTopY -= yRelMod;
lastItemBottomY -= yRelMod; lastItemBottomY -= yRelMod;
} }
@@ -1701,7 +1696,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
const wxFont& normalfont = m_font; const wxFont& normalfont = m_font;
bool reallyFocused = (m_iFlags & wxPG_FL_FOCUSED) ? true : false; bool reallyFocused = (m_iFlags & wxPG_FL_FOCUSED) != 0;
bool isEnabled = IsEnabled(); bool isEnabled = IsEnabled();
@@ -3369,9 +3364,6 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
wxASSERT( m_wndEditor == (wxWindow*) NULL ); wxASSERT( m_wndEditor == (wxWindow*) NULL );
// Do we need OnMeasureCalls?
wxSize imsz = p->OnMeasureImage();
// //
// Only create editor for non-disabled non-caption // Only create editor for non-disabled non-caption
if ( !p->IsCategory() && !(p->m_flags & wxPG_PROP_DISABLED) ) if ( !p->IsCategory() && !(p->m_flags & wxPG_PROP_DISABLED) )
@@ -3717,7 +3709,7 @@ bool wxPropertyGrid::DoExpand( wxPGProperty* p, bool sendEvents )
} }
// Clear dont-center-splitter flag if it wasn't set // Clear dont-center-splitter flag if it wasn't set
m_iFlags = m_iFlags & ~(wxPG_FL_DONT_CENTER_SPLITTER) | old_flag; m_iFlags = (m_iFlags & ~wxPG_FL_DONT_CENTER_SPLITTER) | old_flag;
return res; return res;
} }
@@ -3767,8 +3759,7 @@ void wxPropertyGrid::RecalculateVirtualSize( int forceXPos )
if ( by1 != by2 ) if ( by1 != by2 )
{ {
wxString s = wxString::Format(wxT("VirtualHeight=%i, ActualVirtualHeight=%i, should match!"), by1, by2); wxString s = wxString::Format(wxT("VirtualHeight=%i, ActualVirtualHeight=%i, should match!"), by1, by2);
wxASSERT_MSG( false, wxFAIL_MSG(s.c_str());
s.c_str() );
wxLogDebug(s); wxLogDebug(s);
} }
#endif #endif
@@ -4214,9 +4205,9 @@ bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y, wxMouseEvent &event
int curPropHoverY = y - (y % ih); int curPropHoverY = y - (y % ih);
// On which item it hovers // On which item it hovers
if ( ( !m_propHover ) if ( !m_propHover
|| ||
( m_propHover && ( sy < m_propHoverY || sy >= (m_propHoverY+ih) ) ) ( sy < m_propHoverY || sy >= (m_propHoverY+ih) )
) )
{ {
// Mouse moves on another property // Mouse moves on another property
@@ -4328,8 +4319,7 @@ bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y, wxMouseEvent &event
// (also not if we were dragging and its started // (also not if we were dragging and its started
// outside the splitter region) // outside the splitter region)
if ( m_propHover && if ( !m_propHover->IsCategory() &&
!m_propHover->IsCategory() &&
!event.Dragging() ) !event.Dragging() )
{ {
@@ -4704,7 +4694,7 @@ void wxPropertyGrid::ClearActionTriggers( int action )
{ {
wxPGHashMapI2I::iterator it; wxPGHashMapI2I::iterator it;
for ( it = m_actionTriggers.begin(); it != m_actionTriggers.end(); it++ ) for ( it = m_actionTriggers.begin(); it != m_actionTriggers.end(); ++it )
{ {
if ( it->second == action ) if ( it->second == action )
{ {
@@ -4719,9 +4709,7 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild )
// Handles key event when editor control is not focused. // Handles key event when editor control is not focused.
// //
wxASSERT( !m_frozen ); wxCHECK2(!m_frozen, return);
if ( m_frozen )
return;
// Travelsal between items, collapsing/expanding, etc. // Travelsal between items, collapsing/expanding, etc.
int keycode = event.GetKeyCode(); int keycode = event.GetKeyCode();
@@ -5162,7 +5150,7 @@ bool wxPGStringTokenizer::HasMoreTokens()
} }
else else
{ {
i++; ++i;
m_curPos = i; m_curPos = i;
return true; return true;
} }
@@ -5174,7 +5162,7 @@ bool wxPGStringTokenizer::HasMoreTokens()
prev_a = wxT('\0'); prev_a = wxT('\0');
} }
} }
i++; ++i;
} }
m_curPos = str.end(); m_curPos = str.end();
@@ -5685,7 +5673,7 @@ wxPGChoices wxPropertyGridPopulator::ParseChoices( const wxString& choicesString
int state = 0; int state = 0;
bool labelValid = false; bool labelValid = false;
for ( ; it != choicesString.end(); it++ ) for ( ; it != choicesString.end(); ++it )
{ {
wxChar c = *it; wxChar c = *it;

View File

@@ -74,11 +74,10 @@ void wxPropertyGridIteratorBase::Init( wxPropertyGridPageState* state, int flags
void wxPropertyGridIteratorBase::Init( wxPropertyGridPageState* state, int flags, int startPos, int dir ) void wxPropertyGridIteratorBase::Init( wxPropertyGridPageState* state, int flags, int startPos, int dir )
{ {
wxPGProperty* property; wxPGProperty* property = NULL;
if ( startPos == wxTOP ) if ( startPos == wxTOP )
{ {
property = NULL;
if ( dir == 0 ) if ( dir == 0 )
dir = 1; dir = 1;
} }
@@ -90,8 +89,7 @@ void wxPropertyGridIteratorBase::Init( wxPropertyGridPageState* state, int flags
} }
else else
{ {
wxASSERT_MSG( false, wxT("Only supported stating positions are wxTOP and wxBOTTOM") ); wxFAIL_MSG("Only supported starting positions are wxTOP and wxBOTTOM");
property = NULL;
} }
Init( state, flags, property, dir ); Init( state, flags, property, dir );
@@ -470,7 +468,7 @@ void wxPropertyGridPageState::DoSetPropertyName( wxPGProperty* p,
// NB: Nowadays only needed for alphabetic/categoric mode switching. // NB: Nowadays only needed for alphabetic/categoric mode switching.
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#define II_INVALID_I 0x00FFFFFF //#define II_INVALID_I 0x00FFFFFF
#define ITEM_ITERATION_VARIABLES \ #define ITEM_ITERATION_VARIABLES \
wxPGProperty* parent; \ wxPGProperty* parent; \
@@ -481,6 +479,7 @@ void wxPropertyGridPageState::DoSetPropertyName( wxPGProperty* p,
parent = m_properties; \ parent = m_properties; \
i = 0; i = 0;
#if 0
#define ITEM_ITERATION_INIT(startparent, startindex, state) \ #define ITEM_ITERATION_INIT(startparent, startindex, state) \
parent = startparent; \ parent = startparent; \
i = (unsigned int)startindex; \ i = (unsigned int)startindex; \
@@ -489,6 +488,7 @@ void wxPropertyGridPageState::DoSetPropertyName( wxPGProperty* p,
parent = state->m_properties; \ parent = state->m_properties; \
i = 0; \ i = 0; \
} }
#endif
#define ITEM_ITERATION_LOOP_BEGIN \ #define ITEM_ITERATION_LOOP_BEGIN \
do \ do \
@@ -895,8 +895,6 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
int reduceCol = -1; int reduceCol = -1;
int highestColWidth = 0; int highestColWidth = 0;
bool minimizedCols = false;
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
if ( debug ) if ( debug )
wxLogDebug(wxT("ColumnWidthCheck (virtualWidth: %i, clientWidth: %i)"), width, clientWidth); wxLogDebug(wxT("ColumnWidthCheck (virtualWidth: %i, clientWidth: %i)"), width, clientWidth);
@@ -910,7 +908,6 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
if ( m_colWidths[i] <= min ) if ( m_colWidths[i] <= min )
{ {
m_colWidths[i] = min; m_colWidths[i] = min;
minimizedCols = true;
} }
else else
{ {
@@ -947,10 +944,10 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
if ( colsWidth < width ) if ( colsWidth < width )
{ {
// Increase column // Increase column
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
if ( debug ) if ( debug )
wxLogDebug(wxT(" Adjust last column to %i"), m_colWidths[lastColumn] + widthHigher); wxLogDebug(wxT(" Adjust last column to %i"), m_colWidths[lastColumn] + widthHigher);
#endif #endif
m_colWidths[lastColumn] = m_colWidths[lastColumn] + widthHigher; m_colWidths[lastColumn] = m_colWidths[lastColumn] + widthHigher;
} }
else if ( colsWidth > width ) else if ( colsWidth > width )
@@ -1376,7 +1373,7 @@ void wxPropertyGridPageState::DoSetPropertyValues( const wxVariantList& list, wx
// //
// Second pass for special entries // Second pass for special entries
for ( node = list.begin(); node != list.end(); node++ ) for ( node = list.begin(); node != list.end(); ++node )
{ {
wxVariant *current = (wxVariant*)*node; wxVariant *current = (wxVariant*)*node;
@@ -1440,7 +1437,7 @@ void wxPropertyGridPageState::DoSetPropertyValues( const wxVariantList& list, wx
if ( numSpecialEntries ) if ( numSpecialEntries )
{ {
for ( node = list.begin(); node != list.end(); node++ ) for ( node = list.begin(); node != list.end(); ++node )
{ {
wxVariant *current = (wxVariant*)*node; wxVariant *current = (wxVariant*)*node;
@@ -1471,7 +1468,7 @@ void wxPropertyGridPageState::DoSetPropertyValues( const wxVariantList& list, wx
wxVariantList& list2 = current->GetList(); wxVariantList& list2 = current->GetList();
wxVariantList::const_iterator node2; wxVariantList::const_iterator node2;
for ( node2 = list2.begin(); node2 != list2.end(); node2++ ) for ( node2 = list2.begin(); node2 != list2.end(); ++node2 )
{ {
wxVariant *attr = (wxVariant*)*node2; wxVariant *attr = (wxVariant*)*node2;
foundProp->SetAttribute( attr->GetName(), *attr ); foundProp->SetAttribute( attr->GetName(), *attr );

View File

@@ -200,7 +200,7 @@ bool wxIntProperty::StringToValue( wxVariant& variant, const wxString& text, int
int firstNonZeroPos = 0; int firstNonZeroPos = 0;
for ( ; i != iMax; i++ ) for ( ; i != iMax; ++i )
{ {
wxChar c = *i; wxChar c = *i;
if ( c != wxS('0') && c != wxS(' ') ) if ( c != wxS('0') && c != wxS(' ') )
@@ -606,7 +606,7 @@ void wxPropertyGrid::DoubleToString(wxString& target,
wxString::const_iterator i = target.end() - 1; wxString::const_iterator i = target.end() - 1;
size_t new_len = target.length() - 1; size_t new_len = target.length() - 1;
for ( ; i != target.begin(); i-- ) for ( ; i != target.begin(); --i )
{ {
if ( *i != wxS('0') ) if ( *i != wxS('0') )
break; break;
@@ -973,7 +973,7 @@ void wxEnumProperty::OnSetValue()
else if ( variantType == wxPG_VARIANT_TYPE_STRING ) else if ( variantType == wxPG_VARIANT_TYPE_STRING )
ValueFromString_( m_value, m_value.GetString(), 0 ); ValueFromString_( m_value, m_value.GetString(), 0 );
else else
wxASSERT( false ); wxFAIL;
if ( ms_nextIndex != -2 ) if ( ms_nextIndex != -2 )
{ {
@@ -2400,16 +2400,13 @@ void wxPropertyGrid::ArrayStringToString( wxString& dst, const wxArrayString& sr
unsigned int i; unsigned int i;
unsigned int itemCount = src.size(); unsigned int itemCount = src.size();
wxChar preas[2]; wxChar preas[2] = { 0, 0 };
dst.Empty(); dst.Empty();
if ( !preDelim ) if ( flags & 1 )
preas[0] = 0;
else if ( (flags & 1) )
{ {
preas[0] = preDelim; preas[0] = preDelim;
preas[1] = 0;
pdr = wxS("\\"); pdr = wxS("\\");
pdr += preDelim; pdr += preDelim;
} }