[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/khtml
From:       John Tapsell <john () geola ! co ! uk>
Date:       2004-12-31 21:42:24
Message-ID: 20041231214224.9B0A21CF33 () office ! kde ! org
[Download RAW message or body]

CVS commit by johnflux: 

Add a currentPixmap() to html_imageimpl.cpp (since currentImage converts from a pixmap to a qimage).
Also don't make a dragobject of a null or incomplete pixmap.  This causes konqueror to crash.


  M +1 -1      khtml_part.cpp   1.1070
  M +9 -0      html/html_imageimpl.cpp   1.149
  M +8 -0      html/html_imageimpl.h   1.70


--- kdelibs/khtml/khtml_part.cpp  #1.1069:1.1070
@@ -6042,5 +6042,5 @@ void KHTMLPart::khtmlMouseMoveEvent( kht
       urlDrag->metaData()["referrer"] = d->m_referrer;
 
-    if( img ) {
+    if( img && img->complete()) {
       KMultipleDrag *mdrag = new KMultipleDrag( d->m_view->viewport() );
       mdrag->addDragObject( new QImageDrag( img->currentImage(), 0L ) );

--- kdelibs/khtml/html/html_imageimpl.cpp  #1.148:1.149
@@ -229,4 +229,13 @@ QImage HTMLImageElementImpl::currentImag
 }
 
+QPixmap HTMLImageElementImpl::currentPixmap() const
+{
+    RenderImage *r = static_cast<RenderImage*>(renderer());
+
+    if(r)
+        return r->pixmap();
+
+    return QPixmap();
+}
 
 bool HTMLImageElementImpl::complete() const

--- kdelibs/khtml/html/html_imageimpl.h  #1.69:1.70
@@ -53,5 +53,13 @@ public:
 
     bool isServerMap() const { return ( ismap && !usemap.length() );  }
+    /** Return the image for this element.
+     *  This has to convert the pixmap into an image first.
+     *  This will return undefined results if complete() is not true.
+     */
     QImage currentImage() const;
+    /** Return the pixmap for this element.
+     *  This will return undefined results if complete() is not true.
+     */
+    QPixmap currentPixmap() const;
 
     DOMString altText() const;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic