Bug 749055 - Add index parameter to nsDisplayMathMLCharForeground. r=roc

This commit is contained in:
Matt Woodrow 2012-04-27 12:24:54 +12:00
Родитель 3d94253d33
Коммит c676a2d954
6 изменённых файлов: 17 добавлений и 9 удалений

Просмотреть файл

@ -1899,8 +1899,9 @@ class nsDisplayMathMLCharForeground : public nsDisplayItem {
public:
nsDisplayMathMLCharForeground(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsMathMLChar* aChar,
bool aIsSelected)
: nsDisplayItem(aBuilder, aFrame), mChar(aChar), mIsSelected(aIsSelected) {
PRUint32 aIndex, bool aIsSelected)
: nsDisplayItem(aBuilder, aFrame), mChar(aChar),
mIndex(aIndex), mIsSelected(aIsSelected) {
MOZ_COUNT_CTOR(nsDisplayMathMLCharForeground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -1935,8 +1936,11 @@ public:
return GetBounds(aBuilder, &snap);
}
virtual PRUint32 GetPerFrameKey() { return (mIndex << nsDisplayItem::TYPE_BITS) | nsDisplayItem::GetPerFrameKey(); }
private:
nsMathMLChar* mChar;
PRUint32 mIndex;
bool mIsSelected;
};
@ -1982,6 +1986,7 @@ nsresult
nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
nsIFrame* aForFrame,
const nsDisplayListSet& aLists,
PRUint32 aIndex,
const nsRect* aSelectedRect)
{
nsresult rv = NS_OK;
@ -2026,6 +2031,7 @@ nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
}
return aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayMathMLCharForeground(aBuilder, aForFrame, this,
aIndex,
aSelectedRect && !aSelectedRect->IsEmpty()));
}

Просмотреть файл

@ -131,6 +131,7 @@ public:
Display(nsDisplayListBuilder* aBuilder,
nsIFrame* aForFrame,
const nsDisplayListSet& aLists,
PRUint32 aIndex,
const nsRect* aSelectedRect = nsnull);
void PaintForeground(nsPresContext* aPresContext,

Просмотреть файл

@ -236,7 +236,7 @@ nsMathMLmencloseFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
mencloseRect.x = mencloseRect.y = 0;
if (IsToDraw(NOTATION_RADICAL)) {
rv = mMathMLChar[mRadicalCharIndex].Display(aBuilder, this, aLists);
rv = mMathMLChar[mRadicalCharIndex].Display(aBuilder, this, aLists, 0);
NS_ENSURE_SUCCESS(rv, rv);
nsRect rect;
@ -249,7 +249,7 @@ nsMathMLmencloseFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
if (IsToDraw(NOTATION_LONGDIV)) {
rv = mMathMLChar[mLongDivCharIndex].Display(aBuilder, this, aLists);
rv = mMathMLChar[mLongDivCharIndex].Display(aBuilder, this, aLists, 1);
NS_ENSURE_SUCCESS(rv, rv);
nsRect rect;

Просмотреть файл

@ -220,18 +220,19 @@ nsMathMLmfencedFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
////////////
// display fences and separators
PRUint32 count = 0;
if (mOpenChar) {
rv = mOpenChar->Display(aBuilder, this, aLists);
rv = mOpenChar->Display(aBuilder, this, aLists, count++);
NS_ENSURE_SUCCESS(rv, rv);
}
if (mCloseChar) {
rv = mCloseChar->Display(aBuilder, this, aLists);
rv = mCloseChar->Display(aBuilder, this, aLists, count++);
NS_ENSURE_SUCCESS(rv, rv);
}
for (PRInt32 i = 0; i < mSeparatorsCount; i++) {
rv = mSeparatorsChar[i].Display(aBuilder, this, aLists);
rv = mSeparatorsChar[i].Display(aBuilder, this, aLists, count++);
NS_ENSURE_SUCCESS(rv, rv);
}
return NS_OK;

Просмотреть файл

@ -140,7 +140,7 @@ nsMathMLmoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
selectedRect = firstChild->GetRect();
isSelected = true;
}
rv = mMathMLChar.Display(aBuilder, this, aLists, isSelected ? &selectedRect : nsnull);
rv = mMathMLChar.Display(aBuilder, this, aLists, 0, isSelected ? &selectedRect : nsnull);
NS_ENSURE_SUCCESS(rv, rv);
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)

Просмотреть файл

@ -134,7 +134,7 @@ nsMathMLmrootFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
/////////////
// paint the sqrt symbol
if (!NS_MATHML_HAS_ERROR(mPresentationData.flags)) {
rv = mSqrChar.Display(aBuilder, this, aLists);
rv = mSqrChar.Display(aBuilder, this, aLists, 0);
NS_ENSURE_SUCCESS(rv, rv);
rv = DisplayBar(aBuilder, this, mBarRect, aLists);