| Index: src/plugin/PluginClass.cpp |
| =================================================================== |
| --- a/src/plugin/PluginClass.cpp |
| +++ b/src/plugin/PluginClass.cpp |
| @@ -52,7 +52,38 @@ |
| std::map<UINT,std::wstring> CPluginClass::s_menuDomains; |
| #endif |
| +//------------------------------------------------------- |
| +// Rectangle |
| +//------------------------------------------------------- |
| +namespace { |
|
Oleksandr
2014/07/09 19:29:08
Nit: New line before {
|
| + // Without an extra namespace within the anonymous one, the identifier "Rectangle" is ambiguous |
|
Felix Dahlke
2014/07/10 04:49:03
Hm, guess it conflicts with this one?
http://msdn
Eric
2014/07/23 11:25:05
FYI. This URL is exhibited a defect in the code re
Eric
2014/07/23 12:03:18
Well, the base class is "RECT", and it doesn't see
|
| + namespace Local { |
|
Oleksandr
2014/07/09 19:29:08
Nit: New line before {
|
| + /** |
| + * Replacement for ATL type CRect. |
| + */ |
| + class Rectangle |
| + : public RECT |
| + { |
| + public: |
| + // C++11 noexcept |
|
Felix Dahlke
2014/07/10 04:49:03
I guess you're marking this so we can make it noex
Eric
2014/07/23 11:25:05
Yes.
|
| + inline int Height() const |
|
Felix Dahlke
2014/07/10 04:49:03
inline is redundant here, since this will only be
|
| + { |
| + return bottom - top; |
| + } |
| + |
| + // C++11 noexcept |
| + inline int Width() const |
| + { |
| + return right - left; |
| + } |
| + }; |
| + } |
| +} |
| + |
| +//------------------------------------------------------- |
| +// CPluginClass |
|
Felix Dahlke
2014/07/10 04:49:03
We don't do class headers like this usually, I per
Oleksandr
2014/07/14 07:56:21
Visually I think it makes sense, and sometimes it'
|
| +//------------------------------------------------------- |
| CPluginClass::CPluginClass() |
| { |
| //Use this line to debug memory leaks |
| @@ -949,7 +980,7 @@ |
| } |
| // Calculate pane height |
| - CRect rcStatusBar; |
| + Local::Rectangle rcStatusBar; |
| ::GetClientRect(hWndStatusBar, &rcStatusBar); |
| if (rcStatusBar.Height() > 0) |
| @@ -1561,10 +1592,10 @@ |
| } |
| LRESULT hRet = CallWindowProc(pClass->m_pWndProcStatus, hWnd, message, wParam, (LPARAM)lpParts); |
| - CRect rcPane; |
| + Local::Rectangle rcPane; |
| ::SendMessage(hWnd, SB_GETRECT, STATUSBAR_PANE_NUMBER, (LPARAM)&rcPane); |
| - CRect rcClient; |
| + Local::Rectangle rcClient; |
| ::GetClientRect(hWnd, &rcClient); |
| ::MoveWindow( |
| @@ -1651,7 +1682,7 @@ |
| PAINTSTRUCT ps; |
| HDC hDC = ::BeginPaint(hWnd, &ps); |
| - CRect rcClient; |
| + Local::Rectangle rcClient; |
| ::GetClientRect(hWnd, &rcClient); |
| int nDrawEdge = 0; |
| @@ -1673,7 +1704,7 @@ |
| // Draw background |
| if (pfnDrawThemeBackground) |
| { |
| - CRect rc = rcClient; |
| + Local::Rectangle rc = rcClient; |
| rc.right -= 2; |
| pfnDrawThemeBackground(pClass->m_hTheme, hDC, 0, 0, &rc, NULL); |
| } |
| @@ -1713,7 +1744,7 @@ |
| HFONT hFont = (HFONT)::SendMessage(pClass->m_hStatusBarWnd, WM_GETFONT, 0, 0); |
| HGDIOBJ hOldFont = ::SelectObject(hDC,hFont); |
| - CRect rcText = rcClient; |
| + Local::Rectangle rcText = rcClient; |
| rcText.left += offx; |
| ::SetBkMode(hDC, TRANSPARENT); |
| ::DrawTextW(hDC, IEPLUGIN_VERSION, -1, &rcText, DT_WORD_ELLIPSIS|DT_LEFT|DT_SINGLELINE|DT_VCENTER); |