From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Mon, 20 Oct 2008 09:00:19 +0000 (+0000)
Subject: work around Borland compilation errors
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3232da9d90cac87a3d60eadb169e08e3330829a9

work around Borland compilation errors

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/include/wx/event.h b/include/wx/event.h
index 3de8901911..0d31e326f5 100644
--- a/include/wx/event.h
+++ b/include/wx/event.h
@@ -908,10 +908,13 @@ public:
     // example)
     wxKeyEvent& operator=(const wxKeyEvent& evt)
     {
-        if (&evt != this)
+        if ( &evt != this )
         {
             wxEvent::operator=(evt);
-            wxKeyboardState::operator=(evt);
+
+            // Borland C++ 5.82 doesn't compile an explicit call to an
+            // implicitly defined operator=() so need to do it this way:
+            *static_cast<wxKeyboardState *>(this) = evt;
 
             m_x = evt.m_x;
             m_y = evt.m_y;
diff --git a/src/common/event.cpp b/src/common/event.cpp
index 7b33c11e77..3299349d15 100644
--- a/src/common/event.cpp
+++ b/src/common/event.cpp
@@ -561,7 +561,10 @@ wxMouseEvent::wxMouseEvent(wxEventType commandType)
 void wxMouseEvent::Assign(const wxMouseEvent& event)
 {
     wxEvent::operator=(event);
-    wxMouseState::operator=(event);
+
+    // Borland C++ 5.82 doesn't compile an explicit call to an implicitly
+    // defined operator=() so need to do it this way:
+    *static_cast<wxMouseState *>(this) = event;
 
     m_x = event.m_x;
     m_y = event.m_y;
diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp
index 6872113502..0193e5a859 100644
--- a/src/xml/xml.cpp
+++ b/src/xml/xml.cpp
@@ -784,7 +784,7 @@ bool OutputString(wxOutputStream& stream,
 #if wxUSE_UNICODE
     wxUnusedVar(convMem);
 
-    const wxWX2MBbuf buf(str.mb_str(convFile ? *convFile : wxConvUTF8));
+    const wxWX2MBbuf buf(str.mb_str(*(convFile ? convFile : &wxConvUTF8)));
     if ( !buf )
         return false;