--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -1973,60 +1973,60 @@ TSFTextStore::GetSelection(ULONG ulIndex
*pSelection = currentSel.ACP();
*pcFetched = 1;
MOZ_LOG(sTextStoreLog, LogLevel::Info,
("TSF: 0x%p TSFTextStore::GetSelection() succeeded", this));
return S_OK;
}
TSFTextStore::Content&
-TSFTextStore::LockedContent()
+TSFTextStore::ContentForTSFRef()
{
// This should be called when the document is locked or the content hasn't
// been abandoned yet.
if (NS_WARN_IF(!IsReadLocked() && !mContentForTSF.IsInitialized())) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
- ("TSF: 0x%p TSFTextStore::LockedContent(), FAILED, due to "
+ ("TSF: 0x%p TSFTextStore::ContentForTSFRef(), FAILED, due to "
"called wrong timing, IsReadLocked()=%s, "
"mContentForTSF.IsInitialized()=%s",
this, GetBoolName(IsReadLocked()),
GetBoolName(mContentForTSF.IsInitialized())));
mContentForTSF.Clear();
return mContentForTSF;
}
Selection& currentSel = CurrentSelection();
if (currentSel.IsDirty()) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
- ("TSF: 0x%p TSFTextStore::LockedContent(), FAILED, due to "
+ ("TSF: 0x%p TSFTextStore::ContentForTSFRef(), FAILED, due to "
"CurrentSelection() failure", this));
mContentForTSF.Clear();
return mContentForTSF;
}
if (!mContentForTSF.IsInitialized()) {
nsAutoString text;
if (NS_WARN_IF(!GetCurrentText(text))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
- ("TSF: 0x%p TSFTextStore::LockedContent(), FAILED, due to "
+ ("TSF: 0x%p TSFTextStore::ContentForTSFRef(), FAILED, due to "
"GetCurrentText() failure", this));
mContentForTSF.Clear();
return mContentForTSF;
}
mContentForTSF.Init(text);
// Basically, the locked content should be cleared after the document is
// unlocked. However, in e10s mode, content will be modified
// asynchronously. In such case, mDeferClearingLockedContent may be
// true even after the document is unlocked.
mDeferClearingLockedContent = false;
}
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
- ("TSF: 0x%p TSFTextStore::LockedContent(): "
+ ("TSF: 0x%p TSFTextStore::ContentForTSFRef(): "
"mContentForTSF={ mText=\"%s\" (Length()=%u), "
"mLastCompositionString=\"%s\" (Length()=%u), "
"mMinTextModifiedOffset=%u }",
this, mContentForTSF.Text().Length() <= 20 ?
NS_ConvertUTF16toUTF8(mContentForTSF.Text()).get() : "<omitted>",
mContentForTSF.Text().Length(),
NS_ConvertUTF16toUTF8(mContentForTSF.LastCompositionString()).get(),
mContentForTSF.LastCompositionString().Length(),
@@ -2319,21 +2319,21 @@ TSFTextStore::RestartComposition(ITfComp
MOZ_ASSERT(keepComposingStartOffset <= keepComposingEndOffset,
"Why keepComposingEndOffset is smaller than keepComposingStartOffset?");
LONG keepComposingLength = keepComposingEndOffset - keepComposingStartOffset;
// Remove the overlapped part from the commit string.
nsAutoString commitString(mComposition.mString);
commitString.Cut(keepComposingStartOffset - mComposition.mStart,
keepComposingLength);
// Update the composition string.
- Content& lockedContent = LockedContent();
+ Content& lockedContent = ContentForTSFRef();
if (!lockedContent.IsInitialized()) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::RestartComposition() FAILED "
- "due to LockedContent() failure", this));
+ "due to ContentForTSFRef() failure", this));
return E_FAIL;
}
lockedContent.ReplaceTextWith(mComposition.mStart,
mComposition.mString.Length(),
commitString);
// Record a compositionupdate action for commit the part of composing string.
PendingAction* action = LastOrNewPendingCompositionUpdate();
action->mData = mComposition.mString;
@@ -2777,21 +2777,21 @@ TSFTextStore::GetText(LONG acpStart,
if (pchPlain && cchPlainReq) *pchPlain = 0;
if (pulRunInfoOut) *pulRunInfoOut = 0;
if (pacpNext) *pacpNext = acpStart;
if (prgRunInfo && ulRunInfoReq) {
prgRunInfo->uCount = 0;
prgRunInfo->type = TS_RT_PLAIN;
}
- Content& lockedContent = LockedContent();
+ Content& lockedContent = ContentForTSFRef();
if (!lockedContent.IsInitialized()) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::GetText() FAILED due to "
- "LockedContent() failure", this));
+ "ContentForTSFRef() failure", this));
return E_FAIL;
}
if (lockedContent.Text().Length() < static_cast<uint32_t>(acpStart)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::GetText() FAILED due to "
"acpStart is larger offset than the actual text length", this));
return TS_E_INVALIDPOS;
}
@@ -3243,21 +3243,21 @@ TSFTextStore::GetEndACP(LONG* pacp)
if (!pacp) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::GetEndACP() FAILED due to "
"null argument", this));
return E_INVALIDARG;
}
- Content& lockedContent = LockedContent();
+ Content& lockedContent = ContentForTSFRef();
if (!lockedContent.IsInitialized()) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::GetEndACP() FAILED due to "
- "LockedContent() failure", this));
+ "ContentForTSFRef() failure", this));
return E_FAIL;
}
*pacp = static_cast<LONG>(lockedContent.Text().Length());
return S_OK;
}
STDMETHODIMP
TSFTextStore::GetActiveView(TsViewCookie* pvcView)
@@ -3402,21 +3402,21 @@ TSFTextStore::GetACPFromPoint(TsViewCook
// the other is after the offset, we could resolve the offset.
// However, dispatching 2 eQueryTextRect may be expensive.
// So, use tentative offset for now.
offset = charAtPt.mReply.mTentativeCaretOffset;
// However, if it's after the last character, we need to decrement the
// offset.
- Content& lockedContent = LockedContent();
+ Content& lockedContent = ContentForTSFRef();
if (!lockedContent.IsInitialized()) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::GetACPFromPoint() FAILED due to "
- "LockedContent() failure", this));
+ "ContentForTSFRef() failure", this));
return E_FAIL;
}
if (lockedContent.Text().Length() <= offset) {
// If the tentative caret is after the last character, let's return
// the last character's offset.
offset = lockedContent.Text().Length() - 1;
}
}
@@ -3905,21 +3905,21 @@ TSFTextStore::InsertTextAtSelectionInter
TS_TEXTCHANGE* aTextChange)
{
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("TSF: 0x%p TSFTextStore::InsertTextAtSelectionInternal("
"aInsertStr=\"%s\", aTextChange=0x%p), IsComposing=%s",
this, NS_ConvertUTF16toUTF8(aInsertStr).get(), aTextChange,
GetBoolName(mComposition.IsComposing())));
- Content& lockedContent = LockedContent();
+ Content& lockedContent = ContentForTSFRef();
if (!lockedContent.IsInitialized()) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::InsertTextAtSelectionInternal() failed "
- "due to LockedContent() failure()", this));
+ "due to ContentForTSFRef() failure()", this));
return false;
}
TS_SELECTION_ACP oldSelection = lockedContent.Selection().ACP();
if (!mComposition.IsComposing()) {
// Use a temporary composition to contain the text
PendingAction* compositionStart = mPendingActions.AppendElement();
compositionStart->mType = PendingAction::COMPOSITION_START;
@@ -4012,21 +4012,21 @@ TSFTextStore::RecordCompositionStartActi
{
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("TSF: 0x%p TSFTextStore::RecordCompositionStartAction("
"aComposition=0x%p, aStart=%d, aLength=%d, aPreserveSelection=%s), "
"mComposition.mView=0x%p",
this, aComposition, aStart, aLength, GetBoolName(aPreserveSelection),
mComposition.mView.get()));
- Content& lockedContent = LockedContent();
+ Content& lockedContent = ContentForTSFRef();
if (!lockedContent.IsInitialized()) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::RecordCompositionStartAction() FAILED "
- "due to LockedContent() failure", this));
+ "due to ContentForTSFRef() failure", this));
return E_FAIL;
}
CompleteLastActionIfStillIncomplete();
// TIP may have inserted text at selection before calling
// OnStartComposition(). In this case, we've already created a pair of
// pending compositionstart and pending compositionend. If the pending
@@ -4104,21 +4104,21 @@ TSFTextStore::RecordCompositionEndAction
MOZ_ASSERT(mComposition.IsComposing());
CompleteLastActionIfStillIncomplete();
PendingAction* action = mPendingActions.AppendElement();
action->mType = PendingAction::COMPOSITION_END;
action->mData = mComposition.mString;
- Content& lockedContent = LockedContent();
+ Content& lockedContent = ContentForTSFRef();
if (!lockedContent.IsInitialized()) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::RecordCompositionEndAction() FAILED due "
- "to LockedContent() failure", this));
+ "to ContentForTSFRef() failure", this));
return E_FAIL;
}
lockedContent.EndComposition(*action);
// If this composition was restart but the composition doesn't modify
// anything, we should remove the pending composition for preventing to
// dispatch redundant composition events.
for (size_t i = mPendingActions.Length(), j = 1; i > 0; --i, ++j) {