Don't take the address of temporary values to appease MSVC /W4
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Jul 2007 04:52:32 +0000 (04:52 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Jul 2007 04:52:32 +0000 (04:52 +0000)
Reviewed by Oliver.

No regression test possible.

* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenu::invalidateItem):
(WebCore::PopupMenu::valueChanged):
(WebCore::PopupWndProc):
* platform/win/ScrollViewWin.cpp:
(WebCore::ScrollView::ScrollViewPrivate::scrollBackingStore):
* platform/win/UniscribeController.cpp:
(WebCore::UniscribeController::shapeAndPlaceItem):
* platform/win/WidgetWin.cpp:
(WebCore::Widget::invalidateRect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23901 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/win/PopupMenuWin.cpp
WebCore/platform/win/ScrollViewWin.cpp
WebCore/platform/win/UniscribeController.cpp
WebCore/platform/win/WidgetWin.cpp

index 292cd72af402360aa91bf71cc9211a700565490a..39a077980af73e9b8fb26422b2f55b0edb280b07 100644 (file)
@@ -1,5 +1,24 @@
 2007-06-30  Adam Roben  <aroben@apple.com>
 
+        Don't take the address of temporary values to appease MSVC /W4
+
+        Reviewed by Oliver.
+
+        No regression test possible.
+
+        * platform/win/PopupMenuWin.cpp:
+        (WebCore::PopupMenu::invalidateItem):
+        (WebCore::PopupMenu::valueChanged):
+        (WebCore::PopupWndProc):
+        * platform/win/ScrollViewWin.cpp:
+        (WebCore::ScrollView::ScrollViewPrivate::scrollBackingStore):
+        * platform/win/UniscribeController.cpp:
+        (WebCore::UniscribeController::shapeAndPlaceItem):
+        * platform/win/WidgetWin.cpp:
+        (WebCore::Widget::invalidateRect):
+
+2007-06-29  Adam Roben  <aroben@apple.com>
+
         Make an int -> UINT conversion explicit that MSVC /W4 complains about
 
         Reviewed by John and Oliver.
index f98f8a40da9218c836788793ab3e0eece328dc2f..8add07d44a67a1288397ecdb643af7ec810d4614 100644 (file)
@@ -351,7 +351,8 @@ void PopupMenu::invalidateItem(int index)
     if (m_scrollBar)
         damageRect.setWidth(damageRect.width() - m_scrollBar->frameGeometry().width());
 
-    ::InvalidateRect(m_popup, &RECT(damageRect), TRUE);
+    RECT r = damageRect;
+    ::InvalidateRect(m_popup, &r, TRUE);
 }
 
 IntRect PopupMenu::clientRect() const
@@ -561,9 +562,12 @@ void PopupMenu::valueChanged(Scrollbar* scrollBar)
     IntRect listRect = clientRect();
     if (m_scrollBar)
         listRect.setWidth(listRect.width() - m_scrollBar->frameGeometry().width());
-    ::ScrollWindowEx(m_popup, 0, scrolledLines * m_itemHeight, &RECT(listRect), 0, 0, 0, flags);
-    if (m_scrollBar)
-        ::InvalidateRect(m_popup, &RECT(m_scrollBar->frameGeometry()), TRUE);
+    RECT r = listRect;
+    ::ScrollWindowEx(m_popup, 0, scrolledLines * m_itemHeight, &r, 0, 0, 0, flags);
+    if (m_scrollBar) {
+        r = m_scrollBar->frameGeometry();
+        ::InvalidateRect(m_popup, &r, TRUE);
+    }
     ::UpdateWindow(m_popup);
 }
 
@@ -765,7 +769,8 @@ static LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                         PlatformMouseEvent event(hWnd, message, wParam, MAKELPARAM(mousePoint.x(), mousePoint.y()));
                         popup->scrollBar()->handleMouseReleaseEvent(event);
                         // FIXME: This is a hack to work around PlatformScrollbar not invalidating correctly when it doesn't have a parent widget
-                        ::InvalidateRect(popup->popupHandle(), &RECT(scrollBarRect), TRUE);
+                        RECT r = scrollBarRect;
+                        ::InvalidateRect(popup->popupHandle(), &r, TRUE);
                         break;
                     }
                 }
index 78fb6daf6aeb62360d663c3956a8540f6dd79e70..41e91a9b3d4a07efd7436d076c44dbdf2b35c778 100644 (file)
@@ -151,7 +151,8 @@ void ScrollView::ScrollViewPrivate::scrollBackingStore(const IntSize& scrollDelt
     IntRect scrollViewRect = m_view->convertToContainingWindow(IntRect(0, 0, m_view->visibleWidth(), m_view->visibleHeight()));
     IntRect updateRect = clipRect;
     updateRect.intersect(scrollViewRect);
-    ::InvalidateRect(containingWindowHandle, &RECT(updateRect), false);
+    RECT r = updateRect;
+    ::InvalidateRect(containingWindowHandle, &r, false);
 
     if (!m_hasStaticBackground) // The main frame can just blit the WebView window
        // FIXME: Find a way to blit subframes without blitting overlapping content
index a3c9067bc1f8d64b5db23826bd8071433b44efe0..5d2cd436de9858288b559018eff3247a6713fabe 100644 (file)
@@ -377,8 +377,10 @@ bool UniscribeController::shapeAndPlaceItem(const UChar* cp, unsigned i, bool sm
         // FIXME: We need to take the GOFFSETS for combining glyphs and store them in the glyph buffer
         // as well, so that when the time comes to draw those glyphs, we can apply the appropriate
         // translation.
-        if (glyphBuffer)
-            glyphBuffer->add(glyph, fontData, advance, &FloatSize(offsetX, offsetY));
+        if (glyphBuffer) {
+            FloatSize size(offsetX, offsetY);
+            glyphBuffer->add(glyph, fontData, advance, &size);
+        }
 
         // Mutate the glyph array to contain our altered advances.
         if (m_computingOffsetPosition)
index dee61fad5b36dc9cb9f14d55e58afc09709cb07e..098efde016854be34c7cc3106ee8a372baa2afa6 100644 (file)
@@ -215,7 +215,8 @@ void Widget::invalidateRect(const IntRect& r)
         return;
 
     if (!parent()) {
-        ::InvalidateRect(containingWindow(), &RECT(r), false);
+        RECT rect = r;
+        ::InvalidateRect(containingWindow(), &rect, false);
         if (isFrameView())
             static_cast<FrameView*>(this)->addToDirtyRegion(r);
         return;
@@ -234,7 +235,8 @@ void Widget::invalidateRect(const IntRect& r)
     IntRect clipRect = windowClipRect();
     windowRect.intersect(clipRect);
 
-    ::InvalidateRect(containingWindow(), &RECT(windowRect), false);
+    RECT rect = windowRect;
+    ::InvalidateRect(containingWindow(), &rect, false);
     outermostView->addToDirtyRegion(windowRect);
 }