diff --git a/uppsrc/CtrlCore/Win32Proc.cpp b/uppsrc/CtrlCore/Win32Proc.cpp index aa768d73c..a02e347ab 100644 --- a/uppsrc/CtrlCore/Win32Proc.cpp +++ b/uppsrc/CtrlCore/Win32Proc.cpp @@ -451,10 +451,12 @@ LRESULT Ctrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { MINMAXINFO *mmi = (MINMAXINFO *)lParam; Rect frmrc = Size(200, 200); ::AdjustWindowRect(frmrc, WS_OVERLAPPEDWINDOW, FALSE); - Size msz = Ctrl::GetWorkArea().Deflated(-frmrc.left, -frmrc.top, - frmrc.right - 200, frmrc.bottom - 200).GetSize(); - Rect minr(Point(50, 50), min(msz, GetMinSize())); - Rect maxr(Point(50, 50), min(msz, GetMaxSize())); +// Size msz = Ctrl::GetWorkArea().Deflated(-frmrc.left, -frmrc.top, +// frmrc.right - 200, frmrc.bottom - 200).GetSize(); +// Rect minr(Point(50, 50), min(msz, GetMinSize())); +// Rect maxr(Point(50, 50), min(msz, GetMaxSize())); // Removed cxl&nixnixnix 2012-6-12 + Rect minr(Point(50, 50), GetMinSize()); + Rect maxr(Point(50, 50), GetMaxSize()); dword style = ::GetWindowLong(hwnd, GWL_STYLE); dword exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE); AdjustWindowRectEx(minr, style, FALSE, exstyle); diff --git a/uppsrc/Painter/Painter.cpp b/uppsrc/Painter/Painter.cpp index 2eec8f96c..6c5223127 100644 --- a/uppsrc/Painter/Painter.cpp +++ b/uppsrc/Painter/Painter.cpp @@ -481,9 +481,8 @@ Painter& Painter::Text(double x, double y, const String& s, Font fnt, double *dx Painter& Painter::Text(const Pointf& p, const char *text, Font fnt, int n, double *dx) { - if(n < 0) - n = strlen(text); - return Text(p, ToUnicode(text, n, CHARSET_DEFAULT), fnt, n, dx); + WString s = ToUnicode(text, CHARSET_DEFAULT); + return Text(p, s, fnt, n < 0 ? s.GetCount() : n, dx); } Painter& Painter::Text(double x, double y, const char *text, Font fnt, int n, double *dx)