From 7bc1440f39f706e7e335542edef7cb863f6d2d47 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Fri, 21 Apr 2000 21:53:38 +0000 Subject: [PATCH] text content longer gets set to "" which it ignores, it gets set to " " when thedisplay should be "" bug 36459 Add ifdef'ed Performance Reflow Counting code --- layout/forms/nsComboboxControlFrame.cpp | 9 ++++++++- layout/forms/nsComboboxControlFrame.h | 4 ++-- layout/html/forms/src/nsComboboxControlFrame.cpp | 9 ++++++++- layout/html/forms/src/nsComboboxControlFrame.h | 4 ++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index fe02b825356..71769904222 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -1019,6 +1019,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { + DO_GLOBAL_REFLOW_COUNT("nsComboboxControlFrame", aReflowState.reason); + aStatus = NS_FRAME_COMPLETE; REFLOW_COUNTER_REQUEST(); @@ -1860,7 +1862,12 @@ nsComboboxControlFrame::SelectionChanged() REFLOW_DEBUG_MSG3("**** SelectionChanged Old[%s] New[%s]\n", value.ToNewCString(), mTextStr.ToNewCString()); } if (shouldSetValue) { - rv = mDisplayContent->SetText(mTextStr.GetUnicode(), mTextStr.Length(), PR_TRUE); + if (mTextStr.Length() == 0) { + nsAutoString space(" "); + rv = mDisplayContent->SetText(space.GetUnicode(), space.Length(), PR_TRUE); + } else { + rv = mDisplayContent->SetText(mTextStr.GetUnicode(), mTextStr.Length(), PR_TRUE); + } nsFrameState state; //mTextFrame->GetFrameState(&state); //state |= NS_FRAME_IS_DIRTY; diff --git a/layout/forms/nsComboboxControlFrame.h b/layout/forms/nsComboboxControlFrame.h index a2f772dbbf0..8fa32a1ff6f 100644 --- a/layout/forms/nsComboboxControlFrame.h +++ b/layout/forms/nsComboboxControlFrame.h @@ -28,8 +28,8 @@ #endif #ifdef DEBUG_rods -#define DO_REFLOW_DEBUG -#define DO_REFLOW_COUNTER +//#define DO_REFLOW_DEBUG +//#define DO_REFLOW_COUNTER //#define DO_UNCONSTRAINED_CHECK //#define DO_PIXELS //#define DO_NEW_REFLOW diff --git a/layout/html/forms/src/nsComboboxControlFrame.cpp b/layout/html/forms/src/nsComboboxControlFrame.cpp index fe02b825356..71769904222 100644 --- a/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -1019,6 +1019,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { + DO_GLOBAL_REFLOW_COUNT("nsComboboxControlFrame", aReflowState.reason); + aStatus = NS_FRAME_COMPLETE; REFLOW_COUNTER_REQUEST(); @@ -1860,7 +1862,12 @@ nsComboboxControlFrame::SelectionChanged() REFLOW_DEBUG_MSG3("**** SelectionChanged Old[%s] New[%s]\n", value.ToNewCString(), mTextStr.ToNewCString()); } if (shouldSetValue) { - rv = mDisplayContent->SetText(mTextStr.GetUnicode(), mTextStr.Length(), PR_TRUE); + if (mTextStr.Length() == 0) { + nsAutoString space(" "); + rv = mDisplayContent->SetText(space.GetUnicode(), space.Length(), PR_TRUE); + } else { + rv = mDisplayContent->SetText(mTextStr.GetUnicode(), mTextStr.Length(), PR_TRUE); + } nsFrameState state; //mTextFrame->GetFrameState(&state); //state |= NS_FRAME_IS_DIRTY; diff --git a/layout/html/forms/src/nsComboboxControlFrame.h b/layout/html/forms/src/nsComboboxControlFrame.h index a2f772dbbf0..8fa32a1ff6f 100644 --- a/layout/html/forms/src/nsComboboxControlFrame.h +++ b/layout/html/forms/src/nsComboboxControlFrame.h @@ -28,8 +28,8 @@ #endif #ifdef DEBUG_rods -#define DO_REFLOW_DEBUG -#define DO_REFLOW_COUNTER +//#define DO_REFLOW_DEBUG +//#define DO_REFLOW_COUNTER //#define DO_UNCONSTRAINED_CHECK //#define DO_PIXELS //#define DO_NEW_REFLOW