Bug 452797 - Clean up unused variables in layout/; v6; r+sr=roc

This commit is contained in:
Arpad Borsos 2008-09-20 15:42:03 +02:00
Родитель e3bafe020d
Коммит ba63ac8756
16 изменённых файлов: 77 добавлений и 54 удалений

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

@ -212,7 +212,10 @@ nsImageLoader::RedrawDirtyFrame(const nsRect* aDamageRect)
{
if (mReflowOnLoad) {
nsIPresShell *shell = mPresContext->GetPresShell();
nsresult rv = shell->FrameNeedsReflow(mFrame, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
#ifdef DEBUG
nsresult rv =
#endif
shell->FrameNeedsReflow(mFrame, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Could not reflow after loading border-image");
// The reflow might not do all the invalidation we need, so continue
// on with the invalidation codepath.

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

@ -90,9 +90,7 @@
* A namespace class for static layout utilities.
*/
#ifdef DEBUG
PRBool nsLayoutUtils::sDisableGetUsedXAssertions = PR_FALSE;
#endif
nsIFrame*
nsLayoutUtils::GetLastContinuationWithChild(nsIFrame* aFrame)
@ -2023,7 +2021,6 @@ nsLayoutUtils::ComputeWidthDependentValue(
NS_PRECONDITION(aContainingBlockWidth != NS_UNCONSTRAINEDSIZE,
"unconstrained widths no longer supported");
nscoord result;
if (eStyleUnit_Coord == aCoord.GetUnit()) {
return aCoord.GetCoordValue();
}
@ -2101,7 +2098,6 @@ nsLayoutUtils::ComputeHeightDependentValue(
nscoord aContainingBlockHeight,
const nsStyleCoord& aCoord)
{
nscoord result;
if (eStyleUnit_Coord == aCoord.GetUnit()) {
return aCoord.GetCoordValue();
}

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

@ -866,14 +866,11 @@ public:
* Indicates if the nsIFrame::GetUsedXXX assertions in nsFrame.cpp should
* disabled.
*/
#ifdef DEBUG
static PRBool sDisableGetUsedXAssertions;
#endif
};
class nsAutoDisableGetUsedXAssertions
{
#ifdef DEBUG
public:
nsAutoDisableGetUsedXAssertions()
: mOldValue(nsLayoutUtils::sDisableGetUsedXAssertions)
@ -887,7 +884,6 @@ public:
private:
PRBool mOldValue;
#endif
};
class nsSetAttrRunnable : public nsRunnable

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

@ -2700,8 +2700,7 @@ void PresShell::RestoreCaret()
NS_IMETHODIMP PresShell::SetCaretEnabled(PRBool aInEnable)
{
nsresult result = NS_OK;
PRBool oldEnabled = mCaretEnabled;
PRBool oldEnabled = mCaretEnabled;
mCaretEnabled = aInEnable;

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

@ -671,7 +671,9 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
mMightNeedSecondPass = NS_SUBTREE_DIRTY(this) ||
aReflowState.ShouldReflowAllKids();
#ifdef DEBUG
nscoord oldHeightOfARow = HeightOfARow();
#endif
nsHTMLReflowState state(aReflowState);
@ -1545,13 +1547,16 @@ nsListControlFrame::SetOptionsSelectedFromFrame(PRInt32 aStartIndex,
{
nsCOMPtr<nsISelectElement> selectElement(do_QueryInterface(mContent));
PRBool wasChanged = PR_FALSE;
nsresult rv = selectElement->SetOptionsSelectedByIndex(aStartIndex,
aEndIndex,
aValue,
aClearAll,
PR_FALSE,
PR_TRUE,
&wasChanged);
#ifdef DEBUG
nsresult rv =
#endif
selectElement->SetOptionsSelectedByIndex(aStartIndex,
aEndIndex,
aValue,
aClearAll,
PR_FALSE,
PR_TRUE,
&wasChanged);
NS_ASSERTION(NS_SUCCEEDED(rv), "SetSelected failed");
return wasChanged;
}

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

@ -4261,7 +4261,9 @@ nsBlockFrame::HandleOverflowPlaceholdersOnPulledLine(
// First, see if it's a line of continuation placeholders. If it
// is, remove one and retry.
if (aLine->mFirstChild && IsContinuationPlaceholder(aLine->mFirstChild)) {
#ifdef DEBUG
PRBool taken =
#endif
HandleOverflowPlaceholdersForPulledFrame(aState, aLine->mFirstChild);
NS_ASSERTION(taken, "We must have removed that frame");
return PR_TRUE;
@ -4613,8 +4615,10 @@ nsBlockFrame::SetOverflowOutOfFlows(const nsFrameList& aList)
if (!(GetStateBits() & NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS)) {
return;
}
#ifdef DEBUG
nsIFrame* result = static_cast<nsIFrame*>
(UnsetProperty(nsGkAtoms::overflowOutOfFlowsProperty));
#endif
(UnsetProperty(nsGkAtoms::overflowOutOfFlowsProperty));
NS_ASSERTION(result, "value should always be non-empty when state set");
RemoveStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS);
} else {
@ -5591,8 +5595,7 @@ void
nsBlockFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
nsIFrame* aNextInFlow)
{
nsIFrame* prevInFlow = aNextInFlow->GetPrevInFlow();
NS_PRECONDITION(prevInFlow, "bad next-in-flow");
NS_PRECONDITION(aNextInFlow->GetPrevInFlow(), "bad next-in-flow");
if (NS_FRAME_IS_OVERFLOW_CONTAINER & aNextInFlow->GetStateBits()) {
nsContainerFrame::DeleteNextInFlowChild(aPresContext, aNextInFlow);

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

@ -223,7 +223,10 @@ nsContainerFrame::RemoveFrame(nsIAtom* aListName,
if (!parent->mFrames.DestroyFrame(aOldFrame)) {
// Try to remove it from our overflow list, if we have one.
// The simplest way is to reuse StealFrame.
nsresult rv = StealFrame(PresContext(), aOldFrame, PR_TRUE);
#ifdef DEBUG
nsresult rv =
#endif
StealFrame(PresContext(), aOldFrame, PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "Could not find frame to remove!");
aOldFrame->Destroy();
}
@ -489,8 +492,7 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
PRBool isCanvas;
const nsStyleBackground* bg;
PRBool hasBG =
nsCSSRendering::FindBackground(aPresContext, aFrame, &bg, &isCanvas);
nsCSSRendering::FindBackground(aPresContext, aFrame, &bg, &isCanvas);
if (isCanvas) {
nsIView* rootView;
@ -1103,7 +1105,9 @@ void
nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
nsIFrame* aNextInFlow)
{
#ifdef DEBUG
nsIFrame* prevInFlow = aNextInFlow->GetPrevInFlow();
#endif
NS_PRECONDITION(prevInFlow, "bad prev-in-flow");
// If the next-in-flow has a next-in-flow then delete it, too (and
@ -1129,7 +1133,10 @@ nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
nsSplittableFrame::BreakFromPrevFlow(aNextInFlow);
// Take the next-in-flow out of the parent's child list
nsresult rv = StealFrame(aPresContext, aNextInFlow);
#ifdef DEBUG
nsresult rv =
#endif
StealFrame(aPresContext, aNextInFlow);
NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame failure");
// Delete the next-in-flow frame and its descendants.

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

@ -1169,7 +1169,6 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
return;
// now we need to setup the correct location for printing
nsresult rv;
nsPluginWindow window;
window.window = nsnull;
@ -1218,7 +1217,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
window.width = aDirtyRect.width;
window.height = aDirtyRect.height;
npprint.print.embedPrint.window = window;
rv = pi->Print(&npprint);
nsresult rv = pi->Print(&npprint);
if (NS_FAILED(rv)) {
PR_LOG(nsObjectFrameLM, PR_LOG_DEBUG, ("error: plugin returned failure %lx\n", (long)rv));
fclose(plugintmpfile);
@ -1241,7 +1240,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
npprint.print.embedPrint.platformPrint = hps;
npprint.print.embedPrint.window = window;
// send off print info to plugin
rv = pi->Print(&npprint);
pi->Print(&npprint);
#elif defined(XP_WIN)
/* On Windows, we use the win32 printing surface to print. This, in
@ -1295,7 +1294,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
npprint.print.embedPrint.platformPrint = dc;
npprint.print.embedPrint.window = window;
// send off print info to plugin
rv = pi->Print(&npprint);
pi->Print(&npprint);
nativeDraw.EndNativeDrawing();
} while (nativeDraw.ShouldRenderAgain());
@ -1332,7 +1331,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
npprint.print.embedPrint.platformPrint = dc;
npprint.print.embedPrint.window = window;
// send off print info to plugin
rv = pi->Print(&npprint);
pi->Print(&npprint);
#endif
// XXX Nav 4.x always sent a SetWindow call after print. Should we do the same?

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

@ -697,7 +697,9 @@ nsCSSExpandedDataBlock::ComputeSize()
nsCSSProperty(iHigh * kPropertiesSetChunkSize + iLow);
NS_ASSERTION(0 <= iProp && iProp < eCSSProperty_COUNT_no_shorthands,
"out of range");
#ifdef DEBUG
void *prop = PropertyAt(iProp);
#endif
PRUint32 increment = 0;
switch (nsCSSProps::kTypeTable[iProp]) {
case eCSSType_Value: {

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

@ -890,11 +890,6 @@ nsresult nsComputedDOMStyle::GetMozTransform(nsIDOMCSSValue **aValue)
resultString.AppendFloat(display->mTransform.GetMainMatrixEntry(index));
resultString.Append(NS_LITERAL_STRING(", "));
}
/* For the next part, we need to compute the translate values. This means
* that we'll need to get the width and height of this object.
*/
PRInt32 cssPxWidth = 0, cssPxHeight = 0;
/* Use the inner frame for width and height. If we fail, assume zero.
* TODO: There is no good way for us to represent the case where there's no

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

@ -3460,11 +3460,14 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
(displayData.mTransformOrigin.mXValue.GetIntValue()));
else {
/* Convert lengths, percents, and inherit. Default value is 50%. */
PRBool result = SetCoord(displayData.mTransformOrigin.mXValue,
display->mTransformOrigin[0],
parentDisplay->mTransformOrigin[0],
SETCOORD_LPH | SETCOORD_INITIAL_HALF,
aContext, mPresContext, aInherited);
#ifdef DEBUG
PRBool result =
#endif
SetCoord(displayData.mTransformOrigin.mXValue,
display->mTransformOrigin[0],
parentDisplay->mTransformOrigin[0],
SETCOORD_LPH | SETCOORD_INITIAL_HALF,
aContext, mPresContext, aInherited);
NS_ASSERTION(result, "Malformed -moz-transform-origin parse!");
}
@ -3475,11 +3478,14 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
(displayData.mTransformOrigin.mYValue.GetIntValue()));
else {
/* Convert lengths, percents, initial, inherit. */
PRBool result = SetCoord(displayData.mTransformOrigin.mYValue,
display->mTransformOrigin[1],
parentDisplay->mTransformOrigin[1],
SETCOORD_LPH | SETCOORD_INITIAL_HALF,
aContext, mPresContext, aInherited);
#ifdef DEBUG
PRBool result =
#endif
SetCoord(displayData.mTransformOrigin.mYValue,
display->mTransformOrigin[1],
parentDisplay->mTransformOrigin[1],
SETCOORD_LPH | SETCOORD_INITIAL_HALF,
aContext, mPresContext, aInherited);
NS_ASSERTION(result, "Malformed -moz-transform-origin parse!");
}
}

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

@ -419,7 +419,10 @@ nsSVGOuterSVGFrame::DidReflow(nsPresContext* aPresContext,
// Now that all viewport establishing descendants have their correct size,
// tell our foreignObject descendants to reflow their children.
if (mForeignObjectHash.IsInitialized()) {
PRUint32 count = mForeignObjectHash.EnumerateEntries(ReflowForeignObject, nsnull);
#ifdef DEBUG
PRUint32 count =
#endif
mForeignObjectHash.EnumerateEntries(ReflowForeignObject, nsnull);
NS_ASSERTION(count == mForeignObjectHash.Count(),
"We didn't reflow all our nsSVGForeignObjectFrames!");
}

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

@ -757,8 +757,8 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize)
widthSet = PR_TRUE;
}
} else if (position->mMinWidth.GetUnit() == eStyleUnit_Percent) {
float min = position->mMinWidth.GetPercentValue();
NS_ASSERTION(min == 0.0f, "Non-zero percentage values not currently supported");
NS_ASSERTION(position->mMinWidth.GetPercentValue() == 0.0f,
"Non-zero percentage values not currently supported");
aSize.width = 0;
widthSet = PR_TRUE;
}
@ -774,8 +774,8 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize)
heightSet = PR_TRUE;
}
} else if (position->mMinHeight.GetUnit() == eStyleUnit_Percent) {
float min = position->mMinHeight.GetPercentValue();
NS_ASSERTION(min == 0.0f, "Non-zero percentage values not currently supported");
NS_ASSERTION(position->mMinHeight.GetPercentValue() == 0.0f,
"Non-zero percentage values not currently supported");
aSize.height = 0;
heightSet = PR_TRUE;
}

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

@ -531,7 +531,7 @@ CheckCaretDrawingState(nsIDocument *aDocument) {
return;
nsRefPtr<nsCaret> caret;
nsresult res = presShell->GetCaret(getter_AddRefs(caret));
presShell->GetCaret(getter_AddRefs(caret));
if (!caret)
return;
caret->CheckCaretDrawingState();

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

@ -481,7 +481,10 @@ SetTitletipLabel(nsITreeBoxObject* aTreeBox, nsIContent* aTooltip,
aTreeBox->GetView(getter_AddRefs(view));
if (view) {
nsAutoString label;
nsresult rv = view->GetCellText(aRow, aCol, label);
#ifdef DEBUG
nsresult rv =
#endif
view->GetCellText(aRow, aCol, label);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Couldn't get the cell text!");
aTooltip->SetAttr(kNameSpaceID_None, nsGkAtoms::label, label, PR_TRUE);
}

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

@ -1170,7 +1170,10 @@ nsTreeBodyFrame::GetCoordsForCellItem(PRInt32 aRow, nsITreeColumn* aCol, const n
// The Rect for the current cell.
nscoord colWidth;
nsresult rv = currCol->GetWidthInTwips(this, &colWidth);
#ifdef DEBUG
nsresult rv =
#endif
currCol->GetWidthInTwips(this, &colWidth);
NS_ASSERTION(NS_SUCCEEDED(rv), "invalid column");
nsRect cellRect(currX, mInnerBox.y + mRowHeight * (aRow - mTopRowIndex),
@ -3742,7 +3745,10 @@ nsTreeBodyFrame::PaintDropFeedback(const nsRect& aDropFeedbackRect,
nsTreeColumn* primaryCol = mColumns->GetPrimaryColumn();
if (primaryCol) {
nsresult rv = primaryCol->GetXInTwips(this, &currX);
#ifdef DEBUG
nsresult rv =
#endif
primaryCol->GetXInTwips(this, &currX);
NS_ASSERTION(NS_SUCCEEDED(rv), "primary column is invalid?");
currX += aPt.x - mHorzPosition;