Bug 654369 - Part 10: Make nsFloatManager::StoreRegionFor return void r=bz
authorCraig Topper <craig.topper@gmail.com>
Sun, 08 May 2011 01:00:29 -0700
changeset 72313 605c1bfa4ad2b2101c22bf24ee474b30bc488817
parent 72312 2ff6a55908afddd8af580474b0c13c17cc6b3090
child 72314 acec89b9786bb24df059210436ff7db4ab1e1cf7
push idunknown
push userunknown
push dateunknown
reviewersbz
bugs654369
milestone7.0a1
Bug 654369 - Part 10: Make nsFloatManager::StoreRegionFor return void r=bz
layout/generic/nsBlockReflowState.cpp
layout/generic/nsFloatManager.cpp
layout/generic/nsFloatManager.h
--- a/layout/generic/nsBlockReflowState.cpp
+++ b/layout/generic/nsBlockReflowState.cpp
@@ -877,18 +877,17 @@ nsBlockReflowState::FlowAndPlaceFloat(ns
   if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus) &&
       (NS_UNCONSTRAINEDSIZE != mContentArea.height)) {
     region.height = NS_MAX(region.height, mContentArea.height - floatY);
   }
   nsresult rv =
   mFloatManager->AddFloat(aFloat, region);
   NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv), "bad float placement");
   // store region
-  rv = nsFloatManager::StoreRegionFor(aFloat, region);
-  NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv), "float region storage failed");
+  nsFloatManager::StoreRegionFor(aFloat, region);
 
   // If the float's dimensions have changed, note the damage in the
   // float manager.
   if (!region.IsEqualEdges(oldRegion)) {
     // XXXwaterson conservative: we could probably get away with noting
     // less damage; e.g., if only height has changed, then only note the
     // area into which the float has grown or from which the float has
     // shrunk.
--- a/layout/generic/nsFloatManager.cpp
+++ b/layout/generic/nsFloatManager.cpp
@@ -333,36 +333,34 @@ nsFloatManager::GetRegionFor(nsIFrame* a
   void* storedRegion = aFloat->Properties().Get(FloatRegionProperty());
   if (storedRegion) {
     nsMargin margin = *static_cast<nsMargin*>(storedRegion);
     region.Inflate(margin);
   }
   return region;
 }
 
-nsresult
+void
 nsFloatManager::StoreRegionFor(nsIFrame* aFloat,
                                nsRect&   aRegion)
 {
-  nsresult rv = NS_OK;
   nsRect rect = aFloat->GetRect();
   FrameProperties props = aFloat->Properties();
   if (aRegion.IsEqualEdges(rect)) {
     props.Delete(FloatRegionProperty());
   }
   else {
     nsMargin* storedMargin = static_cast<nsMargin*>
       (props.Get(FloatRegionProperty()));
     if (!storedMargin) {
       storedMargin = new nsMargin();
       props.Set(FloatRegionProperty(), storedMargin);
     }
     *storedMargin = aRegion - rect;
   }
-  return rv;
 }
 
 nsresult
 nsFloatManager::RemoveTrailingRegions(nsIFrame* aFrameList)
 {
   if (!aFrameList) {
     return NS_OK;
   }
--- a/layout/generic/nsFloatManager.h
+++ b/layout/generic/nsFloatManager.h
@@ -95,18 +95,17 @@ public:
    */
   static nsRect CalculateRegionFor(nsIFrame* aFloatFrame,
                                    const nsMargin& aMargin);
   /**
    * Store the float region on the frame. The region is stored
    * as a delta against the mRect, so repositioning the frame will
    * also reposition the float region.
    */
-  static nsresult StoreRegionFor(nsIFrame* aFloat,
-                                 nsRect&   aRegion);
+  static void StoreRegionFor(nsIFrame* aFloat, nsRect& aRegion);
 
   // Structure that stores the current state of a frame manager for
   // Save/Restore purposes.
   struct SavedState;
   friend struct SavedState;
   struct SavedState {
   private:
     PRUint32 mFloatInfoCount;