don't dereferencep ossibly NULL pointers in DoScreenToClient/ClientToScreen()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1212,9 +1212,11 @@ void wxWindow::DoScreenToClient(int *x, int *y) const
|
||||
Window thisWindow = XtWindow(widget);
|
||||
|
||||
Window childWindow;
|
||||
int xx = *x;
|
||||
int yy = *y;
|
||||
XTranslateCoordinates(display, rootWindow, thisWindow, xx, yy, x, y, &childWindow);
|
||||
int xx = x ? *x : 0;
|
||||
int yy = y ? *y : 0;
|
||||
XTranslateCoordinates(display, rootWindow, thisWindow,
|
||||
xx, yy, x ? x : &xx, y ? y : &yy,
|
||||
&childWindow);
|
||||
}
|
||||
|
||||
void wxWindow::DoClientToScreen(int *x, int *y) const
|
||||
@@ -1225,9 +1227,11 @@ void wxWindow::DoClientToScreen(int *x, int *y) const
|
||||
Window thisWindow = XtWindow(widget);
|
||||
|
||||
Window childWindow;
|
||||
int xx = *x;
|
||||
int yy = *y;
|
||||
XTranslateCoordinates(display, thisWindow, rootWindow, xx, yy, x, y, &childWindow);
|
||||
int xx = x ? *x : 0;
|
||||
int yy = y ? *y : 0;
|
||||
XTranslateCoordinates(display, thisWindow, rootWindow,
|
||||
xx, yy, x ? x : &xx, y ? y : &yy,
|
||||
&childWindow);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -805,9 +805,11 @@ void wxWindowX11::DoScreenToClient(int *x, int *y) const
|
||||
Window thisWindow = (Window) m_clientWindow;
|
||||
|
||||
Window childWindow;
|
||||
int xx = *x;
|
||||
int yy = *y;
|
||||
XTranslateCoordinates(display, rootWindow, thisWindow, xx, yy, x, y, &childWindow);
|
||||
int xx = x ? *x : 0;
|
||||
int yy = y ? *y : 0;
|
||||
XTranslateCoordinates(display, rootWindow, thisWindow,
|
||||
xx, yy, x ? x : &xx, y ? y : &yy,
|
||||
&childWindow);
|
||||
}
|
||||
|
||||
void wxWindowX11::DoClientToScreen(int *x, int *y) const
|
||||
@@ -816,10 +818,11 @@ void wxWindowX11::DoClientToScreen(int *x, int *y) const
|
||||
Window rootWindow = RootWindowOfScreen(DefaultScreenOfDisplay(display));
|
||||
Window thisWindow = (Window) m_clientWindow;
|
||||
|
||||
Window childWindow;
|
||||
int xx = *x;
|
||||
int yy = *y;
|
||||
XTranslateCoordinates(display, thisWindow, rootWindow, xx, yy, x, y, &childWindow);
|
||||
int xx = x ? *x : 0;
|
||||
int yy = y ? *y : 0;
|
||||
XTranslateCoordinates(display, thisWindow, rootWindow,
|
||||
xx, yy, x ? x : &xx, y ? y : &yy,
|
||||
&childWindow);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user