Bug 1276948 - Remove IMEInputHandler::ConversationIdentifier. r?masayuki
This method is for old NSTextInput API and unused now.
MozReview-Commit-ID: thcbEExH58
--- a/widget/cocoa/TextInputHandler.h
+++ b/widget/cocoa/TextInputHandler.h
@@ -773,25 +773,16 @@ public:
* @param aReplacementRange The range which will be replaced with the
* aAttrString instead of current marked range.
*/
void SetMarkedText(NSAttributedString* aAttrString,
NSRange& aSelectedRange,
NSRange* aReplacementRange = nullptr);
/**
- * ConversationIdentifier() returns an ID for the current editor. The ID is
- * guaranteed to be unique among currently existing editors. But it might be
- * the same as the ID of an editor that has already been destroyed.
- *
- * @return An identifier of current focused editor.
- */
- NSInteger ConversationIdentifier();
-
- /**
* GetAttributedSubstringFromRange() returns an NSAttributedString instance
* which is allocated as autorelease for aRange.
*
* @param aRange The range of string which you want.
* @param aActualRange The actual range of the result.
* @return The string in aRange. If the string is empty,
* this returns nil. If succeeded, this returns
* an instance which is allocated as autorelease.
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -3212,43 +3212,16 @@ IMEInputHandler::SetMarkedText(NSAttribu
MOZ_LOG(gLog, LogLevel::Info,
("%p IMEInputHandler::SetMarkedText, "
"destroyed by compositioncommit event", this));
}
NS_OBJC_END_TRY_ABORT_BLOCK;
}
-NSInteger
-IMEInputHandler::ConversationIdentifier()
-{
- MOZ_LOG(gLog, LogLevel::Info,
- ("%p IMEInputHandler::ConversationIdentifier, Destroyed()=%s",
- this, TrueOrFalse(Destroyed())));
-
- if (Destroyed()) {
- return reinterpret_cast<NSInteger>(mView);
- }
-
- RefPtr<IMEInputHandler> kungFuDeathGrip(this);
-
- // NOTE: The size of NSInteger is same as pointer size.
- WidgetQueryContentEvent textContent(true, eQueryTextContent, mWidget);
- textContent.InitForQueryTextContent(0, 0);
- DispatchEvent(textContent);
- if (!textContent.mSucceeded) {
- MOZ_LOG(gLog, LogLevel::Info,
- ("%p IMEInputHandler::ConversationIdentifier, Failed", this));
- return reinterpret_cast<NSInteger>(mView);
- }
- // XXX This might return same ID as a previously existing editor if the
- // deleted editor was created at the same address. Is there a better way?
- return reinterpret_cast<NSInteger>(textContent.mReply.mContentsRoot);
-}
-
NSAttributedString*
IMEInputHandler::GetAttributedSubstringFromRange(NSRange& aRange,
NSRange* aActualRange)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
MOZ_LOG(gLog, LogLevel::Info,
("%p IMEInputHandler::GetAttributedSubstringFromRange, "