diff --git a/dw/stackingcontextmgr.cc b/dw/stackingcontextmgr.cc index c84e6e3..a177593 100644 --- a/dw/stackingcontextmgr.cc +++ b/dw/stackingcontextmgr.cc @@ -34,8 +34,7 @@ StackingContextMgr::StackingContextMgr (Widget *widget) this->widget = widget; - childSCWidgets = new Vector (1, false); - DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets->size()); + DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets.size()); numZIndices = 0; zIndices = NULL; @@ -44,7 +43,6 @@ StackingContextMgr::StackingContextMgr (Widget *widget) StackingContextMgr::~StackingContextMgr () { - delete childSCWidgets; if (zIndices) free (zIndices); DBG_OBJ_DELETE (); @@ -76,9 +74,9 @@ void StackingContextMgr::addChildSCWidget (Widget *widget) DBG_OBJ_ARRSET_NUM ("zIndex", pos, zIndices[pos]); } - childSCWidgets->put (widget); - DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets->size()); - DBG_OBJ_ARRSET_PTR ("childSCWidgets", childSCWidgets->size() - 1, widget); + childSCWidgets.push_back (widget); + DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets.size()); + DBG_OBJ_ARRSET_PTR ("childSCWidgets", childSCWidgets.size() - 1, widget); DBG_OBJ_LEAVE (); } @@ -135,8 +133,8 @@ void StackingContextMgr::draw (View *view, Rectangle *area, int startZIndex, DBG_OBJ_MSGF ("draw", 1, "drawing zIndex = %d", zIndices[zIndexIndex]); DBG_OBJ_MSG_START (); - for (int i = 0; i < childSCWidgets->size (); i++) { - Widget *child = childSCWidgets->get (i); + for (std::size_t i = 0; i < childSCWidgets.size (); i++) { + Widget *child = childSCWidgets.at (i); DBG_OBJ_MSGF ("draw", 2, "widget %p has zIndex = %d", child, child->getStyle()->zIndex); @@ -172,9 +170,9 @@ Widget *StackingContextMgr::getWidgetAtPoint (int x, int y, zIndices[zIndexIndex]); DBG_OBJ_MSG_START (); - for (int i = childSCWidgets->size () - 1; + for (int i = (int)childSCWidgets.size () - 1; widgetAtPoint == NULL && i >= 0; i--) { - Widget *child = childSCWidgets->get (i); + Widget *child = childSCWidgets.at (i); DBG_OBJ_MSGF ("events", 2, "widget %p has zIndex = %d", child, child->getStyle()->zIndex); if (child->getStyle()->zIndex == zIndices[zIndexIndex]) diff --git a/dw/stackingcontextmgr.hh b/dw/stackingcontextmgr.hh index 1f96e09..863d549 100644 --- a/dw/stackingcontextmgr.hh +++ b/dw/stackingcontextmgr.hh @@ -9,6 +9,8 @@ #include +#include + namespace dw { namespace core { @@ -20,7 +22,7 @@ class StackingContextMgr { private: Widget *widget; - lout::container::typed::Vector *childSCWidgets; + std::vector childSCWidgets; int *zIndices, numZIndices; int findZIndex (int zIndex, bool mustExist); @@ -51,7 +53,7 @@ public: void addChildSCWidget (Widget *widget); inline int getNumZIndices () { return numZIndices; } - inline int getNumChildSCWidgets () { return childSCWidgets->size (); } + inline int getNumChildSCWidgets () { return childSCWidgets.size (); } inline void drawBottom (View *view, Rectangle *area, DrawingContext *context) { draw (view, area, INT_MIN, -1, context); }