diff --git a/src/libs/alm/Area.cpp b/src/libs/alm/Area.cpp index e072062f0e..f2b22db00e 100644 --- a/src/libs/alm/Area.cpp +++ b/src/libs/alm/Area.cpp @@ -173,8 +173,6 @@ Area::SetLeft(XTab* left) { fLeft = left; - fColumn = NULL; - fMinContentWidth->SetLeftSide(-1.0, fLeft, 1.0, fRight); if (fMaxContentWidth != NULL) fMaxContentWidth->SetLeftSide(-1.0, fLeft, 1.0, fRight); @@ -194,8 +192,6 @@ Area::SetRight(XTab* right) { fRight = right; - fColumn = NULL; - fMinContentWidth->SetLeftSide(-1.0, fLeft, 1.0, fRight); if (fMaxContentWidth != NULL) fMaxContentWidth->SetLeftSide(-1.0, fLeft, 1.0, fRight); @@ -213,8 +209,6 @@ Area::SetTop(YTab* top) { fTop = top; - fRow = NULL; - fMinContentHeight->SetLeftSide(-1.0, fTop, 1.0, fBottom); if (fMaxContentHeight != NULL) fMaxContentHeight->SetLeftSide(-1.0, fTop, 1.0, fBottom); @@ -232,8 +226,6 @@ Area::SetBottom(YTab* bottom) { fBottom = bottom; - fRow = NULL; - fMinContentHeight->SetLeftSide(-1.0, fTop, 1.0, fBottom); if (fMaxContentHeight != NULL) fMaxContentHeight->SetLeftSide(-1.0, fTop, 1.0, fBottom); diff --git a/src/libs/alm/RowColumnManager.cpp b/src/libs/alm/RowColumnManager.cpp index 82381ee4df..20da2cd3f8 100644 --- a/src/libs/alm/RowColumnManager.cpp +++ b/src/libs/alm/RowColumnManager.cpp @@ -33,7 +33,7 @@ RowColumnManager::~RowColumnManager() delete fColumns.ItemAt(i)->fPrefSizeConstraint; } - + void RowColumnManager::AddArea(Area* area) { @@ -41,16 +41,16 @@ RowColumnManager::AddArea(Area* area) if (row == NULL) { row = new Row(fLinearSpec, area->Top(), area->Bottom()); fRows.AddItem(row); - area->fRow = row; } + area->fRow = row; row->fAreas.AddItem(area); Column* column = _FindColumnFor(area); if (column == NULL) { column = new Column(fLinearSpec, area->Left(), area->Right()); fColumns.AddItem(column); - area->fColumn = column; } + area->fColumn = column; column->fAreas.AddItem(area); _UpdateConstraints(row); @@ -61,24 +61,26 @@ RowColumnManager::AddArea(Area* area) void RowColumnManager::RemoveArea(Area* area) { - Row* row = _FindRowFor(area); + Row* row = area->fRow; if (row) { row->fAreas.RemoveItem(area); + area->fRow = NULL; if (row->fAreas.CountItems() == 0) { fRows.RemoveItem(row); delete row; - } else - _UpdateConstraints(row); + } + _UpdateConstraints(row); } - Column* column = _FindColumnFor(area); + Column* column = area->fColumn; if (column) { column->fAreas.RemoveItem(area); + area->fColumn = NULL; if (column->fAreas.CountItems() == 0) { fColumns.RemoveItem(column); delete column; - } else - _UpdateConstraints(column); + } + _UpdateConstraints(column); } }