mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-15 13:09:14 +00:00
Bug 919865: Replace #ifdef DEBUG with DebugOnly<> in a few spots in layout/generic. r=mats
This commit is contained in:
parent
51d8f87605
commit
7e62c91bb4
@ -1393,10 +1393,7 @@ nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// Take the next-in-flow out of the parent's child list
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
#endif
|
||||
StealFrame(aPresContext, aNextInFlow);
|
||||
DebugOnly<nsresult> rv = StealFrame(aPresContext, aNextInFlow);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame failure");
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -878,10 +878,7 @@ nsIFrame::GetUsedMargin() const
|
||||
if (m) {
|
||||
margin = *m;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
bool hasMargin =
|
||||
#endif
|
||||
StyleMargin()->GetMargin(margin);
|
||||
DebugOnly<bool> hasMargin = StyleMargin()->GetMargin(margin);
|
||||
NS_ASSERTION(hasMargin, "We should have a margin here! (out of memory?)");
|
||||
}
|
||||
return margin;
|
||||
@ -956,10 +953,7 @@ nsIFrame::GetUsedPadding() const
|
||||
if (p) {
|
||||
padding = *p;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
bool hasPadding =
|
||||
#endif
|
||||
StylePadding()->GetPadding(padding);
|
||||
DebugOnly<bool> hasPadding = StylePadding()->GetPadding(padding);
|
||||
NS_ASSERTION(hasPadding, "We should have padding here! (out of memory?)");
|
||||
}
|
||||
return padding;
|
||||
@ -5069,10 +5063,7 @@ ComputeOutlineAndEffectsRect(nsIFrame* aFrame,
|
||||
uint8_t outlineStyle = outline->GetOutlineStyle();
|
||||
if (outlineStyle != NS_STYLE_BORDER_STYLE_NONE) {
|
||||
nscoord width;
|
||||
#ifdef DEBUG
|
||||
bool result =
|
||||
#endif
|
||||
outline->GetOutlineWidth(width);
|
||||
DebugOnly<bool> result = outline->GetOutlineWidth(width);
|
||||
NS_ASSERTION(result, "GetOutlineWidth had no cached outline width");
|
||||
if (width > 0) {
|
||||
if (aStoreRectProperties) {
|
||||
|
@ -3181,10 +3181,7 @@ void
|
||||
nsXULScrollFrame::RemoveHorizontalScrollbar(nsBoxLayoutState& aState, bool aOnBottom)
|
||||
{
|
||||
// removing a scrollbar should always fit
|
||||
#ifdef DEBUG
|
||||
bool result =
|
||||
#endif
|
||||
AddRemoveScrollbar(aState, aOnBottom, true, false);
|
||||
DebugOnly<bool> result = AddRemoveScrollbar(aState, aOnBottom, true, false);
|
||||
NS_ASSERTION(result, "Removing horizontal scrollbar failed to fit??");
|
||||
}
|
||||
|
||||
@ -3192,10 +3189,7 @@ void
|
||||
nsXULScrollFrame::RemoveVerticalScrollbar(nsBoxLayoutState& aState, bool aOnRight)
|
||||
{
|
||||
// removing a scrollbar should always fit
|
||||
#ifdef DEBUG
|
||||
bool result =
|
||||
#endif
|
||||
AddRemoveScrollbar(aState, aOnRight, false, false);
|
||||
DebugOnly<bool> result = AddRemoveScrollbar(aState, aOnRight, false, false);
|
||||
NS_ASSERTION(result, "Removing vertical scrollbar failed to fit??");
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "nsDisplayList.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "nsIReflowCallback.h"
|
||||
|
||||
class nsImageMap;
|
||||
@ -327,11 +328,8 @@ private:
|
||||
}
|
||||
|
||||
void RemoveIconObserver(nsImageFrame *frame) {
|
||||
#ifdef DEBUG
|
||||
bool rv =
|
||||
#endif
|
||||
mIconObservers.RemoveElement(frame);
|
||||
NS_ABORT_IF_FALSE(rv, "Observer not in array");
|
||||
mozilla::DebugOnly<bool> didRemove = mIconObservers.RemoveElement(frame);
|
||||
NS_ABORT_IF_FALSE(didRemove, "Observer not in array");
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user