Jacek Caban : mshtml: Don't assume that end_pos. node is text node in range_to_string.

Alexandre Julliard julliard at winehq.org
Fri Jan 4 07:12:44 CST 2008


Module: wine
Branch: master
Commit: 62b8439484e74a351baa48de371dec328c309674
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=62b8439484e74a351baa48de371dec328c309674

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jan  4 01:49:49 2008 +0100

mshtml: Don't assume that end_pos.node is text node in range_to_string.

---

 dlls/mshtml/txtrange.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/txtrange.c b/dlls/mshtml/txtrange.c
index 862fa8c..31e0791 100644
--- a/dlls/mshtml/txtrange.c
+++ b/dlls/mshtml/txtrange.c
@@ -496,8 +496,12 @@ static void range_to_string(HTMLTxtRange *This, wstrbuf_t *buf)
 
     nsIDOMNode_AddRef(end_pos.node);
 
-    if(start_pos.node != end_pos.node && !is_br_node(end_pos.node))
-        wstrbuf_append_nodetxt(buf, end_pos.p, end_pos.off+1);
+    if(start_pos.node != end_pos.node) {
+        if(end_pos.type == TEXT_NODE)
+            wstrbuf_append_nodetxt(buf, end_pos.p, end_pos.off+1);
+        else
+            wstrbuf_append_node(buf, end_pos.node);
+    }
 
     nsIDOMNode_Release(iter);
     dompos_release(&start_pos);




More information about the wine-cvs mailing list