[
Bug 773839] Fix build warnings under accessible/ r=tbsaunde
--- a/accessible/src/base/nsCoreUtils.cpp
+++ b/accessible/src/base/nsCoreUtils.cpp
@@ -198,18 +198,17 @@ nsCoreUtils::GetDOMElementFor(nsIContent
return nsnull;
}
nsINode *
nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode *aNode, PRUint32 aOffset)
{
if (aNode && aNode->IsElement()) {
PRUint32 childCount = aNode->GetChildCount();
- NS_ASSERTION(aOffset >= 0 && aOffset <= childCount,
- "Wrong offset of the DOM point!");
+ NS_ASSERTION(aOffset <= childCount, "Wrong offset of the DOM point!");
// The offset can be after last child of container node that means DOM point
// is placed immediately after the last child. In this case use the DOM node
// from the given DOM point is used as result node.
if (aOffset != childCount)
return aNode->GetChildAt(aOffset);
}
--- a/accessible/src/generic/ARIAGridAccessible.cpp
+++ b/accessible/src/generic/ARIAGridAccessible.cpp
@@ -260,17 +260,17 @@ ARIAGridAccessible::SelectedCells(nsTArr
aCells->AppendElement(cell);
}
}
}
void
ARIAGridAccessible::SelectedCellIndices(nsTArray<PRUint32>* aCells)
{
- PRUint32 rowCount = RowCount(), colCount = ColCount();
+ PRUint32 colCount = ColCount();
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nsnull;
for (PRUint32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
if (nsAccUtils::IsARIASelected(row)) {
for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++)
aCells->AppendElement(rowIdx * colCount + colIdx);
--- a/accessible/src/generic/HyperTextAccessible.cpp
+++ b/accessible/src/generic/HyperTextAccessible.cpp
@@ -1803,18 +1803,16 @@ HyperTextAccessible::SetSelectionBounds(
Selection* domSel =
frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
NS_ENSURE_STATE(domSel);
PRUint32 rangeCount = domSel->GetRangeCount();
if (rangeCount < static_cast<PRUint32>(aSelectionNum))
return NS_ERROR_INVALID_ARG;
- // Caret is a collapsed selection
- bool isOnlyCaret = (aStartOffset == aEndOffset);
nsRefPtr<nsRange> range;
if (aSelectionNum == rangeCount)
range = new nsRange();
else
range = domSel->GetRangeAt(aSelectionNum);
nsresult rv = HypertextOffsetsToDOMRange(aStartOffset, aEndOffset, range);
NS_ENSURE_SUCCESS(rv, rv);
--- a/accessible/src/html/HTMLTableAccessible.cpp
+++ b/accessible/src/html/HTMLTableAccessible.cpp
@@ -31,16 +31,17 @@
#include "nsIPresShell.h"
#include "nsITableLayout.h"
#include "nsITableCellLayout.h"
#include "nsFrameSelection.h"
#include "nsLayoutErrors.h"
#include "nsArrayUtils.h"
#include "nsComponentManagerUtils.h"
+using namespace mozilla;
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// HTMLTableCellAccessible
////////////////////////////////////////////////////////////////////////////////
HTMLTableCellAccessible::
HTMLTableCellAccessible(nsIContent* aContent, DocAccessible* aDoc) :
@@ -761,40 +762,42 @@ HTMLTableAccessible::ColExtentAt(PRUint3
if (!tableLayout)
return 0;
nsCOMPtr<nsIDOMElement> domElement;
PRInt32 startRowIndex, startColIndex, rowSpan, colSpan, actualRowSpan;
bool isSelected;
PRInt32 columnExtent = 0;
- tableLayout->
+ DebugOnly<nsresult> rv = tableLayout->
GetCellDataAt(aRowIdx, aColIdx, *getter_AddRefs(domElement),
startRowIndex, startColIndex, rowSpan, colSpan,
actualRowSpan, columnExtent, isSelected);
+ NS_ASSERTION(NS_SUCCEEDED(rv), "Could not get cell data");
return columnExtent;
}
PRUint32
HTMLTableAccessible::RowExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx)
{
nsITableLayout* tableLayout = GetTableLayout();
if (!tableLayout)
return 0;
nsCOMPtr<nsIDOMElement> domElement;
PRInt32 startRowIndex, startColIndex, rowSpan, colSpan, actualColSpan;
bool isSelected;
PRInt32 rowExtent = 0;
- tableLayout->
+ DebugOnly<nsresult> rv = tableLayout->
GetCellDataAt(aRowIdx, aColIdx, *getter_AddRefs(domElement),
startRowIndex, startColIndex, rowSpan, colSpan,
rowExtent, actualColSpan, isSelected);
+ NS_ASSERTION(NS_SUCCEEDED(rv), "Could not get cell data");
return rowExtent;
}
bool
HTMLTableAccessible::IsColSelected(PRUint32 aColIdx)
{
bool isSelected = false;
--- a/accessible/src/xpcom/nsAccessibleRelation.h
+++ b/accessible/src/xpcom/nsAccessibleRelation.h
@@ -5,26 +5,27 @@
#ifndef _nsAccessibleRelation_H_
#define _nsAccessibleRelation_H_
#include "nsIAccessibleRelation.h"
#include "nsCOMPtr.h"
#include "nsIMutableArray.h"
+#include "mozilla/Attributes.h"
namespace mozilla {
namespace a11y {
class Relation;
/**
* Class represents an accessible relation.
*/
-class nsAccessibleRelation : public nsIAccessibleRelation
+class nsAccessibleRelation MOZ_FINAL : public nsIAccessibleRelation
{
public:
nsAccessibleRelation(PRUint32 aType, Relation* aRel);
NS_DECL_ISUPPORTS
NS_DECL_NSIACCESSIBLERELATION
private: