]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/clipbrd.cpp
Compile fix when not using WXR resources.
[wxWidgets.git] / src / os2 / clipbrd.cpp
index 8ffa926849ca3fbfd5332ecf49b78d8500d1fa97..9c0ed072cfb7f18187f7b128e3e5b271029e2025 100644 (file)
 
 #include <string.h>
 
 
 #include <string.h>
 
-#define INCL_DOS
-#define INCL_PM
-#include <os2.h>
-
 #include "wx/os2/private.h"
 
 // wxDataObject is tied to OLE/drag and drop implementation,
 #include "wx/os2/private.h"
 
 // wxDataObject is tied to OLE/drag and drop implementation,
@@ -485,7 +481,7 @@ bool wxClipboard::AddData( wxDataObject *data )
 #if wxUSE_DRAG_AND_DROP
     wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") );
 
 #if wxUSE_DRAG_AND_DROP
     wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") );
 
-//    wxDataFormat format = data->GetFormat();
+//    wxDataFormat format = data->GetPreferredFormat();
 // TODO:
 /*
     switch ( format )
 // TODO:
 /*
     switch ( format )
@@ -503,7 +499,7 @@ bool wxClipboard::AddData( wxDataObject *data )
         {
             wxBitmapDataObject* bitmapDataObject = (wxBitmapDataObject*) data;
             wxBitmap bitmap(bitmapDataObject->GetBitmap());
         {
             wxBitmapDataObject* bitmapDataObject = (wxBitmapDataObject*) data;
             wxBitmap bitmap(bitmapDataObject->GetBitmap());
-            return wxSetClipboardData(data->GetFormat(), &bitmap);
+            return wxSetClipboardData(data->GetPreferredFormat(), &bitmap);
         }
 
 #if wxUSE_METAFILE
         }
 
 #if wxUSE_METAFILE
@@ -524,6 +520,8 @@ bool wxClipboard::AddData( wxDataObject *data )
 #else // !wxUSE_DRAG_AND_DROP
 */
     return FALSE;
 #else // !wxUSE_DRAG_AND_DROP
 */
     return FALSE;
+#else
+    return FALSE;
 #endif // wxUSE_DRAG_AND_DROP/!wxUSE_DRAG_AND_DROP
 }
 
 #endif // wxUSE_DRAG_AND_DROP/!wxUSE_DRAG_AND_DROP
 }
 
@@ -537,12 +535,12 @@ bool wxClipboard::IsSupported( wxDataFormat format )
     return wxIsClipboardFormatAvailable(format);
 }
 
     return wxIsClipboardFormatAvailable(format);
 }
 
-bool wxClipboard::GetData( wxDataObject *data )
+bool wxClipboard::GetData( wxDataObjectdata )
 {
     wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") );
 
 #if wxUSE_DRAG_AND_DROP
 {
     wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") );
 
 #if wxUSE_DRAG_AND_DROP
-//    wxDataFormat format = data->GetFormat();
+//    wxDataFormat format = data.GetPreferredFormat();
     // TODO:
 /*
     switch ( format )
     // TODO:
 /*
     switch ( format )
@@ -550,11 +548,11 @@ bool wxClipboard::GetData( wxDataObject *data )
         case wxDF_TEXT:
         case wxDF_OEMTEXT:
         {
         case wxDF_TEXT:
         case wxDF_OEMTEXT:
         {
-            wxTextDataObject* textDataObject = (wxTextDataObject*) data;
+            wxTextDataObject& textDataObject = (wxTextDataObject&) data;
             char* s = (char*) wxGetClipboardData(format);
             if ( s )
             {
             char* s = (char*) wxGetClipboardData(format);
             if ( s )
             {
-                textDataObject->SetText(s);
+                textDataObject.SetText(s);
                 delete[] s;
                 return TRUE;
             }
                 delete[] s;
                 return TRUE;
             }
@@ -565,11 +563,11 @@ bool wxClipboard::GetData( wxDataObject *data )
         case wxDF_BITMAP:
         case wxDF_DIB:
         {
         case wxDF_BITMAP:
         case wxDF_DIB:
         {
-            wxBitmapDataObject* bitmapDataObject = (wxBitmapDataObject *)data;
-            wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data->GetFormat());
+            wxBitmapDataObject& bitmapDataObject = (wxBitmapDataObject &)data;
+            wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data->GetPreferredFormat());
             if (bitmap)
             {
             if (bitmap)
             {
-                bitmapDataObject->SetBitmap(* bitmap);
+                bitmapDataObject.SetBitmap(* bitmap);
                 delete bitmap;
                 return TRUE;
             }
                 delete bitmap;
                 return TRUE;
             }
@@ -579,11 +577,11 @@ bool wxClipboard::GetData( wxDataObject *data )
 #if wxUSE_METAFILE
         case wxDF_METAFILE:
         {
 #if wxUSE_METAFILE
         case wxDF_METAFILE:
         {
-            wxMetafileDataObject* metaFileDataObject = (wxMetafileDataObject *)data;
+            wxMetafileDataObject& metaFileDataObject = (wxMetafileDataObject &)data;
             wxMetafile* metaFile = (wxMetafile *)wxGetClipboardData(wxDF_METAFILE);
             if (metaFile)
             {
             wxMetafile* metaFile = (wxMetafile *)wxGetClipboardData(wxDF_METAFILE);
             if (metaFile)
             {
-                metaFileDataObject->SetMetafile(*metaFile);
+                metaFileDataObject.SetMetafile(*metaFile);
                 delete metaFile;
                 return TRUE;
             }
                 delete metaFile;
                 return TRUE;
             }
@@ -598,7 +596,7 @@ bool wxClipboard::GetData( wxDataObject *data )
                 if ( buf )
                 {
                     // FIXME this is for testing only!!
                 if ( buf )
                 {
                     // FIXME this is for testing only!!
-                    ((wxPrivateDataObject *)data)->SetData(buf, len);
+                    ((wxPrivateDataObject &)data).SetData(buf, len);
                     free(buf);
 
                     return TRUE;
                     free(buf);
 
                     return TRUE;
@@ -610,6 +608,8 @@ bool wxClipboard::GetData( wxDataObject *data )
 #else
 */
     return FALSE;
 #else
 */
     return FALSE;
+#else
+    return FALSE;
 #endif
 }
 
 #endif
 }