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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user