From 0aa2a089cde70dea3b0b6b60f3cbc61cdf6dee35 Mon Sep 17 00:00:00 2001 From: "glazman%netscape.com" Date: Tue, 18 Jun 2002 09:20:07 +0000 Subject: [PATCH] nsHTMLEditor::GetInlinePropertyBase() was not detecting when the selection ends before first char of a text node; b=128401, r=brade, sr=kin git-svn-id: svn://10.0.0.236/trunk@123498 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp b/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp index 24213de4baf..d8de90868d4 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp @@ -1030,6 +1030,12 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty, nsCOMPtr content; nsAutoString firstValue, theValue; iter->CurrentNode(getter_AddRefs(content)); + nsCOMPtr endNode; + PRInt32 endOffset; + result = range->GetEndContainer(getter_AddRefs(endNode)); + if (NS_FAILED(result)) return result; + result = range->GetEndOffset(&endOffset); + if (NS_FAILED(result)) return result; while (NS_ENUMERATOR_FALSE == iter->IsDone()) { nsCOMPtr node = do_QueryInterface(content); @@ -1063,6 +1069,10 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty, skipNode = PR_TRUE; } } + else if (node == endNode && !endOffset) + { + skipNode = PR_TRUE; + } } else { // handle non-text leaf nodes here