From 644f57503bd9940dbdcc219f913ef93c15eb2e68 Mon Sep 17 00:00:00 2001 From: "brade%netscape.com" Date: Mon, 5 Feb 2001 15:44:38 +0000 Subject: [PATCH] caret method renamed to GetCaretCoordinates; r=kin; sr=sfraser git-svn-id: svn://10.0.0.236/trunk@86233 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/base/nsEditor.cpp | 6 +++--- mozilla/editor/base/nsHTMLEditor.cpp | 4 +++- mozilla/editor/base/nsPlaintextEditor.cpp | 4 +++- mozilla/editor/libeditor/base/nsEditor.cpp | 6 +++--- mozilla/editor/libeditor/html/nsHTMLEditor.cpp | 4 +++- mozilla/editor/libeditor/text/nsPlaintextEditor.cpp | 4 +++- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/mozilla/editor/base/nsEditor.cpp b/mozilla/editor/base/nsEditor.cpp index 7a21c310d40..9df3e0d1d21 100644 --- a/mozilla/editor/base/nsEditor.cpp +++ b/mozilla/editor/base/nsEditor.cpp @@ -1734,9 +1734,9 @@ nsEditor::QueryComposition(nsTextEventReply* aReply) if (NS_SUCCEEDED(result) && caretP) { if (aReply) { - caretP->GetWindowRelativeCoordinates( - aReply->mCursorPosition, - aReply->mCursorIsCollapsed, selection); + caretP->SetCaretDOMSelection(selection); + result = caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); } } return result; diff --git a/mozilla/editor/base/nsHTMLEditor.cpp b/mozilla/editor/base/nsHTMLEditor.cpp index b841561a8ee..7a04d04c922 100644 --- a/mozilla/editor/base/nsHTMLEditor.cpp +++ b/mozilla/editor/base/nsHTMLEditor.cpp @@ -2835,7 +2835,9 @@ nsHTMLEditor::SetCompositionString(const nsString& aCompositionString, nsIPrivat nsCOMPtr ps = do_QueryReferent(mPresShellWeak); if (!ps) return NS_ERROR_NOT_INITIALIZED; ps->GetCaret(getter_AddRefs(caretP)); - caretP->GetWindowRelativeCoordinates(aReply->mCursorPosition,aReply->mCursorIsCollapsed,selection); + caretP->SetCaretDOMSelection(selection); + result = caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); // second part of 23558 fix: if (aCompositionString.IsEmpty()) diff --git a/mozilla/editor/base/nsPlaintextEditor.cpp b/mozilla/editor/base/nsPlaintextEditor.cpp index 762ed7275f5..9f1187dc8c2 100644 --- a/mozilla/editor/base/nsPlaintextEditor.cpp +++ b/mozilla/editor/base/nsPlaintextEditor.cpp @@ -1620,7 +1620,9 @@ nsPlaintextEditor::SetCompositionString(const nsString& aCompositionString, nsIP nsCOMPtr ps = do_QueryReferent(mPresShellWeak); if (!ps) return NS_ERROR_NOT_INITIALIZED; ps->GetCaret(getter_AddRefs(caretP)); - caretP->GetWindowRelativeCoordinates(aReply->mCursorPosition,aReply->mCursorIsCollapsed,selection); + caretP->SetCaretDOMSelection(selection); + caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); // second part of 23558 fix: if (aCompositionString.IsEmpty()) diff --git a/mozilla/editor/libeditor/base/nsEditor.cpp b/mozilla/editor/libeditor/base/nsEditor.cpp index 7a21c310d40..9df3e0d1d21 100644 --- a/mozilla/editor/libeditor/base/nsEditor.cpp +++ b/mozilla/editor/libeditor/base/nsEditor.cpp @@ -1734,9 +1734,9 @@ nsEditor::QueryComposition(nsTextEventReply* aReply) if (NS_SUCCEEDED(result) && caretP) { if (aReply) { - caretP->GetWindowRelativeCoordinates( - aReply->mCursorPosition, - aReply->mCursorIsCollapsed, selection); + caretP->SetCaretDOMSelection(selection); + result = caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); } } return result; diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp index b841561a8ee..7a04d04c922 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp @@ -2835,7 +2835,9 @@ nsHTMLEditor::SetCompositionString(const nsString& aCompositionString, nsIPrivat nsCOMPtr ps = do_QueryReferent(mPresShellWeak); if (!ps) return NS_ERROR_NOT_INITIALIZED; ps->GetCaret(getter_AddRefs(caretP)); - caretP->GetWindowRelativeCoordinates(aReply->mCursorPosition,aReply->mCursorIsCollapsed,selection); + caretP->SetCaretDOMSelection(selection); + result = caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); // second part of 23558 fix: if (aCompositionString.IsEmpty()) diff --git a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp index 762ed7275f5..9f1187dc8c2 100644 --- a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp +++ b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp @@ -1620,7 +1620,9 @@ nsPlaintextEditor::SetCompositionString(const nsString& aCompositionString, nsIP nsCOMPtr ps = do_QueryReferent(mPresShellWeak); if (!ps) return NS_ERROR_NOT_INITIALIZED; ps->GetCaret(getter_AddRefs(caretP)); - caretP->GetWindowRelativeCoordinates(aReply->mCursorPosition,aReply->mCursorIsCollapsed,selection); + caretP->SetCaretDOMSelection(selection); + caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); // second part of 23558 fix: if (aCompositionString.IsEmpty())