aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.h
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2013-05-04 17:49:07 +1000
committernyamatongwe <devnull@localhost>2013-05-04 17:49:07 +1000
commit3c4ee3e6f6344a3933383ed939f49c2f8d57e684 (patch)
treec4d2e063f8cb0471f8d94f09ddcfd772e8031e1a /src/PositionCache.h
parent4947d05b57e5d1d009090937ed54ff47da7eb67a (diff)
downloadscintilla-mirror-3c4ee3e6f6344a3933383ed939f49c2f8d57e684.tar.gz
Replacing raw pointers and allocations with std::vector.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r--src/PositionCache.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h
index ad3fffd7f..34f237705 100644
--- a/src/PositionCache.h
+++ b/src/PositionCache.h
@@ -73,13 +73,11 @@ public:
*/
class LineLayoutCache {
int level;
- int length;
- int size;
- LineLayout **cache;
+ std::vector<LineLayout *>cache;
bool allInvalidated;
int styleClock;
int useCount;
- void Allocate(int length_);
+ void Allocate(size_t length_);
void AllocateForLevel(int linesOnScreen, int linesInDoc);
public:
LineLayoutCache();
@@ -122,9 +120,7 @@ class BreakFinder {
int lineEnd;
int posLineStart;
int nextBreak;
- int *selAndEdge;
- unsigned int saeSize;
- unsigned int saeLen;
+ std::vector<int> selAndEdge;
unsigned int saeCurrentPos;
int saeNext;
int subBreak;
@@ -146,8 +142,7 @@ public:
};
class PositionCache {
- PositionCacheEntry *pces;
- size_t size;
+ std::vector<PositionCacheEntry> pces;
unsigned int clock;
bool allClear;
// Private so PositionCache objects can not be copied
@@ -157,7 +152,7 @@ public:
~PositionCache();
void Clear();
void SetSize(size_t size_);
- size_t GetSize() const { return size; }
+ size_t GetSize() const { return pces.size(); }
void MeasureWidths(Surface *surface, ViewStyle &vstyle, unsigned int styleNumber,
const char *s, unsigned int len, XYPOSITION *positions, Document *pdoc);
};