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
This commit is contained in:
mkaply%us.ibm.com 2001-10-01 13:57:47 +00:00
Родитель 505d1e1ebd
Коммит 3c7580a23b
1 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -978,12 +978,12 @@ nsFormFrame::OnSubmit(nsIPresContext* aPresContext, nsIFrame* aFrame)
char* char*
nsFormFrame::UnicodeToNewBytes(const PRUnichar* aSrc, PRUint32 aLen, nsIUnicodeEncoder* encoder) nsFormFrame::UnicodeToNewBytes(const PRUnichar* aSrc, PRUint32 aLen, nsIUnicodeEncoder* encoder)
{ {
#ifdef IBMBIDI_0 // Until we finalize the conversion routine #ifdef IBMBIDI
//ahmed 15-1 //ahmed 15-1
nsString temp; nsAutoString temp;
nsresult rv = NS_OK; nsresult rv = NS_OK;
nsIUBidiUtils* bidiUtils = do_getService("@mozilla.org/intl/unicharbidiutil;1"); nsCOMPtr<nsIUBidiUtils> bidiUtils = do_GetService("@mozilla.org/intl/unicharbidiutil;1");
nsString newBuffer; nsAutoString newBuffer;
//This condition handle the RTL,LTR for a logical file //This condition handle the RTL,LTR for a logical file
if( ( mCtrlsModAtSubmit==IBMBIDI_CONTROLSTEXTMODE_VISUAL )&&( mCharset.EqualsIgnoreCase("windows-1256") ) ){ if( ( mCtrlsModAtSubmit==IBMBIDI_CONTROLSTEXTMODE_VISUAL )&&( mCharset.EqualsIgnoreCase("windows-1256") ) ){
bidiUtils->Conv_06_FE_WithReverse(nsString(aSrc), newBuffer,mTextDir); 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 if (mTextDir == 2) { //RTL
//Now we need to reverse the Buffer, it is by searshing the buffer //Now we need to reverse the Buffer, it is by searshing the buffer
PRUint32 loop = aLen; 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); temp.SetCharAt((PRUnichar)aSrc[loop], z);
loop--; loop--;
} }
@ -1015,7 +1016,8 @@ nsFormFrame::UnicodeToNewBytes(const PRUnichar* aSrc, PRUint32 aLen, nsIUnicodeE
aLen=newBuffer.Length(); aLen=newBuffer.Length();
//Now we need to reverse the Buffer, it is by searshing the buffer //Now we need to reverse the Buffer, it is by searshing the buffer
PRUint32 loop = aLen; 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); temp.SetCharAt((PRUnichar)aSrc[loop], z);
loop--; loop--;
} }