Bug 819280 - Change NS_ASSERTION to MOZ_STATIC_ASSERT r=trev.saunders

This commit is contained in:
Jacek Caban 2012-12-17 12:19:09 +01:00
parent 0e7d953641
commit 8cda41fce3
2 changed files with 4 additions and 8 deletions

View File

@ -1562,12 +1562,10 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
{
uint32_t eventType = aEvent->GetEventType();
NS_ENSURE_TRUE(eventType > 0 &&
eventType < nsIAccessibleEvent::EVENT_LAST_ENTRY,
NS_ERROR_FAILURE);
MOZ_STATIC_ASSERT(sizeof(gWinEventMap)/sizeof(gWinEventMap[0]) == nsIAccessibleEvent::EVENT_LAST_ENTRY,
"MSAA event map skewed");
NS_ASSERTION(gWinEventMap[nsIAccessibleEvent::EVENT_LAST_ENTRY] == kEVENT_LAST_ENTRY,
"MSAA event map skewed");
NS_ENSURE_TRUE(eventType > 0 && eventType < ArrayLength(gWinEventMap), NS_ERROR_FAILURE);
uint32_t winEvent = gWinEventMap[eventType];
if (!winEvent)

View File

@ -9,7 +9,6 @@
#include "AccessibleEventId.h"
const uint32_t kEVENT_WIN_UNKNOWN = 0x00000000;
const uint32_t kEVENT_LAST_ENTRY = 0xffffffff;
static const uint32_t gWinEventMap[] = {
kEVENT_WIN_UNKNOWN, // nsIAccessibleEvent doesn't have 0 constant
@ -98,7 +97,6 @@ static const uint32_t gWinEventMap[] = {
IA2_EVENT_HYPERTEXT_CHANGED, // nsIAccessibleEvent::EVENT_HYPERTEXT_CHANGED
IA2_EVENT_HYPERTEXT_NLINKS_CHANGED, // nsIAccessibleEvent::EVENT_HYPERTEXT_NLINKS_CHANGED
IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED, // nsIAccessibleEvent::EVENT_OBJECT_ATTRIBUTE_CHANGED
kEVENT_WIN_UNKNOWN, // nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED
kEVENT_LAST_ENTRY // nsIAccessibleEvent::EVENT_LAST_ENTRY
kEVENT_WIN_UNKNOWN // nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED
};