Compilation fix for VC6 in wxInfoBarGeneric code.

VC6 apparently can't compare const pointer to derived class with a non-const
pointer to the base class.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-10-06 14:18:48 +00:00
parent 537c33898e
commit 21d5ec7d65

View File

@@ -170,10 +170,13 @@ wxInfoBarGeneric::BarPlacement wxInfoBarGeneric::GetBarPlacement() const
if ( !sizer )
return BarPlacement_Unknown;
// FIXME-VC6: can't compare "const wxInfoBarGeneric *" and "wxWindow *",
// so need this workaround
wxWindow * const self = const_cast<wxInfoBarGeneric *>(this);
const wxSizerItemList& siblings = sizer->GetChildren();
if ( siblings.GetFirst()->GetData()->GetWindow() == this )
if ( siblings.GetFirst()->GetData()->GetWindow() == self )
return BarPlacement_Top;
else if ( siblings.GetLast()->GetData()->GetWindow() == this )
else if ( siblings.GetLast()->GetData()->GetWindow() == self )
return BarPlacement_Bottom;
else
return BarPlacement_Unknown;