]> git.saurik.com Git - wxWidgets.git/commitdiff
Compilation fix for VC6 in wxInfoBarGeneric code.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 6 Oct 2009 14:18:48 +0000 (14:18 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 6 Oct 2009 14:18:48 +0000 (14:18 +0000)
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

src/generic/infobar.cpp

index 2cc7b5e164230ac41367b12e0e936c3a7c756196..de16c788a33aca90a3a0d467d9c8b2fac9fefbfa 100644 (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;