From 8827755d994e9ebb49097da51a4e460c56385774 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 7 May 2021 23:25:56 +1000 Subject: Use shared_ptr for LineLayoutCache as it simpifies lifetime management. AutoLineLayout and other code no longer needed so removed. --- src/PositionCache.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/PositionCache.h') diff --git a/src/PositionCache.h b/src/PositionCache.h index 41da53bcf..4c62900e8 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -61,7 +61,6 @@ private: int lenLineStarts; /// Drawing is only performed for @a maxLineLength characters on each line. Sci::Line lineNumber; - bool inCache; public: enum { wrapWidthInfinite = 0x7ffffff }; @@ -160,10 +159,9 @@ public: }; private: Cache level; - std::vector>cache; + std::vector>cache; bool allInvalidated; int styleClock; - int useCount; size_t EntryForLine(Sci::Line line) const noexcept; void AllocateForLevel(Sci::Line linesOnScreen, Sci::Line linesInDoc); public: @@ -178,9 +176,8 @@ public: void Invalidate(LineLayout::ValidLevel validity_) noexcept; void SetLevel(Cache level_) noexcept; Cache GetLevel() const noexcept { return level; } - LineLayout *Retrieve(Sci::Line lineNumber, Sci::Line lineCaret, int maxChars, int styleClock_, + std::shared_ptr Retrieve(Sci::Line lineNumber, Sci::Line lineCaret, int maxChars, int styleClock_, Sci::Line linesOnScreen, Sci::Line linesInDoc); - void Dispose(LineLayout *ll) noexcept; }; class PositionCacheEntry { -- cgit v1.2.3