mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1175382 TextRangeArray::TargetClauseOffset() and TextRangeArray::TargetClauseLength() shouldn't be public and same name methods of WidgetCompositionEvent should be used r=m_kato
This commit is contained in:
parent
7edd823b28
commit
360ff0cac8
@ -191,6 +191,8 @@ struct TextRange
|
||||
******************************************************************************/
|
||||
class TextRangeArray final : public nsAutoTArray<TextRange, 10>
|
||||
{
|
||||
friend class WidgetCompositionEvent;
|
||||
|
||||
~TextRangeArray() {}
|
||||
|
||||
NS_INLINE_DECL_REFCOUNTING(TextRangeArray)
|
||||
@ -207,17 +209,6 @@ class TextRangeArray final : public nsAutoTArray<TextRange, 10>
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
public:
|
||||
bool IsComposing() const
|
||||
{
|
||||
for (uint32_t i = 0; i < Length(); ++i) {
|
||||
if (ElementAt(i).IsClause()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Returns target clause offset. If there are selected clauses, this returns
|
||||
// the first selected clause offset. Otherwise, 0.
|
||||
uint32_t TargetClauseOffset() const
|
||||
@ -234,6 +225,17 @@ public:
|
||||
return range ? range->Length() : UINT32_MAX;
|
||||
}
|
||||
|
||||
public:
|
||||
bool IsComposing() const
|
||||
{
|
||||
for (uint32_t i = 0; i < Length(); ++i) {
|
||||
if (ElementAt(i).IsClause()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Equals(const TextRangeArray& aOther) const
|
||||
{
|
||||
size_t len = Length();
|
||||
|
@ -1210,7 +1210,7 @@ nsGtkIMModule::DispatchCompositionChangeEvent(
|
||||
|
||||
compositionChangeEvent.mRanges =
|
||||
CreateTextRangeArray(aContext, mDispatchedCompositionString);
|
||||
targetOffset += compositionChangeEvent.mRanges->TargetClauseOffset();
|
||||
targetOffset += compositionChangeEvent.TargetClauseOffset();
|
||||
|
||||
mCompositionState = eCompositionState_CompositionChangeEventDispatched;
|
||||
|
||||
@ -1220,7 +1220,7 @@ nsGtkIMModule::DispatchCompositionChangeEvent(
|
||||
mLayoutChanged = false;
|
||||
mCompositionTargetRange.mOffset = targetOffset;
|
||||
mCompositionTargetRange.mLength =
|
||||
compositionChangeEvent.mRanges->TargetClauseLength();
|
||||
compositionChangeEvent.TargetClauseLength();
|
||||
|
||||
mLastFocusedWindow->DispatchEvent(&compositionChangeEvent, status);
|
||||
if (lastFocusedWindow->IsDestroyed() ||
|
||||
|
Loading…
Reference in New Issue
Block a user