Commit f0cad26e authored by rjw's avatar rjw

Fixed crasher in findTextSlave.

        * khtml/rendering/render_text.cpp:
        (RenderText::findTextSlave):

        Added error checks.
        * khtml/khtml_part.cpp:
        (startAndEndLineNodesIncludingNode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b43b8a13
2002-09-20 Richard Williamson <rjw@apple.com>
Fixed crasher in findTextSlave.
* khtml/rendering/render_text.cpp:
(RenderText::findTextSlave):
Added error checks.
* khtml/khtml_part.cpp:
(startAndEndLineNodesIncludingNode):
2002-09-20 Richard Williamson <rjw@apple.com>
Made double and triple click selection behave like
......
2002-09-20 Richard Williamson <rjw@apple.com>
Fixed crasher in findTextSlave.
* khtml/rendering/render_text.cpp:
(RenderText::findTextSlave):
Added error checks.
* khtml/khtml_part.cpp:
(startAndEndLineNodesIncludingNode):
2002-09-20 Richard Williamson <rjw@apple.com>
Made double and triple click selection behave like
......
2002-09-20 Richard Williamson <rjw@apple.com>
Fixed crasher in findTextSlave.
* khtml/rendering/render_text.cpp:
(RenderText::findTextSlave):
Added error checks.
* khtml/khtml_part.cpp:
(startAndEndLineNodesIncludingNode):
2002-09-20 Richard Williamson <rjw@apple.com>
Made double and triple click selection behave like
......
......@@ -4009,11 +4009,13 @@ static bool startAndEndLineNodesIncludingNode (DOM::NodeImpl *node, int offset,
// Look for all the first child in the block that is on the same line
// as the selection point.
firstSlaveAt (renderNode, selectionPointY, startNode, startOffset);
if (!firstSlaveAt (renderNode, selectionPointY, startNode, startOffset))
return false;
// Look for all the last child in the block that is on the same line
// as the selection point.
lastSlaveAt (renderNode, selectionPointY, endNode, endOffset);
if (!lastSlaveAt (renderNode, selectionPointY, endNode, endOffset))
return false;
_startNode = startNode;
_endNode = endNode;
......
......@@ -343,11 +343,11 @@ TextSlave * RenderText::findTextSlave( int offset, int &pos )
return 0L;
TextSlave* s = m_lines[0];
uint si = 0;
uint si = 1;
int off = s->m_len;
while(offset > off && si < m_lines.count())
{
s = m_lines[++si];
s = m_lines[si++];
off = s->m_start + s->m_len;
}
// we are now in the correct text slave
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment