From 3c7580a23b89c6d8fc0c64cee2706f8edc36930e Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Mon, 1 Oct 2001 13:57:47 +0000 Subject: [PATCH] #80167 r=ftang, r=mikek, sr=blizzard Code from simon@softel.co.il - code from original Bidi landing can be turned on now that converson is finalized Also fixed two warnings that were in the code that could have also broke some unixes --- layout/html/forms/src/nsFormFrame.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/layout/html/forms/src/nsFormFrame.cpp b/layout/html/forms/src/nsFormFrame.cpp index 650ccf3403ad..0808eb6aa7b3 100644 --- a/layout/html/forms/src/nsFormFrame.cpp +++ b/layout/html/forms/src/nsFormFrame.cpp @@ -978,12 +978,12 @@ nsFormFrame::OnSubmit(nsIPresContext* aPresContext, nsIFrame* aFrame) char* nsFormFrame::UnicodeToNewBytes(const PRUnichar* aSrc, PRUint32 aLen, nsIUnicodeEncoder* encoder) { -#ifdef IBMBIDI_0 // Until we finalize the conversion routine +#ifdef IBMBIDI //ahmed 15-1 - nsString temp; + nsAutoString temp; nsresult rv = NS_OK; - nsIUBidiUtils* bidiUtils = do_getService("@mozilla.org/intl/unicharbidiutil;1"); - nsString newBuffer; + nsCOMPtr bidiUtils = do_GetService("@mozilla.org/intl/unicharbidiutil;1"); + nsAutoString newBuffer; //This condition handle the RTL,LTR for a logical file if( ( mCtrlsModAtSubmit==IBMBIDI_CONTROLSTEXTMODE_VISUAL )&&( mCharset.EqualsIgnoreCase("windows-1256") ) ){ bidiUtils->Conv_06_FE_WithReverse(nsString(aSrc), newBuffer,mTextDir); @@ -1000,7 +1000,8 @@ nsFormFrame::UnicodeToNewBytes(const PRUnichar* aSrc, PRUint32 aLen, nsIUnicodeE if (mTextDir == 2) { //RTL //Now we need to reverse the Buffer, it is by searshing the buffer PRUint32 loop = aLen; - for (int z=0; z<=aLen; z++){ + unsigned int z; + for (z=0; z<=aLen; z++){ temp.SetCharAt((PRUnichar)aSrc[loop], z); loop--; } @@ -1015,7 +1016,8 @@ nsFormFrame::UnicodeToNewBytes(const PRUnichar* aSrc, PRUint32 aLen, nsIUnicodeE aLen=newBuffer.Length(); //Now we need to reverse the Buffer, it is by searshing the buffer PRUint32 loop = aLen; - for (int z=0; z<=aLen; z++){ + unsigned int z; + for (z=0; z<=aLen; z++){ temp.SetCharAt((PRUnichar)aSrc[loop], z); loop--; }