Backed out changeset 4b2c67fe7e6b (relanding bug 449168)

This commit is contained in:
Justin Dolske 2008-08-13 21:18:02 -07:00
parent bf2cf8a1af
commit 53328c578f
3 changed files with 21 additions and 4 deletions

View File

@ -63,6 +63,14 @@
struct SelectionDetails
{
#ifdef NS_BUILD_REFCNT_LOGGING
SelectionDetails() {
MOZ_COUNT_CTOR(SelectionDetails);
}
~SelectionDetails() {
MOZ_COUNT_DTOR(SelectionDetails);
}
#endif
PRInt32 mStart;
PRInt32 mEnd;
SelectionType mType;

View File

@ -373,6 +373,9 @@ protected:
nscoord mAscent;
gfxTextRun* mTextRun;
// The caller of this method must call DestroySelectionDetails() on the
// return value, if that return value is not null. Calling
// DestroySelectionDetails() on a null value is still OK, just not necessary.
SelectionDetails* GetSelectionDetails();
void AdjustSelectionPointsForBidi(SelectionDetails *sdptr,

View File

@ -4515,12 +4515,18 @@ nsTextFrame::HasSelectionOverflowingDecorations(nsPresContext* aPresContext,
if (ratio <= 1.0f)
return PR_FALSE;
for (SelectionDetails *sd = GetSelectionDetails(); sd; sd = sd->mNext) {
SelectionDetails *details = GetSelectionDetails();
PRBool retval = PR_FALSE;
for (SelectionDetails *sd = details; sd; sd = sd->mNext) {
if (sd->mStart != sd->mEnd &&
sd->mType & SelectionTypesWithDecorations)
return PR_TRUE;
sd->mType & SelectionTypesWithDecorations) {
retval = PR_TRUE;
break;
}
}
return PR_FALSE;
DestroySelectionDetails(details);
return retval;
}
//null range means the whole thing