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

List:       kde-devel
Subject:    PATCH: Attributes not cloned with Node.clone (fwd)
From:       Koos Vriezen <kv () vgelder ! com>
Date:       2001-06-30 21:47:17
[Download RAW message or body]

Hi,

Here is a small patch which fixes the cloning of attributes. Without the
cast, the wrong = operator is used. (And I always thought using operator
functions make c++ code more readable).
The diff is against the cvs of 30 june.

--- kdelibs/khtml/xml/dom_elementimpl.cpp.orig       Sat Jun 30 17:48:13 2001
+++ kdelibs/khtml/xml/dom_elementimpl.cpp  Sat Jun 30 17:48:04 2001
@@ -418,7 +418,7 @@

     // clone attributes
     if(namedAttrMap)
-        *(newImpl->attributes()) = *namedAttrMap;
+        *(static_cast<NamedAttrMapImpl*>(newImpl->attributes())) = *namedAttrMap;
     if (deep)
         cloneChildNodes(newImpl,exceptioncode);


Could someone apply this patch?

Regards,

Koos Vriezen


BTW, found a bug in konqueror, it crashes sometimes in
DocumentImpl::clearSelection (using khtmltests/dom/dom.html):

0x40e08029 in wait4 () from /lib/libc.so.6
#0  0x40e08029 in wait4 () from /lib/libc.so.6
#1  0x40e65778 in __DTOR_END__ () from /lib/libc.so.6
#2  0x40660d2d in KCrash::defaultCrashHandler ()
   from /usr/local/kde/lib/libkdecore.so.3
#3  0x40da59d8 in __restore () from /lib/libc.so.6
#4  0x410baa4b in DOM::DocumentImpl::clearSelection ()
   from /usr/local/kde/lib/libkhtml.so.3
#5  0x410a3d8c in KHTMLPart::khtmlMousePressEvent ()
   from /usr/local/kde/lib/libkhtml.so.3
#6  0x410a3ad0 in KHTMLPart::event () from /usr/local/kde/lib/libkhtml.so.3
#7  0x4089c3a6 in QApplication::notify () from /usr/local/qt2/lib/libqt.so.2
#8  0x405c9d0c in KApplication::notify ()
   from /usr/local/kde/lib/libkdecore.so.3
#9  0x41082e30 in KHTMLView::viewportMousePressEvent ()
   from /usr/local/kde/lib/libkhtml.so.3
........

 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

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

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