[PATCH] khtml_part.cpp

Pascal Létourneau pletourn at globetrotter.net
Tue Dec 3 15:00:34 GMT 2002


On December 3, 2002 01:17, Dirk Mueller wrote:
> On Die, 03 Dez 2002, Pascal L?tourneau wrote:
> > +      if ( n.elementId() != ID_SCRIPT )
> > +      {
> > +       next = n.firstChild();
> > +        if(next.isNull()) next = n.nextSibling();
> > +      }
> > +      else
> > +       next = n.nextSibling();
>
> thats not really correct. it should do that decision based on whether or
> not a renderer() is available.
>
> This way it will catch more cases.
New patch.

Pascal Létourneau

Index: khtml_part.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_part.cpp,v
retrieving revision 1.770
diff -u -3 -p -r1.770 khtml_part.cpp
--- khtml_part.cpp      2002/11/21 08:52:51     1.770
+++ khtml_part.cpp      2002/12/03 14:55:32
@@ -2248,7 +2259,7 @@ QString KHTMLPart::selectedText() const
   QString text;
   DOM::Node n = d->m_selectionStart;
   while(!n.isNull()) {
-      if(n.nodeType() == DOM::Node::TEXT_NODE) {
+      if(n.nodeType() == DOM::Node::TEXT_NODE && n.handle()->renderer() ) {
         QString str = n.nodeValue().string();
         hasNewLine = false;
         if(n == d->m_selectionStart && n == d->m_selectionEnd)





More information about the kfm-devel mailing list