Bugzilla Bug 281158: make WillBitBlit return nsresult instead of void to

work around an internal compiler error of Visual C++ 6.0 SP5 (without
Processor Pack) and SP6, and eMbedded Visual C++ 4.0 SP4. r=dougt,sr=dbaron
Modified files: nsViewManager.cpp nsViewManager.h
This commit is contained in:
wtchang%redhat.com 2005-09-30 23:10:09 +00:00
Родитель 2bfdb7f900
Коммит 7ee682518c
2 изменённых файлов: 20 добавлений и 12 удалений

Просмотреть файл

@ -1691,17 +1691,12 @@ AccumulateIntersectionsIntoDirtyRegion(nsView* aTargetView,
} }
} }
// This gets around an internal compiler error C1001 nsresult
// (compiler file 'E:\8799\vc98\p2\src\P2\main.c', line 494)
#ifdef WINCE
#pragma optimize( "", off )
#endif
void
nsViewManager::WillBitBlit(nsView* aView, nsPoint aScrollAmount) nsViewManager::WillBitBlit(nsView* aView, nsPoint aScrollAmount)
{ {
if (!IsRootVM()) { if (!IsRootVM()) {
RootViewManager()->WillBitBlit(aView, aScrollAmount); RootViewManager()->WillBitBlit(aView, aScrollAmount);
return; return NS_OK;
} }
NS_PRECONDITION(aView, "Must have a view"); NS_PRECONDITION(aView, "Must have a view");
@ -1712,11 +1707,8 @@ nsViewManager::WillBitBlit(nsView* aView, nsPoint aScrollAmount)
// Since the view is actually moving the widget by -aScrollAmount, that's the // Since the view is actually moving the widget by -aScrollAmount, that's the
// offset we want to use when accumulating dirty rects. // offset we want to use when accumulating dirty rects.
AccumulateIntersectionsIntoDirtyRegion(aView, GetRootView(), -aScrollAmount); AccumulateIntersectionsIntoDirtyRegion(aView, GetRootView(), -aScrollAmount);
return NS_OK;
} }
#ifdef WINCE
#pragma optimize( "", on )
#endif
// Invalidate all widgets which overlap the view, other than the view's own widgets. // Invalidate all widgets which overlap the view, other than the view's own widgets.
void void

Просмотреть файл

@ -468,8 +468,24 @@ public: // NOT in nsIViewManager, so private to the view module
* Called to inform the view manager that a view is about to bit-blit. * Called to inform the view manager that a view is about to bit-blit.
* @param aView the view that will bit-blit * @param aView the view that will bit-blit
* @param aScrollAmount how much aView will scroll by * @param aScrollAmount how much aView will scroll by
* @return always returns NS_OK
* @note
* This method used to return void, but MSVC 6.0 SP5 (without the
* Processor Pack) and SP6, and the MS eMbedded Visual C++ 4.0 SP4
* (for WINCE) hit an internal compiler error when compiling this
* method:
*
* @par
* fatal error C1001: INTERNAL COMPILER ERROR
* (compiler file 'E:\8966\vc98\p2\src\P2\main.c', line 494)
*
* @par
* Making the method return nsresult worked around the internal
* compiler error. See Bugzilla bug 281158. (The WINCE internal
* compiler error was addressed by the patch in bug 291229 comment
* 14 although the bug report did not mention the problem.)
*/ */
void WillBitBlit(nsView* aView, nsPoint aScrollAmount); nsresult WillBitBlit(nsView* aView, nsPoint aScrollAmount);
/** /**
* Called to inform the view manager that a view has scrolled. * Called to inform the view manager that a view has scrolled.