X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42782237f24807ddb0bae1c84997e29573f5c2df..0699a648f61c50bd7f6bae5465f40492484cdc30:/src/os2/utilsgui.cpp?ds=sidebyside diff --git a/src/os2/utilsgui.cpp b/src/os2/utilsgui.cpp index 5b7e06cf34..66647fcd2e 100644 --- a/src/os2/utilsgui.cpp +++ b/src/os2/utilsgui.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: os2/utilsgui.cpp +// Name: src/os2/utilsgui.cpp // Purpose: Various utility functions only available in GUI // Author: David Webster // Modified by: @@ -25,7 +25,6 @@ #endif #ifndef WX_PRECOMP - #include "wx/setup.h" #include "wx/utils.h" #include "wx/app.h" #include "wx/cursor.h" @@ -69,7 +68,7 @@ bool wxWriteResource( HAB hab = 0; HINI hIni = 0; - if (rFile != "") + if (!rFile.empty()) { hIni = ::PrfOpenProfile(hab, (PSZ)WXSTRINGCAST rFile); if (hIni != 0L) @@ -153,7 +152,7 @@ bool wxGetResource( wxChar zDefunkt[] = _T("$$default"); char zBuf[1000]; - if (rFile != "") + if (!rFile.empty()) { hIni = ::PrfOpenProfile(hab, (PSZ)WXSTRINGCAST rFile); if (hIni != 0L) @@ -484,7 +483,7 @@ void wxGUIAppTraits::TerminateGui(unsigned long ulHab) wxToolkitInfo & wxGUIAppTraits::GetToolkitInfo() { - static wxToolkitInfo vInfo; + static wxToolkitInfo vInfo; ULONG ulSysInfo[QSV_MAX] = {0}; APIRET ulrc; @@ -512,44 +511,40 @@ wxToolkitInfo & wxGUIAppTraits::GetToolkitInfo() // window information functions // --------------------------------------------------------------------------- -wxString WXDLLEXPORT wxGetWindowText( - WXHWND hWnd -) +wxString WXDLLEXPORT wxGetWindowText( WXHWND hWnd ) { - wxString vStr; + wxString vStr; if ( hWnd ) { - long lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1; - ::WinQueryWindowText((HWND)hWnd, lLen, (PSZ)(wxChar*)wxStringBuffer(vStr, lLen)); + long lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1; + ::WinQueryWindowText((HWND)hWnd, lLen, (PSZ)(wxChar*)wxStringBuffer(vStr, lLen)); } return vStr; } -wxString WXDLLEXPORT wxGetWindowClass( - WXHWND hWnd -) +wxString WXDLLEXPORT wxGetWindowClass( WXHWND hWnd ) { - wxString vStr; + wxString vStr; if ( hWnd ) { - int nLen = 256; // some starting value - - for ( ;; ) - { - int nCount = ::WinQueryClassName((HWND)hWnd, nLen, (PSZ)(wxChar*)wxStringBuffer(vStr, nLen)); - - if (nCount == nLen ) - { - // the class name might have been truncated, retry with larger - // buffer - nLen *= 2; - } - else - { - break; - } + int nLen = 256; // some starting value + + for ( ;; ) + { + int nCount = ::WinQueryClassName((HWND)hWnd, nLen, (PSZ)(wxChar*)wxStringBuffer(vStr, nLen)); + + if (nCount == nLen ) + { + // the class name might have been truncated, retry with larger + // buffer + nLen *= 2; + } + else + { + break; + } } } return vStr;