From bafe395bffd5928fca85fc040b49fea411dda20f Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Fri, 23 Apr 2004 22:35:18 +0000 Subject: [PATCH] Bug 195355 listBoxObject.getRowCount() returns wrong value r=varga sr=bienvenu a=asa git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_7_BRANCH@155422 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp b/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp index fb17be92428..0429eb7d3ed 100644 --- a/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp @@ -1259,7 +1259,8 @@ nsListBoxBodyFrame::ListBoxInsertFrames(nsIFrame* aPrevFrame, nsIFrame* aFrameLi void nsListBoxBodyFrame::OnContentInserted(nsIPresContext* aPresContext, nsIContent* aChildContent) { - ++mRowCount; + if (mRowCount >= 0) + ++mRowCount; nsIPresShell *shell = aPresContext->PresShell(); // The RDF content builder will build content nodes such that they are all @@ -1299,7 +1300,8 @@ nsListBoxBodyFrame::OnContentInserted(nsIPresContext* aPresContext, nsIContent* void nsListBoxBodyFrame::OnContentRemoved(nsIPresContext* aPresContext, nsIFrame* aChildFrame, PRInt32 aIndex) { - --mRowCount; + if (mRowCount >= 0) + --mRowCount; if (!aChildFrame) { // The row we are removing is out of view, so we need to try to