]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/m_image.cpp
using new API (no visual difference)
[wxWidgets.git] / src / html / m_image.cpp
index 05fe9e123b04c3fcbc1e552db0fc70eb9db0276f..9574b94d419f67bff8df8aec43db7a7de550653d 100644 (file)
@@ -7,10 +7,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation
-#endif
-
 #include "wx/wxprec.h"
 
 #include "wx/defs.h"
@@ -47,7 +43,7 @@ FORCE_LINK_ME(m_image)
 
 WX_DECLARE_OBJARRAY(int, CoordArray);
 #include "wx/arrimpl.cpp" // this is a magic incantation which must be done!
-WX_DEFINE_OBJARRAY(CoordArray);
+WX_DEFINE_OBJARRAY(CoordArray)
 
 
 // ---------------------------------------------------------------------------
@@ -450,6 +446,7 @@ wxHtmlImageCell::wxHtmlImageCell(wxWindow *window, wxFSFile *input,
 
 void wxHtmlImageCell::SetImage(const wxImage& img)
 {
+#if !defined(__WXMSW__) || wxUSE_WXDIB
     if ( img.Ok() )
     {
         delete m_bitmap;
@@ -475,6 +472,7 @@ void wxHtmlImageCell::SetImage(const wxImage& img)
 */
             m_bitmap = new wxBitmap(img);
     }
+#endif
 }
 
 #if wxUSE_GIF && wxUSE_TIMER
@@ -501,6 +499,7 @@ void wxHtmlImageCell::AdvanceAnimation(wxTimer *timer)
     if ( m_window->GetClientRect().Intersects(rect) &&
          m_gifDecoder->ConvertToImage(&img) )
     {
+#if !defined(__WXMSW__) || wxUSE_WXDIB
         if ( (int)m_gifDecoder->GetWidth() != m_Width ||
              (int)m_gifDecoder->GetHeight() != m_Height ||
              m_gifDecoder->GetLeft() != 0 || m_gifDecoder->GetTop() != 0 )
@@ -512,6 +511,7 @@ void wxHtmlImageCell::AdvanceAnimation(wxTimer *timer)
                           true /* use mask */);
         }
         else
+#endif            
             SetImage(img);
         m_window->Refresh(img.HasMask(), &rect);
     }
@@ -649,7 +649,7 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA")
                                           str, w, h,
                                           m_WParser->GetPixelScale(),
                                           al, mn);
-                cel->SetLink(m_WParser->GetLink());
+                m_WParser->ApplyStateToCell(cel);
                 cel->SetId(tag.GetParam(wxT("id"))); // may be empty
                 m_WParser->GetContainer()->InsertCell(cel);
                 if (str)
@@ -696,12 +696,13 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA")
                 }
                 if (cel != NULL && tag.HasParam(wxT("HREF")))
                 {
-                    wxString tmp = tag.GetParam(wxT("HREF"));
-                    wxString target = wxEmptyString;
-                    if (tag.HasParam(wxT("TARGET"))) target = tag.GetParam(wxT("TARGET"));
-                    cel->SetLink( wxHtmlLinkInfo(tmp, target));
+                    wxString target;
+                    if (tag.HasParam(wxT("TARGET")))
+                        target = tag.GetParam(wxT("TARGET"));
+                    cel->SetLink(wxHtmlLinkInfo(tag.GetParam(wxT("HREF")), target));
                 }
-                if (cel != NULL) m_WParser->GetContainer()->InsertCell( cel );
+                if (cel != NULL)
+                    m_WParser->GetContainer()->InsertCell( cel );
             }
         }