From 0a7730ecd56b4d657eb5f491dcd27e4da2b23f7e40e95982dc671f136b6b77e2 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 9 Aug 2025 18:18:05 -0400 Subject: [PATCH] Another `SimpleVector` removed. --- dw/alignedtextblock.cc | 4 +--- dw/alignedtextblock.hh | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dw/alignedtextblock.cc b/dw/alignedtextblock.cc index 687858d..ebafba9 100644 --- a/dw/alignedtextblock.cc +++ b/dw/alignedtextblock.cc @@ -28,7 +28,6 @@ namespace dw { AlignedTextblock::List::List () { textblocks = new lout::misc::SimpleVector (4); - values = new lout::misc::SimpleVector (4); maxValue = 0; refCount = 0; } @@ -36,13 +35,12 @@ AlignedTextblock::List::List () AlignedTextblock::List::~List () { delete textblocks; - delete values; } int AlignedTextblock::List::add(AlignedTextblock *textblock) { textblocks->increase (); - values->increase (); + values.push_back ( 0 ); textblocks->set (textblocks->size () - 1, textblock); refCount++; return textblocks->size () - 1; diff --git a/dw/alignedtextblock.hh b/dw/alignedtextblock.hh index 1650b75..409fb82 100644 --- a/dw/alignedtextblock.hh +++ b/dw/alignedtextblock.hh @@ -17,7 +17,7 @@ private: { private: lout::misc::SimpleVector *textblocks; - lout::misc::SimpleVector *values; + std::vector< int > values; int maxValue, refCount; ~List (); @@ -33,9 +33,8 @@ private: inline int size () { return textblocks->size (); } inline AlignedTextblock *getTextblock (int pos) { return textblocks->get (pos); } - inline int getValue (int pos) {return values->get (pos); } - inline void setValue (int pos, int value) { - return values->set (pos, value); } + inline int getValue (int pos) {return values.at( pos ); } + inline void setValue (int pos, int value) { values.at( pos )= value; } }; List *list;