Bug 564411 Move all methods/attributes of nsIEditorIMESupport to nsIEditor r=smaug
Doing QI from nsIEditor to nsIEditorIMESupport doesn't make sense because editor should always support all methods and attributes of nsIEditorIMESupport (it does NOT mean that all nsIEditor implementation need to support IME). This patch moves all of them to nsIEditor for avoiding redundant QIs. MozReview-Commit-ID: DzIKuGHG4iy
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIEditorIMESupport.h"
|
||||
#include "nsIEditorObserver.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
@@ -2017,10 +2016,7 @@ nsTextEditorState::SetValue(const nsAString& aValue, uint32_t aFlags)
|
||||
// document may be unloaded.
|
||||
mValueBeingSet = aValue;
|
||||
mIsCommittingComposition = true;
|
||||
nsCOMPtr<nsIEditorIMESupport> editorIMESupport =
|
||||
do_QueryInterface(mEditor);
|
||||
MOZ_RELEASE_ASSERT(editorIMESupport);
|
||||
nsresult rv = editorIMESupport->ForceCompositionEnd();
|
||||
nsresult rv = mEditor->ForceCompositionEnd();
|
||||
if (!self.get()) {
|
||||
return true;
|
||||
}
|
||||
@@ -2284,9 +2280,8 @@ bool
|
||||
nsTextEditorState::EditorHasComposition()
|
||||
{
|
||||
bool isComposing = false;
|
||||
nsCOMPtr<nsIEditorIMESupport> editorIMESupport = do_QueryInterface(mEditor);
|
||||
return editorIMESupport &&
|
||||
NS_SUCCEEDED(editorIMESupport->GetComposing(&isComposing)) &&
|
||||
return mEditor &&
|
||||
NS_SUCCEEDED(mEditor->GetComposing(&isComposing)) &&
|
||||
isComposing;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user