Backed out changeset 54215f2cbc66
to fix Bug 454186 SM crashes when try to download file [@ nsString::ToInteger - nsTreeBodyFrame::PaintProgressMeter]
This commit is contained in:
@@ -212,10 +212,7 @@ nsImageLoader::RedrawDirtyFrame(const nsRect* aDamageRect)
|
||||
{
|
||||
if (mReflowOnLoad) {
|
||||
nsIPresShell *shell = mPresContext->GetPresShell();
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
#endif
|
||||
shell->FrameNeedsReflow(mFrame, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
|
||||
nsresult rv = 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.
|
||||
|
||||
@@ -1853,6 +1853,7 @@ nsLayoutUtils::ComputeWidthDependentValue(
|
||||
NS_PRECONDITION(aContainingBlockWidth != NS_UNCONSTRAINEDSIZE,
|
||||
"unconstrained widths no longer supported");
|
||||
|
||||
nscoord result;
|
||||
if (eStyleUnit_Coord == aCoord.GetUnit()) {
|
||||
return aCoord.GetCoordValue();
|
||||
}
|
||||
@@ -1930,6 +1931,7 @@ nsLayoutUtils::ComputeHeightDependentValue(
|
||||
nscoord aContainingBlockHeight,
|
||||
const nsStyleCoord& aCoord)
|
||||
{
|
||||
nscoord result;
|
||||
if (eStyleUnit_Coord == aCoord.GetUnit()) {
|
||||
return aCoord.GetCoordValue();
|
||||
}
|
||||
|
||||
@@ -2700,6 +2700,7 @@ void PresShell::RestoreCaret()
|
||||
|
||||
NS_IMETHODIMP PresShell::SetCaretEnabled(PRBool aInEnable)
|
||||
{
|
||||
nsresult result = NS_OK;
|
||||
PRBool oldEnabled = mCaretEnabled;
|
||||
|
||||
mCaretEnabled = aInEnable;
|
||||
|
||||
@@ -671,9 +671,7 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
||||
mMightNeedSecondPass = NS_SUBTREE_DIRTY(this) ||
|
||||
aReflowState.ShouldReflowAllKids();
|
||||
|
||||
#ifdef DEBUG
|
||||
nscoord oldHeightOfARow = HeightOfARow();
|
||||
#endif
|
||||
|
||||
nsHTMLReflowState state(aReflowState);
|
||||
|
||||
@@ -1547,10 +1545,7 @@ nsListControlFrame::SetOptionsSelectedFromFrame(PRInt32 aStartIndex,
|
||||
{
|
||||
nsCOMPtr<nsISelectElement> selectElement(do_QueryInterface(mContent));
|
||||
PRBool wasChanged = PR_FALSE;
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
#endif
|
||||
selectElement->SetOptionsSelectedByIndex(aStartIndex,
|
||||
nsresult rv = selectElement->SetOptionsSelectedByIndex(aStartIndex,
|
||||
aEndIndex,
|
||||
aValue,
|
||||
aClearAll,
|
||||
|
||||
@@ -4277,9 +4277,7 @@ 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;
|
||||
@@ -4631,9 +4629,7 @@ nsBlockFrame::SetOverflowOutOfFlows(const nsFrameList& aList)
|
||||
if (!(GetStateBits() & NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS)) {
|
||||
return;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
nsIFrame* result = static_cast<nsIFrame*>
|
||||
#endif
|
||||
(UnsetProperty(nsGkAtoms::overflowOutOfFlowsProperty));
|
||||
NS_ASSERTION(result, "value should always be non-empty when state set");
|
||||
RemoveStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS);
|
||||
@@ -5611,7 +5607,8 @@ void
|
||||
nsBlockFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
nsIFrame* aNextInFlow)
|
||||
{
|
||||
NS_PRECONDITION(aNextInFlow->GetPrevInFlow(), "bad next-in-flow");
|
||||
nsIFrame* prevInFlow = aNextInFlow->GetPrevInFlow();
|
||||
NS_PRECONDITION(prevInFlow, "bad next-in-flow");
|
||||
|
||||
if (NS_FRAME_IS_OVERFLOW_CONTAINER & aNextInFlow->GetStateBits()) {
|
||||
nsContainerFrame::DeleteNextInFlowChild(aPresContext, aNextInFlow);
|
||||
|
||||
@@ -223,10 +223,7 @@ 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.
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
#endif
|
||||
StealFrame(PresContext(), aOldFrame, PR_TRUE);
|
||||
nsresult rv = StealFrame(PresContext(), aOldFrame, PR_TRUE);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Could not find frame to remove!");
|
||||
aOldFrame->Destroy();
|
||||
}
|
||||
@@ -492,6 +489,7 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
|
||||
|
||||
PRBool isCanvas;
|
||||
const nsStyleBackground* bg;
|
||||
PRBool hasBG =
|
||||
nsCSSRendering::FindBackground(aPresContext, aFrame, &bg, &isCanvas);
|
||||
|
||||
if (isCanvas) {
|
||||
@@ -1099,7 +1097,8 @@ void
|
||||
nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
nsIFrame* aNextInFlow)
|
||||
{
|
||||
NS_PRECONDITION(aNextInFlow->GetPrevInFlow(), "bad prev-in-flow");
|
||||
nsIFrame* prevInFlow = aNextInFlow->GetPrevInFlow();
|
||||
NS_PRECONDITION(prevInFlow, "bad prev-in-flow");
|
||||
|
||||
// If the next-in-flow has a next-in-flow then delete it, too (and
|
||||
// delete it first).
|
||||
@@ -1124,10 +1123,7 @@ nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
nsSplittableFrame::BreakFromPrevFlow(aNextInFlow);
|
||||
|
||||
// Take the next-in-flow out of the parent's child list
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
#endif
|
||||
StealFrame(aPresContext, aNextInFlow);
|
||||
nsresult rv = StealFrame(aPresContext, aNextInFlow);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame failure");
|
||||
|
||||
// Delete the next-in-flow frame and its descendants.
|
||||
|
||||
@@ -1169,6 +1169,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
|
||||
return;
|
||||
|
||||
// now we need to setup the correct location for printing
|
||||
nsresult rv;
|
||||
nsPluginWindow window;
|
||||
window.window = nsnull;
|
||||
|
||||
@@ -1217,7 +1218,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
|
||||
window.width = aDirtyRect.width;
|
||||
window.height = aDirtyRect.height;
|
||||
npprint.print.embedPrint.window = window;
|
||||
nsresult rv = pi->Print(&npprint);
|
||||
rv = pi->Print(&npprint);
|
||||
if (NS_FAILED(rv)) {
|
||||
PR_LOG(nsObjectFrameLM, PR_LOG_DEBUG, ("error: plugin returned failure %lx\n", (long)rv));
|
||||
fclose(plugintmpfile);
|
||||
@@ -1240,7 +1241,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
|
||||
npprint.print.embedPrint.platformPrint = hps;
|
||||
npprint.print.embedPrint.window = window;
|
||||
// send off print info to plugin
|
||||
pi->Print(&npprint);
|
||||
rv = pi->Print(&npprint);
|
||||
#elif defined(XP_WIN)
|
||||
|
||||
/* On Windows, we use the win32 printing surface to print. This, in
|
||||
@@ -1294,7 +1295,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
|
||||
npprint.print.embedPrint.platformPrint = dc;
|
||||
npprint.print.embedPrint.window = window;
|
||||
// send off print info to plugin
|
||||
pi->Print(&npprint);
|
||||
rv = pi->Print(&npprint);
|
||||
|
||||
nativeDraw.EndNativeDrawing();
|
||||
} while (nativeDraw.ShouldRenderAgain());
|
||||
@@ -1331,7 +1332,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext,
|
||||
npprint.print.embedPrint.platformPrint = dc;
|
||||
npprint.print.embedPrint.window = window;
|
||||
// send off print info to plugin
|
||||
pi->Print(&npprint);
|
||||
rv = pi->Print(&npprint);
|
||||
#endif
|
||||
|
||||
// XXX Nav 4.x always sent a SetWindow call after print. Should we do the same?
|
||||
|
||||
@@ -687,9 +687,7 @@ 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: {
|
||||
|
||||
@@ -419,10 +419,7 @@ 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()) {
|
||||
#ifdef DEBUG
|
||||
PRUint32 count =
|
||||
#endif
|
||||
mForeignObjectHash.EnumerateEntries(ReflowForeignObject, nsnull);
|
||||
PRUint32 count = mForeignObjectHash.EnumerateEntries(ReflowForeignObject, nsnull);
|
||||
NS_ASSERTION(count == mForeignObjectHash.Count(),
|
||||
"We didn't reflow all our nsSVGForeignObjectFrames!");
|
||||
}
|
||||
|
||||
@@ -757,7 +757,8 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize)
|
||||
widthSet = PR_TRUE;
|
||||
}
|
||||
} else if (position->mMinWidth.GetUnit() == eStyleUnit_Percent) {
|
||||
NS_ASSERTION(position->mMinWidth.GetPercentValue() == 0.0f, "Non-zero percentage values not currently supported");
|
||||
float min = position->mMinWidth.GetPercentValue();
|
||||
NS_ASSERTION(min == 0.0f, "Non-zero percentage values not currently supported");
|
||||
aSize.width = 0;
|
||||
widthSet = PR_TRUE;
|
||||
}
|
||||
@@ -773,7 +774,8 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize)
|
||||
heightSet = PR_TRUE;
|
||||
}
|
||||
} else if (position->mMinHeight.GetUnit() == eStyleUnit_Percent) {
|
||||
NS_ASSERTION(position->mMinHeight.GetPercentValue() == 0.0f, "Non-zero percentage values not currently supported");
|
||||
float min = position->mMinHeight.GetPercentValue();
|
||||
NS_ASSERTION(min == 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;
|
||||
presShell->GetCaret(getter_AddRefs(caret));
|
||||
nsresult res = presShell->GetCaret(getter_AddRefs(caret));
|
||||
if (!caret)
|
||||
return;
|
||||
caret->CheckCaretDrawingState();
|
||||
|
||||
@@ -481,10 +481,7 @@ SetTitletipLabel(nsITreeBoxObject* aTreeBox, nsIContent* aTooltip,
|
||||
aTreeBox->GetView(getter_AddRefs(view));
|
||||
if (view) {
|
||||
nsAutoString label;
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
#endif
|
||||
view->GetCellText(aRow, aCol, label);
|
||||
nsresult rv = 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);
|
||||
}
|
||||
|
||||
@@ -1168,10 +1168,7 @@ nsTreeBodyFrame::GetCoordsForCellItem(PRInt32 aRow, nsITreeColumn* aCol, const n
|
||||
|
||||
// The Rect for the current cell.
|
||||
nscoord colWidth;
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
#endif
|
||||
currCol->GetWidthInTwips(this, &colWidth);
|
||||
nsresult rv = currCol->GetWidthInTwips(this, &colWidth);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "invalid column");
|
||||
|
||||
nsRect cellRect(currX, mInnerBox.y + mRowHeight * (aRow - mTopRowIndex),
|
||||
@@ -3702,7 +3699,8 @@ nsTreeBodyFrame::PaintProgressMeter(PRInt32 aRowIndex,
|
||||
nsAutoString value;
|
||||
mView->GetCellValue(aRowIndex, aColumn, value);
|
||||
|
||||
PRInt32 intValue = value.ToInteger(nsnull);
|
||||
PRInt32 rv;
|
||||
PRInt32 intValue = value.ToInteger(&rv);
|
||||
if (intValue < 0)
|
||||
intValue = 0;
|
||||
else if (intValue > 100)
|
||||
|
||||
Reference in New Issue
Block a user