mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-06 03:09:18 +02:00
Fix for bugs:
120299 - Drop feedback is narrow first time 121187 - drag of message summary line (even without drop) garbles bounding box r=sfraser, sr=hyatt
This commit is contained in:
parent
97b9729140
commit
145837642f
4 changed files with 24 additions and 2 deletions
|
|
@ -304,7 +304,7 @@ nsOutlinerBodyFrame::nsOutlinerBodyFrame(nsIPresShell* aPresShell)
|
||||||
:nsLeafBoxFrame(aPresShell), mPresContext(nsnull), mOutlinerBoxObject(nsnull), mImageCache(nsnull),
|
:nsLeafBoxFrame(aPresShell), mPresContext(nsnull), mOutlinerBoxObject(nsnull), mImageCache(nsnull),
|
||||||
mColumns(nsnull), mScrollbar(nsnull), mTopRowIndex(0), mRowHeight(0), mIndentation(0), mStringWidth(-1),
|
mColumns(nsnull), mScrollbar(nsnull), mTopRowIndex(0), mRowHeight(0), mIndentation(0), mStringWidth(-1),
|
||||||
mFocused(PR_FALSE), mColumnsDirty(PR_TRUE), mDropAllowed(PR_FALSE), mHasFixedRowCount(PR_FALSE),
|
mFocused(PR_FALSE), mColumnsDirty(PR_TRUE), mDropAllowed(PR_FALSE), mHasFixedRowCount(PR_FALSE),
|
||||||
mVerticalOverflow(PR_FALSE), mDropRow(-1), mDropOrient(-1), mOpenTimer(nsnull)
|
mVerticalOverflow(PR_FALSE), mImageGuard(PR_FALSE), mDropRow(-1), mDropOrient(-1), mOpenTimer(nsnull)
|
||||||
{
|
{
|
||||||
NS_NewISupportsArray(getter_AddRefs(mScratchArray));
|
NS_NewISupportsArray(getter_AddRefs(mScratchArray));
|
||||||
}
|
}
|
||||||
|
|
@ -781,6 +781,9 @@ NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateCell(PRInt32 aIndex, const PRUnicha
|
||||||
if (aIndex < mTopRowIndex || aIndex > mTopRowIndex + mPageCount + 1)
|
if (aIndex < mTopRowIndex || aIndex > mTopRowIndex + mPageCount + 1)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
|
if (mImageGuard)
|
||||||
|
return NS_OK;
|
||||||
|
|
||||||
nscoord currX = mInnerBox.x;
|
nscoord currX = mInnerBox.x;
|
||||||
nscoord yPos = mInnerBox.y+mRowHeight*(aIndex-mTopRowIndex);
|
nscoord yPos = mInnerBox.y+mRowHeight*(aIndex-mTopRowIndex);
|
||||||
for (nsOutlinerColumn* currCol = mColumns; currCol && currX < mInnerBox.x+mInnerBox.width;
|
for (nsOutlinerColumn* currCol = mColumns; currCol && currX < mInnerBox.x+mInnerBox.width;
|
||||||
|
|
@ -1659,7 +1662,12 @@ nsOutlinerBodyFrame::GetImage(PRInt32 aRowIndex, const PRUnichar* aColID,
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1", &rv));
|
nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1", &rv));
|
||||||
|
mImageGuard = PR_TRUE;
|
||||||
il->LoadImage(srcURI, nsnull, listener, mPresContext, nsIRequest::LOAD_NORMAL, nsnull, nsnull, getter_AddRefs(imageRequest));
|
il->LoadImage(srcURI, nsnull, listener, mPresContext, nsIRequest::LOAD_NORMAL, nsnull, nsnull, getter_AddRefs(imageRequest));
|
||||||
|
mImageGuard = PR_FALSE;
|
||||||
|
|
||||||
|
// In a case it was already cached.
|
||||||
|
imageRequest->GetImage(aResult);
|
||||||
|
|
||||||
if (!mImageCache) {
|
if (!mImageCache) {
|
||||||
mImageCache = new nsSupportsHashtable(64);
|
mImageCache = new nsSupportsHashtable(64);
|
||||||
|
|
|
||||||
|
|
@ -466,6 +466,9 @@ protected: // Data Members
|
||||||
|
|
||||||
PRPackedBool mVerticalOverflow;
|
PRPackedBool mVerticalOverflow;
|
||||||
|
|
||||||
|
// A guard that prevents us from recursive painting.
|
||||||
|
PRPackedBool mImageGuard;
|
||||||
|
|
||||||
// The row the mouse is hovering over during a drop.
|
// The row the mouse is hovering over during a drop.
|
||||||
PRInt32 mDropRow;
|
PRInt32 mDropRow;
|
||||||
// Where we want to draw feedback (above/on this row/below) if allowed.
|
// Where we want to draw feedback (above/on this row/below) if allowed.
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ nsOutlinerBodyFrame::nsOutlinerBodyFrame(nsIPresShell* aPresShell)
|
||||||
:nsLeafBoxFrame(aPresShell), mPresContext(nsnull), mOutlinerBoxObject(nsnull), mImageCache(nsnull),
|
:nsLeafBoxFrame(aPresShell), mPresContext(nsnull), mOutlinerBoxObject(nsnull), mImageCache(nsnull),
|
||||||
mColumns(nsnull), mScrollbar(nsnull), mTopRowIndex(0), mRowHeight(0), mIndentation(0), mStringWidth(-1),
|
mColumns(nsnull), mScrollbar(nsnull), mTopRowIndex(0), mRowHeight(0), mIndentation(0), mStringWidth(-1),
|
||||||
mFocused(PR_FALSE), mColumnsDirty(PR_TRUE), mDropAllowed(PR_FALSE), mHasFixedRowCount(PR_FALSE),
|
mFocused(PR_FALSE), mColumnsDirty(PR_TRUE), mDropAllowed(PR_FALSE), mHasFixedRowCount(PR_FALSE),
|
||||||
mVerticalOverflow(PR_FALSE), mDropRow(-1), mDropOrient(-1), mOpenTimer(nsnull)
|
mVerticalOverflow(PR_FALSE), mImageGuard(PR_FALSE), mDropRow(-1), mDropOrient(-1), mOpenTimer(nsnull)
|
||||||
{
|
{
|
||||||
NS_NewISupportsArray(getter_AddRefs(mScratchArray));
|
NS_NewISupportsArray(getter_AddRefs(mScratchArray));
|
||||||
}
|
}
|
||||||
|
|
@ -781,6 +781,9 @@ NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateCell(PRInt32 aIndex, const PRUnicha
|
||||||
if (aIndex < mTopRowIndex || aIndex > mTopRowIndex + mPageCount + 1)
|
if (aIndex < mTopRowIndex || aIndex > mTopRowIndex + mPageCount + 1)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
|
if (mImageGuard)
|
||||||
|
return NS_OK;
|
||||||
|
|
||||||
nscoord currX = mInnerBox.x;
|
nscoord currX = mInnerBox.x;
|
||||||
nscoord yPos = mInnerBox.y+mRowHeight*(aIndex-mTopRowIndex);
|
nscoord yPos = mInnerBox.y+mRowHeight*(aIndex-mTopRowIndex);
|
||||||
for (nsOutlinerColumn* currCol = mColumns; currCol && currX < mInnerBox.x+mInnerBox.width;
|
for (nsOutlinerColumn* currCol = mColumns; currCol && currX < mInnerBox.x+mInnerBox.width;
|
||||||
|
|
@ -1659,7 +1662,12 @@ nsOutlinerBodyFrame::GetImage(PRInt32 aRowIndex, const PRUnichar* aColID,
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1", &rv));
|
nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1", &rv));
|
||||||
|
mImageGuard = PR_TRUE;
|
||||||
il->LoadImage(srcURI, nsnull, listener, mPresContext, nsIRequest::LOAD_NORMAL, nsnull, nsnull, getter_AddRefs(imageRequest));
|
il->LoadImage(srcURI, nsnull, listener, mPresContext, nsIRequest::LOAD_NORMAL, nsnull, nsnull, getter_AddRefs(imageRequest));
|
||||||
|
mImageGuard = PR_FALSE;
|
||||||
|
|
||||||
|
// In a case it was already cached.
|
||||||
|
imageRequest->GetImage(aResult);
|
||||||
|
|
||||||
if (!mImageCache) {
|
if (!mImageCache) {
|
||||||
mImageCache = new nsSupportsHashtable(64);
|
mImageCache = new nsSupportsHashtable(64);
|
||||||
|
|
|
||||||
|
|
@ -466,6 +466,9 @@ protected: // Data Members
|
||||||
|
|
||||||
PRPackedBool mVerticalOverflow;
|
PRPackedBool mVerticalOverflow;
|
||||||
|
|
||||||
|
// A guard that prevents us from recursive painting.
|
||||||
|
PRPackedBool mImageGuard;
|
||||||
|
|
||||||
// The row the mouse is hovering over during a drop.
|
// The row the mouse is hovering over during a drop.
|
||||||
PRInt32 mDropRow;
|
PRInt32 mDropRow;
|
||||||
// Where we want to draw feedback (above/on this row/below) if allowed.
|
// Where we want to draw feedback (above/on this row/below) if allowed.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue