Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron

Landing on a CLOSED TREE
This commit is contained in:
Ehsan Akhgari 2011-10-17 10:59:28 -04:00
Родитель c91afb835d
Коммит 1deb9f1504
1968 изменённых файлов: 25639 добавлений и 25639 удалений

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

@ -347,7 +347,7 @@ void nsAccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink)
NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject");
if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) {
MaiHyperlink* maiHyperlink = GetMaiHyperlink(PR_FALSE);
MaiHyperlink* maiHyperlink = GetMaiHyperlink(false);
if (!maiHyperlink && !aMaiHyperlink) {
return; // Never set and we're shutting down
}
@ -1063,7 +1063,7 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
atk_focus_tracker_notify(atkObj);
// Fire state change event for focus
nsRefPtr<AccEvent> stateChangeEvent =
new AccStateChangeEvent(accessible, states::FOCUSED, PR_TRUE);
new AccStateChangeEvent(accessible, states::FOCUSED, true);
return FireAtkStateChangeEvent(stateChangeEvent, atkObj);
}
} break;
@ -1215,10 +1215,10 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
break;
case nsIAccessibleEvent::EVENT_SHOW:
return FireAtkShowHideEvent(aEvent, atkObj, PR_TRUE);
return FireAtkShowHideEvent(aEvent, atkObj, true);
case nsIAccessibleEvent::EVENT_HIDE:
return FireAtkShowHideEvent(aEvent, atkObj, PR_FALSE);
return FireAtkShowHideEvent(aEvent, atkObj, false);
/*
* Because dealing with menu is very different between nsIAccessible
@ -1239,7 +1239,7 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_ACTIVATED\n"));
nsRootAccessible *rootAcc =
static_cast<nsRootAccessible *>(accessible);
rootAcc->mActivated = PR_TRUE;
rootAcc->mActivated = true;
guint id = g_signal_lookup ("activate", MAI_TYPE_ATK_OBJECT);
g_signal_emit(atkObj, id, 0);
@ -1252,7 +1252,7 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_DEACTIVATED\n"));
nsRootAccessible *rootAcc =
static_cast<nsRootAccessible *>(accessible);
rootAcc->mActivated = PR_FALSE;
rootAcc->mActivated = false;
guint id = g_signal_lookup ("deactivate", MAI_TYPE_ATK_OBJECT);
g_signal_emit(atkObj, id, 0);
} break;
@ -1299,14 +1299,14 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
case nsIAccessibleEvent::EVENT_MENUPOPUP_START:
MAI_LOG_DEBUG(("\n\nReceived: EVENT_MENUPOPUP_START\n"));
atk_focus_tracker_notify(atkObj); // fire extra focus event
atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, PR_TRUE);
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, PR_TRUE);
atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, true);
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, true);
break;
case nsIAccessibleEvent::EVENT_MENUPOPUP_END:
MAI_LOG_DEBUG(("\n\nReceived: EVENT_MENUPOPUP_END\n"));
atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, PR_FALSE);
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, PR_FALSE);
atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, false);
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, false);
break;
}

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

@ -756,7 +756,7 @@ bool
nsApplicationAccessibleWrap::AppendChild(nsAccessible *aChild)
{
if (!nsApplicationAccessible::AppendChild(aChild))
return PR_FALSE;
return false;
AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild);
atk_object_set_parent(atkAccessible, mAtkObject);
@ -776,7 +776,7 @@ nsApplicationAccessibleWrap::AppendChild(nsAccessible *aChild)
g_timeout_add(0, fireRootAccessibleAddedCB, eventData);
}
return PR_TRUE;
return true;
}
bool

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

@ -49,7 +49,7 @@
nsDocAccessibleWrap::
nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell) :
nsDocAccessible(aDocument, aRootContent, aShell), mActivated(PR_FALSE)
nsDocAccessible(aDocument, aRootContent, aShell), mActivated(false)
{
}

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

@ -257,7 +257,7 @@ getRunAttributesCB(AtkText *aText, gint aOffset,
nsCOMPtr<nsIPersistentProperties> attributes;
PRInt32 startOffset = 0, endOffset = 0;
nsresult rv = accText->GetTextAttributes(PR_FALSE, aOffset,
nsresult rv = accText->GetTextAttributes(false, aOffset,
&startOffset, &endOffset,
getter_AddRefs(attributes));
NS_ENSURE_SUCCESS(rv, nsnull);

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

@ -161,7 +161,7 @@ AccEvent::CaptureIsFromUserInput(EIsFromUserInput aIsFromUserInput)
#endif
if (aIsFromUserInput != eAutoDetect) {
mIsFromUserInput = aIsFromUserInput == eFromUserInput ? PR_TRUE : PR_FALSE;
mIsFromUserInput = aIsFromUserInput == eFromUserInput ? true : false;
return;
}

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

@ -355,7 +355,7 @@ private:
static PLDHashNumber HashKey(KeyTypePointer aKey)
{ return NS_PTR_TO_INT32(aKey) >> 2; }
enum { ALLOW_MEMMOVE = PR_TRUE };
enum { ALLOW_MEMMOVE = true };
protected:
nsCOMPtr<T> mKey;

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

@ -80,7 +80,7 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
}
// Get the text leaf accessible offset and invalidate cached offsets after it.
mTextOffset = mHyperText->GetChildOffset(mTextLeaf, PR_TRUE);
mTextOffset = mHyperText->GetChildOffset(mTextLeaf, true);
NS_ASSERTION(mTextOffset != -1,
"Text leaf hasn't offset within hyper text!");
@ -111,14 +111,14 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
if (strLen1 > 0) {
// Fire text change event for removal.
nsRefPtr<AccEvent> textRemoveEvent =
new AccTextChangeEvent(mHyperText, mTextOffset, str1, PR_FALSE);
new AccTextChangeEvent(mHyperText, mTextOffset, str1, false);
mDocument->FireDelayedAccessibleEvent(textRemoveEvent);
}
if (strLen2 > 0) {
// Fire text change event for insertion.
nsRefPtr<AccEvent> textInsertEvent =
new AccTextChangeEvent(mHyperText, mTextOffset, str2, PR_TRUE);
new AccTextChangeEvent(mHyperText, mTextOffset, str2, true);
mDocument->FireDelayedAccessibleEvent(textInsertEvent);
}

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

@ -91,7 +91,7 @@ private:
{
nsRefPtr<AccEvent> event =
new AccTextChangeEvent(mHyperText, mTextOffset + aAddlOffset,
aText, PR_TRUE);
aText, true);
aEvents.AppendElement(event);
}
@ -103,7 +103,7 @@ private:
{
nsRefPtr<AccEvent> event =
new AccTextChangeEvent(mHyperText, mTextOffset + aAddlOffset,
aText, PR_FALSE);
aText, false);
aEvents.AppendElement(event);
}

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

@ -319,7 +319,7 @@ NS_IMETHODIMP
nsARIAGridAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -342,7 +342,7 @@ nsARIAGridAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
}
} while ((row = rowIter.Next()));
*aIsSelected = PR_TRUE;
*aIsSelected = true;
return NS_OK;
}
@ -350,7 +350,7 @@ NS_IMETHODIMP
nsARIAGridAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -367,7 +367,7 @@ nsARIAGridAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
}
}
*aIsSelected = PR_TRUE;
*aIsSelected = true;
return NS_OK;
}
@ -376,7 +376,7 @@ nsARIAGridAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -392,7 +392,7 @@ nsARIAGridAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
return NS_OK;
}
*aIsSelected = PR_TRUE;
*aIsSelected = true;
return NS_OK;
}
@ -461,7 +461,7 @@ nsARIAGridAccessible::GetSelectedRowCount(PRUint32* aCount)
bool isRowSelected = true;
do {
if (!nsAccUtils::IsARIASelected(cell)) {
isRowSelected = PR_FALSE;
isRowSelected = false;
break;
}
} while ((cell = cellIter.Next()));
@ -496,14 +496,14 @@ nsARIAGridAccessible::GetSelectedCells(nsIArray **aCells)
if (nsAccUtils::IsARIASelected(row)) {
while ((cell = cellIter.Next()))
selCells->AppendElement(static_cast<nsIAccessible *>(cell), PR_FALSE);
selCells->AppendElement(static_cast<nsIAccessible *>(cell), false);
continue;
}
while ((cell = cellIter.Next())) {
if (nsAccUtils::IsARIASelected(cell))
selCells->AppendElement(static_cast<nsIAccessible *>(cell), PR_FALSE);
selCells->AppendElement(static_cast<nsIAccessible *>(cell), false);
}
}
@ -608,7 +608,7 @@ nsARIAGridAccessible::GetSelectedRowIndices(PRUint32 *arowCount,
bool isRowSelected = true;
do {
if (!nsAccUtils::IsARIASelected(cell)) {
isRowSelected = PR_FALSE;
isRowSelected = false;
break;
}
} while ((cell = cellIter.Next()));
@ -661,13 +661,13 @@ nsARIAGridAccessible::SelectColumn(PRInt32 aColumn)
nsAccessible *row = nsnull;
while ((row = rowIter.Next())) {
// Unselect all cells in the row.
nsresult rv = SetARIASelected(row, PR_FALSE);
nsresult rv = SetARIASelected(row, false);
NS_ENSURE_SUCCESS(rv, rv);
// Select cell at the column index.
nsAccessible *cell = GetCellInRowAt(row, aColumn);
if (cell) {
rv = SetARIASelected(cell, PR_TRUE);
rv = SetARIASelected(cell, true);
NS_ENSURE_SUCCESS(rv, rv);
}
}
@ -684,7 +684,7 @@ nsARIAGridAccessible::UnselectRow(PRInt32 aRow)
nsAccessible *row = GetRowAt(aRow);
NS_ENSURE_ARG(row);
return SetARIASelected(row, PR_FALSE);
return SetARIASelected(row, false);
}
NS_IMETHODIMP
@ -701,7 +701,7 @@ nsARIAGridAccessible::UnselectColumn(PRInt32 aColumn)
while ((row = rowIter.Next())) {
nsAccessible *cell = GetCellInRowAt(row, aColumn);
if (cell) {
nsresult rv = SetARIASelected(cell, PR_FALSE);
nsresult rv = SetARIASelected(cell, false);
NS_ENSURE_SUCCESS(rv, rv);
}
}
@ -713,7 +713,7 @@ NS_IMETHODIMP
nsARIAGridAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
{
NS_ENSURE_ARG_POINTER(aIsProbablyForLayout);
*aIsProbablyForLayout = PR_FALSE;
*aIsProbablyForLayout = false;
return NS_OK;
}
@ -725,7 +725,7 @@ bool
nsARIAGridAccessible::IsValidRow(PRInt32 aRow)
{
if (aRow < 0)
return PR_FALSE;
return false;
PRInt32 rowCount = 0;
GetRowCount(&rowCount);
@ -736,7 +736,7 @@ bool
nsARIAGridAccessible::IsValidColumn(PRInt32 aColumn)
{
if (aColumn < 0)
return PR_FALSE;
return false;
PRInt32 colCount = 0;
GetColumnCount(&colCount);
@ -747,12 +747,12 @@ bool
nsARIAGridAccessible::IsValidRowNColumn(PRInt32 aRow, PRInt32 aColumn)
{
if (aRow < 0 || aColumn < 0)
return PR_FALSE;
return false;
PRInt32 rowCount = 0;
GetRowCount(&rowCount);
if (aRow >= rowCount)
return PR_FALSE;
return false;
PRInt32 colCount = 0;
GetColumnCount(&colCount);
@ -822,7 +822,7 @@ nsARIAGridAccessible::SetARIASelected(nsAccessible *aAccessible,
nsAccessible *cell = nsnull;
while ((cell = cellIter.Next())) {
rv = SetARIASelected(cell, PR_FALSE, PR_FALSE);
rv = SetARIASelected(cell, false, false);
NS_ENSURE_SUCCESS(rv, rv);
}
return NS_OK;
@ -838,14 +838,14 @@ nsARIAGridAccessible::SetARIASelected(nsAccessible *aAccessible,
if (row && row->Role() == nsIAccessibleRole::ROLE_ROW &&
nsAccUtils::IsARIASelected(row)) {
rv = SetARIASelected(row, PR_FALSE, PR_FALSE);
rv = SetARIASelected(row, false, false);
NS_ENSURE_SUCCESS(rv, rv);
AccIterator cellIter(row, filters::GetCell);
nsAccessible *cell = nsnull;
while ((cell = cellIter.Next())) {
if (cell != aAccessible) {
rv = SetARIASelected(cell, PR_TRUE, PR_FALSE);
rv = SetARIASelected(cell, true, false);
NS_ENSURE_SUCCESS(rv, rv);
}
}
@ -882,7 +882,7 @@ nsARIAGridAccessible::GetSelectedColumnsArray(PRUint32 *acolumnCount,
nsTArray<bool> isColSelArray(selColCount);
isColSelArray.AppendElements(selColCount);
for (PRInt32 i = 0; i < selColCount; i++)
isColSelArray[i] = PR_TRUE;
isColSelArray[i] = true;
do {
if (nsAccUtils::IsARIASelected(row))
@ -893,9 +893,9 @@ nsARIAGridAccessible::GetSelectedColumnsArray(PRUint32 *acolumnCount,
AccIterator cellIter(row, filters::GetCell);
nsAccessible *cell = nsnull;
for (colIdx = 0; (cell = cellIter.Next()); colIdx++) {
if (isColSelArray.SafeElementAt(colIdx, PR_FALSE) &&
if (isColSelArray.SafeElementAt(colIdx, false) &&
!nsAccUtils::IsARIASelected(cell)) {
isColSelArray[colIdx] = PR_FALSE;
isColSelArray[colIdx] = false;
selColCount--;
}
}
@ -1095,7 +1095,7 @@ NS_IMETHODIMP
nsARIAGridCellAccessible::IsSelected(bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -1107,7 +1107,7 @@ nsARIAGridCellAccessible::IsSelected(bool *aIsSelected)
if (!nsAccUtils::IsARIASelected(row) && !nsAccUtils::IsARIASelected(this))
return NS_OK;
*aIsSelected = PR_TRUE;
*aIsSelected = true;
return NS_OK;
}

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

@ -613,11 +613,11 @@ nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
// eARIACheckableBool
nsStateMapEntry(&nsGkAtoms::aria_checked, kBoolType,
states::CHECKABLE, states::CHECKED, 0, PR_TRUE),
states::CHECKABLE, states::CHECKED, 0, true),
// eARIACheckableMixed
nsStateMapEntry(&nsGkAtoms::aria_checked, kMixedType,
states::CHECKABLE, states::CHECKED, 0, PR_TRUE),
states::CHECKABLE, states::CHECKED, 0, true),
// eARIACheckedMixed
nsStateMapEntry(&nsGkAtoms::aria_checked, kMixedType,
@ -641,7 +641,7 @@ nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
// eARIAMultiline
nsStateMapEntry(&nsGkAtoms::aria_multiline, kBoolType,
0, states::MULTI_LINE, states::SINGLE_LINE, PR_TRUE),
0, states::MULTI_LINE, states::SINGLE_LINE, true),
// eARIAMultiSelectable
nsStateMapEntry(&nsGkAtoms::aria_multiselectable, kBoolType,
@ -662,7 +662,7 @@ nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
// eARIAReadonlyOrEditable
nsStateMapEntry(&nsGkAtoms::aria_readonly, kBoolType,
0, states::READONLY, states::EDITABLE, PR_TRUE),
0, states::READONLY, states::EDITABLE, true),
// eARIARequired
nsStateMapEntry(&nsGkAtoms::aria_required, kBoolType,
@ -670,7 +670,7 @@ nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
// eARIASelectable
nsStateMapEntry(&nsGkAtoms::aria_selected, kBoolType,
states::SELECTABLE, states::SELECTED, 0, PR_TRUE)
states::SELECTABLE, states::SELECTED, 0, true)
};
/**
@ -739,7 +739,7 @@ PRUint32 nsARIAMap::gWAIUnivAttrMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIUnivA
nsStateMapEntry::nsStateMapEntry() :
mAttributeName(nsnull),
mIsToken(PR_FALSE),
mIsToken(false),
mPermanentState(0),
mValue1(nsnull),
mState1(0),
@ -748,7 +748,7 @@ nsStateMapEntry::nsStateMapEntry() :
mValue3(nsnull),
mState3(0),
mDefaultState(0),
mDefinedIfAbsent(PR_FALSE)
mDefinedIfAbsent(false)
{}
nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName, eStateValueType aType,
@ -757,7 +757,7 @@ nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName, eStateValueType aType,
PRUint64 aFalseState,
bool aDefinedIfAbsent) :
mAttributeName(aAttrName),
mIsToken(PR_TRUE),
mIsToken(true),
mPermanentState(aPermanentState),
mValue1("false"),
mState1(aFalseState),
@ -778,11 +778,11 @@ nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName,
const char* aValue1, PRUint64 aState1,
const char* aValue2, PRUint64 aState2,
const char* aValue3, PRUint64 aState3) :
mAttributeName(aAttrName), mIsToken(PR_FALSE), mPermanentState(0),
mAttributeName(aAttrName), mIsToken(false), mPermanentState(0),
mValue1(aValue1), mState1(aState1),
mValue2(aValue2), mState2(aState2),
mValue3(aValue3), mState3(aState3),
mDefaultState(0), mDefinedIfAbsent(PR_FALSE)
mDefaultState(0), mDefinedIfAbsent(false)
{
}
@ -791,11 +791,11 @@ nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName,
const char* aValue1, PRUint64 aState1,
const char* aValue2, PRUint64 aState2,
const char* aValue3, PRUint64 aState3) :
mAttributeName(aAttrName), mIsToken(PR_TRUE), mPermanentState(0),
mAttributeName(aAttrName), mIsToken(true), mPermanentState(0),
mValue1(aValue1), mState1(aState1),
mValue2(aValue2), mState2(aState2),
mValue3(aValue3), mState3(aState3),
mDefaultState(0), mDefinedIfAbsent(PR_TRUE)
mDefaultState(0), mDefinedIfAbsent(true)
{
if (aDefaultStateRule == eUseFirstState)
mDefaultState = aState1;
@ -807,7 +807,7 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
{
// Return true if we should continue.
if (aStateMapEntryID == eARIANone)
return PR_FALSE;
return false;
const nsStateMapEntry& entry = nsARIAMap::gWAIStateMap[aStateMapEntryID];
@ -820,7 +820,7 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
*aState |= entry.mPermanentState;
if (entry.mState1)
*aState |= entry.mState1;
return PR_TRUE;
return true;
}
// We only have attribute state mappings for NMTOKEN (and boolean) based
@ -838,7 +838,7 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
if (entry.mPermanentState)
*aState &= ~entry.mPermanentState;
return PR_TRUE;
return true;
}
if (entry.mPermanentState)
@ -847,27 +847,27 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
nsAutoString attrValue;
if (!aContent->GetAttr(kNameSpaceID_None, *entry.mAttributeName, attrValue))
return PR_TRUE;
return true;
// Apply states for matched value. If no values was matched then apply default
// states.
bool applyDefaultStates = true;
if (entry.mValue1) {
if (attrValue.EqualsASCII(entry.mValue1)) {
applyDefaultStates = PR_FALSE;
applyDefaultStates = false;
if (entry.mState1)
*aState |= entry.mState1;
} else if (entry.mValue2) {
if (attrValue.EqualsASCII(entry.mValue2)) {
applyDefaultStates = PR_FALSE;
applyDefaultStates = false;
if (entry.mState2)
*aState |= entry.mState2;
} else if (entry.mValue3) {
if (attrValue.EqualsASCII(entry.mValue3)) {
applyDefaultStates = PR_FALSE;
applyDefaultStates = false;
if (entry.mState3)
*aState |= entry.mState3;
@ -882,5 +882,5 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
*aState |= entry.mDefaultState;
}
return PR_TRUE;
return true;
}

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

@ -119,12 +119,12 @@ nsAccDocManager::Init()
do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID);
if (!progress)
return PR_FALSE;
return false;
progress->AddProgressListener(static_cast<nsIWebProgressListener*>(this),
nsIWebProgress::NOTIFY_STATE_DOCUMENT);
return PR_TRUE;
return true;
}
void
@ -341,7 +341,7 @@ nsAccDocManager::AddListeners(nsIDocument *aDocument,
{
nsPIDOMWindow *window = aDocument->GetWindow();
nsIDOMEventTarget *target = window->GetChromeEventHandler();
nsEventListenerManager* elm = target->GetListenerManager(PR_TRUE);
nsEventListenerManager* elm = target->GetListenerManager(true);
elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
NS_EVENT_FLAG_CAPTURE);

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

@ -152,10 +152,10 @@ nsAccTreeWalker::PushState(nsIContent* aContent)
{
WalkState* nextToLastState = new WalkState(aContent);
if (!nextToLastState)
return PR_FALSE;
return false;
nextToLastState->prevState = mState;
mState = nextToLastState;
return PR_TRUE;
return true;
}

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

@ -330,9 +330,9 @@ nsAccUtils::HasDefinedARIAToken(nsIContent *aContent, nsIAtom *aAtom)
nsGkAtoms::_empty, eCaseMatters) ||
aContent->AttrValueIs(kNameSpaceID_None, aAtom,
nsGkAtoms::_undefined, eCaseMatters)) {
return PR_FALSE;
return false;
}
return PR_TRUE;
return true;
}
nsIAtom*
@ -593,13 +593,13 @@ nsAccUtils::GetLiveAttrValue(PRUint32 aRule, nsAString& aValue)
switch (aRule) {
case eOffLiveAttr:
aValue = NS_LITERAL_STRING("off");
return PR_TRUE;
return true;
case ePoliteLiveAttr:
aValue = NS_LITERAL_STRING("polite");
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
#ifdef DEBUG_A11Y
@ -613,14 +613,14 @@ nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible *aAccessible)
if (accDoc) {
// Don't test for accessible docs, it makes us create accessibles too
// early and fire mutation events before we need to
return PR_TRUE;
return true;
}
PRInt32 childCount = aAccessible->GetChildCount();
for (PRint32 childIdx = 0; childIdx < childCount; childIdx++) {
nsAccessible *child = GetChildAt(childIdx);
if (IsText(child)) {
foundText = PR_TRUE;
foundText = true;
break;
}
}
@ -629,10 +629,10 @@ nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible *aAccessible)
// found text child node
nsCOMPtr<nsIAccessibleText> text = do_QueryObject(aAccessible);
if (!text)
return PR_FALSE;
return false;
}
return PR_TRUE;
return true;
}
#endif
@ -726,7 +726,7 @@ nsAccUtils::GetHeaderCellsFor(nsIAccessibleTable *aTable,
role == nsIAccessibleRole::ROLE_COLUMNHEADER;
if (isHeader)
cells->AppendElement(cell, PR_FALSE);
cells->AppendElement(cell, false);
}
}

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

@ -146,7 +146,7 @@ public:
* property is not present, or is "" or "undefined". Do not call
* this method for properties of type string, decimal, IDREF or IDREFS.
*
* Return PR_TRUE if the ARIA property is defined, otherwise PR_FALSE
* Return true if the ARIA property is defined, otherwise false
*/
static bool HasDefinedARIAToken(nsIContent *aContent, nsIAtom *aAtom);

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

@ -106,7 +106,7 @@ nsAccessNode::
mContent(aContent), mWeakShell(aShell)
{
#ifdef DEBUG_A11Y
mIsInitialized = PR_FALSE;
mIsInitialized = false;
#endif
}
@ -138,7 +138,7 @@ nsAccessNode::IsDefunct() const
bool
nsAccessNode::Init()
{
return PR_TRUE;
return true;
}
@ -201,7 +201,7 @@ void nsAccessNode::InitXPAccessibility()
prefBranch->GetBoolPref("browser.formfill.enable", &gIsFormFillEnabled);
}
NotifyA11yInitOrShutdown(PR_TRUE);
NotifyA11yInitOrShutdown(true);
}
// nsAccessNode protected static
@ -235,7 +235,7 @@ void nsAccessNode::ShutdownXPAccessibility()
NS_RELEASE(gApplicationAccessible);
}
NotifyA11yInitOrShutdown(PR_FALSE);
NotifyA11yInitOrShutdown(false);
}
already_AddRefed<nsIPresShell>
@ -437,7 +437,7 @@ nsAccessNode::GetCurrentFocus()
nsCOMPtr<nsIDOMElement> focusedElement;
nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
if (fm)
fm->GetFocusedElementForWindow(win, PR_TRUE, getter_AddRefs(focusedWindow),
fm->GetFocusedElementForWindow(win, true, getter_AddRefs(focusedWindow),
getter_AddRefs(focusedElement));
nsINode *focusedNode = nsnull;

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

@ -884,24 +884,24 @@ static bool HasRelatedContent(nsIContent *aContent)
{
nsAutoString id;
if (!aContent || !nsCoreUtils::GetID(aContent, id) || id.IsEmpty()) {
return PR_FALSE;
return false;
}
// If the given ID is referred by relation attribute then create an accessible
// for it. Take care of HTML elements only for now.
if (aContent->IsHTML() &&
nsAccUtils::GetDocAccessibleFor(aContent)->IsDependentID(id))
return PR_TRUE;
return true;
nsIContent *ancestorContent = aContent;
while ((ancestorContent = ancestorContent->GetParent()) != nsnull) {
if (ancestorContent->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant)) {
// ancestor has activedescendant property, this content could be active
return PR_TRUE;
return true;
}
}
return PR_FALSE;
return false;
}
nsAccessible*
@ -1102,20 +1102,20 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
}
// otherwise create ARIA based accessible.
tryTagNameOrFrame = PR_FALSE;
tryTagNameOrFrame = false;
break;
}
if (tableContent->Tag() == nsGkAtoms::table) {
// Stop before we are fooled by any additional table ancestors
// This table cell frameis part of a separate ancestor table.
tryTagNameOrFrame = PR_FALSE;
tryTagNameOrFrame = false;
break;
}
}
if (!tableContent)
tryTagNameOrFrame = PR_FALSE;
tryTagNameOrFrame = false;
}
if (roleMapEntry) {
@ -1230,21 +1230,21 @@ nsAccessibilityService::Init()
{
// Initialize accessible document manager.
if (!nsAccDocManager::Init())
return PR_FALSE;
return false;
// Add observers.
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();
if (!observerService)
return PR_FALSE;
return false;
observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE);
observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
// Initialize accessibility.
nsAccessNodeWrap::InitAccessibility();
gIsShutdown = PR_FALSE;
return PR_TRUE;
gIsShutdown = false;
return true;
}
void
@ -1266,7 +1266,7 @@ nsAccessibilityService::Shutdown()
NS_ASSERTION(!gIsShutdown, "Accessibility was shutdown already");
gIsShutdown = PR_TRUE;
gIsShutdown = true;
nsAccessNodeWrap::ShutdownAccessibility();
}

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

@ -273,7 +273,7 @@ private:
* A universal ARIA property is one that can be defined on any element even if there is no role.
*
* @param aContent The content node to test
* @return PR_TRUE if there is a universal ARIA property set on the node
* @return true if there is a universal ARIA property set on the node
*/
bool HasUniversalAriaProperty(nsIContent *aContent);

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

@ -272,7 +272,7 @@ nsAccessible::GetName(nsAString& aName)
}
if (rv != NS_OK_EMPTY_NAME)
aName.SetIsVoid(PR_TRUE);
aName.SetIsVoid(true);
return NS_OK;
}
@ -542,7 +542,7 @@ nsAccessible::GetChildren(nsIArray **aOutChildren)
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
nsIAccessible* child = GetChildAt(childIdx);
children->AppendElement(child, PR_FALSE);
children->AppendElement(child, false);
}
NS_ADDREF(*aOutChildren = children);
@ -552,7 +552,7 @@ nsAccessible::GetChildren(nsIArray **aOutChildren)
bool
nsAccessible::GetAllowsAnonChildAccessibles()
{
return PR_TRUE;
return true;
}
/* readonly attribute long childCount; */
@ -597,25 +597,25 @@ nsAccessible::IsVisible(bool* aIsOffscreen)
// otherwise it will be marked states::OFFSCREEN. The states::INVISIBLE flag
// is for elements which are programmatically hidden.
*aIsOffscreen = PR_TRUE;
*aIsOffscreen = true;
if (IsDefunct())
return PR_FALSE;
return false;
const PRUint16 kMinPixels = 12;
// Set up the variables we need, return false if we can't get at them all
nsCOMPtr<nsIPresShell> shell(GetPresShell());
if (!shell)
return PR_FALSE;
return false;
nsIFrame *frame = GetFrame();
if (!frame) {
return PR_FALSE;
return false;
}
// If visibility:hidden or visibility:collapsed then mark with STATE_INVISIBLE
if (!frame->GetStyleVisibility()->IsVisible())
{
return PR_FALSE;
return false;
}
// We don't use the more accurate GetBoundsRect, because that is more expensive
@ -649,14 +649,14 @@ nsAccessible::IsVisible(bool* aIsOffscreen)
if (isEmpty && !(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
// Consider zero area objects hidden unless they are absolutely positioned
// or floating and may have descendants that have a non-zero size
return PR_FALSE;
return false;
}
}
// The frame intersects the viewport, but we need to check the parent view chain :(
bool isVisible = nsCoreUtils::CheckVisibilityInParentChain(frame);
if (isVisible && rectVisibility == nsRectVisibility_kVisible) {
*aIsOffscreen = PR_FALSE;
*aIsOffscreen = false;
}
return isVisible;
}
@ -1036,10 +1036,10 @@ NS_IMETHODIMP nsAccessible::SetSelected(bool aSelect)
if (aSelect) {
return mContent->SetAttr(kNameSpaceID_None,
nsGkAtoms::aria_selected,
NS_LITERAL_STRING("true"), PR_TRUE);
NS_LITERAL_STRING("true"), true);
}
return mContent->UnsetAttr(kNameSpaceID_None,
nsGkAtoms::aria_selected, PR_TRUE);
nsGkAtoms::aria_selected, true);
}
}
@ -1060,7 +1060,7 @@ NS_IMETHODIMP nsAccessible::TakeSelection()
nsCOMPtr<nsIAccessibleSelectable> selectable = do_QueryInterface(multiSelect);
selectable->ClearSelection();
}
return SetSelected(PR_TRUE);
return SetSelected(true);
}
return NS_ERROR_FAILURE;
@ -1099,7 +1099,7 @@ nsAccessible::TakeFocus()
focusContent = ancestorContent;
focusContent->SetAttr(kNameSpaceID_None,
nsGkAtoms::aria_activedescendant,
id, PR_TRUE);
id, true);
}
}
}
@ -1376,7 +1376,7 @@ nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
// However, nodes in outer documents override nodes in inner documents:
// Outer doc author may want to override properties on a widget they used in an iframe
nsIContent *startContent = mContent;
while (PR_TRUE) {
while (true) {
NS_ENSURE_STATE(startContent);
nsIDocument *doc = startContent->GetDocument();
nsIContent* rootContent = nsCoreUtils::GetRoleContent(doc);
@ -1748,7 +1748,7 @@ nsAccessible::SetCurrentValue(double aValue)
nsAutoString newValue;
newValue.AppendFloat(aValue);
return mContent->SetAttr(kNameSpaceID_None,
nsGkAtoms::aria_valuenow, newValue, PR_TRUE);
nsGkAtoms::aria_valuenow, newValue, true);
}
/* void setName (in DOMString name); */
@ -2176,7 +2176,7 @@ nsAccessible::GetRelations(nsIArray **aRelations)
PRUint32 targets = 0;
relation->GetTargetsCount(&targets);
if (targets)
relations->AppendElement(relation, PR_FALSE);
relations->AppendElement(relation, false);
}
}
@ -2302,7 +2302,7 @@ NS_IMETHODIMP nsAccessible::RemoveChildFromSelection(PRInt32 aIndex)
NS_IMETHODIMP nsAccessible::IsChildSelected(PRInt32 aIndex, bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct() || !IsSelect())
return NS_ERROR_FAILURE;
@ -2327,7 +2327,7 @@ NS_IMETHODIMP
nsAccessible::SelectAllSelection(bool* aIsMultiSelect)
{
NS_ENSURE_ARG_POINTER(aIsMultiSelect);
*aIsMultiSelect = PR_FALSE;
*aIsMultiSelect = false;
if (IsDefunct() || !IsSelect())
return NS_ERROR_FAILURE;
@ -2420,7 +2420,7 @@ NS_IMETHODIMP
nsAccessible::GetValid(bool *aValid)
{
NS_ENSURE_ARG_POINTER(aValid);
*aValid = PR_FALSE;
*aValid = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -2434,7 +2434,7 @@ NS_IMETHODIMP
nsAccessible::GetSelected(bool *aSelected)
{
NS_ENSURE_ARG_POINTER(aSelected);
*aSelected = PR_FALSE;
*aSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -2569,26 +2569,26 @@ bool
nsAccessible::AppendChild(nsAccessible* aChild)
{
if (!aChild)
return PR_FALSE;
return false;
if (!mChildren.AppendElement(aChild))
return PR_FALSE;
return false;
if (!nsAccUtils::IsEmbeddedObject(aChild))
SetChildrenFlag(eMixedChildren);
aChild->BindToParent(this, mChildren.Length() - 1);
return PR_TRUE;
return true;
}
bool
nsAccessible::InsertChildAt(PRUint32 aIndex, nsAccessible* aChild)
{
if (!aChild)
return PR_FALSE;
return false;
if (!mChildren.InsertElementAt(aIndex, aChild))
return PR_FALSE;
return false;
for (PRUint32 idx = aIndex + 1; idx < mChildren.Length(); idx++) {
NS_ASSERTION(mChildren[idx]->mIndexInParent == idx - 1, "Accessible child index doesn't match");
@ -2601,23 +2601,23 @@ nsAccessible::InsertChildAt(PRUint32 aIndex, nsAccessible* aChild)
mEmbeddedObjCollector = nsnull;
aChild->BindToParent(this, aIndex);
return PR_TRUE;
return true;
}
bool
nsAccessible::RemoveChild(nsAccessible* aChild)
{
if (!aChild)
return PR_FALSE;
return false;
if (aChild->mParent != this || aChild->mIndexInParent == -1)
return PR_FALSE;
return false;
PRUint32 index = static_cast<PRUint32>(aChild->mIndexInParent);
if (index >= mChildren.Length() || mChildren[index] != aChild) {
NS_ERROR("Child is bound to parent but parent hasn't this child at its index!");
aChild->UnbindFromParent();
return PR_FALSE;
return false;
}
for (PRUint32 idx = index + 1; idx < mChildren.Length(); idx++) {
@ -2629,7 +2629,7 @@ nsAccessible::RemoveChild(nsAccessible* aChild)
mChildren.RemoveElementAt(index);
mEmbeddedObjCollector = nsnull;
return PR_TRUE;
return true;
}
nsAccessible*
@ -2808,7 +2808,7 @@ nsAccessible::SelectedItems()
AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
nsIAccessible* selected = nsnull;
while ((selected = iter.Next()))
selectedItems->AppendElement(selected, PR_FALSE);
selectedItems->AppendElement(selected, false);
nsIMutableArray* items = nsnull;
selectedItems.forget(&items);
@ -2863,7 +2863,7 @@ nsAccessible::AddItemToSelection(PRUint32 aIndex)
index++;
if (selected)
selected->SetSelected(PR_TRUE);
selected->SetSelected(true);
return static_cast<bool>(selected);
}
@ -2878,7 +2878,7 @@ nsAccessible::RemoveItemFromSelection(PRUint32 aIndex)
index++;
if (selected)
selected->SetSelected(PR_FALSE);
selected->SetSelected(false);
return static_cast<bool>(selected);
}
@ -2892,7 +2892,7 @@ nsAccessible::SelectAll()
AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
while((selectable = iter.Next())) {
success = true;
selectable->SetSelected(PR_TRUE);
selectable->SetSelected(true);
}
return success;
}
@ -2906,7 +2906,7 @@ nsAccessible::UnselectAll()
AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
while ((selected = iter.Next())) {
success = true;
selected->SetSelected(PR_FALSE);
selected->SetSelected(false);
}
return success;
}
@ -3065,7 +3065,7 @@ nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
nsCOMPtr<nsIDOMTreeWalker> walker;
domDoc->CreateTreeWalker(rootNode,
nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
nsnull, PR_FALSE, getter_AddRefs(walker));
nsnull, false, getter_AddRefs(walker));
NS_ENSURE_TRUE(walker, nsnull);
walker->SetCurrentNode(currentNode);

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

@ -318,7 +318,7 @@ bool
nsApplicationAccessible::Init()
{
mAppInfo = do_GetService("@mozilla.org/xre/app-info;1");
return PR_TRUE;
return true;
}
void

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

@ -95,8 +95,8 @@ nsLinkableAccessible::
nsLinkableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell),
mActionAcc(nsnull),
mIsLink(PR_FALSE),
mIsOnclick(PR_FALSE)
mIsLink(false),
mIsOnclick(false)
{
}
@ -186,8 +186,8 @@ nsLinkableAccessible::AccessKey() const
void
nsLinkableAccessible::Shutdown()
{
mIsLink = PR_FALSE;
mIsOnclick = PR_FALSE;
mIsLink = false;
mIsOnclick = false;
mActionAcc = nsnull;
nsAccessibleWrap::Shutdown();
}
@ -220,11 +220,11 @@ nsLinkableAccessible::BindToParent(nsAccessible* aParent,
// Cache action content.
mActionAcc = nsnull;
mIsLink = PR_FALSE;
mIsOnclick = PR_FALSE;
mIsLink = false;
mIsOnclick = false;
if (nsCoreUtils::HasClickListener(mContent)) {
mIsOnclick = PR_TRUE;
mIsOnclick = true;
return;
}
@ -235,14 +235,14 @@ nsLinkableAccessible::BindToParent(nsAccessible* aParent,
while ((walkUpAcc = walkUpAcc->Parent()) && !walkUpAcc->IsDoc()) {
if (walkUpAcc->Role() == nsIAccessibleRole::ROLE_LINK &&
walkUpAcc->State() & states::LINKED) {
mIsLink = PR_TRUE;
mIsLink = true;
mActionAcc = walkUpAcc;
return;
}
if (nsCoreUtils::HasClickListener(walkUpAcc->GetContent())) {
mActionAcc = walkUpAcc;
mIsOnclick = PR_TRUE;
mIsOnclick = true;
return;
}
}

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

@ -77,9 +77,9 @@ static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID);
bool
nsCoreUtils::HasClickListener(nsIContent *aContent)
{
NS_ENSURE_TRUE(aContent, PR_FALSE);
NS_ENSURE_TRUE(aContent, false);
nsEventListenerManager* listenerManager =
aContent->GetListenerManager(PR_FALSE);
aContent->GetListenerManager(false);
return listenerManager &&
(listenerManager->HasListenersFor(NS_LITERAL_STRING("click")) ||
@ -157,13 +157,13 @@ nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType,
{
nsIFrame *frame = aContent->GetPrimaryFrame();
if (!frame)
return PR_FALSE;
return false;
// Compute x and y coordinates.
nsPoint point;
nsCOMPtr<nsIWidget> widget = frame->GetNearestWidget(point);
if (!widget)
return PR_FALSE;
return false;
nsSize size = frame->GetSize();
@ -174,7 +174,7 @@ nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType,
// Fire mouse event.
DispatchMouseEvent(aEventType, x, y, aContent, frame, aPresShell, widget);
return PR_TRUE;
return true;
}
void
@ -182,7 +182,7 @@ nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType, PRInt32 aX, PRInt32 aY,
nsIContent *aContent, nsIFrame *aFrame,
nsIPresShell *aPresShell, nsIWidget *aRootWidget)
{
nsMouseEvent event(PR_TRUE, aEventType, aRootWidget,
nsMouseEvent event(true, aEventType, aRootWidget,
nsMouseEvent::eReal, nsMouseEvent::eNormal);
event.refPoint = nsIntPoint(aX, aY);
@ -285,16 +285,16 @@ nsCoreUtils::IsAncestorOf(nsINode *aPossibleAncestorNode,
nsINode *aPossibleDescendantNode,
nsINode *aRootNode)
{
NS_ENSURE_TRUE(aPossibleAncestorNode && aPossibleDescendantNode, PR_FALSE);
NS_ENSURE_TRUE(aPossibleAncestorNode && aPossibleDescendantNode, false);
nsINode *parentNode = aPossibleDescendantNode;
while ((parentNode = parentNode->GetNodeParent()) &&
parentNode != aRootNode) {
if (parentNode == aPossibleAncestorNode)
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
nsresult
@ -340,7 +340,7 @@ nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame,
selection->AddRange(scrollToRange);
privSel->ScrollIntoView(nsISelectionController::SELECTION_ANCHOR_REGION,
PR_TRUE, aVPercent, aHPercent);
true, aVPercent, aHPercent);
selection->CollapseToStart();
@ -505,7 +505,7 @@ nsCoreUtils::IsErrorPage(nsIDocument *aDocument)
bool isAboutScheme = false;
uri->SchemeIs("about", &isAboutScheme);
if (!isAboutScheme)
return PR_FALSE;
return false;
nsCAutoString path;
uri->GetPath(path);
@ -551,7 +551,7 @@ bool
nsCoreUtils::GetID(nsIContent *aContent, nsAString& aID)
{
nsIAtom *idAttribute = aContent->GetIDAttributeName();
return idAttribute ? aContent->GetAttr(kNameSpaceID_None, idAttribute, aID) : PR_FALSE;
return idAttribute ? aContent->GetAttr(kNameSpaceID_None, idAttribute, aID) : false;
}
bool
@ -564,18 +564,18 @@ nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsIAtom *aAttr, PRInt32 *aUInt)
PRInt32 integer = value.ToInteger(&error);
if (NS_SUCCEEDED(error) && integer > 0) {
*aUInt = integer;
return PR_TRUE;
return true;
}
}
return PR_FALSE;
return false;
}
bool
nsCoreUtils::IsXLink(nsIContent *aContent)
{
if (!aContent)
return PR_FALSE;
return false;
return aContent->AttrValueIs(kNameSpaceID_XLink, nsGkAtoms::type,
nsGkAtoms::simple, eCaseMatters) &&

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

@ -150,7 +150,7 @@ public:
* aPossibleAncestorNode
* @param aRootNode [in, optional] the root node that search
* search should be performed within
* @return PR_TRUE if aPossibleAncestorNode is an ancestor of
* @return true if aPossibleAncestorNode is an ancestor of
* aPossibleDescendantNode
*/
static bool IsAncestorOf(nsINode *aPossibleAncestorNode,
@ -274,7 +274,7 @@ public:
* Get the ID for an element, in some types of XML this may not be the ID attribute
* @param aContent Node to get the ID for
* @param aID Where to put ID string
* @return PR_TRUE if there is an ID set for this node
* @return true if there is an ID set for this node
*/
static bool GetID(nsIContent *aContent, nsAString& aID);
@ -289,7 +289,7 @@ public:
* Check if the given element is XLink.
*
* @param aContent the given element
* @return PR_TRUE if the given element is XLink
* @return true if the given element is XLink
*/
static bool IsXLink(nsIContent *aContent);

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

@ -587,7 +587,7 @@ nsDocAccessible::Init()
nsCOMPtr<nsIPresShell> shell(GetPresShell());
mNotificationController = new NotificationController(this, shell);
if (!mNotificationController)
return PR_FALSE;
return false;
// Mark the document accessible as loaded if its DOM document was loaded at
// this point (this can happen because a11y is started late or DOM document
@ -596,7 +596,7 @@ nsDocAccessible::Init()
mLoadState |= eDOMLoaded;
AddEventListeners();
return PR_TRUE;
return true;
}
void
@ -879,7 +879,7 @@ NS_IMETHODIMP nsDocAccessible::Observe(nsISupports *aSubject, const char *aTopic
// accessible object. See the AccStateChangeEvent constructor for details
// about this exceptional case.
nsRefPtr<AccEvent> event =
new AccStateChangeEvent(this, states::EDITABLE, PR_TRUE);
new AccStateChangeEvent(this, states::EDITABLE, true);
FireDelayedAccessibleEvent(event);
}
@ -1213,7 +1213,7 @@ void nsDocAccessible::ContentStateChanged(nsIDocument* aDocument,
if (aStateMask.HasState(NS_EVENT_STATE_INVALID)) {
nsRefPtr<AccEvent> event =
new AccStateChangeEvent(aContent, states::INVALID, PR_TRUE);
new AccStateChangeEvent(aContent, states::INVALID, true);
FireDelayedAccessibleEvent(event);
}
}
@ -1492,7 +1492,7 @@ nsDocAccessible::NotifyOfLoading(bool aIsReloading)
// Fire state busy change event. Use delayed event since we don't care
// actually if event isn't delivered when the document goes away like a shot.
nsRefPtr<AccEvent> stateEvent =
new AccStateChangeEvent(mDocument, states::BUSY, PR_TRUE);
new AccStateChangeEvent(mDocument, states::BUSY, true);
FireDelayedAccessibleEvent(stateEvent);
}
@ -1547,7 +1547,7 @@ nsDocAccessible::ProcessLoad()
// Fire busy state change event.
nsRefPtr<AccEvent> stateEvent =
new AccStateChangeEvent(this, states::BUSY, PR_FALSE);
new AccStateChangeEvent(this, states::BUSY, false);
nsEventShell::FireEvent(stateEvent);
}

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

@ -188,13 +188,13 @@ nsOuterDocAccessible::AppendChild(nsAccessible *aAccessible)
mChildren[0]->Shutdown();
if (!nsAccessible::AppendChild(aAccessible))
return PR_FALSE;
return false;
NS_LOG_ACCDOCCREATE("append document to outerdoc",
aAccessible->GetDocumentNode())
NS_LOG_ACCDOCCREATE_ACCADDRESS("outerdoc", this)
return PR_TRUE;
return true;
}
bool
@ -203,7 +203,7 @@ nsOuterDocAccessible::RemoveChild(nsAccessible *aAccessible)
nsAccessible *child = mChildren.SafeElementAt(0, nsnull);
if (child != aAccessible) {
NS_ERROR("Wrong child to remove!");
return PR_FALSE;
return false;
}
NS_LOG_ACCDOCDESTROY_FOR("remove document from outerdoc",

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

@ -260,7 +260,7 @@ nsresult nsRootAccessible::AddEventListeners()
* const* e_end = ArrayEnd(docEvents);
e < e_end; ++e) {
nsresult rv = nstarget->AddEventListener(NS_ConvertASCIItoUTF16(*e),
this, PR_TRUE, PR_TRUE, 2);
this, true, true, 2);
NS_ENSURE_SUCCESS(rv, rv);
}
}
@ -279,7 +279,7 @@ nsresult nsRootAccessible::RemoveEventListeners()
for (const char* const* e = docEvents,
* const* e_end = ArrayEnd(docEvents);
e < e_end; ++e) {
nsresult rv = target->RemoveEventListener(NS_ConvertASCIItoUTF16(*e), this, PR_TRUE);
nsresult rv = target->RemoveEventListener(NS_ConvertASCIItoUTF16(*e), this, true);
NS_ENSURE_SUCCESS(rv, rv);
}
}
@ -678,7 +678,7 @@ nsRootAccessible::HandlePopupShownEvent(nsAccessible* aAccessible)
if (comboboxRole == nsIAccessibleRole::ROLE_COMBOBOX ||
comboboxRole == nsIAccessibleRole::ROLE_AUTOCOMPLETE) {
nsRefPtr<AccEvent> event =
new AccStateChangeEvent(combobox, states::EXPANDED, PR_TRUE);
new AccStateChangeEvent(combobox, states::EXPANDED, true);
if (event)
nsEventShell::FireEvent(event);
}
@ -784,7 +784,7 @@ nsRootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
// Fire expanded state change event.
if (notifyOf & kNotifyOfState) {
nsRefPtr<AccEvent> event =
new AccStateChangeEvent(widget, states::EXPANDED, PR_FALSE);
new AccStateChangeEvent(widget, states::EXPANDED, false);
document->FireDelayedAccessibleEvent(event);
}
}

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

@ -234,7 +234,7 @@ nsTextAttrsMgr::GetRange(const nsTArray<nsITextAttr*>& aTextAttrArray,
for (PRUint32 attrIdx = 0; attrIdx < attrLen; attrIdx++) {
nsITextAttr *textAttr = aTextAttrArray[attrIdx];
if (!textAttr->Equal(currElm)) {
offsetFound = PR_TRUE;
offsetFound = true;
break;
}
}
@ -262,7 +262,7 @@ nsTextAttrsMgr::GetRange(const nsTArray<nsITextAttr*>& aTextAttrArray,
// Alter the end offset when text attribute changes its value and stop
// the search.
if (!textAttr->Equal(currElm)) {
offsetFound = PR_TRUE;
offsetFound = true;
break;
}
}
@ -336,19 +336,19 @@ nsCSSTextAttr::GetValueFor(nsIContent *aContent, nsAutoString *aValue)
nsCOMPtr<nsIDOMCSSStyleDeclaration> currStyleDecl =
nsCoreUtils::GetComputedStyleDeclaration(EmptyString(), aContent);
if (!currStyleDecl)
return PR_FALSE;
return false;
NS_ConvertASCIItoUTF16 cssName(gCSSTextAttrsMap[mIndex].mCSSName);
nsresult rv = currStyleDecl->GetPropertyValue(cssName, *aValue);
if (NS_FAILED(rv))
return PR_TRUE;
return true;
const char *cssValue = gCSSTextAttrsMap[mIndex].mCSSValue;
if (cssValue != kAnyValue && !aValue->EqualsASCII(cssValue))
return PR_FALSE;
return false;
return PR_TRUE;
return true;
}
void
@ -379,7 +379,7 @@ nsBGColorTextAttr::GetValueFor(nsIContent *aContent, nscolor *aValue)
{
nsIFrame *frame = aContent->GetPrimaryFrame();
if (!frame)
return PR_FALSE;
return false;
return GetColor(frame, aValue);
}
@ -407,20 +407,20 @@ nsBGColorTextAttr::GetColor(nsIFrame *aFrame, nscolor *aColor)
if (NS_GET_A(styleBackground->mBackgroundColor) > 0) {
*aColor = styleBackground->mBackgroundColor;
return PR_TRUE;
return true;
}
nsIFrame *parentFrame = aFrame->GetParent();
if (!parentFrame) {
*aColor = aFrame->PresContext()->DefaultBackgroundColor();
return PR_TRUE;
return true;
}
// Each frame of parents chain for the initially passed 'aFrame' has
// transparent background color. So background color isn't changed from
// 'mRootFrame' to initially passed 'aFrame'.
if (parentFrame == mRootFrame)
return PR_FALSE;
return false;
return GetColor(parentFrame, aColor);
}
@ -436,11 +436,11 @@ nsFontSizeTextAttr::nsFontSizeTextAttr(nsIFrame *aRootFrame, nsIFrame *aFrame) :
mDC = aRootFrame->PresContext()->DeviceContext();
mRootNativeValue = GetFontSize(aRootFrame);
mIsRootDefined = PR_TRUE;
mIsRootDefined = true;
if (aFrame) {
mNativeValue = GetFontSize(aFrame);
mIsDefined = PR_TRUE;
mIsDefined = true;
}
}
@ -449,10 +449,10 @@ nsFontSizeTextAttr::GetValueFor(nsIContent *aContent, nscoord *aValue)
{
nsIFrame *frame = aContent->GetPrimaryFrame();
if (!frame)
return PR_FALSE;
return false;
*aValue = GetFontSize(frame);
return PR_TRUE;
return true;
}
void
@ -493,11 +493,11 @@ nsFontWeightTextAttr::nsFontWeightTextAttr(nsIFrame *aRootFrame,
nsTextAttr<PRInt32>(aFrame == nsnull)
{
mRootNativeValue = GetFontWeight(aRootFrame);
mIsRootDefined = PR_TRUE;
mIsRootDefined = true;
if (aFrame) {
mNativeValue = GetFontWeight(aFrame);
mIsDefined = PR_TRUE;
mIsDefined = true;
}
}
@ -506,10 +506,10 @@ nsFontWeightTextAttr::GetValueFor(nsIContent *aContent, PRInt32 *aValue)
{
nsIFrame *frame = aContent->GetPrimaryFrame();
if (!frame)
return PR_FALSE;
return false;
*aValue = GetFontWeight(frame);
return PR_TRUE;
return true;
}
void

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

@ -188,10 +188,10 @@ public:
}
if (!isDefined)
return PR_FALSE;
return false;
Format(*nativeValue, aValue);
return PR_TRUE;
return true;
}
virtual bool Equal(nsIContent *aContent)
@ -200,7 +200,7 @@ public:
bool isDefined = GetValueFor(aContent, &nativeValue);
if (!mIsDefined && !isDefined)
return PR_TRUE;
return true;
if (mIsDefined && isDefined)
return nativeValue == mNativeValue;

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

@ -120,7 +120,7 @@ nsTextEquivUtils::AppendTextEquivFromContent(nsAccessible *aInitiatorAcc,
nsCOMPtr<nsIWeakReference> shell = nsCoreUtils::GetWeakShellFor(aContent);
if (!shell) {
NS_ASSERTION(PR_TRUE, "There is no presshell!");
NS_ASSERTION(true, "There is no presshell!");
gInitiatorAcc = nsnull;
return NS_ERROR_UNEXPECTED;
}
@ -139,7 +139,7 @@ nsTextEquivUtils::AppendTextEquivFromContent(nsAccessible *aInitiatorAcc,
GetAccService()->GetAccessibleInWeakShell(aContent, shell);
if (accessible) {
rv = AppendFromAccessible(accessible, aString);
goThroughDOMSubtree = PR_FALSE;
goThroughDOMSubtree = false;
}
}
@ -167,7 +167,7 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
const nsStyleDisplay* display = frame->GetStyleDisplay();
if (display->IsBlockOutside() ||
display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
isHTMLBlock = PR_TRUE;
isHTMLBlock = true;
if (!aString->IsEmpty()) {
aString->Append(PRUnichar(' '));
}
@ -250,7 +250,7 @@ nsTextEquivUtils::AppendFromAccessible(nsAccessible *aAccessible,
NS_ENSURE_SUCCESS(rv, rv);
if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
isEmptyTextEquiv = PR_FALSE;
isEmptyTextEquiv = false;
// Implementation of g) step of text equivalent computation guide. Go down
// into subtree if accessible allows "text equivalent from subtree rule" or
@ -262,7 +262,7 @@ nsTextEquivUtils::AppendFromAccessible(nsAccessible *aAccessible,
NS_ENSURE_SUCCESS(rv, rv);
if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
isEmptyTextEquiv = PR_FALSE;
isEmptyTextEquiv = false;
}
}
@ -382,13 +382,13 @@ nsTextEquivUtils::AppendString(nsAString *aString,
{
// Insert spaces to insure that words from controls aren't jammed together.
if (aTextEquivalent.IsEmpty())
return PR_FALSE;
return false;
if (!aString->IsEmpty())
aString->Append(PRUnichar(' '));
aString->Append(aTextEquivalent);
return PR_TRUE;
return true;
}
bool

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

@ -225,7 +225,7 @@ bool
nsHTMLImageAccessible::HasLongDesc()
{
if (IsDefunct())
return PR_FALSE;
return false;
return mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::longdesc);
}
@ -234,7 +234,7 @@ bool
nsHTMLImageAccessible::IsValidLongDescIndex(PRUint8 aIndex)
{
if (!HasLongDesc())
return PR_FALSE;
return false;
return aIndex == nsLinkableAccessible::ActionCount();
}

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

@ -182,7 +182,7 @@ bool
nsHTMLLinkAccessible::IsLinked()
{
if (IsDefunct())
return PR_FALSE;
return false;
nsEventStates state = mContent->AsElement()->State();
return state.HasAtLeastOneOfStates(NS_EVENT_STATE_VISITED |

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

@ -356,7 +356,7 @@ nsHTMLSelectOptionAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
if (childContent->NodeInfo()->Equals(mContent->NodeInfo())) {
if (!isContentFound) {
if (childContent == mContent)
isContentFound = PR_TRUE;
isContentFound = true;
posInSet++;
}

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

@ -248,7 +248,7 @@ NS_IMETHODIMP
nsHTMLTableCellAccessible::IsSelected(bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -328,7 +328,7 @@ nsHTMLTableCellAccessible::GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
if (headerCell && headerCell->Role() == desiredRole)
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
PR_FALSE);
false);
} while ((headerCellElm = iter.NextElem()));
NS_ADDREF(*aHeaderCells = headerCells);
@ -700,7 +700,7 @@ nsHTMLTableAccessible::GetSelectedCells(nsIArray **aCells)
nsCOMPtr<nsIContent> cellContent(do_QueryInterface(cellElement));
nsAccessible *cell =
GetAccService()->GetAccessibleInWeakShell(cellContent, mWeakShell);
selCells->AppendElement(static_cast<nsIAccessible*>(cell), PR_FALSE);
selCells->AppendElement(static_cast<nsIAccessible*>(cell), false);
}
}
}
@ -751,10 +751,10 @@ nsHTMLTableAccessible::GetSelectedCellIndices(PRUint32 *aNumCells,
if (NS_SUCCEEDED(rv) && startRowIndex == rowIndex &&
startColIndex == columnIndex && isSelected) {
states[index] = PR_TRUE;
states[index] = true;
(*aNumCells)++;
} else {
states[index] = PR_FALSE;
states[index] = false;
}
}
}
@ -1015,7 +1015,7 @@ NS_IMETHODIMP
nsHTMLTableAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
PRInt32 colCount = 0;
nsresult rv = GetColumnCount(&colCount);
@ -1045,7 +1045,7 @@ NS_IMETHODIMP
nsHTMLTableAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
PRInt32 rowCount = 0;
nsresult rv = GetRowCount(&rowCount);
@ -1076,7 +1076,7 @@ nsHTMLTableAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
nsITableLayout *tableLayout = GetTableLayout();
NS_ENSURE_STATE(tableLayout);
@ -1104,7 +1104,7 @@ nsHTMLTableAccessible::SelectRow(PRInt32 aRow)
nsresult rv =
RemoveRowsOrColumnsFromSelection(aRow,
nsISelectionPrivate::TABLESELECTION_ROW,
PR_TRUE);
true);
NS_ENSURE_SUCCESS(rv, rv);
return AddRowOrColumnToSelection(aRow,
@ -1120,7 +1120,7 @@ nsHTMLTableAccessible::SelectColumn(PRInt32 aColumn)
nsresult rv =
RemoveRowsOrColumnsFromSelection(aColumn,
nsISelectionPrivate::TABLESELECTION_COLUMN,
PR_TRUE);
true);
NS_ENSURE_SUCCESS(rv, rv);
return AddRowOrColumnToSelection(aColumn,
@ -1136,7 +1136,7 @@ nsHTMLTableAccessible::UnselectRow(PRInt32 aRow)
return
RemoveRowsOrColumnsFromSelection(aRow,
nsISelectionPrivate::TABLESELECTION_ROW,
PR_FALSE);
false);
}
NS_IMETHODIMP
@ -1148,7 +1148,7 @@ nsHTMLTableAccessible::UnselectColumn(PRInt32 aColumn)
return
RemoveRowsOrColumnsFromSelection(aColumn,
nsISelectionPrivate::TABLESELECTION_COLUMN,
PR_FALSE);
false);
}
nsresult
@ -1305,29 +1305,29 @@ nsHTMLTableAccessible::HasDescendant(const nsAString& aTagName,
bool aAllowEmpty)
{
nsCOMPtr<nsIDOMElement> tableElt(do_QueryInterface(mContent));
NS_ENSURE_TRUE(tableElt, PR_FALSE);
NS_ENSURE_TRUE(tableElt, false);
nsCOMPtr<nsIDOMNodeList> nodeList;
tableElt->GetElementsByTagName(aTagName, getter_AddRefs(nodeList));
NS_ENSURE_TRUE(nodeList, PR_FALSE);
NS_ENSURE_TRUE(nodeList, false);
nsCOMPtr<nsIDOMNode> foundItem;
nodeList->Item(0, getter_AddRefs(foundItem));
if (!foundItem)
return PR_FALSE;
return false;
if (aAllowEmpty)
return PR_TRUE;
return true;
// Make sure that the item we found has contents and either has multiple
// children or the found item is not a whitespace-only text node.
nsCOMPtr<nsIContent> foundItemContent = do_QueryInterface(foundItem);
if (foundItemContent->GetChildCount() > 1)
return PR_TRUE; // Treat multiple child nodes as non-empty
return true; // Treat multiple child nodes as non-empty
nsIContent *innerItemContent = foundItemContent->GetChildAt(0);
if (innerItemContent && !innerItemContent->TextIsOnlyWhitespace())
return PR_TRUE;
return true;
// If we found more than one node then return true not depending on
// aAllowEmpty flag.
@ -1493,7 +1493,7 @@ nsHTMLTableAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
lastRowColor = color;
styleDecl->GetPropertyValue(NS_LITERAL_STRING("background-color"), color);
if (rowCount > 0 && PR_FALSE == lastRowColor.Equals(color)) {
if (rowCount > 0 && false == lastRowColor.Equals(color)) {
RETURN_LAYOUT_ANSWER(false, "2 styles of row background color, non-bordered");
}
}

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

@ -216,7 +216,7 @@ nsIntRect nsHyperTextAccessible::GetBoundsForString(nsIFrame *aFrame, PRUint32 a
PRInt32 startContentOffsetInFrame;
// Get the right frame continuation -- not really a child, but a sibling of
// the primary frame passed in
rv = aFrame->GetChildFrameContainingOffset(startContentOffset, PR_FALSE,
rv = aFrame->GetChildFrameContainingOffset(startContentOffset, false,
&startContentOffsetInFrame, &frame);
NS_ENSURE_SUCCESS(rv, screenRect);
@ -367,7 +367,7 @@ nsHyperTextAccessible::GetPosAndText(PRInt32& aStartOffset, PRInt32& aEndOffset,
else {
contentOffset = startOffset;
}
frame->GetChildFrameContainingOffset(contentOffset, PR_TRUE,
frame->GetChildFrameContainingOffset(contentOffset, true,
&outStartLineUnused, &frame);
if (aEndFrame) {
*aEndFrame = frame; // We ended in the current frame
@ -930,7 +930,7 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
break;
case BOUNDARY_WORD_START:
needsStart = PR_TRUE;
needsStart = true;
amount = eSelectWord;
break;
@ -942,7 +942,7 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
// Newlines are considered at the end of a line. Since getting
// the BOUNDARY_LINE_START gets the text from the line-start to the next
// line-start, the newline is included at the end of the string.
needsStart = PR_TRUE;
needsStart = true;
amount = eSelectLine;
break;
@ -955,7 +955,7 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
case BOUNDARY_ATTRIBUTE_RANGE:
{
nsresult rv = GetTextAttributes(PR_FALSE, aOffset,
nsresult rv = GetTextAttributes(false, aOffset,
aStartOffset, aEndOffset, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
@ -1137,7 +1137,7 @@ nsHyperTextAccessible::GetTextAttributes(bool aIncludeDefAttrs,
// default attributes if they were requested, otherwise return empty set.
if (aOffset == 0) {
if (aIncludeDefAttrs) {
nsTextAttrsMgr textAttrsMgr(this, PR_TRUE, nsnull, -1);
nsTextAttrsMgr textAttrsMgr(this, true, nsnull, -1);
return textAttrsMgr.GetAttributes(*aAttributes);
}
return NS_OK;
@ -1194,7 +1194,7 @@ nsHyperTextAccessible::GetDefaultTextAttributes(nsIPersistentProperties **aAttri
NS_ADDREF(*aAttributes = attributes);
nsTextAttrsMgr textAttrsMgr(this, PR_TRUE);
nsTextAttrsMgr textAttrsMgr(this, true);
return textAttrsMgr.GetAttributes(*aAttributes);
}
@ -1353,7 +1353,7 @@ nsHyperTextAccessible::GetOffsetAtPoint(PRInt32 aX, PRInt32 aY,
if (pointInFrame.x < frameSize.width && pointInFrame.y < frameSize.height) {
// Finished
if (frame->GetType() == nsGkAtoms::textFrame) {
nsIFrame::ContentOffsets contentOffsets = frame->GetContentOffsetsFromPointExternal(pointInFrame, PR_TRUE);
nsIFrame::ContentOffsets contentOffsets = frame->GetContentOffsetsFromPointExternal(pointInFrame, true);
if (contentOffsets.IsNull() || contentOffsets.content != content) {
return NS_OK; // Not found, will return -1
}
@ -1858,7 +1858,7 @@ nsHyperTextAccessible::GetSelectionBounds(PRInt32 aSelectionNum,
*aStartOffset = 0; // Could not find start point within this hypertext, so starts before
}
DOMPointToHypertextOffset(endNode, endOffset, aEndOffset, PR_TRUE);
DOMPointToHypertextOffset(endNode, endOffset, aEndOffset, true);
return NS_OK;
}
@ -1906,7 +1906,7 @@ nsHyperTextAccessible::SetSelectionBounds(PRInt32 aSelectionNum,
rv = range->SetStart(startNode, startOffset);
NS_ENSURE_SUCCESS(rv, rv);
rv = isOnlyCaret ? range->Collapse(PR_TRUE) :
rv = isOnlyCaret ? range->Collapse(true) :
range->SetEnd(endNode, endOffset);
NS_ENSURE_SUCCESS(rv, rv);
@ -2041,7 +2041,7 @@ nsHyperTextAccessible::ScrollSubstringToPoint(PRInt32 aStartIndex,
vPercent, hPercent);
NS_ENSURE_SUCCESS(rv, rv);
initialScrolled = PR_TRUE;
initialScrolled = true;
} else {
// Substring was scrolled to the given point already inside its closest
// scrollable area. If there are nested scrollable areas then make
@ -2363,7 +2363,7 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
if (result == 1) { // range is before point
PRInt32 startHTOffset = 0;
nsresult rv = DOMRangeBoundToHypertextOffset(range, PR_FALSE, PR_TRUE,
nsresult rv = DOMRangeBoundToHypertextOffset(range, false, true,
&startHTOffset);
NS_ENSURE_SUCCESS(rv, rv);
@ -2372,7 +2372,7 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
} else if (result == -1) { // range is after point
PRInt32 endHTOffset = 0;
nsresult rv = DOMRangeBoundToHypertextOffset(range, PR_TRUE, PR_FALSE,
nsresult rv = DOMRangeBoundToHypertextOffset(range, true, false,
&endHTOffset);
NS_ENSURE_SUCCESS(rv, rv);
@ -2381,12 +2381,12 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
} else { // point is in range
PRInt32 startHTOffset = 0;
nsresult rv = DOMRangeBoundToHypertextOffset(range, PR_TRUE, PR_TRUE,
nsresult rv = DOMRangeBoundToHypertextOffset(range, true, true,
&startHTOffset);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 endHTOffset = 0;
rv = DOMRangeBoundToHypertextOffset(range, PR_FALSE, PR_FALSE,
rv = DOMRangeBoundToHypertextOffset(range, false, false,
&endHTOffset);
NS_ENSURE_SUCCESS(rv, rv);

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

@ -154,11 +154,11 @@ public:
* if >=0 and aNode is not text, this represents a child node offset
* @param aResultOffset - the character offset into the current
* nsHyperTextAccessible
* @param aIsEndOffset - if PR_TRUE, then then this offset is not inclusive. The character
* @param aIsEndOffset - if true, then then this offset is not inclusive. The character
* indicated by the offset returned is at [offset - 1]. This means
* if the passed-in offset is really in a descendant, then the offset returned
* will come just after the relevant embedded object characer.
* If PR_FALSE, then the offset is inclusive. The character indicated
* If false, then the offset is inclusive. The character indicated
* by the offset returned is at [offset]. If the passed-in offset in inside a
* descendant, then the returned offset will be on the relevant embedded object char.
*

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

@ -86,6 +86,6 @@ struct AccessibleWrapper {
return (bool)[object accessibilityIsIgnored];
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(PR_FALSE);
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
}
};

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

@ -64,16 +64,16 @@ bool
nsAccessibleWrap::Init ()
{
if (!nsAccessible::Init())
return PR_FALSE;
return false;
if (!mNativeWrapper && !AncestorIsFlat()) {
// Create our native object using the class type specified in GetNativeType().
mNativeWrapper = new AccessibleWrapper (this, GetNativeType());
if (!mNativeWrapper)
return PR_FALSE;
return false;
}
return PR_TRUE;
return true;
}
NS_IMETHODIMP
@ -234,12 +234,12 @@ nsAccessibleWrap::GetUnignoredChildCount(bool aDeepCount)
if (aDeepCount) {
// recursively count the unignored children of our children since it's a deep count.
resultChildCount += childAcc->GetUnignoredChildCount(PR_TRUE);
resultChildCount += childAcc->GetUnignoredChildCount(true);
} else {
// no deep counting, but if the child is ignored, we want to substitute it for its
// children.
if (childAcc->IsIgnored())
resultChildCount += childAcc->GetUnignoredChildCount(PR_FALSE);
resultChildCount += childAcc->GetUnignoredChildCount(false);
}
}
@ -316,10 +316,10 @@ nsAccessibleWrap::AncestorIsFlat()
nsAccessible* parent = Parent();
while (parent) {
if (nsAccUtils::MustPrune(parent))
return PR_TRUE;
return true;
parent = parent->Parent();
}
// no parent was flat
return PR_FALSE;
return false;
}

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

@ -54,7 +54,7 @@ bool
nsDocAccessibleWrap::Init ()
{
if (!nsDocAccessible::Init())
return PR_FALSE;
return false;
NS_ASSERTION(!mNativeWrapper, "nsDocAccessibleWrap::Init() called more than once!");
@ -62,8 +62,8 @@ nsDocAccessibleWrap::Init ()
// Create our native object using the class type specified in GetNativeType().
mNativeWrapper = new AccessibleWrapper (this, GetNativeType());
if (!mNativeWrapper)
return PR_FALSE;
return false;
}
return PR_TRUE;
return true;
}

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

@ -95,7 +95,7 @@ __try {
PRInt32 startOffset = 0, endOffset = 0;
nsCOMPtr<nsIPersistentProperties> attributes;
nsresult rv = textAcc->GetTextAttributes(PR_TRUE, aOffset,
nsresult rv = textAcc->GetTextAttributes(true, aOffset,
&startOffset, &endOffset,
getter_AddRefs(attributes));
if (NS_FAILED(rv))
@ -499,7 +499,7 @@ STDMETHODIMP
CAccessibleText::get_newText(IA2TextSegment *aNewText)
{
__try {
return GetModifiedText(PR_TRUE, aNewText);
return GetModifiedText(true, aNewText);
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return E_FAIL;
@ -509,7 +509,7 @@ STDMETHODIMP
CAccessibleText::get_oldText(IA2TextSegment *aOldText)
{
__try {
return GetModifiedText(PR_FALSE, aOldText);
return GetModifiedText(false, aOldText);
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return E_FAIL;

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

@ -675,7 +675,7 @@ bool nsAccessNodeWrap::IsOnlyMsaaCompatibleJawsPresent()
{
HMODULE jhookhandle = ::GetModuleHandleW(kJAWSModuleHandle);
if (!jhookhandle)
return PR_FALSE; // No JAWS, or some other screen reader, use IA2
return false; // No JAWS, or some other screen reader, use IA2
PRUnichar fileName[MAX_PATH];
::GetModuleFileNameW(jhookhandle, fileName, MAX_PATH);
@ -726,14 +726,14 @@ void nsAccessNodeWrap::TurnOffNewTabSwitchingForJawsAndWE()
}
// Value has never been set, set it.
Preferences::SetBool(CTRLTAB_DISALLOW_FOR_SCREEN_READERS_PREF, PR_TRUE);
Preferences::SetBool(CTRLTAB_DISALLOW_FOR_SCREEN_READERS_PREF, true);
}
void nsAccessNodeWrap::DoATSpecificProcessing()
{
if (IsOnlyMsaaCompatibleJawsPresent())
// All versions below 8.0.2173 are not compatible
gIsIA2Disabled = PR_TRUE;
gIsIA2Disabled = true;
TurnOffNewTabSwitchingForJawsAndWE();
}

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

@ -759,10 +759,10 @@ __try {
xpAccessible->TakeSelection();
if (flagsSelect & SELFLAG_ADDSELECTION)
xpAccessible->SetSelected(PR_TRUE);
xpAccessible->SetSelected(true);
if (flagsSelect & SELFLAG_REMOVESELECTION)
xpAccessible->SetSelected(PR_FALSE);
xpAccessible->SetSelected(false);
if (flagsSelect & SELFLAG_EXTENDSELECTION)
xpAccessible->ExtendSelection();

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

@ -224,8 +224,8 @@ nsresult nsTextAccessibleWrap::GetCharacterExtents(PRInt32 aStartOffset, PRInt32
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
nsPoint startPoint, endPoint;
nsIFrame *startFrame = GetPointFromOffset(frame, aStartOffset, PR_TRUE, startPoint);
nsIFrame *endFrame = GetPointFromOffset(frame, aEndOffset, PR_FALSE, endPoint);
nsIFrame *startFrame = GetPointFromOffset(frame, aStartOffset, true, startPoint);
nsIFrame *endFrame = GetPointFromOffset(frame, aEndOffset, false, endPoint);
if (!startFrame || !endFrame) {
return E_FAIL;
}

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

@ -214,7 +214,7 @@ nsXFormsAccessible::Description(nsString& aDescription)
bool
nsXFormsAccessible::GetAllowsAnonChildAccessibles()
{
return PR_FALSE;
return false;
}
@ -237,7 +237,7 @@ nsXFormsContainerAccessible::NativeRole()
bool
nsXFormsContainerAccessible::GetAllowsAnonChildAccessibles()
{
return PR_TRUE;
return true;
}
@ -331,7 +331,7 @@ nsXFormsSelectableAccessible::SelectedItems()
nsIAccessible* item = GetAccService()->GetAccessibleInWeakShell(itemNode,
mWeakShell);
if (item)
selectedItems->AppendElement(item, PR_FALSE);
selectedItems->AppendElement(item, false);
nsIMutableArray* items = nsnull;
selectedItems.forget(&items);
@ -356,7 +356,7 @@ nsXFormsSelectableAccessible::SelectedItems()
nsIAccessible* item = GetAccService()->GetAccessibleInWeakShell(itemNode,
mWeakShell);
if (item)
selectedItems->AppendElement(item, PR_FALSE);
selectedItems->AppendElement(item, false);
}
nsIMutableArray* items = nsnull;
@ -571,7 +571,7 @@ nsXFormsSelectableItemAccessible::IsSelected()
while ((parent = parent->GetNodeParent())) {
nsCOMPtr<nsIContent> content(do_QueryInterface(parent));
if (!content)
return PR_FALSE;
return false;
nsCOMPtr<nsINodeInfo> nodeinfo = content->NodeInfo();
if (!nodeinfo->NamespaceEquals(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS)))
@ -596,6 +596,6 @@ nsXFormsSelectableItemAccessible::IsSelected()
}
}
return PR_FALSE;
return false;
}

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

@ -89,7 +89,7 @@ public:
virtual PRUint64 NativeState();
// Denies accessible nodes in anonymous content of xforms element by
// always returning PR_FALSE value.
// always returning false value.
virtual bool GetAllowsAnonChildAccessibles();
protected:
@ -130,7 +130,7 @@ public:
virtual PRUint32 NativeRole();
// Allows accessible nodes in anonymous content of xforms element by
// always returning PR_TRUE value.
// always returning true value.
virtual bool GetAllowsAnonChildAccessibles();
};

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

@ -591,7 +591,7 @@ nsXFormsSelectComboboxAccessible::NativeState()
bool
nsXFormsSelectComboboxAccessible::GetAllowsAnonChildAccessibles()
{
return PR_TRUE;
return true;
}

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

@ -176,7 +176,7 @@ nsXULColorPickerAccessible::AreItemsOperable() const
void
nsXULColorPickerAccessible::CacheChildren()
{
nsAccTreeWalker walker(mWeakShell, mContent, PR_TRUE);
nsAccTreeWalker walker(mWeakShell, mContent, true);
nsAccessible* child = nsnull;
while ((child = walker.NextChild())) {

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

@ -149,12 +149,12 @@ nsXULComboboxAccessible::GetAllowsAnonChildAccessibles()
// Both the XUL <textbox type="autocomplete"> and <menulist editable="true"> widgets
// use nsXULComboboxAccessible. We need to walk the anonymous children for these
// so that the entry field is a child
return PR_TRUE;
return true;
}
// Argument of PR_FALSE indicates we don't walk anonymous children for
// Argument of false indicates we don't walk anonymous children for
// menuitems
return PR_FALSE;
return false;
}
PRUint8
nsXULComboboxAccessible::ActionCount()

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

@ -221,7 +221,7 @@ nsXULButtonAccessible::CacheChildren()
eCaseMatters);
bool isMenuButton = isMenu ?
PR_FALSE :
false :
mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
nsGkAtoms::menuButton, eCaseMatters);
@ -231,7 +231,7 @@ nsXULButtonAccessible::CacheChildren()
nsAccessible* menupopup = nsnull;
nsAccessible* button = nsnull;
nsAccTreeWalker walker(mWeakShell, mContent, PR_TRUE);
nsAccTreeWalker walker(mWeakShell, mContent, true);
nsAccessible* child = nsnull;
while ((child = walker.NextChild())) {
@ -322,7 +322,7 @@ bool nsXULDropmarkerAccessible::DropmarkerOpen(bool aToggleOpen)
NS_IMETHODIMP nsXULDropmarkerAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
{
if (aIndex == eAction_Click) {
if (DropmarkerOpen(PR_FALSE))
if (DropmarkerOpen(false))
aName.AssignLiteral("close");
else
aName.AssignLiteral("open");
@ -338,7 +338,7 @@ NS_IMETHODIMP nsXULDropmarkerAccessible::GetActionName(PRUint8 aIndex, nsAString
NS_IMETHODIMP nsXULDropmarkerAccessible::DoAction(PRUint8 index)
{
if (index == eAction_Click) {
DropmarkerOpen(PR_TRUE); // Reverse the open attribute
DropmarkerOpen(true); // Reverse the open attribute
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
@ -353,7 +353,7 @@ nsXULDropmarkerAccessible::NativeRole()
PRUint64
nsXULDropmarkerAccessible::NativeState()
{
return DropmarkerOpen(PR_FALSE) ? states::PRESSED : 0;
return DropmarkerOpen(false) ? states::PRESSED : 0;
}
////////////////////////////////////////////////////////////////////////////////
@ -666,7 +666,7 @@ nsXULToolbarButtonAccessible::IsSeparator(nsAccessible *aAccessible)
nsCOMPtr<nsIContent> contentDomNode(do_QueryInterface(domNode));
if (!contentDomNode)
return PR_FALSE;
return false;
return (contentDomNode->Tag() == nsGkAtoms::toolbarseparator) ||
(contentDomNode->Tag() == nsGkAtoms::toolbarspacer) ||
@ -851,7 +851,7 @@ NS_IMETHODIMP nsXULTextFieldAccessible::DoAction(PRUint8 index)
bool
nsXULTextFieldAccessible::GetAllowsAnonChildAccessibles()
{
return PR_FALSE;
return false;
}
NS_IMETHODIMP nsXULTextFieldAccessible::GetAssociatedEditor(nsIEditor **aEditor)
@ -876,7 +876,7 @@ nsXULTextFieldAccessible::CacheChildren()
if (!inputContent)
return;
nsAccTreeWalker walker(mWeakShell, inputContent, PR_FALSE);
nsAccTreeWalker walker(mWeakShell, inputContent, false);
nsAccessible* child = nsnull;
while ((child = walker.NextChild()) && AppendChild(child));

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

@ -168,7 +168,7 @@ nsXULListboxAccessible::IsMulticolumn()
PRInt32 numColumns = 0;
nsresult rv = GetColumnCount(&numColumns);
if (NS_FAILED(rv))
return PR_FALSE;
return false;
return numColumns > 1;
}
@ -443,7 +443,7 @@ NS_IMETHODIMP
nsXULListboxAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -469,7 +469,7 @@ NS_IMETHODIMP
nsXULListboxAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -620,7 +620,7 @@ nsXULListboxAccessible::GetSelectedCells(nsIArray **aCells)
for (PRInt32 cellIdx = 0; cellIdx < cellCount; cellIdx++) {
nsAccessible *cell = mChildren[cellIdx];
if (cell->Role() == nsIAccessibleRole::ROLE_CELL)
selCells->AppendElement(static_cast<nsIAccessible*>(cell), PR_FALSE);
selCells->AppendElement(static_cast<nsIAccessible*>(cell), false);
}
}
}
@ -830,7 +830,7 @@ NS_IMETHODIMP
nsXULListboxAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
{
NS_ENSURE_ARG_POINTER(aIsProbablyForLayout);
*aIsProbablyForLayout = PR_FALSE;
*aIsProbablyForLayout = false;
return NS_OK;
}
@ -1033,7 +1033,7 @@ bool
nsXULListitemAccessible::GetAllowsAnonChildAccessibles()
{
// That indicates we should walk anonymous children for listitems
return PR_TRUE;
return true;
}
void
@ -1216,7 +1216,7 @@ nsXULListCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
headerCells->AppendElement(headerCell, PR_FALSE);
headerCells->AppendElement(headerCell, false);
NS_ADDREF(*aHeaderCells = headerCells);
return NS_OK;
}
@ -1251,7 +1251,7 @@ NS_IMETHODIMP
nsXULListCellAccessible::IsSelected(bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;

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

@ -118,7 +118,7 @@ nsXULSelectableAccessible::SelectedItems()
GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
if (item)
selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
PR_FALSE);
false);
}
}
else { // Single select?
@ -130,7 +130,7 @@ nsXULSelectableAccessible::SelectedItems()
GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
if (item)
selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
PR_FALSE);
false);
}
}
@ -356,7 +356,7 @@ nsXULMenuitemAccessible::NativeState()
bool isCollapsed = false;
nsAccessible* parent = Parent();
if (parent && parent->State() & states::INVISIBLE)
isCollapsed = PR_TRUE;
isCollapsed = true;
if (isSelected) {
state |= states::SELECTED;
@ -565,7 +565,7 @@ bool
nsXULMenuitemAccessible::GetAllowsAnonChildAccessibles()
{
// That indicates we don't walk anonymous children for menuitems
return PR_FALSE;
return false;
}
NS_IMETHODIMP nsXULMenuitemAccessible::DoAction(PRUint8 index)

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

@ -192,7 +192,7 @@ bool
nsXULSliderAccessible::GetAllowsAnonChildAccessibles()
{
// Do not allow anonymous xul:slider be accessible.
return PR_FALSE;
return false;
}
// Utils
@ -251,7 +251,7 @@ nsXULSliderAccessible::SetSliderAttr(nsIAtom *aName, const nsAString& aValue)
nsCOMPtr<nsIContent> sliderNode(GetSliderNode());
NS_ENSURE_STATE(sliderNode);
sliderNode->SetAttr(kNameSpaceID_None, aName, aValue, PR_TRUE);
sliderNode->SetAttr(kNameSpaceID_None, aName, aValue, true);
return NS_OK;
}

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

@ -300,7 +300,7 @@ nsXULTreeAccessible::SelectedItems()
for (PRInt32 rowIdx = firstIdx; rowIdx <= lastIdx; rowIdx++) {
nsIAccessible* item = GetTreeItemAccessible(rowIdx);
if (item)
selectedItems->AppendElement(item, PR_FALSE);
selectedItems->AppendElement(item, false);
}
}
@ -1078,12 +1078,12 @@ nsXULTreeItemAccessibleBase::IsExpandable()
columns->GetPrimaryColumn(getter_AddRefs(primaryColumn));
if (primaryColumn &&
!nsCoreUtils::IsColumnHidden(primaryColumn))
return PR_TRUE;
return true;
}
}
}
return PR_FALSE;
return false;
}
void
@ -1164,10 +1164,10 @@ bool
nsXULTreeItemAccessible::Init()
{
if (!nsXULTreeItemAccessibleBase::Init())
return PR_FALSE;
return false;
GetName(mCachedName);
return PR_TRUE;
return true;
}
void

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

@ -210,7 +210,7 @@ nsXULTreeGridAccessible::GetSelectedCells(nsIArray **aCells)
for (PRInt32 colIdx = 0; colIdx < columnCount; colIdx++) {
nsCOMPtr<nsIAccessible> cell;
GetCellAt(rowIdx, colIdx, getter_AddRefs(cell));
selCells->AppendElement(cell, PR_FALSE);
selCells->AppendElement(cell, false);
}
}
}
@ -494,7 +494,7 @@ nsXULTreeGridAccessible::IsColumnSelected(PRInt32 aColumnIndex,
bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -518,7 +518,7 @@ NS_IMETHODIMP
nsXULTreeGridAccessible::IsRowSelected(PRInt32 aRowIndex, bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -573,7 +573,7 @@ NS_IMETHODIMP
nsXULTreeGridAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
{
NS_ENSURE_ARG_POINTER(aIsProbablyForLayout);
*aIsProbablyForLayout = PR_FALSE;
*aIsProbablyForLayout = false;
return NS_OK;
}
@ -1083,7 +1083,7 @@ nsXULTreeGridCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
if (headerCell)
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
PR_FALSE);
false);
NS_ADDREF(*aHeaderCells = headerCells);
return NS_OK;
@ -1111,7 +1111,7 @@ NS_IMETHODIMP
nsXULTreeGridCellAccessible::IsSelected(bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -1137,7 +1137,7 @@ bool
nsXULTreeGridCellAccessible::Init()
{
if (!nsLeafAccessible::Init())
return PR_FALSE;
return false;
PRInt16 type;
mColumn->GetType(&type);
@ -1146,7 +1146,7 @@ nsXULTreeGridCellAccessible::Init()
else
mTreeView->GetCellText(mRow, mColumn, mCachedTextEquiv);
return PR_TRUE;
return true;
}
bool
@ -1337,19 +1337,19 @@ nsXULTreeGridCellAccessible::IsEditable() const
bool isEditable = false;
nsresult rv = mTreeView->IsEditable(mRow, mColumn, &isEditable);
if (NS_FAILED(rv) || !isEditable)
return PR_FALSE;
return false;
nsCOMPtr<nsIDOMElement> columnElm;
mColumn->GetElement(getter_AddRefs(columnElm));
if (!columnElm)
return PR_FALSE;
return false;
nsCOMPtr<nsIContent> columnContent(do_QueryInterface(columnElm));
if (!columnContent->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::editable,
nsGkAtoms::_true,
eCaseMatters))
return PR_FALSE;
return false;
return mContent->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::editable,

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

@ -103,7 +103,7 @@ static bool IsArg(const char* arg, const char* s)
return !strcasecmp(++arg, s);
#endif
return PR_FALSE;
return false;
}
/**
@ -143,10 +143,10 @@ static int do_main(const char *exePath, int argc, char* argv[])
#ifdef XP_WIN
// exePath comes from mozilla::BinaryPath::Get, which returns a UTF-8
// encoded path, so it is safe to convert it
nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), PR_FALSE,
nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), false,
getter_AddRefs(appini));
#else
nsresult rv = NS_NewNativeLocalFile(nsDependentCString(exePath), PR_FALSE,
nsresult rv = NS_NewNativeLocalFile(nsDependentCString(exePath), false,
getter_AddRefs(appini));
#endif
if (NS_FAILED(rv)) {

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

@ -86,7 +86,7 @@ DirectoryProvider::GetFile(const char *aKey, bool *aPersist, nsIFile* *aResult)
nsCString path;
rv = prefs->GetCharPref("browser.bookmarks.file", getter_Copies(path));
if (NS_SUCCEEDED(rv)) {
NS_NewNativeLocalFile(path, PR_TRUE, (nsILocalFile**)(nsIFile**) getter_AddRefs(file));
NS_NewNativeLocalFile(path, true, (nsILocalFile**)(nsIFile**) getter_AddRefs(file));
}
}
}
@ -123,7 +123,7 @@ DirectoryProvider::GetFile(const char *aKey, bool *aPersist, nsIFile* *aResult)
file->AppendNative(leafstr);
}
*aPersist = PR_TRUE;
*aPersist = true;
NS_ADDREF(*aResult = file);
return NS_OK;
@ -290,7 +290,7 @@ NS_IMPL_ISUPPORTS1(DirectoryProvider::AppendingEnumerator, nsISimpleEnumerator)
NS_IMETHODIMP
DirectoryProvider::AppendingEnumerator::HasMoreElements(bool *aResult)
{
*aResult = mNext ? PR_TRUE : PR_FALSE;
*aResult = mNext ? true : false;
return NS_OK;
}

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

@ -133,15 +133,15 @@ bool
HasAttachmentDisposition(nsIHttpChannel* httpChannel)
{
if (!httpChannel)
return PR_FALSE;
return false;
PRUint32 disp;
nsresult rv = httpChannel->GetContentDisposition(&disp);
if (NS_SUCCEEDED(rv) && disp == nsIChannel::DISPOSITION_ATTACHMENT)
return PR_TRUE;
return true;
return PR_FALSE;
return false;
}
/**
@ -173,7 +173,7 @@ FindChar(char c, const char *begin, const char *end)
* @param end
* The end of the data being sniffed, right before the substring that
* was found.
* @returns PR_TRUE if the found substring is the documentElement, PR_FALSE
* @returns true if the found substring is the documentElement, false
* otherwise.
*/
static bool
@ -184,24 +184,24 @@ IsDocumentElement(const char *start, const char* end)
while ( (start = FindChar('<', start, end)) ) {
++start;
if (start >= end)
return PR_FALSE;
return false;
// Check to see if the character following the '<' is either '?' or '!'
// (processing instruction or doctype or comment)... these are valid nodes
// to have in the prologue.
if (*start != '?' && *start != '!')
return PR_FALSE;
return false;
// Now advance the iterator until the '>' (We do this because we don't want
// to sniff indicator substrings that are embedded within other nodes, e.g.
// comments: <!-- <rdf:RDF .. > -->
start = FindChar('>', start, end);
if (!start)
return PR_FALSE;
return false;
++start;
}
return PR_TRUE;
return true;
}
/**
@ -211,7 +211,7 @@ IsDocumentElement(const char *start, const char* end)
* The data being sniffed
* @param substring
* The substring being tested for existence and root-ness.
* @returns PR_TRUE if the substring exists and is the documentElement, PR_FALSE
* @returns true if the substring exists and is the documentElement, false
* otherwise.
*/
static bool
@ -219,7 +219,7 @@ ContainsTopLevelSubstring(nsACString& dataString, const char *substring)
{
PRInt32 offset = dataString.Find(substring);
if (offset == -1)
return PR_FALSE;
return false;
const char *begin = dataString.BeginReading();
@ -292,7 +292,7 @@ nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request,
// set the feed header as a response header, since we have good metadata
// telling us that the feed is supposed to be RSS or Atom
channel->SetResponseHeader(NS_LITERAL_CSTRING("X-Moz-Is-Feed"),
NS_LITERAL_CSTRING("1"), PR_FALSE);
NS_LITERAL_CSTRING("1"), false);
sniffedType.AssignLiteral(TYPE_MAYBE_FEED);
return NS_OK;
}

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

@ -273,7 +273,7 @@ ImportBookmarksHTML(nsIFile* aBookmarksFile,
NS_ENSURE_SUCCESS(rv, rv);
// Import the bookmarks into the folder.
return importer->ImportHTMLFromFileToFolder(localFile, folder, PR_FALSE);
return importer->ImportHTMLFromFileToFolder(localFile, folder, false);
}
nsresult
@ -283,7 +283,7 @@ InitializeBookmarks(nsIFile* aTargetProfile)
aTargetProfile->Clone(getter_AddRefs(bookmarksFile));
bookmarksFile->Append(BOOKMARKS_FILE_NAME);
nsresult rv = ImportBookmarksHTML(bookmarksFile, PR_TRUE, PR_TRUE, EmptyString().get());
nsresult rv = ImportBookmarksHTML(bookmarksFile, true, true, EmptyString().get());
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}

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

@ -245,13 +245,13 @@ TranslateLanglist(nsIWindowsRegKey *aRegKey, const nsString& aRegValueName,
char *dest = prefStringValue,
*destEnd = dest + (MAX_PATH-2); // room for " \0"
bool skip = false,
comma = PR_FALSE;
comma = false;
while (source < sourceEnd && *source && dest < destEnd) {
if (*source == ',')
skip = PR_FALSE;
skip = false;
else if (*source == ';')
skip = PR_TRUE;
skip = true;
if (!skip) {
if (comma && *source != ' ')
*dest++ = ' ';
@ -425,7 +425,7 @@ nsIEProfileMigrator::Migrate(PRUint16 aItems, nsIProfileStartup* aStartup, const
bool aReplace = false;
if (aStartup) {
aReplace = PR_TRUE;
aReplace = true;
rv = aStartup->DoStartup();
NS_ENSURE_SUCCESS(rv, rv);
}
@ -473,7 +473,7 @@ NS_IMETHODIMP
nsIEProfileMigrator::GetSourceExists(bool* aResult)
{
// IE always exists.
*aResult = PR_TRUE;
*aResult = true;
return NS_OK;
}
@ -481,7 +481,7 @@ nsIEProfileMigrator::GetSourceExists(bool* aResult)
NS_IMETHODIMP
nsIEProfileMigrator::GetSourceHasMultipleProfiles(bool* aResult)
{
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}
@ -573,33 +573,33 @@ nsIEProfileMigrator::TestForIE7()
nsCOMPtr<nsIWindowsRegKey> regKey =
do_CreateInstance("@mozilla.org/windows-registry-key;1");
if (!regKey)
return PR_FALSE;
return false;
NS_NAMED_LITERAL_STRING(key,
"Applications\\iexplore.exe\\shell\\open\\command");
if (NS_FAILED(regKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT,
key, nsIWindowsRegKey::ACCESS_QUERY_VALUE)))
return PR_FALSE;
return false;
nsAutoString iePath;
if (NS_FAILED(regKey->ReadStringValue(EmptyString(), iePath)))
return PR_FALSE;
return false;
// Replace embedded environment variables.
PRUint32 bufLength =
::ExpandEnvironmentStringsW(iePath.get(),
L"", 0);
if (bufLength == 0) // Error
return PR_FALSE;
return false;
nsAutoArrayPtr<PRUnichar> destination(new PRUnichar[bufLength]);
if (!destination)
return PR_FALSE;
return false;
if (!::ExpandEnvironmentStringsW(iePath.get(),
destination,
bufLength))
return PR_FALSE;
return false;
iePath = destination;
@ -611,27 +611,27 @@ nsIEProfileMigrator::TestForIE7()
}
nsCOMPtr<nsILocalFile> lf;
NS_NewLocalFile(iePath, PR_TRUE, getter_AddRefs(lf));
NS_NewLocalFile(iePath, true, getter_AddRefs(lf));
nsCOMPtr<nsILocalFileWin> lfw = do_QueryInterface(lf);
if (!lfw)
return PR_FALSE;
return false;
nsAutoString ieVersion;
if (NS_FAILED(lfw->GetVersionInfoField("FileVersion", ieVersion)))
return PR_FALSE;
return false;
if (ieVersion.Length() > 2) {
PRUint32 index = ieVersion.FindChar('.', 0);
if (index < 0)
return PR_FALSE;
return false;
ieVersion.Cut(index, ieVersion.Length());
PRInt32 ver = wcstol(ieVersion.get(), nsnull, 0);
if (ver >= 7) // Found 7 or greater major version
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
NS_IMETHODIMP
@ -645,16 +645,16 @@ nsIEProfileMigrator::RunBatched(nsISupports* aUserData)
switch (batchAction) {
case BATCH_ACTION_HISTORY:
rv = CopyHistoryBatched(PR_FALSE);
rv = CopyHistoryBatched(false);
break;
case BATCH_ACTION_HISTORY_REPLACE:
rv = CopyHistoryBatched(PR_TRUE);
rv = CopyHistoryBatched(true);
break;
case BATCH_ACTION_BOOKMARKS:
rv = CopyFavoritesBatched(PR_FALSE);
rv = CopyFavoritesBatched(false);
break;
case BATCH_ACTION_BOOKMARKS_REPLACE:
rv = CopyFavoritesBatched(PR_TRUE);
rv = CopyFavoritesBatched(true);
break;
}
NS_ENSURE_SUCCESS(rv, rv);
@ -1101,7 +1101,7 @@ nsIEProfileMigrator::KeyIsURI(const nsAString& aKey, char** aRealm)
nsCOMPtr<nsIURI> uri;
if (NS_FAILED(NS_NewURI(getter_AddRefs(uri), aKey)))
return PR_FALSE;
return false;
bool validScheme = false;
const char* schemes[] = { "http", "https" };
@ -1120,7 +1120,7 @@ nsIEProfileMigrator::KeyIsURI(const nsAString& aKey, char** aRealm)
return validScheme;
}
}
return PR_FALSE;
return false;
}
nsresult
@ -1435,7 +1435,7 @@ nsIEProfileMigrator::CopyFavoritesBatched(bool aReplace)
// Only try to read Favorites folder if it exists on the machine.
if (favoritesDirectory) {
rv = ParseFavoritesFolder(favoritesDirectory, folder, bms,
personalToolbarFolderName, PR_TRUE);
personalToolbarFolderName, true);
NS_ENSURE_SUCCESS(rv, rv);
}
@ -1595,7 +1595,7 @@ nsIEProfileMigrator::ParseFavoritesFolder(nsIFile* aDirectory,
if (NS_FAILED(rv)) continue;
nsCOMPtr<nsILocalFile> localFile;
rv = NS_NewLocalFile(path, PR_TRUE, getter_AddRefs(localFile));
rv = NS_NewLocalFile(path, true, getter_AddRefs(localFile));
if (NS_FAILED(rv)) continue;
// Check for dir here. If path is not a dir, just continue with
@ -1637,7 +1637,7 @@ nsIEProfileMigrator::ParseFavoritesFolder(nsIFile* aDirectory,
rv = ParseFavoritesFolder(currFile, folderId,
aBMS, aPersonalToolbarFolderName,
PR_FALSE);
false);
if (NS_FAILED(rv)) continue;
}
else {
@ -1702,7 +1702,7 @@ nsIEProfileMigrator::CopyPreferences(bool aReplace)
if (entry->regKeyName) {
if (regKeyOpen) {
regKey->Close();
regKeyOpen = PR_FALSE;
regKeyOpen = false;
}
regKeyOpen = NS_SUCCEEDED(regKey->
Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
@ -1930,10 +1930,10 @@ nsIEProfileMigrator::CopyCookiesFromBuffer(char *aBuffer,
bool isIPAddress = false;
if (hostCopy[0] == '.') {
aCookieManager->Remove(nsDependentCString(hostCopy+1),
stringName, stringPath, PR_FALSE);
stringName, stringPath, false);
PRNetAddr addr;
if (PR_StringToNetAddr(hostCopy+1, &addr) == PR_SUCCESS)
isIPAddress = PR_TRUE;
isIPAddress = true;
}
nsresult onerv;
@ -1943,8 +1943,8 @@ nsIEProfileMigrator::CopyCookiesFromBuffer(char *aBuffer,
stringName,
nsDependentCString(value),
flagsValue & 0x1, // isSecure
PR_FALSE, // isHttpOnly
PR_FALSE, // isSession
false, // isHttpOnly
false, // isSession
PRInt64(expirationDate));
if (NS_FAILED(onerv)) {
rv = onerv;
@ -2103,8 +2103,8 @@ nsIEProfileMigrator::CopySecurityPrefs(nsIPrefBranch* aPrefs)
PRUint32 value;
if (NS_SUCCEEDED(regKey->ReadIntValue(NS_LITERAL_STRING("SecureProtocols"),
&value))) {
aPrefs->SetBoolPref("security.enable_ssl3", (value >> 5) & PR_TRUE);
aPrefs->SetBoolPref("security.enable_tls", (value >> 7) & PR_TRUE);
aPrefs->SetBoolPref("security.enable_ssl3", (value >> 5) & true);
aPrefs->SetBoolPref("security.enable_tls", (value >> 7) & true);
}
}
@ -2160,13 +2160,13 @@ nsIEProfileMigrator::CopyProxyPreferences(nsIPrefBranch* aPrefs)
ReadStringValue(NS_LITERAL_STRING("ProxyServer"), buf))) {
ProxyData data[] = {
{ "ftp=", 4, PR_FALSE, "network.proxy.ftp",
{ "ftp=", 4, false, "network.proxy.ftp",
"network.proxy.ftp_port" },
{ "http=", 5, PR_FALSE, "network.proxy.http",
{ "http=", 5, false, "network.proxy.http",
"network.proxy.http_port" },
{ "https=", 6, PR_FALSE, "network.proxy.ssl",
{ "https=", 6, false, "network.proxy.ssl",
"network.proxy.ssl_port" },
{ "socks=", 6, PR_FALSE, "network.proxy.socks",
{ "socks=", 6, false, "network.proxy.socks",
"network.proxy.socks_port" },
};
@ -2175,9 +2175,9 @@ nsIEProfileMigrator::CopyProxyPreferences(nsIPrefBranch* aPrefs)
for (PRUint32 i = 0; i < ArrayLength(data); ++i) {
PRInt32 offset = buf.Find(NS_ConvertASCIItoUTF16(data[i].prefix));
if (offset >= 0) {
foundSpecificProxy = PR_TRUE;
foundSpecificProxy = true;
data[i].proxyConfigured = PR_TRUE;
data[i].proxyConfigured = true;
startIndex = offset + data[i].prefixLength;
@ -2197,7 +2197,7 @@ nsIEProfileMigrator::CopyProxyPreferences(nsIPrefBranch* aPrefs)
// it applies to all protocols.
for (PRUint32 i = 0; i < ArrayLength(data); ++i)
SetProxyPref(buf, data[i].hostPref, data[i].portPref, aPrefs);
aPrefs->SetBoolPref("network.proxy.share_proxy_settings", PR_TRUE);
aPrefs->SetBoolPref("network.proxy.share_proxy_settings", true);
}
}

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

@ -149,16 +149,16 @@ nsOperaProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
MigrationData data[] = { { ToNewUnicode(OPERA_PREFERENCES_FILE_NAME),
nsIBrowserProfileMigrator::SETTINGS,
PR_FALSE },
false },
{ ToNewUnicode(OPERA_COOKIES_FILE_NAME),
nsIBrowserProfileMigrator::COOKIES,
PR_FALSE },
false },
{ ToNewUnicode(OPERA_HISTORY_FILE_NAME),
nsIBrowserProfileMigrator::HISTORY,
PR_FALSE },
false },
{ ToNewUnicode(OPERA_BOOKMARKS_FILE_NAME),
nsIBrowserProfileMigrator::BOOKMARKS,
PR_FALSE } };
false } };
// Frees file name strings allocated above.
GetMigrateDataFromArray(data, sizeof(data)/sizeof(MigrationData),
@ -179,7 +179,7 @@ nsOperaProfileMigrator::GetSourceExists(bool* aResult)
*aResult = count > 0;
}
else
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}
@ -198,7 +198,7 @@ nsOperaProfileMigrator::GetSourceHasMultipleProfiles(bool* aResult)
}
else
#endif
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}
@ -310,24 +310,24 @@ nsOperaProfileMigrator::GetSourceHomePageURL(nsACString& aResult)
static
nsOperaProfileMigrator::PrefTransform gTransforms[] = {
{ "User Prefs", "Download Directory", _OPM(STRING), "browser.download.dir", _OPM(SetFile), PR_FALSE, { -1 } },
{ nsnull, "Enable Cookies", _OPM(INT), "network.cookie.cookieBehavior", _OPM(SetCookieBehavior), PR_FALSE, { -1 } },
{ nsnull, "Accept Cookies Session Only", _OPM(BOOL), "network.cookie.lifetimePolicy", _OPM(SetCookieLifetime), PR_FALSE, { -1 } },
{ nsnull, "Allow script to resize window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Allow script to move window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Allow script to raise window", _OPM(BOOL), "dom.disable_window_flip", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Allow script to change status", _OPM(BOOL), "dom.disable_window_status_change", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Ignore Unrequested Popups", _OPM(BOOL), "dom.disable_open_during_load", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Load Figures", _OPM(BOOL), "permissions.default.image", _OPM(SetImageBehavior), PR_FALSE, { -1 } },
{ "User Prefs", "Download Directory", _OPM(STRING), "browser.download.dir", _OPM(SetFile), false, { -1 } },
{ nsnull, "Enable Cookies", _OPM(INT), "network.cookie.cookieBehavior", _OPM(SetCookieBehavior), false, { -1 } },
{ nsnull, "Accept Cookies Session Only", _OPM(BOOL), "network.cookie.lifetimePolicy", _OPM(SetCookieLifetime), false, { -1 } },
{ nsnull, "Allow script to resize window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), false, { -1 } },
{ nsnull, "Allow script to move window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), false, { -1 } },
{ nsnull, "Allow script to raise window", _OPM(BOOL), "dom.disable_window_flip", _OPM(SetBool), false, { -1 } },
{ nsnull, "Allow script to change status", _OPM(BOOL), "dom.disable_window_status_change", _OPM(SetBool), false, { -1 } },
{ nsnull, "Ignore Unrequested Popups", _OPM(BOOL), "dom.disable_open_during_load", _OPM(SetBool), false, { -1 } },
{ nsnull, "Load Figures", _OPM(BOOL), "permissions.default.image", _OPM(SetImageBehavior), false, { -1 } },
{ "Visited link", nsnull, _OPM(COLOR), "browser.visited_color", _OPM(SetString), PR_FALSE, { -1 } },
{ "Link", nsnull, _OPM(COLOR), "browser.anchor_color", _OPM(SetString), PR_FALSE, { -1 } },
{ nsnull, "Underline", _OPM(BOOL), "browser.underline_anchors", _OPM(SetBool), PR_FALSE, { -1 } },
{ "Visited link", nsnull, _OPM(COLOR), "browser.visited_color", _OPM(SetString), false, { -1 } },
{ "Link", nsnull, _OPM(COLOR), "browser.anchor_color", _OPM(SetString), false, { -1 } },
{ nsnull, "Underline", _OPM(BOOL), "browser.underline_anchors", _OPM(SetBool), false, { -1 } },
{ nsnull, "Enable SSL v3", _OPM(BOOL), "security.enable_ssl3", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Enable TLS v1.0", _OPM(BOOL), "security.enable_tls", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Enable SSL v3", _OPM(BOOL), "security.enable_ssl3", _OPM(SetBool), false, { -1 } },
{ nsnull, "Enable TLS v1.0", _OPM(BOOL), "security.enable_tls", _OPM(SetBool), false, { -1 } },
{ "Extensions", "Scripting", _OPM(BOOL), "javascript.enabled", _OPM(SetBool), PR_FALSE, { -1 } }
{ "Extensions", "Scripting", _OPM(BOOL), "javascript.enabled", _OPM(SetBool), false, { -1 } }
};
nsresult
@ -425,7 +425,7 @@ nsOperaProfileMigrator::CopyPreferences(bool aReplace)
if (NS_SUCCEEDED(rv)) {
transform->stringValue = colorString;
transform->prefHasValue = PR_TRUE;
transform->prefHasValue = true;
transform->prefSetterFunc(transform, branch);
}
if (colorString)
@ -453,7 +453,7 @@ nsOperaProfileMigrator::CopyPreferences(bool aReplace)
default:
break;
}
transform->prefHasValue = PR_TRUE;
transform->prefHasValue = true;
transform->prefSetterFunc(transform, branch);
if (transform->type == _OPM(STRING) && transform->stringValue) {
NS_Free(transform->stringValue);
@ -584,7 +584,7 @@ nsOperaProfileMigrator::CopyUserContentSheet(nsINIParser &aParser)
// Copy the file
nsCOMPtr<nsILocalFile> userContentCSSFile;
rv = NS_NewNativeLocalFile(userContentCSS, PR_TRUE,
rv = NS_NewNativeLocalFile(userContentCSS, true,
getter_AddRefs(userContentCSSFile));
if (NS_FAILED(rv))
return NS_OK;
@ -638,13 +638,13 @@ nsOperaProfileMigrator::CopyCookies(bool aReplace)
nsOperaCookieMigrator::nsOperaCookieMigrator(nsIInputStream* aSourceStream) :
mAppVersion(0), mFileVersion(0), mTagTypeLength(0), mPayloadTypeLength(0),
mCookieOpen(PR_FALSE), mCurrHandlingInfo(0)
mCookieOpen(false), mCurrHandlingInfo(0)
{
mStream = do_CreateInstance("@mozilla.org/binaryinputstream;1");
if (mStream)
mStream->SetInputStream(aSourceStream);
mCurrCookie.isSecure = PR_FALSE;
mCurrCookie.isSecure = false;
mCurrCookie.expiryTime = 0;
}
@ -762,7 +762,7 @@ nsOperaCookieMigrator::Migrate()
AddCookie(manager);
mStream->Read16(&segmentLength);
mCookieOpen = PR_TRUE;
mCookieOpen = true;
}
break;
case COOKIE_ID:
@ -796,7 +796,7 @@ nsOperaCookieMigrator::Migrate()
mStream->Read32(reinterpret_cast<PRUint32*>(&(mCurrCookie.expiryTime)));
break;
case COOKIE_SECURE:
mCurrCookie.isSecure = PR_TRUE;
mCurrCookie.isSecure = true;
break;
// We don't support any of these fields but we must read them in
@ -899,15 +899,15 @@ nsOperaCookieMigrator::AddCookie(nsICookieManager2* aManager)
nsCString path;
SynthesizePath(getter_Copies(path));
mCookieOpen = PR_FALSE;
mCookieOpen = false;
nsresult rv = aManager->Add(domain,
path,
mCurrCookie.id,
mCurrCookie.data,
mCurrCookie.isSecure,
PR_FALSE, // isHttpOnly
PR_FALSE, // isSession
false, // isHttpOnly
false, // isSession
PRInt64(mCurrCookie.expiryTime));
mCurrCookie.isSecure = 0;
@ -975,16 +975,16 @@ nsOperaProfileMigrator::RunBatched(nsISupports* aUserData)
switch (batchAction) {
case BATCH_ACTION_HISTORY:
rv = CopyHistoryBatched(PR_FALSE);
rv = CopyHistoryBatched(false);
break;
case BATCH_ACTION_HISTORY_REPLACE:
rv = CopyHistoryBatched(PR_TRUE);
rv = CopyHistoryBatched(true);
break;
case BATCH_ACTION_BOOKMARKS:
rv = CopyBookmarksBatched(PR_FALSE);
rv = CopyBookmarksBatched(false);
break;
case BATCH_ACTION_BOOKMARKS_REPLACE:
rv = CopyBookmarksBatched(PR_TRUE);
rv = CopyBookmarksBatched(true);
break;
}
NS_ENSURE_SUCCESS(rv, rv);
@ -1380,7 +1380,7 @@ nsOperaProfileMigrator::ParseBookmarksFolder(nsILineInputStream* aStream,
break;
case LineType_ONTOOLBAR:
if (NS_LITERAL_STRING("YES").Equals(data))
onToolbar = PR_TRUE;
onToolbar = true;
break;
case LineType_NL: {
// XXX We don't know for sure how Opera deals with IDN hostnames in URL.
@ -1404,7 +1404,7 @@ nsOperaProfileMigrator::ParseBookmarksFolder(nsILineInputStream* aStream,
url.Truncate();
keyword.Truncate();
description.Truncate();
onToolbar = PR_FALSE;
onToolbar = false;
}
}
else if (entryType == EntryType_FOLDER) {

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

@ -226,7 +226,7 @@ nsProfileMigrator::GetDefaultBrowserMigratorKey(nsACString& aKey,
// VERSIONINFO segment, but we just assume the first one).
nsCOMPtr<nsILocalFile> lf;
NS_NewLocalFile(filePath, PR_TRUE, getter_AddRefs(lf));
NS_NewLocalFile(filePath, true, getter_AddRefs(lf));
if (!lf)
return NS_ERROR_FAILURE;
@ -275,35 +275,35 @@ nsProfileMigrator::ImportRegistryProfiles(const nsACString& aAppName)
nsCOMPtr<nsIToolkitProfileService> profileSvc
(do_GetService(NS_PROFILESERVICE_CONTRACTID));
NS_ENSURE_TRUE(profileSvc, PR_FALSE);
NS_ENSURE_TRUE(profileSvc, false);
nsCOMPtr<nsIProperties> dirService
(do_GetService("@mozilla.org/file/directory_service;1"));
NS_ENSURE_TRUE(dirService, PR_FALSE);
NS_ENSURE_TRUE(dirService, false);
nsCOMPtr<nsILocalFile> regFile;
#ifdef XP_WIN
rv = dirService->Get(NS_WIN_APPDATA_DIR, NS_GET_IID(nsILocalFile),
getter_AddRefs(regFile));
NS_ENSURE_SUCCESS(rv, PR_FALSE);
NS_ENSURE_SUCCESS(rv, false);
regFile->AppendNative(aAppName);
regFile->AppendNative(NS_LITERAL_CSTRING("registry.dat"));
#elif defined(XP_MACOSX)
rv = dirService->Get(NS_MAC_USER_LIB_DIR, NS_GET_IID(nsILocalFile),
getter_AddRefs(regFile));
NS_ENSURE_SUCCESS(rv, PR_FALSE);
NS_ENSURE_SUCCESS(rv, false);
regFile->AppendNative(aAppName);
regFile->AppendNative(NS_LITERAL_CSTRING("Application Registry"));
#elif defined(XP_OS2)
rv = dirService->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile),
getter_AddRefs(regFile));
NS_ENSURE_SUCCESS(rv, PR_FALSE);
NS_ENSURE_SUCCESS(rv, false);
regFile->AppendNative(aAppName);
regFile->AppendNative(NS_LITERAL_CSTRING("registry.dat"));
#else
rv = dirService->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile),
getter_AddRefs(regFile));
NS_ENSURE_SUCCESS(rv, PR_FALSE);
NS_ENSURE_SUCCESS(rv, false);
nsCAutoString dotAppName;
ToLowerCase(aAppName, dotAppName);
dotAppName.Insert('.', 0);
@ -314,10 +314,10 @@ nsProfileMigrator::ImportRegistryProfiles(const nsACString& aAppName)
nsCAutoString path;
rv = regFile->GetNativePath(path);
NS_ENSURE_SUCCESS(rv, PR_FALSE);
NS_ENSURE_SUCCESS(rv, false);
if (NR_StartupRegistry())
return PR_FALSE;
return false;
bool migrated = false;
HREG reg = nsnull;
@ -365,7 +365,7 @@ nsProfileMigrator::ImportRegistryProfiles(const nsACString& aAppName)
profileSvc->CreateProfile(profileFile, nsnull,
nsDependentCString(profileName),
getter_AddRefs(tprofile));
migrated = PR_TRUE;
migrated = true;
}
cleanup:

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

@ -61,7 +61,7 @@ protected:
/**
* Import profiles from ~/.firefox/
* @return PR_TRUE if any profiles imported.
* @return true if any profiles imported.
*/
bool ImportRegistryProfiles(const nsACString& aAppName);
};

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

@ -103,7 +103,7 @@ nsSafariProfileMigrator::Migrate(PRUint16 aItems, nsIProfileStartup* aStartup,
bool replace = false;
if (aStartup) {
replace = PR_TRUE;
replace = true;
rv = aStartup->DoStartup();
NS_ENSURE_SUCCESS(rv, rv);
}
@ -140,10 +140,10 @@ nsSafariProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
// Safari stores most of its user settings under ~/Library/Safari/
MigrationData data[] = { { ToNewUnicode(SAFARI_HISTORY_FILE_NAME),
nsIBrowserProfileMigrator::HISTORY,
PR_FALSE },
false },
{ ToNewUnicode(SAFARI_BOOKMARKS_FILE_NAME),
nsIBrowserProfileMigrator::BOOKMARKS,
PR_FALSE } };
false } };
// Frees file name strings allocated above.
GetMigrateDataFromArray(data, sizeof(data)/sizeof(MigrationData),
aReplace, safariSettingsDir, aResult);
@ -151,7 +151,7 @@ nsSafariProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
// Safari stores Cookies under ~/Library/Cookies/Cookies.plist
MigrationData data2[] = { { ToNewUnicode(SAFARI_COOKIES_FILE_NAME),
nsIBrowserProfileMigrator::COOKIES,
PR_FALSE } };
false } };
GetMigrateDataFromArray(data2, sizeof(data2)/sizeof(MigrationData),
aReplace, safariCookiesDir, aResult);
@ -161,7 +161,7 @@ nsSafariProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
getter_AddRefs(systemPrefsDir));
MigrationData data3[]= { { ToNewUnicode(SAFARI_PREFERENCES_FILE_NAME),
nsIBrowserProfileMigrator::SETTINGS,
PR_FALSE } };
false } };
GetMigrateDataFromArray(data3, sizeof(data3)/sizeof(MigrationData),
aReplace, systemPrefsDir, aResult);
@ -186,7 +186,7 @@ NS_IMETHODIMP
nsSafariProfileMigrator::GetSourceExists(bool* aResult)
{
PRUint16 data;
GetMigrateData(nsnull, PR_FALSE, &data);
GetMigrateData(nsnull, false, &data);
*aResult = data != 0;
@ -197,7 +197,7 @@ NS_IMETHODIMP
nsSafariProfileMigrator::GetSourceHasMultipleProfiles(bool* aResult)
{
// Safari only has one profile per-user.
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}
@ -297,9 +297,9 @@ GetDictionaryStringValue(CFDictionaryRef aDictionary, CFStringRef aKey,
::CFStringGetCharacters(value, CFRangeMake(0, valueLength), buffer.Elements());
aResult.Assign(buffer.Elements(), valueLength);
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
bool
@ -314,10 +314,10 @@ GetDictionaryCStringValue(CFDictionaryRef aDictionary, CFStringRef aKey,
if (::CFStringGetCString(value, buffer.Elements(), valueLength + 1, aEncoding)) {
aResult = buffer.Elements();
return PR_TRUE;
return true;
}
}
return PR_FALSE;
return false;
}
bool
@ -331,31 +331,31 @@ GetArrayStringValue(CFArrayRef aArray, PRInt32 aIndex, nsAString& aResult)
::CFStringGetCharacters(value, CFRangeMake(0, valueLength), buffer.Elements());
aResult.Assign(buffer.Elements(), valueLength);
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
#define _SPM(type) nsSafariProfileMigrator::type
static
nsSafariProfileMigrator::PrefTransform gTransforms[] = {
{ CFSTR("AlwaysShowTabBar"), _SPM(BOOL), "browser.tabs.autoHide", _SPM(SetBoolInverted), PR_FALSE, { -1 } },
{ CFSTR("AutoFillPasswords"), _SPM(BOOL), "signon.rememberSignons", _SPM(SetBool), PR_FALSE, { -1 } },
{ CFSTR("OpenNewTabsInFront"), _SPM(BOOL), "browser.tabs.loadInBackground", _SPM(SetBoolInverted), PR_FALSE, { -1 } },
{ CFSTR("NSDefaultOpenDir"), _SPM(STRING), "browser.download.dir", _SPM(SetDownloadFolder), PR_FALSE, { -1 } },
{ CFSTR("AutoOpenSafeDownloads"), _SPM(BOOL), nsnull, _SPM(SetDownloadHandlers), PR_FALSE, { -1 } },
{ CFSTR("DownloadsClearingPolicy"), _SPM(INT), "browser.download.manager.retention", _SPM(SetDownloadRetention), PR_FALSE, { -1 } },
{ CFSTR("WebKitDefaultTextEncodingName"),_SPM(STRING), "intl.charset.default", _SPM(SetDefaultEncoding), PR_FALSE, { -1 } },
{ CFSTR("WebKitStandardFont"), _SPM(STRING), "font.name.serif.", _SPM(SetFontName), PR_FALSE, { -1 } },
{ CFSTR("WebKitDefaultFontSize"), _SPM(INT), "font.size.serif.", _SPM(SetFontSize), PR_FALSE, { -1 } },
{ CFSTR("WebKitFixedFont"), _SPM(STRING), "font.name.fixed.", _SPM(SetFontName), PR_FALSE, { -1 } },
{ CFSTR("WebKitDefaultFixedFontSize"), _SPM(INT), "font.size.fixed.", _SPM(SetFontSize), PR_FALSE, { -1 } },
{ CFSTR("WebKitMinimumFontSize"), _SPM(INT), "font.minimum-size.", _SPM(SetFontSize), PR_FALSE, { -1 } },
{ CFSTR("WebKitDisplayImagesKey"), _SPM(BOOL), "permissions.default.image", _SPM(SetDisplayImages), PR_FALSE, { -1 } },
{ CFSTR("WebKitJavaScriptEnabled"), _SPM(BOOL), "javascript.enabled", _SPM(SetBool), PR_FALSE, { -1 } },
{ CFSTR("AlwaysShowTabBar"), _SPM(BOOL), "browser.tabs.autoHide", _SPM(SetBoolInverted), false, { -1 } },
{ CFSTR("AutoFillPasswords"), _SPM(BOOL), "signon.rememberSignons", _SPM(SetBool), false, { -1 } },
{ CFSTR("OpenNewTabsInFront"), _SPM(BOOL), "browser.tabs.loadInBackground", _SPM(SetBoolInverted), false, { -1 } },
{ CFSTR("NSDefaultOpenDir"), _SPM(STRING), "browser.download.dir", _SPM(SetDownloadFolder), false, { -1 } },
{ CFSTR("AutoOpenSafeDownloads"), _SPM(BOOL), nsnull, _SPM(SetDownloadHandlers), false, { -1 } },
{ CFSTR("DownloadsClearingPolicy"), _SPM(INT), "browser.download.manager.retention", _SPM(SetDownloadRetention), false, { -1 } },
{ CFSTR("WebKitDefaultTextEncodingName"),_SPM(STRING), "intl.charset.default", _SPM(SetDefaultEncoding), false, { -1 } },
{ CFSTR("WebKitStandardFont"), _SPM(STRING), "font.name.serif.", _SPM(SetFontName), false, { -1 } },
{ CFSTR("WebKitDefaultFontSize"), _SPM(INT), "font.size.serif.", _SPM(SetFontSize), false, { -1 } },
{ CFSTR("WebKitFixedFont"), _SPM(STRING), "font.name.fixed.", _SPM(SetFontName), false, { -1 } },
{ CFSTR("WebKitDefaultFixedFontSize"), _SPM(INT), "font.size.fixed.", _SPM(SetFontSize), false, { -1 } },
{ CFSTR("WebKitMinimumFontSize"), _SPM(INT), "font.minimum-size.", _SPM(SetFontSize), false, { -1 } },
{ CFSTR("WebKitDisplayImagesKey"), _SPM(BOOL), "permissions.default.image", _SPM(SetDisplayImages), false, { -1 } },
{ CFSTR("WebKitJavaScriptEnabled"), _SPM(BOOL), "javascript.enabled", _SPM(SetBool), false, { -1 } },
{ CFSTR("WebKitJavaScriptCanOpenWindowsAutomatically"),
_SPM(BOOL), "dom.disable_open_during_load", _SPM(SetBoolInverted), PR_FALSE, { -1 } }
_SPM(BOOL), "dom.disable_open_during_load", _SPM(SetBoolInverted), false, { -1 } }
};
nsresult
@ -481,7 +481,7 @@ nsSafariProfileMigrator::SetDownloadFolder(void* aTransform, nsIPrefBranch* aBra
nsCOMPtr<nsILocalFile> downloadFolder;
nsresult rv = NS_NewNativeLocalFile(nsDependentCString(xform->stringValue),
PR_TRUE, getter_AddRefs(downloadFolder));
true, getter_AddRefs(downloadFolder));
NS_ENSURE_SUCCESS(rv, rv);
// If the Safari download folder is the desktop, set the folderList pref
@ -542,18 +542,18 @@ nsSafariProfileMigrator::SetDownloadHandlers(void* aTransform, nsIPrefBranch* aB
overridesList->GetCount(&count);
for (PRInt32 i = count; i >= 1; --i) {
nsCOMPtr<nsIRDFNode> currOverrideNode;
overridesList->RemoveElementAt(i, PR_FALSE, getter_AddRefs(currOverrideNode));
overridesList->RemoveElementAt(i, false, getter_AddRefs(currOverrideNode));
nsCOMPtr<nsIRDFResource> currOverride(do_QueryInterface(currOverrideNode));
nsCOMPtr<nsIRDFNode> handlerPropNode;
mimeTypes->GetTarget(currOverride, handlerPropArc, PR_TRUE,
mimeTypes->GetTarget(currOverride, handlerPropArc, true,
getter_AddRefs(handlerPropNode));
nsCOMPtr<nsIRDFResource> handlerPropResource(do_QueryInterface(handlerPropNode));
if (handlerPropResource) {
nsCOMPtr<nsIRDFNode> externalApplicationNode;
mimeTypes->GetTarget(handlerPropResource, externalApplicationArc,
PR_TRUE, getter_AddRefs(externalApplicationNode));
true, getter_AddRefs(externalApplicationNode));
nsCOMPtr<nsIRDFResource> externalApplicationResource(do_QueryInterface(externalApplicationNode));
// Strip the resources down so that the datasource is completely flushed.
@ -593,7 +593,7 @@ nsSafariProfileMigrator::CleanResource(nsIRDFDataSource* aDataSource,
if (currArc) {
nsCOMPtr<nsIRDFNode> currTarget;
aDataSource->GetTarget(aResource, currArc, PR_TRUE,
aDataSource->GetTarget(aResource, currArc, true,
getter_AddRefs(currTarget));
aDataSource->Unassert(aResource, currArc, currTarget);
@ -681,7 +681,7 @@ nsSafariProfileMigrator::CopyPreferences(bool aReplace)
if (!hasValue)
continue;
transform->prefHasValue = PR_FALSE;
transform->prefHasValue = false;
switch (transform->type) {
case _SPM(STRING): {
CFStringRef stringValue = (CFStringRef)
@ -690,7 +690,7 @@ nsSafariProfileMigrator::CopyPreferences(bool aReplace)
char* value = GetNullTerminatedString(stringValue);
if (value) {
transform->stringValue = value;
transform->prefHasValue = PR_TRUE;
transform->prefHasValue = true;
}
}
break;
@ -701,7 +701,7 @@ nsSafariProfileMigrator::CopyPreferences(bool aReplace)
PRInt32 value = 0;
if (::CFNumberGetValue(intValue, kCFNumberSInt32Type, &value)) {
transform->intValue = value;
transform->prefHasValue = PR_TRUE;
transform->prefHasValue = true;
}
}
break;
@ -710,7 +710,7 @@ nsSafariProfileMigrator::CopyPreferences(bool aReplace)
::CFDictionaryGetValue(safariPrefs,
transform->keyName);
transform->boolValue = boolValue == kCFBooleanTrue;
transform->prefHasValue = PR_TRUE;
transform->prefHasValue = true;
}
break;
default:
@ -798,9 +798,9 @@ nsSafariProfileMigrator::CopyCookies(bool aReplace)
expiryTime += SAFARI_DATE_OFFSET;
cookieManager->Add(domain, path, name, value,
PR_FALSE, // isSecure
PR_FALSE, // isHttpOnly
PR_FALSE, // isSession
false, // isSecure
false, // isHttpOnly
false, // isSession
expiryTime);
}
}
@ -820,16 +820,16 @@ nsSafariProfileMigrator::RunBatched(nsISupports* aUserData)
switch (batchAction) {
case BATCH_ACTION_HISTORY:
rv = CopyHistoryBatched(PR_FALSE);
rv = CopyHistoryBatched(false);
break;
case BATCH_ACTION_HISTORY_REPLACE:
rv = CopyHistoryBatched(PR_TRUE);
rv = CopyHistoryBatched(true);
break;
case BATCH_ACTION_BOOKMARKS:
rv = CopyBookmarksBatched(PR_FALSE);
rv = CopyBookmarksBatched(false);
break;
case BATCH_ACTION_BOOKMARKS_REPLACE:
rv = CopyBookmarksBatched(PR_TRUE);
rv = CopyBookmarksBatched(true);
break;
}
NS_ENSURE_SUCCESS(rv, rv);
@ -1016,7 +1016,7 @@ nsSafariProfileMigrator::CopyBookmarksBatched(bool aReplace)
CFArrayRef children =
(CFArrayRef)::CFDictionaryGetValue(safariBookmarks, CFSTR("Children"));
if (children) {
rv = ParseBookmarksFolder(children, folder, bms, PR_TRUE);
rv = ParseBookmarksFolder(children, folder, bms, true);
}
}
}
@ -1062,14 +1062,14 @@ nsSafariProfileMigrator::ParseBookmarksFolder(CFArrayRef aChildren,
rv |= ParseBookmarksFolder(children,
toolbarFolder,
aBookmarksService,
PR_FALSE);
false);
}
// Look for the BookmarksMenu Bookmarks and flatten them into the top level
else if (title.EqualsLiteral("BookmarksMenu") && aIsAtRootLevel) {
rv |= ParseBookmarksFolder(children,
aParentFolder,
aBookmarksService,
PR_TRUE);
true);
}
else {
// Encountered a Folder, so create one in our Bookmarks DataSource and then
@ -1081,7 +1081,7 @@ nsSafariProfileMigrator::ParseBookmarksFolder(CFArrayRef aChildren,
rv |= ParseBookmarksFolder(children,
folder,
aBookmarksService,
PR_FALSE);
false);
}
}
else if (type.EqualsLiteral("WebBookmarkTypeLeaf")) {
@ -1120,7 +1120,7 @@ nsSafariProfileMigrator::HasFormDataToImport()
CFDictionaryRef safariPrefs = CopySafariPrefs();
if (safariPrefs) {
if (::CFDictionaryContainsKey(safariPrefs, CFSTR("RecentSearchStrings")))
hasFormData = PR_TRUE;
hasFormData = true;
::CFRelease(safariPrefs);
}
return hasFormData;
@ -1185,7 +1185,7 @@ nsSafariProfileMigrator::ProfileHasContentStyleSheet(bool *outExists)
path.Append("/userContent.css");
nsCOMPtr<nsILocalFile> file;
rv = NS_NewNativeLocalFile(path, PR_FALSE,
rv = NS_NewNativeLocalFile(path, false,
getter_AddRefs(file));
NS_ENSURE_SUCCESS(rv, rv);
@ -1217,7 +1217,7 @@ nsSafariProfileMigrator::GetSafariUserStyleSheet(nsILocalFile** aResult)
CFSTR("WebKitUserStyleSheetLocation" \
"PreferenceKey"), path)) {
nsCOMPtr<nsILocalFile> file;
rv = NS_NewLocalFile(path, PR_FALSE, getter_AddRefs(file));
rv = NS_NewLocalFile(path, false, getter_AddRefs(file));
if (NS_SUCCEEDED(rv)) {
bool exists = false;
file->Exists(&exists);

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

@ -85,10 +85,10 @@ struct MimeTypeAssociation
};
static const ProtocolAssociation appProtocols[] = {
{ "http", PR_TRUE },
{ "https", PR_TRUE },
{ "ftp", PR_FALSE },
{ "chrome", PR_FALSE }
{ "http", true },
{ "https", true },
{ "ftp", false },
{ "chrome", false }
};
static const MimeTypeAssociation appTypes[] = {
@ -160,25 +160,25 @@ nsGNOMEShellService::GetAppPathFromLauncher()
const char *launcher = PR_GetEnv("MOZ_APP_LAUNCHER");
if (!launcher)
return PR_FALSE;
return false;
if (g_path_is_absolute(launcher)) {
mAppPath = launcher;
tmp = g_path_get_basename(launcher);
gchar *fullpath = g_find_program_in_path(tmp);
if (fullpath && mAppPath.Equals(fullpath))
mAppIsInPath = PR_TRUE;
mAppIsInPath = true;
g_free(fullpath);
} else {
tmp = g_find_program_in_path(launcher);
if (!tmp)
return PR_FALSE;
return false;
mAppPath = tmp;
mAppIsInPath = PR_TRUE;
mAppIsInPath = true;
}
g_free(tmp);
return PR_TRUE;
return true;
}
bool
@ -190,7 +190,7 @@ nsGNOMEShellService::KeyMatchesAppName(const char *aKeyValue) const
gchar *nativePath = g_filename_from_utf8(aKeyValue, -1, NULL, NULL, NULL);
if (!nativePath) {
NS_ERROR("Error converting path to filesystem encoding");
return PR_FALSE;
return false;
}
commandPath = g_find_program_in_path(nativePath);
@ -200,7 +200,7 @@ nsGNOMEShellService::KeyMatchesAppName(const char *aKeyValue) const
}
if (!commandPath)
return PR_FALSE;
return false;
bool matches = mAppPath.Equals(commandPath);
g_free(commandPath);
@ -223,18 +223,18 @@ nsGNOMEShellService::CheckHandlerMatchesAppName(const nsACString &handler) const
}
if (!KeyMatchesAppName(command.get()))
return PR_FALSE; // the handler is set to another app
return false; // the handler is set to another app
return PR_TRUE;
return true;
}
NS_IMETHODIMP
nsGNOMEShellService::IsDefaultBrowser(bool aStartupCheck,
bool* aIsDefaultBrowser)
{
*aIsDefaultBrowser = PR_FALSE;
*aIsDefaultBrowser = false;
if (aStartupCheck)
mCheckedThisSession = PR_TRUE;
mCheckedThisSession = true;
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
@ -270,7 +270,7 @@ nsGNOMEShellService::IsDefaultBrowser(bool aStartupCheck,
}
}
*aIsDefaultBrowser = PR_TRUE;
*aIsDefaultBrowser = true;
return NS_OK;
}
@ -357,7 +357,7 @@ nsGNOMEShellService::GetShouldCheckDefaultBrowser(bool* aResult)
// If we've already checked, the browser has been started and this is a
// new window open, and we don't want to check again.
if (mCheckedThisSession) {
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}
@ -482,7 +482,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
nsDependentCString(file_uri));
g_free(file_uri);
background_settings->SetBoolean(NS_LITERAL_CSTRING(kDesktopDrawBGGSKey),
PR_TRUE);
true);
return rv;
}
}
@ -500,7 +500,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
EmptyCString());
gconf->SetString(NS_LITERAL_CSTRING(kDesktopImageKey), filePath);
gconf->SetBool(NS_LITERAL_CSTRING(kDesktopDrawBGKey), PR_TRUE);
gconf->SetBool(NS_LITERAL_CSTRING(kDesktopDrawBGKey), true);
}
return rv;
@ -671,7 +671,7 @@ nsGNOMEShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const ns
const nsCString spec(aURI);
const char* specStr = spec.get();
return process->Run(PR_FALSE, &specStr, 1);
return process->Run(false, &specStr, 1);
}
NS_IMETHODIMP

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

@ -43,7 +43,7 @@
class nsGNOMEShellService : public nsIShellService
{
public:
nsGNOMEShellService() : mCheckedThisSession(PR_FALSE), mAppIsInPath(PR_FALSE) { }
nsGNOMEShellService() : mCheckedThisSession(false), mAppIsInPath(false) { }
NS_DECL_ISUPPORTS
NS_DECL_NSISHELLSERVICE

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

@ -68,7 +68,7 @@ NS_IMPL_ISUPPORTS3(nsMacShellService, nsIMacShellService, nsIShellService, nsIWe
NS_IMETHODIMP
nsMacShellService::IsDefaultBrowser(bool aStartupCheck, bool* aIsDefaultBrowser)
{
*aIsDefaultBrowser = PR_FALSE;
*aIsDefaultBrowser = false;
CFStringRef firefoxID = ::CFBundleGetIdentifier(::CFBundleGetMainBundle());
if (!firefoxID) {
@ -89,7 +89,7 @@ nsMacShellService::IsDefaultBrowser(bool aStartupCheck, bool* aIsDefaultBrowser)
// checked this session (so that subsequent window opens don't show the
// default browser dialog).
if (aStartupCheck)
mCheckedThisSession = PR_TRUE;
mCheckedThisSession = true;
return NS_OK;
}
@ -129,7 +129,7 @@ nsMacShellService::GetShouldCheckDefaultBrowser(bool* aResult)
// If we've already checked, the browser has been started and this is a
// new window open, and we don't want to check again.
if (mCheckedThisSession) {
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}
@ -360,7 +360,7 @@ nsMacShellService::OpenApplication(PRInt32 aApplication)
case nsIMacShellService::APPLICATION_NETWORK:
{
nsCOMPtr<nsILocalFile> lf;
rv = NS_NewNativeLocalFile(NETWORK_PREFPANE, PR_TRUE, getter_AddRefs(lf));
rv = NS_NewNativeLocalFile(NETWORK_PREFPANE, true, getter_AddRefs(lf));
NS_ENSURE_SUCCESS(rv, rv);
bool exists;
lf->Exists(&exists);
@ -372,7 +372,7 @@ nsMacShellService::OpenApplication(PRInt32 aApplication)
case nsIMacShellService::APPLICATION_DESKTOP:
{
nsCOMPtr<nsILocalFile> lf;
rv = NS_NewNativeLocalFile(DESKTOP_PREFPANE, PR_TRUE, getter_AddRefs(lf));
rv = NS_NewNativeLocalFile(DESKTOP_PREFPANE, true, getter_AddRefs(lf));
NS_ENSURE_SUCCESS(rv, rv);
bool exists;
lf->Exists(&exists);

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

@ -47,7 +47,7 @@ class nsMacShellService : public nsIMacShellService,
public nsIWebProgressListener
{
public:
nsMacShellService() : mCheckedThisSession(PR_FALSE) {};
nsMacShellService() : mCheckedThisSession(false) {};
virtual ~nsMacShellService() {};
NS_DECL_ISUPPORTS

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

@ -351,10 +351,10 @@ nsWindowsShellService::IsDefaultBrowserVista(bool* aIsDefaultBrowser)
*aIsDefaultBrowser = res;
pAAR->Release();
return PR_TRUE;
return true;
}
#endif
return PR_FALSE;
return false;
}
NS_IMETHODIMP
@ -365,12 +365,12 @@ nsWindowsShellService::IsDefaultBrowser(bool aStartupCheck,
// checked this session (so that subsequent window opens don't show the
// default browser dialog).
if (aStartupCheck)
mCheckedThisSession = PR_TRUE;
mCheckedThisSession = true;
SETTING* settings;
SETTING* end = gSettings + sizeof(gSettings)/sizeof(SETTING);
*aIsDefaultBrowser = PR_TRUE;
*aIsDefaultBrowser = true;
PRUnichar exePath[MAX_BUF];
if (!::GetModuleFileNameW(0, exePath, MAX_BUF))
@ -396,7 +396,7 @@ nsWindowsShellService::IsDefaultBrowser(bool aStartupCheck,
HKEY theKey;
rv = OpenKeyForReading(HKEY_CLASSES_ROOT, key, &theKey);
if (NS_FAILED(rv)) {
*aIsDefaultBrowser = PR_FALSE;
*aIsDefaultBrowser = false;
return NS_OK;
}
@ -408,7 +408,7 @@ nsWindowsShellService::IsDefaultBrowser(bool aStartupCheck,
if (REG_FAILED(res) ||
!dataLongPath.Equals(currValue, CaseInsensitiveCompare)) {
// Key wasn't set, or was set to something other than our registry entry
*aIsDefaultBrowser = PR_FALSE;
*aIsDefaultBrowser = false;
return NS_OK;
}
}
@ -445,7 +445,7 @@ nsWindowsShellService::GetShouldCheckDefaultBrowser(bool* aResult)
// If we've already checked, the browser has been started and this is a
// new window open, and we don't want to check again.
if (mCheckedThisSession) {
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}
@ -847,7 +847,7 @@ nsWindowsShellService::GetMailAccountKey(HKEY* aResult)
// Close the key we opened.
::RegCloseKey(mailKey);
return PR_TRUE;
return true;
}
}
else
@ -857,7 +857,7 @@ nsWindowsShellService::GetMailAccountKey(HKEY* aResult)
// Close the key we opened.
::RegCloseKey(mailKey);
return PR_FALSE;
return false;
}
NS_IMETHODIMP
@ -876,7 +876,7 @@ nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication,
const nsCString spec(aURI);
const char* specStr = spec.get();
return process->Run(PR_FALSE, &specStr, 1);
return process->Run(false, &specStr, 1);
}
NS_IMETHODIMP

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

@ -49,7 +49,7 @@
class nsWindowsShellService : public nsIWindowsShellService
{
public:
nsWindowsShellService() : mCheckedThisSession(PR_FALSE) {};
nsWindowsShellService() : mCheckedThisSession(false) {};
virtual ~nsWindowsShellService() {};
NS_DECL_ISUPPORTS

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

@ -134,7 +134,7 @@ public:
return PLDHashNumber(hash);
}
enum { ALLOW_MEMMOVE = PR_TRUE };
enum { ALLOW_MEMMOVE = true };
private:
nsCOMPtr<nsIPrincipal> mKey;
@ -188,7 +188,7 @@ InitPropertyPolicyEntry(PLDHashTable *table,
pp->key = (JSString *)key;
pp->mGet.level = SCRIPT_SECURITY_UNDEFINED_ACCESS;
pp->mSet.level = SCRIPT_SECURITY_UNDEFINED_ACCESS;
return PR_TRUE;
return true;
}
static void
@ -251,15 +251,15 @@ InitClassPolicyEntry(PLDHashTable *table,
cp->mDomainWeAreWildcardFor = nsnull;
cp->key = PL_strdup((const char*)key);
if (!cp->key)
return PR_FALSE;
return false;
cp->mPolicy = PL_NewDHashTable(&classPolicyOps, nsnull,
sizeof(PropertyPolicy), 16);
if (!cp->mPolicy) {
PL_strfree(cp->key);
cp->key = nsnull;
return PR_FALSE;
return false;
}
return PR_TRUE;
return true;
}
// Domain Policy

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

@ -124,7 +124,7 @@ nsTranscodeJSPrincipals(JSXDRState *xdr, JSPrincipals **jsprinp)
nsJSPrincipals *nsjsprin =
static_cast<nsJSPrincipals*>(*jsprinp);
rv = stream->WriteObject(nsjsprin->nsIPrincipalPtr, PR_TRUE);
rv = stream->WriteObject(nsjsprin->nsIPrincipalPtr, true);
}
}
} else {
@ -133,7 +133,7 @@ nsTranscodeJSPrincipals(JSXDRState *xdr, JSPrincipals **jsprinp)
reinterpret_cast<nsIObjectInputStream*>(xdr->userdata);
nsCOMPtr<nsIPrincipal> prin;
rv = stream->ReadObject(PR_TRUE, getter_AddRefs(prin));
rv = stream->ReadObject(true, getter_AddRefs(prin));
if (NS_SUCCEEDED(rv)) {
PRUint32 size;
rv = stream->Read32(&size);

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

@ -152,7 +152,7 @@ nsNullPrincipal::GetPreferences(char** aPrefName, char** aID,
*aSubjectName = nsnull;
*aGrantedList = nsnull;
*aDeniedList = nsnull;
*aIsTrusted = PR_FALSE;
*aIsTrusted = false;
return NS_ERROR_FAILURE;
}
@ -230,7 +230,7 @@ nsNullPrincipal::IsCapabilityEnabled(const char *aCapability,
bool *aResult)
{
// Nope. No capabilities, I say!
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}
@ -310,7 +310,7 @@ nsNullPrincipal::GetOrigin(char** aOrigin)
NS_IMETHODIMP
nsNullPrincipal::GetHasCertificate(bool* aResult)
{
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}

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

@ -212,7 +212,7 @@ nsNullPrincipalURI::GetSpecIgnoringRef(nsACString &result)
NS_IMETHODIMP
nsNullPrincipalURI::GetHasRef(bool *result)
{
*result = PR_FALSE;
*result = false;
return NS_OK;
}
@ -266,7 +266,7 @@ nsNullPrincipalURI::CloneIgnoringRef(nsIURI **_newURI)
NS_IMETHODIMP
nsNullPrincipalURI::Equals(nsIURI *aOther, bool *_equals)
{
*_equals = PR_FALSE;
*_equals = false;
nsNullPrincipalURI *otherURI;
nsresult rv = aOther->QueryInterface(kNullPrincipalURIImplementationCID,
(void **)&otherURI);

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

@ -116,16 +116,16 @@ nsPrincipal::Release()
nsPrincipal::nsPrincipal()
: mCapabilities(nsnull),
mSecurityPolicy(nsnull),
mTrusted(PR_FALSE),
mInitialized(PR_FALSE),
mCodebaseImmutable(PR_FALSE),
mDomainImmutable(PR_FALSE)
mTrusted(false),
mInitialized(false),
mCodebaseImmutable(false),
mDomainImmutable(false)
{
if (!gIsObservingCodeBasePrincipalSupport) {
nsresult rv =
Preferences::AddBoolVarCache(&gCodeBasePrincipalSupport,
"signed.applets.codebase_principal_support",
PR_FALSE);
false);
gIsObservingCodeBasePrincipalSupport = NS_SUCCEEDED(rv);
NS_WARN_IF_FALSE(gIsObservingCodeBasePrincipalSupport,
"Installing gCodeBasePrincipalSupport failed!");
@ -142,7 +142,7 @@ nsPrincipal::Init(const nsACString& aCertFingerprint,
NS_ENSURE_STATE(!mInitialized);
NS_ENSURE_ARG(!aCertFingerprint.IsEmpty() || aCodebase); // better have one of these.
mInitialized = PR_TRUE;
mInitialized = true;
mCodebase = NS_TryToMakeImmutable(aCodebase);
mCodebaseImmutable = URIIsImmutable(mCodebase);
@ -259,16 +259,16 @@ nsPrincipal::CertificateEquals(nsIPrincipal *aOther)
aOther->GetHasCertificate(&otherHasCert);
if (otherHasCert != (mCert != nsnull)) {
// One has a cert while the other doesn't. Not equal.
return PR_FALSE;
return false;
}
if (!mCert)
return PR_TRUE;
return true;
nsCAutoString str;
aOther->GetFingerprint(str);
if (!str.Equals(mCert->fingerprint))
return PR_FALSE;
return false;
// If either subject name is empty, just let the result stand (so that
// nsScriptSecurityManager::SetCanEnableCapability works), but if they're
@ -279,7 +279,7 @@ nsPrincipal::CertificateEquals(nsIPrincipal *aOther)
return str.Equals(mCert->subjectName) || str.IsEmpty();
}
return PR_TRUE;
return true;
}
NS_IMETHODIMP
@ -287,13 +287,13 @@ nsPrincipal::Equals(nsIPrincipal *aOther, bool *aResult)
{
if (!aOther) {
NS_WARNING("Need a principal to compare this to!");
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}
if (this != aOther) {
if (!CertificateEquals(aOther)) {
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}
@ -304,12 +304,12 @@ nsPrincipal::Equals(nsIPrincipal *aOther, bool *aResult)
nsCOMPtr<nsIURI> otherURI;
nsresult rv = aOther->GetURI(getter_AddRefs(otherURI));
if (NS_FAILED(rv)) {
*aResult = PR_FALSE;
*aResult = false;
return rv;
}
if (!otherURI || !mCodebase) {
*aResult = PR_TRUE;
*aResult = true;
return NS_OK;
}
@ -323,7 +323,7 @@ nsPrincipal::Equals(nsIPrincipal *aOther, bool *aResult)
return NS_OK;
}
*aResult = PR_TRUE;
*aResult = true;
return NS_OK;
}
@ -331,11 +331,11 @@ NS_IMETHODIMP
nsPrincipal::EqualsIgnoringDomain(nsIPrincipal *aOther, bool *aResult)
{
if (this == aOther) {
*aResult = PR_TRUE;
*aResult = true;
return NS_OK;
}
*aResult = PR_FALSE;
*aResult = false;
if (!CertificateEquals(aOther)) {
return NS_OK;
}
@ -432,13 +432,13 @@ nsPrincipal::CheckMayLoad(nsIURI* aURI, bool aReport)
bool contained = false;
nsresult rv = codebaseFile->IsDirectory(&codebaseIsDir);
if (NS_SUCCEEDED(rv) && codebaseIsDir) {
rv = codebaseFile->Contains(targetFile, PR_TRUE, &contained);
rv = codebaseFile->Contains(targetFile, true, &contained);
}
else {
nsCOMPtr<nsIFile> codebaseParent;
rv = codebaseFile->GetParent(getter_AddRefs(codebaseParent));
if (NS_SUCCEEDED(rv) && codebaseParent) {
rv = codebaseParent->Contains(targetFile, PR_TRUE, &contained);
rv = codebaseParent->Contains(targetFile, true, &contained);
}
}
@ -564,7 +564,7 @@ NS_IMETHODIMP
nsPrincipal::IsCapabilityEnabled(const char *capability, void *annotation,
bool *result)
{
*result = PR_FALSE;
*result = false;
nsHashtable *ht = (nsHashtable *) annotation;
if (!ht) {
return NS_OK;
@ -838,7 +838,7 @@ nsPrincipal::InitFromPersistent(const char* aPrefName,
"mAnnotations was already initialized?");
NS_PRECONDITION(!mInitialized, "We were already initialized?");
mInitialized = PR_TRUE;
mInitialized = true;
nsresult rv;
if (aIsCert) {
@ -927,7 +927,7 @@ AppendCapability(nsHashKey *aKey, void *aData, void *capListPtr)
capList->denied->Append(' ');
}
return PR_TRUE;
return true;
}
NS_IMETHODIMP
@ -1126,14 +1126,14 @@ nsPrincipal::Read(nsIObjectInputStream* aStream)
return rv;
}
rv = aStream->ReadObject(PR_TRUE, getter_AddRefs(cert));
rv = aStream->ReadObject(true, getter_AddRefs(cert));
if (NS_FAILED(rv)) {
return rv;
}
}
nsCOMPtr<nsIURI> codebase;
rv = NS_ReadOptionalObject(aStream, PR_TRUE, getter_AddRefs(codebase));
rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(codebase));
if (NS_FAILED(rv)) {
return rv;
}
@ -1142,7 +1142,7 @@ nsPrincipal::Read(nsIObjectInputStream* aStream)
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIURI> domain;
rv = NS_ReadOptionalObject(aStream, PR_TRUE, getter_AddRefs(domain));
rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(domain));
if (NS_FAILED(rv)) {
return rv;
}
@ -1212,7 +1212,7 @@ nsPrincipal::Write(nsIObjectOutputStream* aStream)
}
rv = aStream->WriteCompoundObject(mCert->cert, NS_GET_IID(nsISupports),
PR_TRUE);
true);
if (NS_FAILED(rv)) {
return rv;
}
@ -1223,13 +1223,13 @@ nsPrincipal::Write(nsIObjectOutputStream* aStream)
// preferences change.
rv = NS_WriteOptionalCompoundObject(aStream, mCodebase, NS_GET_IID(nsIURI),
PR_TRUE);
true);
if (NS_FAILED(rv)) {
return rv;
}
rv = NS_WriteOptionalCompoundObject(aStream, mDomain, NS_GET_IID(nsIURI),
PR_TRUE);
true);
if (NS_FAILED(rv)) {
return rv;
}

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

@ -227,8 +227,8 @@ public:
ClassInfoData(nsIClassInfo *aClassInfo, const char *aName)
: mClassInfo(aClassInfo),
mName(const_cast<char *>(aName)),
mDidGetFlags(PR_FALSE),
mMustFreeName(PR_FALSE)
mDidGetFlags(false),
mMustFreeName(false)
{
}
@ -250,7 +250,7 @@ public:
mFlags = 0;
}
mDidGetFlags = PR_TRUE;
mDidGetFlags = true;
}
return mFlags;
@ -269,7 +269,7 @@ public:
}
if (mName) {
mMustFreeName = PR_TRUE;
mMustFreeName = true;
} else {
mName = const_cast<char *>("UnnamedClass");
}
@ -440,7 +440,7 @@ static bool
DeleteCapability(nsHashKey *aKey, void *aData, void* closure)
{
NS_Free(aData);
return PR_TRUE;
return true;
}
//-- Per-Domain Policy - applies to one or more protocols or hosts
@ -464,16 +464,16 @@ struct DomainEntry
int len = strlen(anOrigin);
int thisLen = mOrigin.Length();
if (len < thisLen)
return PR_FALSE;
return false;
if (mOrigin.RFindChar(':', thisLen-1, 1) != -1)
//-- Policy applies to all URLs of this scheme, compare scheme only
return mOrigin.EqualsIgnoreCase(anOrigin, thisLen);
//-- Policy applies to a particular host; compare domains
if (!mOrigin.Equals(anOrigin + (len - thisLen)))
return PR_FALSE;
return false;
if (len == thisLen)
return PR_TRUE;
return true;
char charBefore = anOrigin[len-thisLen-1];
return (charBefore == '.' || charBefore == ':' || charBefore == '/');
}
@ -496,7 +496,7 @@ DeleteDomainEntry(nsHashKey *aKey, void *aData, void* closure)
delete entry;
entry = next;
} while (entry);
return PR_TRUE;
return true;
}
/////////////////////////////
@ -1018,14 +1018,14 @@ nsScriptSecurityManager::CheckSameOriginPrincipal(nsIPrincipal* aSubject,
if (!subjectURI) {
aSubject->GetURI(getter_AddRefs(subjectURI));
} else {
subjectSetDomain = PR_TRUE;
subjectSetDomain = true;
}
aObject->GetDomain(getter_AddRefs(objectURI));
if (!objectURI) {
aObject->GetURI(getter_AddRefs(objectURI));
} else {
objectSetDomain = PR_TRUE;
objectSetDomain = true;
}
if (SecurityCompareURIs(subjectURI, objectURI))
@ -1463,7 +1463,7 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
NS_ENSURE_SUCCESS(rv, rv);
if (hasFlags) {
return aPrincipal->CheckMayLoad(targetBaseURI, PR_TRUE);
return aPrincipal->CheckMayLoad(targetBaseURI, true);
}
//-- get the source scheme
@ -1788,12 +1788,12 @@ nsScriptSecurityManager::CanExecuteScripts(JSContext* cx,
nsIPrincipal *aPrincipal,
bool *result)
{
*result = PR_FALSE;
*result = false;
if (aPrincipal == mSystemPrincipal)
{
// Even if JavaScript is disabled, we must still execute system scripts
*result = PR_TRUE;
*result = true;
return NS_OK;
}
@ -1803,7 +1803,7 @@ nsScriptSecurityManager::CanExecuteScripts(JSContext* cx,
if (!scriptContext->GetScriptsEnabled()) {
// No scripting on this context, folks
*result = PR_FALSE;
*result = false;
return NS_OK;
}
@ -1838,7 +1838,7 @@ nsScriptSecurityManager::CanExecuteScripts(JSContext* cx,
aPrincipal->GetURI(getter_AddRefs(principalURI));
if (!principalURI) {
// Broken principal of some sort. Disallow.
*result = PR_FALSE;
*result = false;
return NS_ERROR_UNEXPECTED;
}
@ -1852,7 +1852,7 @@ nsScriptSecurityManager::CanExecuteScripts(JSContext* cx,
rv = module->GetURIFlags(principalURI, &flags);
if (NS_SUCCEEDED(rv) &&
(flags & nsIAboutModule::ALLOW_SCRIPT)) {
*result = PR_TRUE;
*result = true;
return NS_OK;
}
}
@ -1872,12 +1872,12 @@ nsScriptSecurityManager::CanExecuteScripts(JSContext* cx,
nsnull, &secLevel);
if (NS_FAILED(rv) || secLevel.level == SCRIPT_SECURITY_NO_ACCESS)
{
*result = PR_FALSE;
*result = false;
return rv;
}
//-- Nobody vetoed, so allow the JS to run.
*result = PR_TRUE;
*result = true;
return NS_OK;
}
@ -1917,7 +1917,7 @@ NS_IMETHODIMP
nsScriptSecurityManager::SubjectPrincipalIsSystem(bool* aIsSystem)
{
NS_ENSURE_ARG_POINTER(aIsSystem);
*aIsSystem = PR_FALSE;
*aIsSystem = false;
if (!mSystemPrincipal)
return NS_OK;
@ -1931,7 +1931,7 @@ nsScriptSecurityManager::SubjectPrincipalIsSystem(bool* aIsSystem)
{
// No subject principal means no JS is running;
// this is the equivalent of system principal code
*aIsSystem = PR_TRUE;
*aIsSystem = true;
return NS_OK;
}
@ -1953,7 +1953,7 @@ nsScriptSecurityManager::GetCertificatePrincipal(const nsACString& aCertFingerpr
aCertificate);
return DoGetCertificatePrincipal(aCertFingerprint, aSubjectName,
aPrettyName, aCertificate, aURI, PR_TRUE,
aPrettyName, aCertificate, aURI, true,
result);
}
@ -2037,7 +2037,7 @@ nsScriptSecurityManager::DoGetCertificatePrincipal(const nsACString& aCertFinger
subjectName, aPrettyName,
granted, denied,
aCertificate,
PR_TRUE, PR_FALSE);
true, false);
if (NS_FAILED(rv))
return rv;
@ -2136,7 +2136,7 @@ nsScriptSecurityManager::GetCodebasePrincipal(nsIURI *aURI,
rv = codebase->InitFromPersistent(prefName, id,
subjectName, EmptyCString(),
granted, denied,
nsnull, PR_FALSE,
nsnull, false,
isTrusted);
if (NS_FAILED(rv))
return rv;
@ -2450,7 +2450,7 @@ nsScriptSecurityManager::doGetObjectPrincipal(JSObject *aObj
#ifdef DEBUG
aAllowShortCircuit
#else
PR_TRUE
true
#endif
);
if (result) {
@ -2494,7 +2494,7 @@ nsScriptSecurityManager::doGetObjectPrincipal(JSObject *aObj
#ifdef DEBUG
if (aAllowShortCircuit) {
nsIPrincipal *principal = doGetObjectPrincipal(origObj, PR_FALSE);
nsIPrincipal *principal = doGetObjectPrincipal(origObj, false);
// Location is always wrapped (even for same-compartment), so we can
// loosen the check to same-origin instead of same-principal.
@ -2538,7 +2538,7 @@ nsScriptSecurityManager::SavePrincipal(nsIPrincipal* aToSave)
subjectNamePrefName );
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
mIsWritingPrefs = PR_TRUE;
mIsWritingPrefs = true;
if (grantedList) {
Preferences::SetCString(grantedPrefName.get(), grantedList);
} else {
@ -2559,7 +2559,7 @@ nsScriptSecurityManager::SavePrincipal(nsIPrincipal* aToSave)
Preferences::ClearUser(subjectNamePrefName.get());
}
mIsWritingPrefs = PR_FALSE;
mIsWritingPrefs = false;
nsIPrefService* prefService = Preferences::GetService();
NS_ENSURE_TRUE(prefService, NS_ERROR_FAILURE);
@ -2596,12 +2596,12 @@ nsScriptSecurityManager::IsCapabilityEnabled(const char *capability,
*result = (targetPrincipal && !target)
? (targetPrincipal == mSystemPrincipal)
: PR_TRUE;
: true;
return NS_OK;
}
*result = PR_FALSE;
*result = false;
nsIPrincipal* previousPrincipal = nsnull;
do
{
@ -2703,7 +2703,7 @@ nsScriptSecurityManager::CheckConfirmDialog(JSContext* cx, nsIPrincipal* aPrinci
const char* aCapability, bool *checkValue)
{
nsresult rv;
*checkValue = PR_FALSE;
*checkValue = false;
//-- Get a prompter for the current window.
nsCOMPtr<nsIPrompt> prompter;
@ -2726,7 +2726,7 @@ nsScriptSecurityManager::CheckConfirmDialog(JSContext* cx, nsIPrincipal* aPrinci
if (wwatch)
wwatch->GetNewPrompter(0, getter_AddRefs(prompter));
if (!prompter)
return PR_FALSE;
return false;
}
//-- Localize the dialog text
@ -2734,25 +2734,25 @@ nsScriptSecurityManager::CheckConfirmDialog(JSContext* cx, nsIPrincipal* aPrinci
rv = sStrBundle->GetStringFromName(NS_LITERAL_STRING("CheckMessage").get(),
getter_Copies(check));
if (NS_FAILED(rv))
return PR_FALSE;
return false;
nsXPIDLString title;
rv = sStrBundle->GetStringFromName(NS_LITERAL_STRING("Titleline").get(),
getter_Copies(title));
if (NS_FAILED(rv))
return PR_FALSE;
return false;
nsXPIDLString yesStr;
rv = sStrBundle->GetStringFromName(NS_LITERAL_STRING("Yes").get(),
getter_Copies(yesStr));
if (NS_FAILED(rv))
return PR_FALSE;
return false;
nsXPIDLString noStr;
rv = sStrBundle->GetStringFromName(NS_LITERAL_STRING("No").get(),
getter_Copies(noStr));
if (NS_FAILED(rv))
return PR_FALSE;
return false;
nsCAutoString val;
bool hasCert;
@ -2763,7 +2763,7 @@ nsScriptSecurityManager::CheckConfirmDialog(JSContext* cx, nsIPrincipal* aPrinci
rv = GetPrincipalDomainOrigin(aPrincipal, val);
if (NS_FAILED(rv))
return PR_FALSE;
return false;
NS_ConvertUTF8toUTF16 location(val);
NS_ConvertASCIItoUTF16 capability(aCapability);
@ -2776,7 +2776,7 @@ nsScriptSecurityManager::CheckConfirmDialog(JSContext* cx, nsIPrincipal* aPrinci
ArrayLength(formatStrings),
getter_Copies(message));
if (NS_FAILED(rv))
return PR_FALSE;
return false;
PRInt32 buttonPressed = 1; // If the user exits by clicking the close box, assume No (button 1)
rv = prompter->ConfirmEx(title.get(), message.get(),
@ -2787,7 +2787,7 @@ nsScriptSecurityManager::CheckConfirmDialog(JSContext* cx, nsIPrincipal* aPrinci
yesStr.get(), noStr.get(), nsnull, check.get(), checkValue, &buttonPressed);
if (NS_FAILED(rv))
*checkValue = PR_FALSE;
*checkValue = false;
return (buttonPressed == 0);
}
@ -3002,7 +3002,7 @@ nsScriptSecurityManager::SetCanEnableCapability(const nsACString& certFingerprin
nsCOMPtr<nsIPrincipal> objectPrincipal;
rv = DoGetCertificatePrincipal(certFingerprint, EmptyCString(),
EmptyCString(), nsnull,
nsnull, PR_FALSE,
nsnull, false,
getter_AddRefs(objectPrincipal));
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
rv = objectPrincipal->SetCanEnableCapability(capability, canEnable);
@ -3307,7 +3307,7 @@ nsScriptSecurityManager::Observe(nsISupports* aObject, const char* aTopic,
else if (PL_strncmp(message, sPolicyPrefix, sizeof(sPolicyPrefix)-1) == 0)
{
// This will force re-initialization of the pref table
mPolicyPrefsChanged = PR_TRUE;
mPolicyPrefsChanged = true;
}
else if ((PL_strncmp(message, sPrincipalPrefix, sizeof(sPrincipalPrefix)-1) == 0) &&
!mIsWritingPrefs)
@ -3333,10 +3333,10 @@ nsScriptSecurityManager::nsScriptSecurityManager(void)
mDefaultPolicy(nsnull),
mCapabilities(nsnull),
mContextPrincipals(nsnull),
mPrefInitialized(PR_FALSE),
mIsJavaScriptEnabled(PR_FALSE),
mIsWritingPrefs(PR_FALSE),
mPolicyPrefsChanged(PR_TRUE)
mPrefInitialized(false),
mIsJavaScriptEnabled(false),
mIsWritingPrefs(false),
mPolicyPrefsChanged(true)
{
NS_ASSERTION(sizeof(PRWord) == sizeof(void*),
"PRWord and void* have different lengths on this platform. "
@ -3657,7 +3657,7 @@ nsScriptSecurityManager::InitPolicies()
}
// Reset the "dirty" flag
mPolicyPrefsChanged = PR_FALSE;
mPolicyPrefsChanged = false;
#ifdef DEBUG_CAPS_HACKER
PrintPolicyDB();
@ -3905,7 +3905,7 @@ nsScriptSecurityManager::InitPrincipals(PRUint32 aPrefCount, const char** aPrefN
if (PL_strncmp(aPrefNames[c], certificateName,
sizeof(certificateName) - 1) == 0)
{
isCert = PR_TRUE;
isCert = true;
}
else if (PL_strncmp(aPrefNames[c], codebaseName,
sizeof(codebaseName) - 1) == 0)
@ -3936,9 +3936,9 @@ inline void
nsScriptSecurityManager::ScriptSecurityPrefChanged()
{
// JavaScript defaults to enabled in failure cases.
mIsJavaScriptEnabled = PR_TRUE;
mIsJavaScriptEnabled = true;
sStrictFileOriginPolicy = PR_TRUE;
sStrictFileOriginPolicy = true;
nsresult rv;
if (!mPrefInitialized) {
@ -3961,7 +3961,7 @@ nsScriptSecurityManager::InitPrefs()
nsIPrefBranch* branch = Preferences::GetRootBranch();
NS_ENSURE_TRUE(branch, NS_ERROR_FAILURE);
mPrefInitialized = PR_TRUE;
mPrefInitialized = true;
// Set the initial value of the "javascript.enabled" prefs
ScriptSecurityPrefChanged();
@ -4037,7 +4037,7 @@ PrintDomainPolicy(nsHashKey *aKey, void *aData, void* aClosure)
printf("Domain: %s Policy Name: %s.\n", de->mOrigin.get(),
de->mPolicyName_DEBUG.get());
PL_DHashTableEnumerate(de->mDomainPolicy, PrintClassPolicy, aClosure);
return PR_TRUE;
return true;
}
static bool
@ -4045,7 +4045,7 @@ PrintCapability(nsHashKey *aKey, void *aData, void* aClosure)
{
char* cap = (char*)aData;
printf(" %s.\n", cap);
return PR_TRUE;
return true;
}
void

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

@ -100,7 +100,7 @@ nsSystemPrincipal::GetPreferences(char** aPrefName, char** aID,
*aSubjectName = nsnull;
*aGrantedList = nsnull;
*aDeniedList = nsnull;
*aIsTrusted = PR_FALSE;
*aIsTrusted = false;
return NS_ERROR_FAILURE;
}
@ -121,7 +121,7 @@ nsSystemPrincipal::EqualsIgnoringDomain(nsIPrincipal *other, bool *result)
NS_IMETHODIMP
nsSystemPrincipal::Subsumes(nsIPrincipal *other, bool *result)
{
*result = PR_TRUE;
*result = true;
return NS_OK;
}
@ -160,7 +160,7 @@ nsSystemPrincipal::IsCapabilityEnabled(const char *capability,
void *annotation,
bool *result)
{
*result = PR_TRUE;
*result = true;
return NS_OK;
}
@ -229,7 +229,7 @@ nsSystemPrincipal::GetCertificate(nsISupports** aCertificate)
NS_IMETHODIMP
nsSystemPrincipal::GetHasCertificate(bool* aResult)
{
*aResult = PR_FALSE;
*aResult = false;
return NS_OK;
}

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

@ -96,7 +96,7 @@ NS_IMETHODIMP
nsChromeProtocolHandler::AllowPort(PRInt32 port, const char *scheme, bool *_retval)
{
// don't override anything.
*_retval = PR_FALSE;
*_retval = false;
return NS_OK;
}
@ -136,7 +136,7 @@ nsChromeProtocolHandler::NewURI(const nsACString &aSpec,
if (NS_FAILED(rv))
return rv;
surl->SetMutable(PR_FALSE);
surl->SetMutable(false);
NS_ADDREF(*result = url);
return NS_OK;

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

@ -184,7 +184,7 @@ nsChromeRegistry::Init()
// before we are actually fully initialized.
gChromeRegistry = this;
mInitialized = PR_TRUE;
mInitialized = true;
return NS_OK;
}
@ -423,8 +423,8 @@ static bool IsChromeURI(nsIURI* aURI)
{
bool isChrome=false;
if (NS_SUCCEEDED(aURI->SchemeIs("chrome", &isChrome)) && isChrome)
return PR_TRUE;
return PR_FALSE;
return true;
return false;
}
// XXXbsmedberg: move this to windowmediator
@ -470,7 +470,7 @@ nsresult nsChromeRegistry::RefreshWindow(nsIDOMWindow* aWindow)
if (IsChromeURI(uri)) {
// Reload the sheet.
nsRefPtr<nsCSSStyleSheet> newSheet;
rv = document->LoadChromeSheetSync(uri, PR_TRUE,
rv = document->LoadChromeSheetSync(uri, true,
getter_AddRefs(newSheet));
if (NS_FAILED(rv)) return rv;
if (newSheet) {
@ -516,7 +516,7 @@ nsresult nsChromeRegistry::RefreshWindow(nsIDOMWindow* aWindow)
nsRefPtr<nsCSSStyleSheet> newSheet;
// XXX what about chrome sheets that have a title or are disabled? This
// only works by sheer dumb luck.
document->LoadChromeSheetSync(uri, PR_FALSE, getter_AddRefs(newSheet));
document->LoadChromeSheetSync(uri, false, getter_AddRefs(newSheet));
// Even if it's null, we put in in there.
newSheets.AppendObject(newSheet);
}
@ -572,7 +572,7 @@ nsChromeRegistry::ReloadChrome()
nsCOMPtr<nsIDOMLocation> location;
domWindow->GetLocation(getter_AddRefs(location));
if (location) {
rv = location->Reload(PR_FALSE);
rv = location->Reload(false);
if (NS_FAILED(rv)) return rv;
}
}
@ -589,7 +589,7 @@ NS_IMETHODIMP
nsChromeRegistry::AllowScriptsForPackage(nsIURI* aChromeURI, bool *aResult)
{
nsresult rv;
*aResult = PR_FALSE;
*aResult = false;
#ifdef DEBUG
bool isChrome;
@ -605,7 +605,7 @@ nsChromeRegistry::AllowScriptsForPackage(nsIURI* aChromeURI, bool *aResult)
NS_ENSURE_SUCCESS(rv, rv);
if (!provider.EqualsLiteral("skin"))
*aResult = PR_TRUE;
*aResult = true;
return NS_OK;
}
@ -615,7 +615,7 @@ nsChromeRegistry::AllowContentToAccess(nsIURI *aURI, bool *aResult)
{
nsresult rv;
*aResult = PR_FALSE;
*aResult = false;
#ifdef DEBUG
bool isChrome;
@ -647,17 +647,17 @@ nsChromeRegistry::WrappersEnabled(nsIURI *aURI)
{
nsCOMPtr<nsIURL> chromeURL (do_QueryInterface(aURI));
if (!chromeURL)
return PR_FALSE;
return false;
bool isChrome = false;
nsresult rv = chromeURL->SchemeIs("chrome", &isChrome);
if (NS_FAILED(rv) || !isChrome)
return PR_FALSE;
return false;
nsCAutoString package;
rv = chromeURL->GetHostPort(package);
if (NS_FAILED(rv))
return PR_FALSE;
return false;
PRUint32 flags;
rv = GetFlagsFromPackage(package, &flags);

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

@ -99,7 +99,7 @@ public:
NS_IMETHOD ConvertChromeURL(nsIURI* aChromeURI, nsIURI* *aResult);
// nsChromeRegistry methods:
nsChromeRegistry() : mInitialized(PR_FALSE) { }
nsChromeRegistry() : mInitialized(false) { }
virtual ~nsChromeRegistry();
virtual nsresult Init();

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

@ -106,7 +106,7 @@ static bool
LanguagesMatch(const nsACString& a, const nsACString& b)
{
if (a.Length() < 2 || b.Length() < 2)
return PR_FALSE;
return false;
nsACString::const_iterator as, ae, bs, be;
a.BeginReading(as);
@ -116,13 +116,13 @@ LanguagesMatch(const nsACString& a, const nsACString& b)
while (*as == *bs) {
if (*as == '-')
return PR_TRUE;
return true;
++as; ++bs;
// reached the end
if (as == ae && bs == be)
return PR_TRUE;
return true;
// "a" is short
if (as == ae)
@ -133,11 +133,11 @@ LanguagesMatch(const nsACString& a, const nsACString& b)
return (*as == '-');
}
return PR_FALSE;
return false;
}
nsChromeRegistryChrome::nsChromeRegistryChrome()
: mProfileLoaded(PR_FALSE)
: mProfileLoaded(false)
{
mPackagesHash.ops = nsnull;
}
@ -192,16 +192,16 @@ nsChromeRegistryChrome::Init()
nsCOMPtr<nsIPrefBranch2> prefs2 (do_QueryInterface(prefs));
if (prefs2) {
rv = prefs2->AddObserver(MATCH_OS_LOCALE_PREF, this, PR_TRUE);
rv = prefs2->AddObserver(SELECTED_LOCALE_PREF, this, PR_TRUE);
rv = prefs2->AddObserver(SELECTED_SKIN_PREF, this, PR_TRUE);
rv = prefs2->AddObserver(MATCH_OS_LOCALE_PREF, this, true);
rv = prefs2->AddObserver(SELECTED_LOCALE_PREF, this, true);
rv = prefs2->AddObserver(SELECTED_SKIN_PREF, this, true);
}
}
nsCOMPtr<nsIObserverService> obsService = mozilla::services::GetObserverService();
if (obsService) {
obsService->AddObserver(this, "command-line-startup", PR_TRUE);
obsService->AddObserver(this, "profile-initial-state", PR_TRUE);
obsService->AddObserver(this, "command-line-startup", true);
obsService->AddObserver(this, "profile-initial-state", true);
}
return NS_OK;
@ -272,7 +272,7 @@ getUILangCountry(nsACString& aUILang)
NS_IMETHODIMP
nsChromeRegistryChrome::IsLocaleRTL(const nsACString& package, bool *aResult)
{
*aResult = PR_FALSE;
*aResult = false;
nsCAutoString locale;
GetSelectedLocale(package, locale);
@ -384,7 +384,7 @@ nsChromeRegistryChrome::Observe(nsISupports *aSubject, const char *aTopic,
if (cmdLine) {
nsAutoString uiLocale;
rv = cmdLine->HandleFlagWithParam(NS_LITERAL_STRING(UILOCALE_CMD_LINE_ARG),
PR_FALSE, uiLocale);
false, uiLocale);
if (NS_SUCCEEDED(rv) && !uiLocale.IsEmpty()) {
CopyUTF16toUTF8(uiLocale, mSelectedLocale);
nsCOMPtr<nsIPrefBranch2> prefs (do_GetService(NS_PREFSERVICE_CONTRACTID));
@ -395,7 +395,7 @@ nsChromeRegistryChrome::Observe(nsISupports *aSubject, const char *aTopic,
}
}
else if (!strcmp("profile-initial-state", aTopic)) {
mProfileLoaded = PR_TRUE;
mProfileLoaded = true;
}
else {
NS_ERROR("Unexpected observer topic!");
@ -619,7 +619,7 @@ nsChromeRegistryChrome::InitEntry(PLDHashTable *table, PLDHashEntryHdr *entry,
const nsACString& str = *reinterpret_cast<const nsACString*>(key);
new (entry) PackageEntry(str);
return PR_TRUE;
return true;
}
const PLDHashTableOps

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

@ -249,8 +249,8 @@ public:
* aPossibleAncestor
* @param aPossibleAncestor node to test for being an ancestor of
* aPossibleDescendant
* @return PR_TRUE if aPossibleDescendant is a descendant of
* aPossibleAncestor (or is aPossibleAncestor). PR_FALSE
* @return true if aPossibleDescendant is a descendant of
* aPossibleAncestor (or is aPossibleAncestor). false
* otherwise.
*/
static bool ContentIsDescendantOf(const nsINode* aPossibleDescendant,
@ -319,7 +319,7 @@ public:
* 0 if error or if point1 == point2.
* NOTE! If the two nodes aren't in the same connected subtree,
* the result is 1, and the optional aDisconnected parameter
* is set to PR_TRUE.
* is set to true.
*/
static PRInt32 ComparePoints(nsINode* aParent1, PRInt32 aOffset1,
nsINode* aParent2, PRInt32 aOffset2,
@ -557,8 +557,8 @@ public:
nsIAtom **aTagName, PRInt32 *aNameSpaceID);
// Get a permission-manager setting for the given uri and type.
// If the pref doesn't exist or if it isn't ALLOW_ACTION, PR_FALSE is
// returned, otherwise PR_TRUE is returned.
// If the pref doesn't exist or if it isn't ALLOW_ACTION, false is
// returned, otherwise true is returned.
static bool IsSitePermAllow(nsIURI* aURI, const char* aType);
static nsILineBreaker* LineBreaker()
@ -584,7 +584,7 @@ public:
static void UnregisterShutdownObserver(nsIObserver* aObserver);
/**
* @return PR_TRUE if aContent has an attribute aName in namespace aNameSpaceID,
* @return true if aContent has an attribute aName in namespace aNameSpaceID,
* and the attribute value is non-empty.
*/
static bool HasNonEmptyAttr(const nsIContent* aContent, PRInt32 aNameSpaceID,
@ -610,10 +610,10 @@ public:
* image. This will be set even if a security check fails for the
* image, to some reasonable REJECT_* value. This out param will only
* be set if it's non-null.
* @return PR_TRUE if the load can proceed, or PR_FALSE if it is blocked.
* @return true if the load can proceed, or false if it is blocked.
* Note that aImageBlockingStatus, if set will always be an ACCEPT
* status if PR_TRUE is returned and always be a REJECT_* status if
* PR_FALSE is returned.
* status if true is returned and always be a REJECT_* status if
* false is returned.
*/
static bool CanLoadImage(nsIURI* aURI,
nsISupports* aContext,
@ -718,7 +718,7 @@ public:
*
* This method is particularly useful for callers who are trying to ensure
* that they are working with a non-anonymous descendant of a given node. If
* aContent is a descendant of aNode, a return value of PR_FALSE from this
* aContent is a descendant of aNode, a return value of false from this
* method means that it's an anonymous descendant from aNode's point of view.
*
* Both arguments to this method must be non-null.
@ -834,8 +834,8 @@ public:
* referenced by aURI. In cases where there's no need for any extra
* security wrapper automation the script file name that's returned
* will be the spec in aURI, else it will be the spec in aDocument's
* URI followed by aURI's spec, separated by " -> ". Returns PR_TRUE
* if the script file name was modified, PR_FALSE if it's aURI's
* URI followed by aURI's spec, separated by " -> ". Returns true
* if the script file name was modified, false if it's aURI's
* spec.
*/
static bool GetWrapperSafeScriptFilename(nsIDocument *aDocument,
@ -876,7 +876,7 @@ public:
* Quick helper to determine whether there are any mutation listeners
* of a given type that apply to any content in this document. It is valid
* to pass null for aDocument here, in which case this function always
* returns PR_TRUE.
* returns true.
*
* @param aDocument The document to search for listeners
* @param aType The type of listener (NS_EVENT_BITS_MUTATION_*)
@ -999,10 +999,10 @@ public:
/**
* Get the eventlistener manager for aNode. If a new eventlistener manager
* was created, aCreated is set to PR_TRUE.
* was created, aCreated is set to true.
*
* @param aNode The node for which to get the eventlistener manager.
* @param aCreateIfNotFound If PR_FALSE, returns a listener manager only if
* @param aCreateIfNotFound If false, returns a listener manager only if
* one already exists.
*/
static nsEventListenerManager* GetListenerManager(nsINode* aNode,
@ -1272,7 +1272,7 @@ public:
nsXPCOMCycleCollectionParticipant* participant;
CallQueryInterface(aScriptObjectHolder, &participant);
HoldJSObjects(aScriptObjectHolder, participant);
aCache->SetPreservingWrapper(PR_TRUE);
aCache->SetPreservingWrapper(true);
#ifdef DEBUG
// Make sure the cycle collector will be able to traverse to the wrapper.
CheckCCWrapperTraversal(aScriptObjectHolder, aCache);
@ -1347,7 +1347,7 @@ public:
* @param aIsUserTriggered whether the user triggered the link. This would be
* false for loads from auto XLinks or from the
* click() method if we ever implement it.
* @param aIsTrusted If PR_FALSE, JS Context will be pushed to stack
* @param aIsTrusted If false, JS Context will be pushed to stack
* when the link is triggered.
*/
static void TriggerLink(nsIContent *aContent, nsPresContext *aPresContext,
@ -1588,7 +1588,7 @@ public:
/**
* The method checks whether the caller can access native anonymous content.
* If there is no JS in the stack or privileged JS is running, this
* method returns PR_TRUE, otherwise PR_FALSE.
* method returns true, otherwise false.
*/
static bool CanAccessNativeAnon();
@ -1697,12 +1697,12 @@ public:
static bool IsFocusedContent(const nsIContent *aContent);
/**
* Returns PR_TRUE if the DOM full-screen API is enabled.
* Returns true if the DOM full-screen API is enabled.
*/
static bool IsFullScreenApiEnabled();
/**
* Returns PR_TRUE if requests for full-screen are allowed in the current
* Returns true if requests for full-screen are allowed in the current
* context. Requests are only allowed if the user initiated them (like with
* a mouse-click or key press), unless this check has been disabled by
* setting the pref "full-screen-api.allow-trusted-requests-only" to false.
@ -1710,7 +1710,7 @@ public:
static bool IsRequestFullScreenAllowed();
/**
* Returns PR_TRUE if key input is restricted in DOM full-screen mode
* Returns true if key input is restricted in DOM full-screen mode
* to non-alpha-numeric key codes only. This mirrors the
* "full-screen-api.key-input-restricted" pref.
*/
@ -1718,7 +1718,7 @@ public:
/**
* Returns the time limit on handling user input before
* nsEventStateManager::IsHandlingUserInput() stops returning PR_TRUE.
* nsEventStateManager::IsHandlingUserInput() stops returning true.
* This enables us to detect long running user-generated event handlers.
*/
static TimeDuration HandlingUserInputTimeout();
@ -1942,7 +1942,7 @@ public:
nsCxPusher();
~nsCxPusher(); // Calls Pop();
// Returns PR_FALSE if something erroneous happened.
// Returns false if something erroneous happened.
bool Push(nsIDOMEventTarget *aCurrentTarget);
// If nothing has been pushed to stack, this works like Push.
// Otherwise if context will change, Pop and Push will be called.

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

@ -78,7 +78,7 @@ public:
mName(aName), mStart(0), mLength(aLength)
{
// Ensure non-null mContentType by default
mContentType.SetIsVoid(PR_FALSE);
mContentType.SetIsVoid(false);
}
nsDOMFileBase(const nsAString& aContentType, PRUint64 aLength)
@ -86,7 +86,7 @@ public:
mStart(0), mLength(aLength)
{
// Ensure non-null mContentType by default
mContentType.SetIsVoid(PR_FALSE);
mContentType.SetIsVoid(false);
}
nsDOMFileBase(const nsAString& aContentType,
@ -97,7 +97,7 @@ public:
NS_ASSERTION(aLength != PR_UINT64_MAX,
"Must know length when creating slice");
// Ensure non-null mContentType by default
mContentType.SetIsVoid(PR_FALSE);
mContentType.SetIsVoid(false);
}
virtual ~nsDOMFileBase() {}
@ -138,7 +138,7 @@ public:
{
NS_ASSERTION(mFile, "must have file");
// Lazily get the content type and size
mContentType.SetIsVoid(PR_TRUE);
mContentType.SetIsVoid(true);
mFile->GetLeafName(mName);
}
@ -158,8 +158,8 @@ public:
mWholeFile(true)
{
// Lazily get the content type and size
mContentType.SetIsVoid(PR_TRUE);
mName.SetIsVoid(PR_TRUE);
mContentType.SetIsVoid(true);
mName.SetIsVoid(true);
}
NS_DECL_ISUPPORTS_INHERITED

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

@ -139,7 +139,7 @@ public:
* parent's child list and after the nsIDocumentObserver notifications for
* the removal have been dispatched.
* @param aDeep Whether to recursively unbind the entire subtree rooted at
* this node. The only time PR_FALSE should be passed is when the
* this node. The only time false should be passed is when the
* parent node of the content is being destroyed.
* @param aNullParent Whether to null out the parent pointer as well. This
* is usually desirable. This argument should only be false while
@ -398,8 +398,8 @@ public:
* @param aNameSpaceID the namespace of the attr
* @param aName the name of the attr
* @param aResult the value (may legitimately be the empty string) [OUT]
* @returns PR_TRUE if the attribute was set (even when set to empty string)
* PR_FALSE when not set.
* @returns true if the attribute was set (even when set to empty string)
* false when not set.
*/
virtual bool GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsAString& aResult) const = 0;
@ -428,7 +428,7 @@ public:
const nsAString& aValue,
nsCaseTreatment aCaseSensitive) const
{
return PR_FALSE;
return false;
}
/**
@ -446,7 +446,7 @@ public:
nsIAtom* aValue,
nsCaseTreatment aCaseSensitive) const
{
return PR_FALSE;
return false;
}
enum {
@ -525,7 +525,7 @@ public:
virtual PRUint32 TextLength() = 0;
/**
* Set the text to the given value. If aNotify is PR_TRUE then
* Set the text to the given value. If aNotify is true then
* the document is notified of the content change.
* NOTE: For elements this always ASSERTS and returns NS_ERROR_FAILURE
*/
@ -533,7 +533,7 @@ public:
bool aNotify) = 0;
/**
* Append the given value to the current text. If aNotify is PR_TRUE then
* Append the given value to the current text. If aNotify is true then
* the document is notified of the content change.
* NOTE: For elements this always ASSERTS and returns NS_ERROR_FAILURE
*/
@ -541,7 +541,7 @@ public:
bool aNotify) = 0;
/**
* Set the text to the given value. If aNotify is PR_TRUE then
* Set the text to the given value. If aNotify is true then
* the document is notified of the content change.
* NOTE: For elements this always asserts and returns NS_ERROR_FAILURE
*/
@ -552,7 +552,7 @@ public:
/**
* Query method to see if the frame is nothing but whitespace
* NOTE: Always returns PR_FALSE for elements
* NOTE: Always returns false for elements
*/
virtual bool TextIsOnlyWhitespace() = 0;
@ -588,7 +588,7 @@ public:
{
if (aTabIndex)
*aTabIndex = -1; // Default, not tabbable
return PR_FALSE;
return false;
}
/**
@ -672,7 +672,7 @@ public:
* set to this link's URI will be passed out.
*
* @note The out param, aURI, is guaranteed to be set to a non-null pointer
* when the return value is PR_TRUE.
* when the return value is true.
*
* XXXjwatt: IMO IsInteractiveLink would be a better name.
*/
@ -777,16 +777,16 @@ public:
/**
* For HTML textarea, select, applet, and object elements, returns
* PR_TRUE if all children have been added OR if the element was not
* created by the parser. Returns PR_TRUE for all other elements.
* @returns PR_FALSE if the element was created by the parser and
* true if all children have been added OR if the element was not
* created by the parser. Returns true for all other elements.
* @returns false if the element was created by the parser and
* it is an HTML textarea, select, applet, or object
* element and not all children have been added.
* @returns PR_TRUE otherwise.
* @returns true otherwise.
*/
virtual bool IsDoneAddingChildren()
{
return PR_TRUE;
return true;
}
/**

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

@ -158,16 +158,16 @@ public:
mCharacterSet(NS_LITERAL_CSTRING("ISO-8859-1")),
mNodeInfoManager(nsnull),
mCompatMode(eCompatibility_FullStandards),
mIsInitialDocumentInWindow(PR_FALSE),
mMayStartLayout(PR_TRUE),
mVisible(PR_TRUE),
mRemovedFromDocShell(PR_FALSE),
mIsInitialDocumentInWindow(false),
mMayStartLayout(true),
mVisible(true),
mRemovedFromDocShell(false),
// mAllowDNSPrefetch starts true, so that we can always reliably && it
// with various values that might disable it. Since we never prefetch
// unless we get a window, and in that case the docshell value will get
// &&-ed in, this is safe.
mAllowDNSPrefetch(PR_TRUE),
mIsBeingUsedAsImage(PR_FALSE),
mAllowDNSPrefetch(true),
mIsBeingUsedAsImage(false),
mPartID(0)
{
SetInDocument();
@ -199,7 +199,7 @@ public:
* on whatever it knows about the data it's going to load.
*
* Once this has been called, the document will return false for
* MayStartLayout() until SetMayStartLayout(PR_TRUE) is called on it. Making
* MayStartLayout() until SetMayStartLayout(true) is called on it. Making
* sure this happens is the responsibility of the caller of
* StartDocumentLoad().
*/
@ -335,7 +335,7 @@ public:
* This fires at difficult times. It is generally not safe to do anything
* which could modify the DOM in any way. Use
* nsContentUtils::AddScriptRunner.
* @return PR_TRUE to keep the callback in the callback set, PR_FALSE
* @return true to keep the callback in the callback set, false
* to remove it.
*/
typedef bool (* IDTargetObserver)(Element* aOldElement,
@ -401,7 +401,7 @@ public:
*/
void SetBidiEnabled()
{
mBidiEnabled = PR_TRUE;
mBidiEnabled = true;
}
/**
@ -414,7 +414,7 @@ public:
void SetMathMLEnabled()
{
mMathMLEnabled = PR_TRUE;
mMathMLEnabled = true;
}
/**
@ -665,7 +665,7 @@ public:
* be got. Normally GetScriptHandlingObject() returns the same object as
* GetScriptGlobalObject(), but if the document is loaded as data,
* non-null may be returned, even if GetScriptGlobalObject() returns null.
* aHasHadScriptHandlingObject is set PR_TRUE if document has had the object
* aHasHadScriptHandlingObject is set true if document has had the object
* for event/script handling. Do not process any events/script if the method
* returns null, but aHasHadScriptHandlingObject is true.
*/
@ -769,7 +769,7 @@ public:
virtual void UpdateFullScreenStatus(bool aIsFullScreen) = 0;
/**
* Returns PR_TRUE if this document is in full-screen mode.
* Returns true if this document is in full-screen mode.
*/
virtual bool IsFullScreenDoc() = 0;
@ -973,8 +973,8 @@ public:
/**
* Enumerate all subdocuments.
* The enumerator callback should return PR_TRUE to continue enumerating, or
* PR_FALSE to stop. This will never get passed a null aDocument.
* The enumerator callback should return true to continue enumerating, or
* false to stop. This will never get passed a null aDocument.
*/
typedef bool (*nsSubDocEnumFunc)(nsIDocument *aDocument, void *aData);
virtual void EnumerateSubDocuments(nsSubDocEnumFunc aCallback,
@ -1226,7 +1226,7 @@ public:
}
void SetIsBeingUsedAsImage() {
mIsBeingUsedAsImage = PR_TRUE;
mIsBeingUsedAsImage = true;
}
bool IsResourceDoc() const {
@ -1310,8 +1310,8 @@ public:
/**
* Enumerate the external resource documents associated with this document.
* The enumerator callback should return PR_TRUE to continue enumerating, or
* PR_FALSE to stop. This callback will never get passed a null aDocument.
* The enumerator callback should return true to continue enumerating, or
* false to stop. This callback will never get passed a null aDocument.
*/
virtual void EnumerateExternalResources(nsSubDocEnumFunc aCallback,
void* aData) = 0;
@ -1341,7 +1341,7 @@ public:
#ifdef MOZ_SMIL
// Indicates whether mAnimationController has been (lazily) initialized.
// If this returns PR_TRUE, we're promising that GetAnimationController()
// If this returns true, we're promising that GetAnimationController()
// will have a non-null return value.
bool HasAnimationController() { return !!mAnimationController; }
@ -1364,7 +1364,7 @@ public:
/**
* Unsuppress event handling.
* @param aFireEvents If PR_TRUE, delayed events (focus/blur) will be fired
* @param aFireEvents If true, delayed events (focus/blur) will be fired
* asynchronously.
*/
virtual void UnsuppressEventHandlingAndFireEvents(bool aFireEvents) = 0;
@ -1388,12 +1388,12 @@ public:
bool IsDNSPrefetchAllowed() const { return mAllowDNSPrefetch; }
/**
* Returns PR_TRUE if this document is allowed to contain XUL element and
* Returns true if this document is allowed to contain XUL element and
* use non-builtin XBL bindings.
*/
bool AllowXULXBL() {
return mAllowXULXBL == eTriTrue ? PR_TRUE :
mAllowXULXBL == eTriFalse ? PR_FALSE :
return mAllowXULXBL == eTriTrue ? true :
mAllowXULXBL == eTriFalse ? false :
InternalAllowXULXBL();
}
@ -1402,7 +1402,7 @@ public:
}
/**
* PR_TRUE when this document is a static clone of a normal document.
* true when this document is a static clone of a normal document.
* For example print preview and printing use static documents.
*/
bool IsStaticDocument() { return mIsStaticDocument; }
@ -1523,7 +1523,7 @@ public:
void ScheduleBeforePaintEvent(nsIAnimationFrameListener* aListener);
void BeforePaintEventFiring()
{
mHavePendingPaint = PR_FALSE;
mHavePendingPaint = false;
}
typedef nsTArray< nsCOMPtr<nsIAnimationFrameListener> > AnimationListenerList;

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

@ -157,7 +157,7 @@ public:
*
* @param aDocument The document being observed
* @param aStyleSheet the StyleSheet that has changed state
* @param aApplicable PR_TRUE if the sheet is applicable, PR_FALSE if
* @param aApplicable true if the sheet is applicable, false if
* it is not applicable
*/
virtual void StyleSheetApplicableStateChanged(nsIDocument *aDocument,

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

@ -461,12 +461,12 @@ public:
nsINode*
InsertBefore(nsINode *aNewChild, nsINode *aRefChild, nsresult *aReturn)
{
return ReplaceOrInsertBefore(PR_FALSE, aNewChild, aRefChild, aReturn);
return ReplaceOrInsertBefore(false, aNewChild, aRefChild, aReturn);
}
nsINode*
ReplaceChild(nsINode *aNewChild, nsINode *aOldChild, nsresult *aReturn)
{
return ReplaceOrInsertBefore(PR_TRUE, aNewChild, aOldChild, aReturn);
return ReplaceOrInsertBefore(true, aNewChild, aOldChild, aReturn);
}
nsINode*
AppendChild(nsINode *aNewChild, nsresult *aReturn)
@ -578,8 +578,8 @@ public:
* @param aValue new value of property.
* @param aDtor destructor function to be used when this property
* is destroyed.
* @param aTransfer if PR_TRUE the property will not be deleted when the
* ownerDocument of the node changes, if PR_FALSE it
* @param aTransfer if true the property will not be deleted when the
* ownerDocument of the node changes, if false it
* will be deleted.
*
* @return NS_PROPTABLE_PROP_OVERWRITTEN (success value) if the property
@ -604,8 +604,8 @@ public:
* @param aValue new value of property.
* @param aDtor destructor function to be used when this property
* is destroyed.
* @param aTransfer if PR_TRUE the property will not be deleted when the
* ownerDocument of the node changes, if PR_FALSE it
* @param aTransfer if true the property will not be deleted when the
* ownerDocument of the node changes, if false it
* will be deleted.
* @param aOldValue [out] previous value of property.
*
@ -782,7 +782,7 @@ public:
/**
* Checks if a node has the same ownerDocument as this one. Note that this
* actually compares nodeinfo managers because nodes always have one, even
* when they don't have an ownerDocument. If this function returns PR_TRUE
* when they don't have an ownerDocument. If this function returns true
* it doesn't mean that the nodes actually have an ownerDocument.
*
* @param aOther Other node to check
@ -897,16 +897,16 @@ public:
}
/**
* Returns PR_TRUE if |this| or any of its ancestors is native anonymous.
* Returns true if |this| or any of its ancestors is native anonymous.
*/
bool IsInNativeAnonymousSubtree() const
{
#ifdef DEBUG
if (HasFlag(NODE_IS_IN_ANONYMOUS_SUBTREE)) {
return PR_TRUE;
return true;
}
CheckNotNativeAnonymous();
return PR_FALSE;
return false;
#else
return HasFlag(NODE_IS_IN_ANONYMOUS_SUBTREE);
#endif
@ -1080,7 +1080,7 @@ public:
*/
nsIContent* GetNextNode(const nsINode* aRoot = nsnull) const
{
return GetNextNodeImpl(aRoot, PR_FALSE);
return GetNextNodeImpl(aRoot, false);
}
/**
@ -1092,7 +1092,7 @@ public:
*/
nsIContent* GetNextNonChildNode(const nsINode* aRoot = nsnull) const
{
return GetNextNodeImpl(aRoot, PR_TRUE);
return GetNextNodeImpl(aRoot, true);
}
/**

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

@ -58,9 +58,9 @@ public:
: mRoot(nsnull),
mStartOffset(0),
mEndOffset(0),
mIsPositioned(PR_FALSE),
mIsDetached(PR_FALSE),
mMaySpanAnonymousSubtrees(PR_FALSE)
mIsPositioned(false),
mIsDetached(false),
mMaySpanAnonymousSubtrees(false)
{
}

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

@ -61,16 +61,16 @@ public:
nsIScriptElement(mozilla::dom::FromParser aFromParser)
: mLineNumber(0),
mAlreadyStarted(PR_FALSE),
mMalformed(PR_FALSE),
mAlreadyStarted(false),
mMalformed(false),
mDoneAddingChildren(aFromParser == mozilla::dom::NOT_FROM_PARSER ||
aFromParser == mozilla::dom::FROM_PARSER_FRAGMENT),
mForceAsync(aFromParser == mozilla::dom::NOT_FROM_PARSER ||
aFromParser == mozilla::dom::FROM_PARSER_FRAGMENT),
mFrozen(PR_FALSE),
mDefer(PR_FALSE),
mAsync(PR_FALSE),
mExternal(PR_FALSE),
mFrozen(false),
mDefer(false),
mAsync(false),
mExternal(false),
mParserCreated(aFromParser == mozilla::dom::FROM_PARSER_FRAGMENT ?
mozilla::dom::NOT_FROM_PARSER : aFromParser),
// Fragment parser-created scripts (if executable)
@ -155,7 +155,7 @@ public:
void SetIsMalformed()
{
mMalformed = PR_TRUE;
mMalformed = true;
}
bool IsMalformed()
{
@ -164,12 +164,12 @@ public:
void PreventExecution()
{
mAlreadyStarted = PR_TRUE;
mAlreadyStarted = true;
}
void LoseParserInsertedness()
{
mFrozen = PR_FALSE;
mFrozen = false;
mUri = nsnull;
mCreatorParser = nsnull;
mParserCreated = mozilla::dom::NOT_FROM_PARSER;

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

@ -62,7 +62,7 @@ class nsCycleCollectionCallback;
* By default this is a single-shot tracker --- i.e., when ElementChanged
* fires, we will automatically stop tracking. get() will continue to return
* the changed-to element.
* Override IsPersistent to return PR_TRUE if you want to keep tracking after
* Override IsPersistent to return true if you want to keep tracking after
* the first change.
*/
class nsReferencedElement {

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

@ -82,8 +82,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(FileIOObject,
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
FileIOObject::FileIOObject()
: mProgressEventWasDelayed(PR_FALSE),
mTimerIsActive(PR_FALSE),
: mProgressEventWasDelayed(false),
mTimerIsActive(false),
mReadyState(0),
mTotal(0), mTransferred(0)
{}
@ -101,8 +101,8 @@ FileIOObject::StartProgressEventTimer()
mProgressNotifier = do_CreateInstance(NS_TIMER_CONTRACTID);
}
if (mProgressNotifier) {
mProgressEventWasDelayed = PR_FALSE;
mTimerIsActive = PR_TRUE;
mProgressEventWasDelayed = false;
mTimerIsActive = true;
mProgressNotifier->Cancel();
mProgressNotifier->InitWithCallback(this, NS_PROGRESS_EVENT_INTERVAL,
nsITimer::TYPE_ONE_SHOT);
@ -112,8 +112,8 @@ FileIOObject::StartProgressEventTimer()
void
FileIOObject::ClearProgressEventTimer()
{
mProgressEventWasDelayed = PR_FALSE;
mTimerIsActive = PR_FALSE;
mProgressEventWasDelayed = false;
mTimerIsActive = false;
if (mProgressNotifier) {
mProgressNotifier->Cancel();
}
@ -152,20 +152,20 @@ FileIOObject::DispatchProgressEvent(const nsAString& aType)
nsCOMPtr<nsIPrivateDOMEvent> privevent(do_QueryInterface(event));
NS_ENSURE_TRUE(privevent, NS_ERROR_UNEXPECTED);
privevent->SetTrusted(PR_TRUE);
privevent->SetTrusted(true);
nsCOMPtr<nsIDOMProgressEvent> progress = do_QueryInterface(event);
NS_ENSURE_TRUE(progress, NS_ERROR_UNEXPECTED);
bool known;
PRUint64 size;
if (mTotal != kUnknownSize) {
known = PR_TRUE;
known = true;
size = mTotal;
} else {
known = PR_FALSE;
known = false;
size = 0;
}
rv = progress->InitProgressEvent(aType, PR_FALSE, PR_FALSE, known,
rv = progress->InitProgressEvent(aType, false, false, known,
mTransferred, size);
NS_ENSURE_SUCCESS(rv, rv);
@ -177,7 +177,7 @@ NS_IMETHODIMP
FileIOObject::Notify(nsITimer* aTimer)
{
nsresult rv;
mTimerIsActive = PR_FALSE;
mTimerIsActive = false;
if (mProgressEventWasDelayed) {
rv = DispatchProgressEvent(NS_LITERAL_STRING("progress"));
@ -217,7 +217,7 @@ FileIOObject::OnDataAvailable(nsIRequest *aRequest,
//Notify the timer is the appropriate timeframe has passed
if (mTimerIsActive) {
mProgressEventWasDelayed = PR_TRUE;
mProgressEventWasDelayed = true;
} else {
rv = DispatchProgressEvent(NS_LITERAL_STRING(PROGRESS_STR));
NS_ENSURE_SUCCESS(rv, rv);

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

@ -528,7 +528,7 @@ Link::SetHrefAttribute(nsIURI *aURI)
nsCAutoString href;
(void)aURI->GetSpec(href);
(void)mElement->SetAttr(kNameSpaceID_None, nsGkAtoms::href,
NS_ConvertUTF8toUTF16(href), PR_TRUE);
NS_ConvertUTF8toUTF16(href), true);
}
} // namespace dom

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

@ -110,7 +110,7 @@ mozSanitizingHTMLSerializer::ReleaseProperties(nsHashKey* key, void* data,
{
nsIProperties* prop = (nsIProperties*)data;
NS_IF_RELEASE(prop);
return PR_TRUE;
return true;
}
//</copy>
@ -136,7 +136,7 @@ mozSanitizingHTMLSerializer::Initialize(nsAString* aOutString,
PRUint32 aFlags,
const nsAString& allowedTags)
{
nsresult rv = Init(aFlags, 0, nsnull, PR_FALSE, PR_FALSE);
nsresult rv = Init(aFlags, 0, nsnull, false, false);
NS_ENSURE_SUCCESS(rv, rv);
// XXX This is wrong. It violates XPCOM string ownership rules.
@ -178,7 +178,7 @@ mozSanitizingHTMLSerializer::Write(const nsAString& aString)
NS_IMETHODIMP
mozSanitizingHTMLSerializer::IsEnabled(PRInt32 aTag, bool* aReturn)
{
*aReturn = PR_FALSE;
*aReturn = false;
return NS_OK;
}
@ -557,7 +557,7 @@ mozSanitizingHTMLSerializer::IsAllowedAttribute(nsHTMLTag aTag,
nsPRUint32Key tag_key(aTag);
nsIProperties* attr_bag = (nsIProperties*)mAllowedTags.Get(&tag_key);
NS_ENSURE_TRUE(attr_bag, PR_FALSE);
NS_ENSURE_TRUE(attr_bag, false);
bool allowed;
nsAutoString attr(anAttributeName);
@ -565,7 +565,7 @@ mozSanitizingHTMLSerializer::IsAllowedAttribute(nsHTMLTag aTag,
rv = attr_bag->Has(NS_LossyConvertUTF16toASCII(attr).get(),
&allowed);
if (NS_FAILED(rv))
return PR_FALSE;
return false;
#ifdef DEBUG_BenB
printf(" Allowed: %s\n", allowed?"yes":"no");

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

@ -51,7 +51,7 @@ nsAtomListUtils::IsMember(nsIAtom *aAtom,
for (const nsStaticAtom *info = aInfo, *info_end = aInfo + aInfoCount;
info != info_end; ++info) {
if (aAtom == *(info->mAtom))
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}

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

@ -461,7 +461,7 @@ nsAttrAndChildArray::RemoveAttrAt(PRUint32 aPos, nsAttrValue& aValue)
}
nsRefPtr<nsMappedAttributes> mapped;
nsresult rv = GetModifiableMapped(nsnull, nsnull, PR_FALSE,
nsresult rv = GetModifiableMapped(nsnull, nsnull, false,
getter_AddRefs(mapped));
NS_ENSURE_SUCCESS(rv, rv);
@ -600,7 +600,7 @@ nsAttrAndChildArray::SetMappedAttrStyleSheet(nsHTMLStyleSheet* aSheet)
}
nsRefPtr<nsMappedAttributes> mapped;
nsresult rv = GetModifiableMapped(nsnull, nsnull, PR_FALSE,
nsresult rv = GetModifiableMapped(nsnull, nsnull, false,
getter_AddRefs(mapped));
NS_ENSURE_SUCCESS(rv, rv);
@ -670,9 +670,9 @@ nsAttrAndChildArray::Clear()
PRUint32 end = slotCount * ATTRSIZE + ChildCount();
for (i = slotCount * ATTRSIZE; i < end; ++i) {
nsIContent* child = static_cast<nsIContent*>(mImpl->mBuffer[i]);
// making this PR_FALSE so tree teardown doesn't end up being
// making this false so tree teardown doesn't end up being
// O(N*D) (number of nodes times average depth of tree).
child->UnbindFromTree(PR_FALSE); // XXX is it better to let the owner do this?
child->UnbindFromTree(false); // XXX is it better to let the owner do this?
// Make sure to unlink our kids from each other, since someone
// else could stil be holding references to some of them.
@ -794,7 +794,7 @@ nsAttrAndChildArray::GrowBy(PRUint32 aGrowSize)
bool needToInitialize = !mImpl;
Impl* newImpl = static_cast<Impl*>(PR_Realloc(mImpl, size * sizeof(void*)));
NS_ENSURE_TRUE(newImpl, PR_FALSE);
NS_ENSURE_TRUE(newImpl, false);
mImpl = newImpl;
@ -806,7 +806,7 @@ nsAttrAndChildArray::GrowBy(PRUint32 aGrowSize)
mImpl->mBufferSize = size - NS_IMPL_EXTRA_SIZE;
return PR_TRUE;
return true;
}
bool
@ -818,7 +818,7 @@ nsAttrAndChildArray::AddAttrSlot()
// Grow buffer if needed
if (!(mImpl && mImpl->mBufferSize >= (slotCount + 1) * ATTRSIZE + childCount) &&
!GrowBy(ATTRSIZE)) {
return PR_FALSE;
return false;
}
void** offset = mImpl->mBuffer + slotCount * ATTRSIZE;
@ -831,7 +831,7 @@ nsAttrAndChildArray::AddAttrSlot()
offset[0] = nsnull;
offset[1] = nsnull;
return PR_TRUE;
return true;
}
inline void

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

@ -382,7 +382,7 @@ nsAttrValue::ToString(nsAString& aResult) const
#endif
case eEnum:
{
GetEnumString(aResult, PR_FALSE);
GetEnumString(aResult, false);
break;
}
case ePercent:
@ -433,11 +433,11 @@ nsAttrValue::GetColorValue(nscolor& aColor) const
if (Type() != eColor) {
// Unparseable value, treat as unset.
NS_ASSERTION(Type() == eString, "unexpected type for color-valued attr");
return PR_FALSE;
return false;
}
aColor = GetMiscContainer()->mColor;
return PR_TRUE;
return true;
}
void
@ -584,7 +584,7 @@ bool
nsAttrValue::Equals(const nsAttrValue& aOther) const
{
if (BaseType() != aOther.BaseType()) {
return PR_FALSE;
return false;
}
switch(BaseType()) {
@ -606,7 +606,7 @@ nsAttrValue::Equals(const nsAttrValue& aOther) const
MiscContainer* thisCont = GetMiscContainer();
MiscContainer* otherCont = aOther.GetMiscContainer();
if (thisCont->mType != otherCont->mType) {
return PR_FALSE;
return false;
}
bool needsStringComparison = false;
@ -615,28 +615,28 @@ nsAttrValue::Equals(const nsAttrValue& aOther) const
case eInteger:
{
if (thisCont->mInteger == otherCont->mInteger) {
needsStringComparison = PR_TRUE;
needsStringComparison = true;
}
break;
}
case eEnum:
{
if (thisCont->mEnumValue == otherCont->mEnumValue) {
needsStringComparison = PR_TRUE;
needsStringComparison = true;
}
break;
}
case ePercent:
{
if (thisCont->mPercent == otherCont->mPercent) {
needsStringComparison = PR_TRUE;
needsStringComparison = true;
}
break;
}
case eColor:
{
if (thisCont->mColor == otherCont->mColor) {
needsStringComparison = PR_TRUE;
needsStringComparison = true;
}
break;
}
@ -650,10 +650,10 @@ nsAttrValue::Equals(const nsAttrValue& aOther) const
// classlists are never mapped attributes so they are never compared.
if (!(*thisCont->mAtomArray == *otherCont->mAtomArray)) {
return PR_FALSE;
return false;
}
needsStringComparison = PR_TRUE;
needsStringComparison = true;
break;
}
case eDoubleValue:
@ -667,12 +667,12 @@ nsAttrValue::Equals(const nsAttrValue& aOther) const
default:
{
NS_NOTREACHED("unknown type stored in MiscContainer");
return PR_FALSE;
return false;
}
}
if (needsStringComparison) {
if (thisCont->mStringBits == otherCont->mStringBits) {
return PR_TRUE;
return true;
}
if ((static_cast<ValueBaseType>(thisCont->mStringBits & NS_ATTRVALUE_BASETYPE_MASK) ==
eStringBase) &&
@ -682,7 +682,7 @@ nsAttrValue::Equals(const nsAttrValue& aOther) const
nsCheapString(reinterpret_cast<nsStringBuffer*>(otherCont->mStringBits)));
}
}
return PR_FALSE;
return false;
}
bool
@ -787,14 +787,14 @@ nsAttrValue::Contains(nsIAtom* aValue, nsCaseTreatment aCaseSensitive) const
// anyway.
if (nsContentUtils::EqualsIgnoreASCIICase(val1,
nsDependentAtomString(*cur))) {
return PR_TRUE;
return true;
}
}
}
}
}
return PR_FALSE;
return false;
}
void
@ -818,7 +818,7 @@ nsAttrValue::ParseAtomArray(const nsAString& aValue)
// skip initial whitespace
while (iter != end && nsContentUtils::IsHTMLWhitespace(*iter)) {
hasSpace = PR_TRUE;
hasSpace = true;
++iter;
}
@ -842,7 +842,7 @@ nsAttrValue::ParseAtomArray(const nsAString& aValue)
// skip whitespace
while (iter != end && nsContentUtils::IsHTMLWhitespace(*iter)) {
hasSpace = PR_TRUE;
hasSpace = true;
++iter;
}
@ -996,7 +996,7 @@ nsAttrValue::ParseEnumValue(const nsAString& aValue,
NS_ASSERTION(GetEnumValue() == tableEntry->value,
"failed to store enum properly");
return PR_TRUE;
return true;
}
tableEntry++;
}
@ -1006,10 +1006,10 @@ nsAttrValue::ParseEnumValue(const nsAString& aValue,
"aDefaultValue not inside aTable?");
SetIntValueAndType(EnumTableEntryToValue(aTable, aDefaultValue),
eEnum, &aValue);
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
bool
@ -1021,17 +1021,17 @@ nsAttrValue::ParseSpecialIntValue(const nsAString& aString)
bool strict;
bool isPercent = false;
nsAutoString tmp(aString);
PRInt32 originalVal = StringToInteger(aString, &strict, &ec, PR_TRUE, &isPercent);
PRInt32 originalVal = StringToInteger(aString, &strict, &ec, true, &isPercent);
if (NS_FAILED(ec)) {
return PR_FALSE;
return false;
}
PRInt32 val = NS_MAX(originalVal, 0);
// % (percent)
if (isPercent || tmp.RFindChar('%') >= 0) {
isPercent = PR_TRUE;
isPercent = true;
}
strict = strict && (originalVal == val);
@ -1039,7 +1039,7 @@ nsAttrValue::ParseSpecialIntValue(const nsAString& aString)
SetIntValueAndType(val,
isPercent ? ePercent : eInteger,
strict ? nsnull : &aString);
return PR_TRUE;
return true;
}
bool
@ -1054,7 +1054,7 @@ nsAttrValue::ParseIntWithBounds(const nsAString& aString,
bool strict;
PRInt32 originalVal = StringToInteger(aString, &strict, &ec);
if (NS_FAILED(ec)) {
return PR_FALSE;
return false;
}
PRInt32 val = NS_MAX(originalVal, aMin);
@ -1062,7 +1062,7 @@ nsAttrValue::ParseIntWithBounds(const nsAString& aString,
strict = strict && (originalVal == val);
SetIntValueAndType(val, eInteger, strict ? nsnull : &aString);
return PR_TRUE;
return true;
}
bool
@ -1074,12 +1074,12 @@ nsAttrValue::ParseNonNegativeIntValue(const nsAString& aString)
bool strict;
PRInt32 originalVal = StringToInteger(aString, &strict, &ec);
if (NS_FAILED(ec) || originalVal < 0) {
return PR_FALSE;
return false;
}
SetIntValueAndType(originalVal, eInteger, strict ? nsnull : &aString);
return PR_TRUE;
return true;
}
bool
@ -1091,12 +1091,12 @@ nsAttrValue::ParsePositiveIntValue(const nsAString& aString)
bool strict;
PRInt32 originalVal = StringToInteger(aString, &strict, &ec);
if (NS_FAILED(ec) || originalVal <= 0) {
return PR_FALSE;
return false;
}
SetIntValueAndType(originalVal, eInteger, strict ? nsnull : &aString);
return PR_TRUE;
return true;
}
void
@ -1130,9 +1130,9 @@ nsAttrValue::ParseColor(const nsAString& aString)
// (I'm a little skeptical that we shouldn't do the whitespace
// trimming; WebKit also does it.)
nsAutoString colorStr(aString);
colorStr.CompressWhitespace(PR_TRUE, PR_TRUE);
colorStr.CompressWhitespace(true, true);
if (colorStr.IsEmpty()) {
return PR_FALSE;
return false;
}
nscolor color;
@ -1142,12 +1142,12 @@ nsAttrValue::ParseColor(const nsAString& aString)
nsDependentString withoutHash(colorStr.get() + 1, colorStr.Length() - 1);
if (NS_HexToRGB(withoutHash, &color)) {
SetColorValue(color, aString);
return PR_TRUE;
return true;
}
} else {
if (NS_ColorNameToRGB(colorStr, &color)) {
SetColorValue(color, aString);
return PR_TRUE;
return true;
}
}
@ -1159,10 +1159,10 @@ nsAttrValue::ParseColor(const nsAString& aString)
// Use NS_LooseHexToRGB as a fallback if nothing above worked.
if (NS_LooseHexToRGB(colorStr, &color)) {
SetColorValue(color, aString);
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
bool nsAttrValue::ParseDoubleValue(const nsAString& aString)
@ -1172,7 +1172,7 @@ bool nsAttrValue::ParseDoubleValue(const nsAString& aString)
PRInt32 ec;
double val = PromiseFlatString(aString).ToDouble(&ec);
if (NS_FAILED(ec)) {
return PR_FALSE;
return false;
}
if (EnsureEmptyMiscContainer()) {
MiscContainer* cont = GetMiscContainer();
@ -1181,10 +1181,10 @@ bool nsAttrValue::ParseDoubleValue(const nsAString& aString)
nsAutoString serializedFloat;
serializedFloat.AppendFloat(val);
SetMiscAtomOrString(serializedFloat.Equals(aString) ? nsnull : &aString);
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
bool
@ -1194,17 +1194,17 @@ nsAttrValue::ParseIntMarginValue(const nsAString& aString)
nsIntMargin margins;
if (!nsContentUtils::ParseIntMarginValue(aString, margins))
return PR_FALSE;
return false;
if (EnsureEmptyMiscContainer()) {
MiscContainer* cont = GetMiscContainer();
cont->mIntMargin = new nsIntMargin(margins);
cont->mType = eIntMarginValue;
SetMiscAtomOrString(&aString);
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
void
@ -1287,7 +1287,7 @@ nsAttrValue::EnsureEmptyMiscContainer()
ResetIfSet();
cont = new MiscContainer;
NS_ENSURE_TRUE(cont, PR_FALSE);
NS_ENSURE_TRUE(cont, false);
SetPtrValueAndType(cont, eOtherBase);
}
@ -1296,7 +1296,7 @@ nsAttrValue::EnsureEmptyMiscContainer()
cont->mStringBits = 0;
cont->mColor = 0;
return PR_TRUE;
return true;
}
bool
@ -1305,25 +1305,25 @@ nsAttrValue::EnsureEmptyAtomArray()
if (Type() == eAtomArray) {
ResetMiscAtomOrString();
GetAtomArrayValue()->Clear();
return PR_TRUE;
return true;
}
if (!EnsureEmptyMiscContainer()) {
// should already be reset
return PR_FALSE;
return false;
}
AtomArray* array = new AtomArray;
if (!array) {
Reset();
return PR_FALSE;
return false;
}
MiscContainer* cont = GetMiscContainer();
cont->mAtomArray = array;
cont->mType = eAtomArray;
return PR_TRUE;
return true;
}
nsStringBuffer*

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

@ -366,7 +366,7 @@ private:
bool EnsureEmptyMiscContainer();
bool EnsureEmptyAtomArray();
nsStringBuffer* GetStringBuffer(const nsAString& aValue) const;
// aStrict is set PR_TRUE if stringifying the return value equals with
// aStrict is set true if stringifying the return value equals with
// aValue.
PRInt32 StringToInteger(const nsAString& aValue,
bool* aStrict,
@ -453,9 +453,9 @@ nsAttrValue::GetIntMarginValue(nsIntMargin& aMargin) const
NS_PRECONDITION(Type() == eIntMarginValue, "wrong type");
nsIntMargin* m = GetMiscContainer()->mIntMargin;
if (!m)
return PR_FALSE;
return false;
aMargin = *m;
return PR_TRUE;
return true;
}
inline nsAttrValue::ValueBaseType

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

@ -76,13 +76,13 @@ nsCCUncollectableMarker::Init()
nsresult rv;
// This makes the observer service hold an owning reference to the marker
rv = obs->AddObserver(marker, "xpcom-shutdown", PR_FALSE);
rv = obs->AddObserver(marker, "xpcom-shutdown", false);
NS_ENSURE_SUCCESS(rv, rv);
rv = obs->AddObserver(marker, "cycle-collector-begin", PR_FALSE);
rv = obs->AddObserver(marker, "cycle-collector-begin", false);
NS_ENSURE_SUCCESS(rv, rv);
sInited = PR_TRUE;
sInited = true;
return NS_OK;
}
@ -153,7 +153,7 @@ MarkDocShell(nsIDocShellTreeNode* aNode)
history->GetCount(&historyCount);
for (i = 0; i < historyCount; ++i) {
nsCOMPtr<nsIHistoryEntry> historyEntry;
history->GetEntryAtIndex(i, PR_FALSE, getter_AddRefs(historyEntry));
history->GetEntryAtIndex(i, false, getter_AddRefs(historyEntry));
nsCOMPtr<nsISHEntry> shEntry = do_QueryInterface(historyEntry);
MarkSHEntry(shEntry);

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

@ -177,7 +177,7 @@ nsContentAreaDragDrop::GetDragData(nsIDOMWindow* aWindow,
{
NS_ENSURE_TRUE(aSelectionTargetNode, NS_ERROR_INVALID_ARG);
*aCanDrag = PR_TRUE;
*aCanDrag = true;
DragDataProducer
provider(aWindow, aTarget, aSelectionTargetNode, aIsAltKeyPressed);
@ -306,7 +306,7 @@ DragDataProducer::DragDataProducer(nsIDOMWindow* aWindow,
mTarget(aTarget),
mSelectionTargetNode(aSelectionTargetNode),
mIsAltKeyPressed(aIsAltKeyPressed),
mIsAnchor(PR_FALSE)
mIsAnchor(false)
{
}
@ -446,7 +446,7 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer,
// if set, serialize the content under this node
nsCOMPtr<nsIContent> nodeToSerialize;
*aDragSelection = PR_FALSE;
*aDragSelection = false;
{
bool haveSelectedContent = false;
@ -463,7 +463,7 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer,
// really allow dragging them if they happen to be images.
nsCOMPtr<nsIFormControl> form(do_QueryInterface(mTarget));
if (form && !mIsAltKeyPressed && form->GetType() != NS_FORM_OBJECT) {
*aCanDrag = PR_FALSE;
*aCanDrag = false;
return NS_OK;
}
@ -484,11 +484,11 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer,
link = do_QueryInterface(selectedImageOrLinkNode);
if (link && mIsAltKeyPressed) {
// if alt is pressed, select the link text instead of drag the link
*aCanDrag = PR_FALSE;
*aCanDrag = false;
return NS_OK;
}
*aDragSelection = PR_TRUE;
*aDragSelection = true;
} else if (selectedImageOrLinkNode) {
// an image is selected
image = do_QueryInterface(selectedImageOrLinkNode);
@ -501,7 +501,7 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer,
// anchor because we want to do selection.
parentLink = FindParentLinkNode(draggedNode);
if (parentLink && mIsAltKeyPressed) {
*aCanDrag = PR_FALSE;
*aCanDrag = false;
return NS_OK;
}
@ -523,7 +523,7 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer,
}
// we'll generate HTML like <a href="absurl">alt text</a>
mIsAnchor = PR_TRUE;
mIsAnchor = true;
// gives an absolute link
GetAnchorURL(draggedNode, mUrlString);
@ -536,7 +536,7 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer,
dragNode = draggedNode;
} else if (image) {
mIsAnchor = PR_TRUE;
mIsAnchor = true;
// grab the href as the url, use alt text as the title of the
// area if it's there. the drag data is the image tag and src
// attribute.
@ -651,7 +651,7 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer,
}
if (linkNode) {
mIsAnchor = PR_TRUE;
mIsAnchor = true;
GetAnchorURL(linkNode, mUrlString);
dragNode = linkNode;
}
@ -816,7 +816,7 @@ DragDataProducer::GetDraggableSelectionData(nsISelection* inSelection,
NS_ENSURE_ARG_POINTER(outImageOrLinkNode);
*outImageOrLinkNode = nsnull;
*outDragSelectedText = PR_FALSE;
*outDragSelectedText = false;
bool selectionContainsTarget = false;
@ -824,7 +824,7 @@ DragDataProducer::GetDraggableSelectionData(nsISelection* inSelection,
inSelection->GetIsCollapsed(&isCollapsed);
if (!isCollapsed) {
nsCOMPtr<nsIDOMNode> realTargetNode = do_QueryInterface(inRealTargetNode);
inSelection->ContainsNode(realTargetNode, PR_FALSE,
inSelection->ContainsNode(realTargetNode, false,
&selectionContainsTarget);
if (selectionContainsTarget) {
@ -870,7 +870,7 @@ DragDataProducer::GetDraggableSelectionData(nsISelection* inSelection,
GetSelectedLink(inSelection, outImageOrLinkNode);
// indicate that a link or text is selected
*outDragSelectedText = PR_TRUE;
*outDragSelectedText = true;
}
}

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

@ -86,18 +86,18 @@ NodeIsInTraversalRange(nsINode *aNode, bool aIsPreMode,
nsINode *aEndNode, PRInt32 aEndOffset)
{
if (!aStartNode || !aEndNode || !aNode)
return PR_FALSE;
return false;
// If a chardata node contains an end point of the traversal range,
// it is always in the traversal range.
if (aNode->IsNodeOfType(nsINode::eDATA_NODE) &&
(aNode == aStartNode || aNode == aEndNode)) {
return PR_TRUE;
return true;
}
nsINode* parent = aNode->GetNodeParent();
if (!parent)
return PR_FALSE;
return false;
PRInt32 indx = parent->IndexOf(aNode);
@ -213,7 +213,7 @@ private:
nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult)
{
nsContentIterator * iter = new nsContentIterator(PR_FALSE);
nsContentIterator * iter = new nsContentIterator(false);
if (!iter) {
return NS_ERROR_OUT_OF_MEMORY;
}
@ -226,7 +226,7 @@ nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult)
nsresult NS_NewPreContentIterator(nsIContentIterator** aInstancePtrResult)
{
nsContentIterator * iter = new nsContentIterator(PR_TRUE);
nsContentIterator * iter = new nsContentIterator(true);
if (!iter) {
return NS_ERROR_OUT_OF_MEMORY;
}
@ -262,7 +262,7 @@ NS_IMPL_CYCLE_COLLECTION_4(nsContentIterator,
nsContentIterator::nsContentIterator(bool aPre) :
// don't need to explicitly initialize |nsCOMPtr|s, they will automatically be NULL
mCachedIndex(0), mIsDone(PR_FALSE), mPre(aPre)
mCachedIndex(0), mIsDone(false), mPre(aPre)
{
}
@ -283,7 +283,7 @@ nsContentIterator::Init(nsINode* aRoot)
if (!aRoot)
return NS_ERROR_NULL_POINTER;
mIsDone = PR_FALSE;
mIsDone = false;
mIndexes.Clear();
if (mPre)
@ -317,7 +317,7 @@ nsContentIterator::Init(nsIRange* aRange)
{
NS_ENSURE_ARG_POINTER(aRange);
mIsDone = PR_FALSE;
mIsDone = false;
// get common content parent
mCommonParent = aRange->GetCommonAncestor();
@ -556,7 +556,7 @@ nsContentIterator::MakeEmpty()
mFirst = nsnull;
mLast = nsnull;
mCommonParent = nsnull;
mIsDone = PR_TRUE;
mIsDone = true;
mIndexes.Clear();
}
@ -956,7 +956,7 @@ nsContentIterator::Next()
if (mCurNode == mLast)
{
mIsDone = PR_TRUE;
mIsDone = true;
return;
}
@ -972,7 +972,7 @@ nsContentIterator::Prev()
if (mCurNode == mFirst)
{
mIsDone = PR_TRUE;
mIsDone = true;
return;
}
@ -1002,7 +1002,7 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
// take an early out if this doesn't actually change the position
if (mCurNode == tempNode)
{
mIsDone = PR_FALSE; // paranoia
mIsDone = false; // paranoia
return NS_OK;
}
@ -1048,7 +1048,7 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
!NodeIsInTraversalRange(mCurNode, mPre, firstNode, firstOffset,
lastNode, lastOffset)))
{
mIsDone = PR_TRUE;
mIsDone = true;
return NS_ERROR_FAILURE;
}
@ -1089,7 +1089,7 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
// All we need to do is drop some indexes. Shortcut here.
mIndexes.RemoveElementsAt(mIndexes.Length() - oldParentStack.Length(),
oldParentStack.Length());
mIsDone = PR_FALSE;
mIsDone = false;
return NS_OK;
}
tempNode = parent;
@ -1129,7 +1129,7 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
// phew!
mIsDone = PR_FALSE;
mIsDone = false;
return NS_OK;
}
@ -1168,7 +1168,7 @@ nsContentIterator::GetCurrentNode()
class nsContentSubtreeIterator : public nsContentIterator
{
public:
nsContentSubtreeIterator() : nsContentIterator(PR_FALSE) {}
nsContentSubtreeIterator() : nsContentIterator(false) {}
virtual ~nsContentSubtreeIterator() {}
NS_DECL_ISUPPORTS_INHERITED
@ -1266,7 +1266,7 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
if (!aRange)
return NS_ERROR_NULL_POINTER;
mIsDone = PR_FALSE;
mIsDone = false;
mRange = aRange;
@ -1475,7 +1475,7 @@ nsContentSubtreeIterator::Next()
if (mCurNode == mLast)
{
mIsDone = PR_TRUE;
mIsDone = true;
return;
}
@ -1522,7 +1522,7 @@ nsContentSubtreeIterator::Prev()
if (mCurNode == mFirst)
{
mIsDone = PR_TRUE;
mIsDone = true;
return;
}

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

@ -148,7 +148,7 @@ nsBaseContentList::IndexOf(nsIContent *aContent, bool aDoFlush)
PRInt32
nsBaseContentList::IndexOf(nsIContent* aContent)
{
return IndexOf(aContent, PR_TRUE);
return IndexOf(aContent, true);
}
void nsBaseContentList::AppendElement(nsIContent *aContent)
@ -435,15 +435,15 @@ nsContentList::nsContentList(nsINode* aRootNode,
mData(nsnull),
mState(LIST_DIRTY),
mDeep(aDeep),
mFuncMayDependOnAttr(PR_FALSE)
mFuncMayDependOnAttr(false)
{
NS_ASSERTION(mRootNode, "Must have root");
if (nsGkAtoms::_asterix == mHTMLMatchAtom) {
NS_ASSERTION(mXMLMatchAtom == nsGkAtoms::_asterix, "HTML atom and XML atom are not both asterix?");
mMatchAll = PR_TRUE;
mMatchAll = true;
}
else {
mMatchAll = PR_FALSE;
mMatchAll = false;
}
mRootNode->AddMutationObserver(this);
@ -473,7 +473,7 @@ nsContentList::nsContentList(nsINode* aRootNode,
mDestroyFunc(aDestroyFunc),
mData(aData),
mState(LIST_DIRTY),
mMatchAll(PR_FALSE),
mMatchAll(false),
mDeep(aDeep),
mFuncMayDependOnAttr(aFuncMayDependOnAttr)
{
@ -595,7 +595,7 @@ nsContentList::IndexOf(nsIContent *aContent, bool aDoFlush)
PRInt32
nsContentList::IndexOf(nsIContent* aContent)
{
return IndexOf(aContent, PR_TRUE);
return IndexOf(aContent, true);
}
void
@ -614,7 +614,7 @@ nsContentList::NodeWillBeDestroyed(const nsINode* aNode)
NS_IMETHODIMP
nsContentList::GetLength(PRUint32* aLength)
{
*aLength = Length(PR_TRUE);
*aLength = Length(true);
return NS_OK;
}
@ -636,7 +636,7 @@ nsContentList::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
NS_IMETHODIMP
nsContentList::NamedItem(const nsAString& aName, nsIDOMNode** aReturn)
{
nsIContent *content = NamedItem(aName, PR_TRUE);
nsIContent *content = NamedItem(aName, true);
if (content) {
return CallQueryInterface(content, aReturn);
@ -650,14 +650,14 @@ nsContentList::NamedItem(const nsAString& aName, nsIDOMNode** aReturn)
nsIContent*
nsContentList::GetNodeAt(PRUint32 aIndex)
{
return Item(aIndex, PR_TRUE);
return Item(aIndex, true);
}
nsISupports*
nsContentList::GetNamedItem(const nsAString& aName, nsWrapperCache **aCache)
{
nsIContent *item;
*aCache = item = NamedItem(aName, PR_TRUE);
*aCache = item = NamedItem(aName, true);
return item;
}
@ -725,7 +725,7 @@ nsContentList::ContentAppended(nsIDocument* aDocument, nsIContent* aContainer,
PRInt32 ourCount = mElements.Count();
bool appendToList = false;
if (ourCount == 0) {
appendToList = PR_TRUE;
appendToList = true;
} else {
nsIContent* ourLastContent = mElements[ourCount - 1];
/*
@ -733,7 +733,7 @@ nsContentList::ContentAppended(nsIDocument* aDocument, nsIContent* aContainer,
* that got appended comes after ourLastContent.
*/
if (nsContentUtils::PositionIsBefore(ourLastContent, aFirstNewContent)) {
appendToList = PR_TRUE;
appendToList = true;
}
}
@ -834,7 +834,7 @@ nsContentList::Match(Element *aElement)
}
if (!mXMLMatchAtom)
return PR_FALSE;
return false;
nsINodeInfo *ni = aElement->NodeInfo();
@ -873,24 +873,24 @@ nsContentList::MatchSelf(nsIContent *aContent)
"MatchSelf called on a node that we can't possibly match");
if (!aContent->IsElement()) {
return PR_FALSE;
return false;
}
if (Match(aContent->AsElement()))
return PR_TRUE;
return true;
if (!mDeep)
return PR_FALSE;
return false;
for (nsIContent* cur = aContent->GetFirstChild();
cur;
cur = cur->GetNextNode(aContent)) {
if (cur->IsElement() && Match(cur->AsElement())) {
return PR_TRUE;
return true;
}
}
return PR_FALSE;
return false;
}
void
@ -1048,7 +1048,7 @@ nsContentList::AssertInSync()
}
PRInt32 cnt = 0, index = 0;
while (PR_TRUE) {
while (true) {
if (cnt == mElements.Count() && mState == LIST_LAZY) {
break;
}

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

@ -371,9 +371,9 @@ protected:
/**
* @param aContainer a content node which must be a descendant of
* mRootNode
* @return PR_TRUE if children or descendants of aContainer could match our
* @return true if children or descendants of aContainer could match our
* criterion.
* PR_FALSE otherwise.
* false otherwise.
*/
bool MayContainRelevantNodes(nsINode* aContainer)
{

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

@ -241,7 +241,7 @@ void
nsContentSink::InitializeStatics()
{
Preferences::AddBoolVarCache(&sNotifyOnTimer,
"content.notify.ontimer", PR_TRUE);
"content.notify.ontimer", true);
// -1 means never.
Preferences::AddIntVarCache(&sBackoffCount,
"content.notify.backoffcount", -1);
@ -273,7 +273,7 @@ nsContentSink::InitializeStatics()
Preferences::AddIntVarCache(&sEnablePerfMode,
"content.sink.enable_perf_mode", 0);
Preferences::AddBoolVarCache(&sCanInterruptParser,
"content.interrupt.parsing", PR_TRUE);
"content.interrupt.parsing", true);
}
nsresult
@ -353,7 +353,7 @@ nsContentSink::StyleSheetLoaded(nsCSSStyleSheet* aSheet,
// that if mDeferredLayoutStart is true, that means any subclass
// StartLayout() stuff that needs to happen has already happened, so we
// don't need to worry about it.
StartLayout(PR_FALSE);
StartLayout(false);
}
// Go ahead and try to scroll to our ref if we have one
@ -567,7 +567,7 @@ nsContentSink::LinkContextIsOurDocument(const nsSubstring& aAnchor)
{
if (aAnchor.IsEmpty()) {
// anchor parameter not present or empty -> same document reference
return PR_TRUE;
return true;
}
nsIURI* docUri = mDocument->GetDocumentURI();
@ -580,7 +580,7 @@ nsContentSink::LinkContextIsOurDocument(const nsSubstring& aAnchor)
if (NS_FAILED(rv)) {
// copying failed
return PR_FALSE;
return false;
}
// resolve anchor against context
@ -590,14 +590,14 @@ nsContentSink::LinkContextIsOurDocument(const nsSubstring& aAnchor)
if (NS_FAILED(rv)) {
// resolving failed
return PR_FALSE;
return false;
}
bool same;
rv = contextUri->Equals(resolvedUri, &same);
if (NS_FAILED(rv)) {
// comparison failed
return PR_FALSE;
return false;
}
return same;
@ -715,7 +715,7 @@ nsContentSink::ProcessLinkHeader(nsIContent* aElement,
}
} else {
PRUnichar* equals = start;
seenParameters = PR_TRUE;
seenParameters = true;
while ((*equals != kNullCh) && (*equals != kEqual)) {
equals++;
@ -798,7 +798,7 @@ nsContentSink::ProcessLinkHeader(nsIContent* aElement,
media.Truncate();
anchor.Truncate();
seenParameters = PR_FALSE;
seenParameters = false;
}
start = ++end;
@ -1201,7 +1201,7 @@ nsContentSink::ProcessOfflineManifest(const nsAString& aManifestSpec)
}
// Documents must list a manifest from the same origin
rv = mDocument->NodePrincipal()->CheckMayLoad(manifestURI, PR_TRUE);
rv = mDocument->NodePrincipal()->CheckMayLoad(manifestURI, true);
if (NS_FAILED(rv)) {
action = CACHE_SELECTION_RESELECT_WITHOUT_MANIFEST;
}
@ -1268,7 +1268,7 @@ nsContentSink::ProcessOfflineManifest(const nsAString& aManifestSpec)
break;
}
default:
NS_ASSERTION(PR_FALSE,
NS_ASSERTION(false,
"Cache selection algorithm didn't decide on proper action");
break;
}
@ -1288,14 +1288,14 @@ nsContentSink::StartLayout(bool aIgnorePendingSheets)
return;
}
mDeferredLayoutStart = PR_TRUE;
mDeferredLayoutStart = true;
if (!aIgnorePendingSheets && WaitForPendingSheets()) {
// Bail out; we'll start layout when the sheets load
return;
}
mDeferredLayoutStart = PR_FALSE;
mDeferredLayoutStart = false;
// Notify on all our content. If none of our presshells have started layout
// yet it'll be a no-op except for updating our data structures, a la
@ -1305,10 +1305,10 @@ nsContentSink::StartLayout(bool aIgnorePendingSheets)
// loop over the shells.
FlushTags();
mLayoutStarted = PR_TRUE;
mLayoutStarted = true;
mLastNotificationTime = PR_Now();
mDocument->SetMayStartLayout(PR_TRUE);
mDocument->SetMayStartLayout(true);
nsCOMPtr<nsIPresShell> shell = mDocument->GetShell();
// Make sure we don't call InitialReflow() for a shell that has
// already called it. This can happen when the layout frame for
@ -1358,7 +1358,7 @@ nsContentSink::Notify(nsITimer *timer)
{
if (mParsing) {
// We shouldn't interfere with our normal DidProcessAToken logic
mDroppedTimer = PR_TRUE;
mDroppedTimer = true;
return NS_OK;
}
@ -1383,7 +1383,7 @@ nsContentSink::Notify(nsITimer *timer)
#endif
if (WaitForPendingSheets()) {
mDeferredFlushTags = PR_TRUE;
mDeferredFlushTags = true;
} else {
FlushTags();
@ -1401,12 +1401,12 @@ nsContentSink::IsTimeToNotify()
{
if (!sNotifyOnTimer || !mLayoutStarted || !mBackoffCount ||
mInMonolithicContainer) {
return PR_FALSE;
return false;
}
if (WaitForPendingSheets()) {
mDeferredFlushTags = PR_TRUE;
return PR_FALSE;
mDeferredFlushTags = true;
return false;
}
PRTime now = PR_Now();
@ -1417,10 +1417,10 @@ nsContentSink::IsTimeToNotify()
if (LL_CMP(diff, >, interval)) {
mBackoffCount--;
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
nsresult
@ -1432,7 +1432,7 @@ nsContentSink::WillInterruptImpl()
("nsContentSink::WillInterrupt: this=%p", this));
#ifndef SINK_NO_INCREMENTAL
if (WaitForPendingSheets()) {
mDeferredFlushTags = PR_TRUE;
mDeferredFlushTags = true;
} else if (sNotifyOnTimer && mLayoutStarted) {
if (mBackoffCount && !mInMonolithicContainer) {
PRInt64 now = PR_Now();
@ -1448,7 +1448,7 @@ nsContentSink::WillInterruptImpl()
result = FlushTags();
if (mDroppedTimer) {
ScrollToRef();
mDroppedTimer = PR_FALSE;
mDroppedTimer = false;
}
} else if (!mNotificationTimer) {
interval -= diff;
@ -1481,7 +1481,7 @@ nsContentSink::WillInterruptImpl()
}
#endif
mParsing = PR_FALSE;
mParsing = false;
return result;
}
@ -1492,7 +1492,7 @@ nsContentSink::WillResumeImpl()
SINK_TRACE(gContentSinkLogModuleInfo, SINK_TRACE_CALLS,
("nsContentSink::WillResume: this=%p", this));
mParsing = PR_TRUE;
mParsing = true;
return NS_OK;
}
@ -1601,7 +1601,7 @@ nsContentSink::DidBuildModelImpl(bool aTerminated)
}
if (!mDocument->HaveFiredDOMTitleChange()) {
mDocument->NotifyPossibleTitleChange(PR_FALSE);
mDocument->NotifyPossibleTitleChange(false);
}
// Cancel a timer if we had one out there
@ -1634,11 +1634,11 @@ nsContentSink::DropParserAndPerfHint(void)
if (mDynamicLowerValue) {
// Reset the performance hint which was set to FALSE
// when mDynamicLowerValue was set.
FavorPerformanceHint(PR_TRUE, 0);
FavorPerformanceHint(true, 0);
}
if (mCanInterruptParser) {
mDocument->UnblockOnload(PR_TRUE);
mDocument->UnblockOnload(true);
}
}
@ -1679,7 +1679,7 @@ nsContentSink::WillParseImpl(void)
}
mDeflectedCount = 0;
mHasPendingEvent = PR_FALSE;
mHasPendingEvent = false;
mCurrentParseEndTime = currentTime +
(mDynamicLowerValue ? sInteractiveParseTime : sPerfParseTime);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше