本文整理汇总了C++中nsTreeRange类的典型用法代码示例。如果您正苦于以下问题:C++ nsTreeRange类的具体用法?C++ nsTreeRange怎么用?C++ nsTreeRange使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了nsTreeRange类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Insert
void Insert(nsTreeRange* aRange) {
if (mMin >= aRange->mMax)
aRange->Connect(mPrev, this);
else if (mNext)
mNext->Insert(aRange);
else
aRange->Connect(this, nsnull);
};
示例2: RemoveAllBut
void RemoveAllBut(PRInt32 aIndex) {
if (aIndex >= mMin && aIndex <= mMax) {
// Invalidate everything in this list.
mSelection->mFirstRange->Invalidate();
mMin = aIndex;
mMax = aIndex;
nsTreeRange* first = mSelection->mFirstRange;
if (mPrev)
mPrev->mNext = mNext;
if (mNext)
mNext->mPrev = mPrev;
mNext = mPrev = nsnull;
if (first != this) {
delete mSelection->mFirstRange;
mSelection->mFirstRange = this;
}
}
else if (mNext)
mNext->RemoveAllBut(aIndex);
}
示例3: Contains
PRBool Contains(PRInt32 aIndex) {
if (aIndex >= mMin && aIndex <= mMax)
return PR_TRUE;
if (mNext)
return mNext->Contains(aIndex);
return PR_FALSE;
}
示例4: Contains
bool Contains(PRInt32 aIndex) {
if (aIndex >= mMin && aIndex <= mMax)
return true;
if (mNext)
return mNext->Contains(aIndex);
return false;
}
示例5: Invalidate
void Invalidate() {
if (mSelection->mTree)
mSelection->mTree->InvalidateRange(mMin, mMax);
if (mNext)
mNext->Invalidate();
}
示例6: Count
PRInt32 Count() {
PRInt32 total = mMax - mMin + 1;
if (mNext)
total += mNext->Count();
return total;
}
示例7: Count
int32_t Count() {
int32_t total = mMax - mMin + 1;
if (mNext)
total += mNext->Count();
return total;
}