]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/bitmap.cpp
compilation fix after wxCStrData changes
[wxWidgets.git] / src / dfb / bitmap.cpp
index 1f65aacad0f1d8b8dc9340fa6239ee1082aabd56..21dffe41c9ca0bc2574a750cb6f9ddae51753628 100644 (file)
@@ -69,8 +69,7 @@ public:
 
     wxBitmapRefData(const wxBitmapRefData& data)
     {
-        if ( data.m_surface )
-            m_surface = data.m_surface->Clone();
+        m_surface = data.m_surface ? data.m_surface->Clone() : NULL;
 
         m_mask = data.m_mask ? new wxMask(*data.m_mask) : NULL;
 #if wxUSE_PALETTE
@@ -78,7 +77,7 @@ public:
 #endif
     }
 
-    ~wxBitmapRefData()
+    virtual ~wxBitmapRefData()
     {
         delete m_mask;
 #if wxUSE_PALETTE
@@ -189,17 +188,11 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
     wxFAIL_MSG( _T("not implemented") );
 }
 
-bool wxBitmap::Ok() const
+bool wxBitmap::IsOk() const
 {
     return (m_refData != NULL && M_BITMAP->m_surface);
 }
 
-bool wxBitmap::operator==(const wxBitmap& bmp) const
-{
-    // FIXME: is this the right way to compare bitmaps?
-    return (m_refData == bmp.m_refData);
-}
-
 int wxBitmap::GetHeight() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
@@ -236,6 +229,7 @@ void wxBitmap::SetMask(wxMask *mask)
 {
     wxCHECK_RET( Ok(), wxT("invalid bitmap") );
 
+    AllocExclusive();
     delete M_BITMAP->m_mask;
     M_BITMAP->m_mask = mask;
 }
@@ -273,7 +267,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
         wxImage image;
         if ( !image.LoadFile(name, type) || !image.Ok() )
         {
-            wxLogError("no bitmap handler for type %d defined.", type);
+            wxLogError(_("No bitmap handler for type %d defined."), type);
             return false;
         }
         else
@@ -307,7 +301,7 @@ bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPal
             return image.SaveFile(filename, type);
         else
         {
-            wxLogError("no bitmap handler for type %d defined.", type);
+            wxLogError(_("No bitmap handler for type %d defined."), type);
             return false;
         }
     }
@@ -328,6 +322,7 @@ void wxBitmap::SetPalette(const wxPalette& palette)
     wxCHECK_RET( Ok(), wxT("invalid bitmap") );
     wxCHECK_RET( GetDepth() > 1 && GetDepth() <= 8, wxT("cannot set palette for bitmap of this depth") );
 
+    AllocExclusive();
     delete M_BITMAP->m_palette;
     M_BITMAP->m_palette = NULL;