synch with nsWindow.cpp rev 3.272. code by roc+moz@cs.cmu.edu

This commit is contained in:
danm%netscape.com 2000-04-27 00:25:01 +00:00
Родитель fa7a39c23d
Коммит 468f4aa039
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -89,6 +89,7 @@ nsresult nsTextWidget::QueryInterface(const nsIID& aIID, void** aInstancePtr)
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void nsTextWidget::SubclassWindow(BOOL bState) void nsTextWidget::SubclassWindow(BOOL bState)
{ {
if (NULL != mWnd) {
NS_PRECONDITION(::IsWindow(mWnd), "Invalid window handle"); NS_PRECONDITION(::IsWindow(mWnd), "Invalid window handle");
if (bState) { if (bState) {
@ -97,12 +98,14 @@ void nsTextWidget::SubclassWindow(BOOL bState)
(LONG)nsTextWidget::TextWindowProc); (LONG)nsTextWidget::TextWindowProc);
NS_ASSERTION(mPrevWndProc, "Null standard window procedure"); NS_ASSERTION(mPrevWndProc, "Null standard window procedure");
// connect the this pointer to the nsWindow handle // connect the this pointer to the nsWindow handle
::SetWindowLong(mWnd, GWL_USERDATA, (LONG)this); SetNSWindowPtr(mWnd, this);
} }
else { else {
(void) ::SetWindowLong(mWnd, GWL_WNDPROC, (LONG)mPrevWndProc); (void) ::SetWindowLong(mWnd, GWL_WNDPROC, (LONG)mPrevWndProc);
SetNSWindowPtr(mWnd, NULL);
mPrevWndProc = NULL; mPrevWndProc = NULL;
} }
}
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------