diff --git a/layout/base/nsPresState.h b/layout/base/nsPresState.h index ced3eae76feb..5e780b0f5b6a 100644 --- a/layout/base/nsPresState.h +++ b/layout/base/nsPresState.h @@ -111,6 +111,16 @@ public: return mDroppedDown; } + void SetPreviewText(const nsAString& aValue) + { + mPreviewText = aValue; + } + + void GetPreviewText(nsAString& aValue) + { + aValue = mPreviewText; + } + // MEMBER VARIABLES protected: nsCOMPtr mContentData; @@ -121,6 +131,7 @@ protected: bool mDisabledSet; bool mDisabled; bool mDroppedDown; + nsString mPreviewText; }; #endif /* nsPresState_h_ */ diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 191f16177cac..c93c9b73a63a 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -1681,6 +1681,7 @@ nsComboboxControlFrame::SaveState(nsPresState** aState) MOZ_ASSERT(!(*aState)); (*aState) = new nsPresState(); (*aState)->SetDroppedDown(mDroppedDown); + (*aState)->SetPreviewText(mPreviewText); return NS_OK; } @@ -1690,6 +1691,7 @@ nsComboboxControlFrame::RestoreState(nsPresState* aState) if (!aState) { return NS_ERROR_FAILURE; } + aState->GetPreviewText(mPreviewText); ShowList(aState->GetDroppedDown()); // might destroy us return NS_OK; }