Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginClass.cpp

Issue 6215938672164864: [IE] Replace ATL::CRect (Closed)
Patch Set: hopefully final Created July 23, 2014, 4:28 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginClass.cpp
===================================================================
--- a/src/plugin/PluginClass.cpp
+++ b/src/plugin/PluginClass.cpp
@@ -49,6 +49,30 @@
std::map<UINT,CString> CPluginClass::s_menuDomains;
#endif
+/*
+ * Without namespace declaration, the identifier "Rectangle" is ambiguous
+ * See http://msdn.microsoft.com/en-us/library/windows/desktop/dd162898(v=vs.85).aspx
+ */
+namespace AdblockPlus
Felix Dahlke 2014/07/24 07:24:17 This would normally be an anonymous namespace, so
+{
+ /**
+ * Replacement for ATL type CRect.
+ */
+ class Rectangle
+ : public RECT
+ {
+ public:
+ int Height() const
+ {
+ return bottom - top;
+ }
+
+ int Width() const
+ {
+ return right - left;
+ }
+ };
+}
CPluginClass::CPluginClass()
{
@@ -944,7 +968,7 @@
}
// Calculate pane height
- CRect rcStatusBar;
+ AdblockPlus::Rectangle rcStatusBar;
::GetClientRect(hWndStatusBar, &rcStatusBar);
if (rcStatusBar.Height() > 0)
@@ -1575,10 +1599,10 @@
}
LRESULT hRet = CallWindowProc(pClass->m_pWndProcStatus, hWnd, message, wParam, (LPARAM)lpParts);
- CRect rcPane;
+ AdblockPlus::Rectangle rcPane;
::SendMessage(hWnd, SB_GETRECT, STATUSBAR_PANE_NUMBER, (LPARAM)&rcPane);
- CRect rcClient;
+ AdblockPlus::Rectangle rcClient;
::GetClientRect(hWnd, &rcClient);
::MoveWindow(
@@ -1665,7 +1689,7 @@
PAINTSTRUCT ps;
HDC hDC = ::BeginPaint(hWnd, &ps);
- CRect rcClient;
+ AdblockPlus::Rectangle rcClient;
::GetClientRect(hWnd, &rcClient);
int nDrawEdge = 0;
@@ -1687,7 +1711,7 @@
// Draw background
if (pfnDrawThemeBackground)
{
- CRect rc = rcClient;
+ AdblockPlus::Rectangle rc = rcClient;
rc.right -= 2;
pfnDrawThemeBackground(pClass->m_hTheme, hDC, 0, 0, &rc, NULL);
}
@@ -1727,7 +1751,7 @@
HFONT hFont = (HFONT)::SendMessage(pClass->m_hStatusBarWnd, WM_GETFONT, 0, 0);
HGDIOBJ hOldFont = ::SelectObject(hDC,hFont);
- CRect rcText = rcClient;
+ AdblockPlus::Rectangle rcText = rcClient;
rcText.left += offx;
::SetBkMode(hDC, TRANSPARENT);
::DrawTextW(hDC, IEPLUGIN_VERSION, -1, &rcText, DT_WORD_ELLIPSIS|DT_LEFT|DT_SINGLELINE|DT_VCENTER);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld