From e9baf4e167d122f172f95b9a996e8b54b84be53d7e50c807ffeba3c6635ad982 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 9 Aug 2025 12:13:06 -0400 Subject: [PATCH] Another one's gone, another one's gone... Another one bites the dust! Hey hey! --- dw/oofposabslikemgr.cc | 12 ++++++------ dw/oofpositionedmgr.cc | 44 ++++++++++++++++++++---------------------- dw/oofpositionedmgr.hh | 2 +- dw/oofposrelmgr.cc | 14 +++++++------- 4 files changed, 35 insertions(+), 37 deletions(-) diff --git a/dw/oofposabslikemgr.cc b/dw/oofposabslikemgr.cc index b53c117..53232e7 100644 --- a/dw/oofposabslikemgr.cc +++ b/dw/oofposabslikemgr.cc @@ -49,8 +49,8 @@ void OOFPosAbsLikeMgr::sizeAllocateChildren () int refWidth = container->getAvailWidth (true) - containerBoxDiffWidth (); int refHeight = container->getAvailHeight (true) - containerBoxDiffHeight (); - for (int i = 0; i < children->size(); i++) { - Child *child = children->get (i); + for (int i = 0; i < children.size(); i++) { + Child *child = children.at (i); int x, y, width, ascent, descent; calcPosAndSizeChildOfChild (child, refWidth, refHeight, &x, &y, &width, @@ -81,8 +81,8 @@ void OOFPosAbsLikeMgr::getSize (Requisition *containerReq, int *oofWidth, int refWidth = container->getAvailWidth (true); int refHeight = container->getAvailHeight (true); - for (int i = 0; i < children->size(); i++) { - Child *child = children->get(i); + for (int i = 0; i < children.size(); i++) { + Child *child = children.at(i); // Children whose position cannot be determined will be // considered later in sizeAllocateEnd. @@ -110,8 +110,8 @@ void OOFPosAbsLikeMgr::getExtremes (Extremes *containerExtr, int *oofMinWidth, *oofMinWidth = *oofMaxWidth = 0; - for (int i = 0; i < children->size(); i++) { - Child *child = children->get(i); + for (int i = 0; i < children.size(); i++) { + Child *child = children.at(i); // Children whose position cannot be determined will be // considered later in sizeAllocateEnd. diff --git a/dw/oofpositionedmgr.cc b/dw/oofpositionedmgr.cc index 2f67a6d..a1e8806 100644 --- a/dw/oofpositionedmgr.cc +++ b/dw/oofpositionedmgr.cc @@ -49,8 +49,7 @@ OOFPositionedMgr::OOFPositionedMgr (OOFAwareWidget *container) { DBG_OBJ_CREATE ("dw::oof::OOFPositionedMgr"); - this->container = (OOFAwareWidget*)container; - children = new Vector (1, false); + this->container = container; childrenByWidget = new HashTable, Child> (true, true); if(container->wasAllocated()) { @@ -70,7 +69,6 @@ OOFPositionedMgr::OOFPositionedMgr (OOFAwareWidget *container) OOFPositionedMgr::~OOFPositionedMgr () { - delete children; delete childrenByWidget; DBG_OBJ_DELETE (); @@ -128,8 +126,8 @@ bool OOFPositionedMgr::doChildrenExceedContainer () DBG_OBJ_MSG_START (); - for (int i = 0; i < children->size () && !exceeds; i++) { - Child *child = children->get (i); + for (int i = 0; i < children.size () && !exceeds; i++) { + Child *child = children.at (i); Allocation *childAlloc = child->widget->getAllocation (); DBG_OBJ_MSGF ("resize.oofm", 2, "Does childAlloc = (%d, %d, %d * %d) exceed container " @@ -162,8 +160,8 @@ void OOFPositionedMgr::containerSizeChangedForChildren () { DBG_OBJ_ENTER0 ("resize", 0, "containerSizeChangedForChildren"); - for (int i = 0; i < children->size(); i++) - children->get(i)->widget->containerSizeChanged (); + for (int i = 0; i < children.size(); i++) + children.at(i)->widget->containerSizeChanged (); DBG_OBJ_LEAVE (); } @@ -174,8 +172,8 @@ void OOFPositionedMgr::draw (View *view, Rectangle *area, DBG_OBJ_ENTER ("draw", 0, "draw", "%d, %d, %d * %d", area->x, area->y, area->width, area->height); - for (int i = 0; i < children->size(); i++) { - Child *child = children->get(i); + for (int i = 0; i < children.size(); i++) { + Child *child = children.at(i); Rectangle childArea; if (!context->hasWidgetBeenProcessedAsInterruption (child->widget) && @@ -200,12 +198,12 @@ int OOFPositionedMgr::addWidgetOOF (Widget *widget, OOFAwareWidget *generator, widget, generator, externalIndex); Child *child = new Child (widget, generator, externalIndex); - children->put (child); + children.push_back( child ); childrenByWidget->put (new TypedPointer (widget), child); - int subRef = children->size() - 1; - DBG_OBJ_SET_NUM ("children.size", children->size()); - DBG_OBJ_ARRSET_PTR ("children", children->size() - 1, widget); + int subRef = children.size() - 1; + DBG_OBJ_SET_NUM ("children.size", children.size()); + DBG_OBJ_ARRSET_PTR ("children", children.size() - 1, widget); DBG_OBJ_SET_PTR_O (widget, ".generator", generator); DBG_OBJ_SET_NUM_O (widget, ".externalIndex", externalIndex); @@ -218,8 +216,8 @@ int OOFPositionedMgr::addWidgetOOF (Widget *widget, OOFAwareWidget *generator, void OOFPositionedMgr::moveExternalIndices (OOFAwareWidget *generator, int oldStartIndex, int diff) { - for (int i = 0; i < children->size (); i++) { - Child *child = children->get (i); + for (int i = 0; i < children.size (); i++) { + Child *child = children.at (i); if (child->externalIndex >= oldStartIndex) { child->externalIndex += diff; DBG_OBJ_SET_NUM_O (child->widget, ".externalIndex", @@ -245,8 +243,8 @@ Widget *OOFPositionedMgr::getWidgetAtPoint (int x, int y, Widget *widgetAtPoint = NULL; - for (int i = children->size() - 1; widgetAtPoint == NULL && i >= 0; i--) { - Widget *childWidget = children->get(i)->widget; + for (int i = children.size() - 1; widgetAtPoint == NULL && i >= 0; i--) { + Widget *childWidget = children.at(i)->widget; if (!context->hasWidgetBeenProcessedAsInterruption (childWidget) && !StackingContextMgr::handledByStackingContextMgr (childWidget)) widgetAtPoint = childWidget->getWidgetAtPoint (x, y, context); @@ -362,12 +360,12 @@ bool OOFPositionedMgr::dealingWithSizeOfChild (Widget *child) int OOFPositionedMgr::getNumWidgets () { - return children->size(); + return children.size(); } Widget *OOFPositionedMgr::getWidget (int i) { - return children->get(i)->widget; + return children.at(i)->widget; } bool OOFPositionedMgr::getPosBorder (style::Length cssValue, int refLength, @@ -386,16 +384,16 @@ bool OOFPositionedMgr::getPosBorder (style::Length cssValue, int refLength, bool OOFPositionedMgr::allChildrenConsideredForSize () { - for (int i = 0; i < children->size(); i++) - if (!children->get(i)->consideredForSize) + for (int i = 0; i < children.size(); i++) + if (!children.at(i)->consideredForSize) return false; return true; } bool OOFPositionedMgr::allChildrenConsideredForExtremes () { - for (int i = 0; i < children->size(); i++) - if (!children->get(i)->consideredForExtremes) + for (int i = 0; i < children.size(); i++) + if (!children.at(i)->consideredForExtremes) return false; return true; } diff --git a/dw/oofpositionedmgr.hh b/dw/oofpositionedmgr.hh index dcc9b6b..efc8586 100644 --- a/dw/oofpositionedmgr.hh +++ b/dw/oofpositionedmgr.hh @@ -28,7 +28,7 @@ protected: enum { NOT_ALLOCATED, IN_ALLOCATION, WAS_ALLOCATED } containerAllocationState; - lout::container::typed::Vector *children; + std::vector< Child * > children; lout::container::typed::HashTable, Child> *childrenByWidget; diff --git a/dw/oofposrelmgr.cc b/dw/oofposrelmgr.cc index 2c081cd..5840d51 100644 --- a/dw/oofposrelmgr.cc +++ b/dw/oofposrelmgr.cc @@ -42,7 +42,7 @@ OOFPosRelMgr::~OOFPosRelMgr () void OOFPosRelMgr::markSizeChange (int ref) { DBG_OBJ_ENTER ("resize.oofm", 0, "markSizeChange", "%d", ref); - Child *child = children->get(ref); + Child *child = children.at(ref); DBG_OBJ_MSGF ("resize.oofm", 1, "generator = %p, externalIndex = %d", child->generator, child->externalIndex); child->generator->widgetRefSizeChanged (child->externalIndex); @@ -79,8 +79,8 @@ void OOFPosRelMgr::sizeAllocateChildren () { DBG_OBJ_ENTER0 ("resize.oofm", 0, "sizeAllocateChildren"); - for (int i = 0; i < children->size (); i++) { - Child *child = children->get(i); + for (int i = 0; i < children.size (); i++) { + Child *child = children.at(i); Requisition childReq; child->widget->sizeRequest (&childReq); @@ -106,8 +106,8 @@ void OOFPosRelMgr::getSize (Requisition *containerReq, int *oofWidth, *oofWidth = *oofHeight = 0; - for (int i = 0; i < children->size (); i++) { - Child *child = children->get(i); + for (int i = 0; i < children.size (); i++) { + Child *child = children.at(i); // Children whose position cannot be determined will be // considered later in sizeAllocateEnd. @@ -132,8 +132,8 @@ void OOFPosRelMgr::getExtremes (Extremes *containerExtr, int *oofMinWidth, { *oofMinWidth = *oofMaxWidth = 0; - for (int i = 0; i < children->size (); i++) { - Child *child = children->get(i); + for (int i = 0; i < children.size (); i++) { + Child *child = children.at(i); // Children whose position cannot be determined will be // considered later in sizeAllocateEnd.