diff options
-rw-r--r-- | gtk/ScintillaGTK.cxx | 4 | ||||
-rw-r--r-- | win32/PlatWin.cxx | 20 |
2 files changed, 13 insertions, 11 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index dea716c82..a61838923 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1074,8 +1074,8 @@ bool ScintillaGTK::PaintContains(PRectangle rc) { rc.right - rc.left, rc.bottom - rc.top}; contains = CRectListContains(rgnUpdate, grc); #else - GdkRectangle grc = {rc.left, rc.top, - rc.right - rc.left, rc.bottom - rc.top}; + GdkRectangle grc = {static_cast<gint>(rc.left), static_cast<gint>(rc.top), + static_cast<gint>(rc.right - rc.left), static_cast<gint>(rc.bottom - rc.top)}; if (gdk_region_rect_in(rgnUpdate, &grc) != GDK_OVERLAP_RECTANGLE_IN) { contains = false; } diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 5884cd4f2..2a4c36c6e 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -108,7 +108,8 @@ Point Point::FromLong(long lpoint) { } static RECT RectFromPRectangle(PRectangle prc) { - RECT rc = {prc.left, prc.top, prc.right, prc.bottom}; + RECT rc = {static_cast<LONG>(prc.left), static_cast<LONG>(prc.top), + static_cast<LONG>(prc.right), static_cast<LONG>(prc.bottom)}; return rc; } @@ -691,7 +692,7 @@ void SurfaceGDI::Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired BrushColor(back); std::vector<POINT> outline; for (int i=0;i<npts;i++) { - POINT pt = {pts[i].x, pts[i].y}; + POINT pt = {static_cast<LONG>(pts[i].x), static_cast<LONG>(pts[i].y)}; outline.push_back(pt); } ::Polygon(hdc, &outline[0], npts); @@ -1852,7 +1853,7 @@ void Window::SetPositionRelative(PRectangle rc, Window w) { #ifdef MONITOR_DEFAULTTONULL // We're using the stub functionality of MultiMon.h to decay gracefully on machines // (ie, pre Win2000, Win95) that do not support the newer functions. - RECT rcMonitor = {rc.left, rc.top, rc.right, rc.bottom}; + RECT rcMonitor = RectFromPRectangle(rc); MONITORINFO mi = {0}; mi.cbSize = sizeof(mi); @@ -1992,7 +1993,8 @@ PRectangle Window::GetMonitorRect(Point pt) { // There could be conditional code and dynamic loading in a future version // so this would work on those platforms where they are available. PRectangle rcPosition = GetPosition(); - POINT ptDesktop = {pt.x + rcPosition.left, pt.y + rcPosition.top}; + POINT ptDesktop = {static_cast<LONG>(pt.x + rcPosition.left), + static_cast<LONG>(pt.y + rcPosition.top)}; HMONITOR hMonitor = ::MonitorFromPoint(ptDesktop, MONITOR_DEFAULTTONEAREST); MONITORINFO mi = {0}; memset(&mi, 0, sizeof(mi)); @@ -2232,7 +2234,7 @@ void ListBoxX::Create(Window &parent_, int ctrlID_, Point location_, int lineHei hinstanceParent, this); - POINT locationw = {location.x, location.y}; + POINT locationw = {static_cast<LONG>(location.x), static_cast<LONG>(location.y)}; ::MapWindowPoints(hwndParent, NULL, &locationw, 1); location = Point(locationw.x, locationw.y); } @@ -2521,7 +2523,7 @@ void ListBoxX::SetList(const char *list, char separator, char typesep) { } void ListBoxX::AdjustWindowRect(PRectangle *rc) const { - RECT rcw = {rc->left, rc->top, rc->right, rc->bottom }; + RECT rcw = RectFromPRectangle(*rc); ::AdjustWindowRectEx(&rcw, WS_THICKFRAME, false, WS_EX_WINDOWEDGE); *rc = PRectangle(rcw.left, rcw.top, rcw.right, rcw.bottom); } @@ -2542,7 +2544,7 @@ int ListBoxX::MinClientWidth() const { POINT ListBoxX::MinTrackSize() const { PRectangle rc(0, 0, MinClientWidth(), ItemHeight()); AdjustWindowRect(&rc); - POINT ret = {rc.Width(), rc.Height()}; + POINT ret = {static_cast<LONG>(rc.Width()), static_cast<LONG>(rc.Height())}; return ret; } @@ -2552,7 +2554,7 @@ POINT ListBoxX::MaxTrackSize() const { TextOffset() + ::GetSystemMetrics(SM_CXVSCROLL), ItemHeight() * lti.Count()); AdjustWindowRect(&rc); - POINT ret = {rc.Width(), rc.Height()}; + POINT ret = {static_cast<LONG>(rc.Width()), static_cast<LONG>(rc.Height())}; return ret; } @@ -2732,7 +2734,7 @@ void ListBoxX::Paint(HDC hDC) { // The list background is mainly erased during painting, but can be a small // unpainted area when at the end of a non-integrally sized list with a // vertical scroll bar - RECT rc = { 0, 0, extent.x, extent.y }; + RECT rc = { 0, 0, static_cast<LONG>(extent.x), static_cast<LONG>(extent.y) }; ::FillRect(bitmapDC, &rc, reinterpret_cast<HBRUSH>(COLOR_WINDOW+1)); // Paint the entire client area and vertical scrollbar ::SendMessage(lb, WM_PRINT, reinterpret_cast<WPARAM>(bitmapDC), PRF_CLIENT|PRF_NONCLIENT); |