From 138f5a52ef676eac56e19fcf8c61df91afdfca34 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Mon, 4 Aug 2008 12:31:05 +0200
Subject: [PATCH] Windows 2003 compile fixes, i#92397.


Signed-off-by: Jan Nieuwenhuizen <Jan Nieuwenhuizen janneke@gnu.org>
---
 toolkit/source/awt/forward.hxx        |    7 +++++++
 toolkit/source/awt/vclxdialog.cxx     |    2 +-
 toolkit/source/awt/vclxfixedline.cxx  |    2 +-
 toolkit/source/awt/vclxplugin.cxx     |    4 +++-
 toolkit/source/awt/vclxscroller.cxx   |    2 +-
 toolkit/source/awt/vclxsplitter.cxx   |    2 +-
 toolkit/source/awt/vclxtabcontrol.cxx |    2 +-
 toolkit/source/awt/vclxtabpage.cxx    |    2 +-
 8 files changed, 16 insertions(+), 7 deletions(-)

diff --git toolkit/source/awt/forward.hxx toolkit/source/awt/forward.hxx
index f4140aa..0e6dfec 100644
--- toolkit/source/awt/forward.hxx
+++ toolkit/source/awt/forward.hxx
@@ -71,4 +71,11 @@
         return aReturn; \
     }
 
+#if defined (_MSC_VER) && (_MSC_VER <= 1310)
+// Windows .Net2003 build fix
+#define W3K_EXPLICIT_CAST(x) static_cast <XWindow2*> (&x)
+#else // !(defined (_MSC_VER) && (_MSC_VER <= 1310))
+#define W3K_EXPLICIT_CAST(x) x
+#endif // !(defined (_MSC_VER) && (_MSC_VER <= 1310))
+
 #endif /*AWT_FORWARD_HXX*/
diff --git toolkit/source/awt/vclxdialog.cxx toolkit/source/awt/vclxdialog.cxx
index f72500c..87f77a7 100644
--- toolkit/source/awt/vclxdialog.cxx
+++ toolkit/source/awt/vclxdialog.cxx
@@ -113,7 +113,7 @@ void SAL_CALL VCLXDialog::dispose() throw(::com::sun::star::uno::RuntimeExceptio
         ::vos::OGuard aGuard( GetMutex() );
 
         ::com::sun::star::lang::EventObject aDisposeEvent;
-        aDisposeEvent.Source = *this;
+        aDisposeEvent.Source = W3K_EXPLICIT_CAST (*this);
 //            maTabListeners.disposeAndClear( aDisposeEvent );
     }
 
diff --git toolkit/source/awt/vclxfixedline.cxx toolkit/source/awt/vclxfixedline.cxx
index 879189c..7089e89 100644
--- toolkit/source/awt/vclxfixedline.cxx
+++ toolkit/source/awt/vclxfixedline.cxx
@@ -71,7 +71,7 @@ void SAL_CALL VCLXFixedLine::dispose( ) throw(RuntimeException)
         ::vos::OGuard aGuard( GetMutex() );
 
         EventObject aDisposeEvent;
-        aDisposeEvent.Source = *this;
+        aDisposeEvent.Source = W3K_EXPLICIT_CAST (*this);
     }
 
     VCLXWindow::dispose();
diff --git toolkit/source/awt/vclxplugin.cxx toolkit/source/awt/vclxplugin.cxx
index f17552a..8145174 100644
--- toolkit/source/awt/vclxplugin.cxx
+++ toolkit/source/awt/vclxplugin.cxx
@@ -40,6 +40,8 @@
 #include <toolkit/helper/property.hxx>
 #include <vcl/ctrl.hxx>
 
+#include "forward.hxx"
+
 namespace layoutimpl
 {
 
@@ -63,7 +65,7 @@ void SAL_CALL VCLXPlugin::dispose() throw(uno::RuntimeException)
         ::vos::OGuard aGuard( GetMutex() );
         
         lang::EventObject aDisposeEvent;
-        aDisposeEvent.Source = *this;
+        aDisposeEvent.Source = W3K_EXPLICIT_CAST (*this);
     }
     
     VCLXWindow::dispose();
diff --git toolkit/source/awt/vclxscroller.cxx toolkit/source/awt/vclxscroller.cxx
index c794ba2..fac0417 100644
--- toolkit/source/awt/vclxscroller.cxx
+++ toolkit/source/awt/vclxscroller.cxx
@@ -78,7 +78,7 @@ void SAL_CALL VCLXScroller::dispose( ) throw(RuntimeException)
         ::vos::OGuard aGuard( GetMutex() );
 
         EventObject aDisposeEvent;
-        aDisposeEvent.Source = *this;
+        aDisposeEvent.Source = W3K_EXPLICIT_CAST (*this);
 //            maTabListeners.disposeAndClear( aDisposeEvent );
     }
 
diff --git toolkit/source/awt/vclxsplitter.cxx toolkit/source/awt/vclxsplitter.cxx
index 9b73c91..947e3ca 100644
--- toolkit/source/awt/vclxsplitter.cxx
+++ toolkit/source/awt/vclxsplitter.cxx
@@ -117,7 +117,7 @@ void SAL_CALL VCLXSplitter::dispose( ) throw(RuntimeException)
         ::vos::OGuard aGuard( GetMutex() );
 
         EventObject aDisposeEvent;
-        aDisposeEvent.Source = *this;
+        aDisposeEvent.Source = W3K_EXPLICIT_CAST (*this);
 //            maTabListeners.disposeAndClear( aDisposeEvent );
     }
 
diff --git toolkit/source/awt/vclxtabcontrol.cxx toolkit/source/awt/vclxtabcontrol.cxx
index b803889..b02eab0 100644
--- toolkit/source/awt/vclxtabcontrol.cxx
+++ toolkit/source/awt/vclxtabcontrol.cxx
@@ -104,7 +104,7 @@ void SAL_CALL VCLXTabControl::dispose( ) throw(RuntimeException)
         ::vos::OGuard aGuard( GetMutex() );
 
         EventObject aDisposeEvent;
-        aDisposeEvent.Source = *this;
+        aDisposeEvent.Source = W3K_EXPLICIT_CAST (*this);
 //            maTabListeners.disposeAndClear( aDisposeEvent );
     }
 
diff --git toolkit/source/awt/vclxtabpage.cxx toolkit/source/awt/vclxtabpage.cxx
index 4a1c127..9890bd1 100644
--- toolkit/source/awt/vclxtabpage.cxx
+++ toolkit/source/awt/vclxtabpage.cxx
@@ -72,7 +72,7 @@ void SAL_CALL VCLXTabPage::dispose() throw(uno::RuntimeException)
         ::vos::OGuard aGuard( GetMutex() );
         
         lang::EventObject aDisposeEvent;
-        aDisposeEvent.Source = *this;
+        aDisposeEvent.Source = W3K_EXPLICIT_CAST (*this);
     }
     
     VCLXWindow::dispose();
-- 
1.6.0.rc0.44.g67270


