From 06d7b2176b51a5984f3e8e612888c71299526b6a Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Sun, 1 Feb 2009 14:16:20 +0000 Subject: [PATCH] add uint/long/ulong overloads of operator* and operator/ to avoid problems with ambiguos overloads in wxSize git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gdicmn.h | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 74a39cfcd1..eb299a4687 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -240,6 +240,12 @@ public: wxSize& operator-=(const wxSize& sz) { x -= sz.x; y -= sz.y; return *this; } wxSize& operator/=(int i) { x /= i; y /= i; return *this; } wxSize& operator*=(int i) { x *= i; y *= i; return *this; } + wxSize& operator/=(unsigned int i) { x /= i; y /= i; return *this; } + wxSize& operator*=(unsigned int i) { x *= i; y *= i; return *this; } + wxSize& operator/=(long i) { x /= i; y /= i; return *this; } + wxSize& operator*=(long i) { x *= i; y *= i; return *this; } + wxSize& operator/=(unsigned long i) { x /= i; y /= i; return *this; } + wxSize& operator*=(unsigned long i) { x *= i; y *= i; return *this; } wxSize& operator/=(double i) { x = int(x/i); y = int(y/i); return *this; } wxSize& operator*=(double i) { x = int(x*i); y = int(y*i); return *this; } @@ -320,6 +326,51 @@ inline wxSize operator*(int i, const wxSize& s) return wxSize(s.x * i, s.y * i); } +inline wxSize operator/(const wxSize& s, unsigned int i) +{ + return wxSize(s.x / i, s.y / i); +} + +inline wxSize operator*(const wxSize& s, unsigned int i) +{ + return wxSize(s.x * i, s.y * i); +} + +inline wxSize operator*(unsigned int i, const wxSize& s) +{ + return wxSize(s.x * i, s.y * i); +} + +inline wxSize operator/(const wxSize& s, long i) +{ + return wxSize(s.x / i, s.y / i); +} + +inline wxSize operator*(const wxSize& s, long i) +{ + return wxSize(s.x * i, s.y * i); +} + +inline wxSize operator*(long i, const wxSize& s) +{ + return wxSize(s.x * i, s.y * i); +} + +inline wxSize operator/(const wxSize& s, unsigned long i) +{ + return wxSize(s.x / i, s.y / i); +} + +inline wxSize operator*(const wxSize& s, unsigned long i) +{ + return wxSize(s.x * i, s.y * i); +} + +inline wxSize operator*(unsigned long i, const wxSize& s) +{ + return wxSize(s.x * i, s.y * i); +} + inline wxSize operator*(const wxSize& s, double i) { return wxSize(int(s.x * i), int(s.y * i));