From abe94c118b2e49e429ca1ad44e030b622f4fe2fa Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Fri, 22 Oct 1999 21:45:19 +0000 Subject: [PATCH] set window title using multibyte. submitted by jamestoder@yahoo.com. r:ftang@netscape.com, by lack of timely objection. git-svn-id: svn://10.0.0.236/trunk@51573 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/windows/nsWindow.cpp | 68 +++++++++++++------------ 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp index 979db13a6e0..b3abfcd8b56 100644 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ b/mozilla/widget/src/windows/nsWindow.cpp @@ -2369,7 +2369,9 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT static UINT vkKeyCached = 0; // caches VK code fon WM_KEYDOWN static BOOL firstTime = TRUE; // for mouse wheel logic static int iDeltaPerLine, iAccumDelta ; // for mouse wheel logic +#ifdef LOSER ULONG ulScrollLines ; // for mouse wheel logic +#endif PRBool result = PR_FALSE; // call the default nsWindow proc nsPaletteInfo palInfo; @@ -2868,7 +2870,6 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT break; } case WM_IME_STARTCOMPOSITION: { - COMPOSITIONFORM compForm; HIMC hIMEContext; mIMEIsComposing = PR_TRUE; @@ -2890,7 +2891,6 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT break; case WM_IME_COMPOSITION: { - //COMPOSITIONFORM compForm; HIMC hIMEContext; result = PR_FALSE; // will change this if an IME message we handle @@ -3668,9 +3668,11 @@ DWORD nsWindow::GetBorderStyle(nsBorderStyle aBorderStyle) NS_METHOD nsWindow::SetTitle(const nsString& aTitle) { - NS_ALLOC_STR_BUF(buf, aTitle, 256); - ::SendMessage(mWnd, WM_SETTEXT, (WPARAM)0, (LPARAM)(LPCTSTR)buf); - NS_FREE_STR_BUF(buf); + char* title = GetACPString(aTitle); + if (title) { + ::SendMessage(mWnd, WM_SETTEXT, (WPARAM)0, (LPARAM)(LPCTSTR)title); + delete [] title; + } return NS_OK; } @@ -3832,7 +3834,9 @@ nsWindow::HandleEndComposition(void) void nsWindow::MapDBCSAtrributeArrayToUnicodeOffsets(PRUint32* textRangeListLengthResult,nsTextRangeArray* textRangeListResult) { - PRUint32 i,rangePointer; + PRUint32 rangePointer; + PRInt32 ictr; + PRUint32 uctr; size_t lastUnicodeOffset, substringLength, lastMBCSOffset; // @@ -3856,8 +3860,8 @@ nsWindow::MapDBCSAtrributeArrayToUnicodeOffsets(PRUint32* textRangeListLengthRes } else { *textRangeListLengthResult = 1; - for(i=0;i