diff --git a/widget/src/xlib/nsTextHelper.cpp b/widget/src/xlib/nsTextHelper.cpp index a7542d742f1..e0a3c895534 100644 --- a/widget/src/xlib/nsTextHelper.cpp +++ b/widget/src/xlib/nsTextHelper.cpp @@ -30,11 +30,16 @@ NS_METHOD nsTextHelper::SetMaxTextLength(PRUint32 aChars) NS_METHOD nsTextHelper::GetText(nsString& aTextBuffer, PRUint32 aBufferSize, PRUint32& aActualSize) { + aTextBuffer.SetLength(0); + aTextBuffer.Append(mText); + aActualSize = mText.Length(); return NS_OK; } NS_METHOD nsTextHelper::SetText(const nsString &aText, PRUint32& aActualSize) -{ +{ + aActualSize = aText.Length(); + mText = aText; return NS_OK; } diff --git a/widget/src/xlib/nsTextHelper.h b/widget/src/xlib/nsTextHelper.h index 92e64fd6c0c..9ef65695dc4 100644 --- a/widget/src/xlib/nsTextHelper.h +++ b/widget/src/xlib/nsTextHelper.h @@ -53,6 +53,7 @@ public: virtual PRBool AutoErase(); protected: + nsString mText; }; #endif // nsTextHelper_h__