From 7f93e6b2bdd4a9eae6426617cde141b85ceaa568 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 17 Apr 2018 08:04:38 +1000 Subject: Templatize LineVector so it can later be switched between 32-bits and 64-bits. --- src/CellBuffer.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 0ee66ce7c..d6d83c20b 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -45,8 +45,9 @@ public: using namespace Scintilla; +template class LineVector : public ILineVector { - Partitioning starts; + Partitioning starts; PerLine *perLine; public: LineVector() : starts(256), perLine(0) { @@ -65,10 +66,10 @@ public: perLine = pl; } void InsertText(Sci::Line line, Sci::Position delta) override { - starts.InsertText(line, delta); + starts.InsertText(static_cast(line), static_cast(delta)); } void InsertLine(Sci::Line line, Sci::Position position, bool lineStart) override { - starts.InsertPartition(line, position); + starts.InsertPartition(static_cast(line), static_cast(position)); if (perLine) { if ((line > 0) && lineStart) line--; @@ -76,10 +77,10 @@ public: } } void SetLineStart(Sci::Line line, Sci::Position position) override { - starts.SetPartitionStartPosition(line, position); + starts.SetPartitionStartPosition(static_cast(line), static_cast(position)); } void RemoveLine(Sci::Line line) override { - starts.RemovePartition(line); + starts.RemovePartition(static_cast(line)); if (perLine) { perLine->RemoveLine(line); } @@ -88,10 +89,10 @@ public: return starts.Partitions(); } Sci::Line LineFromPosition(Sci::Position pos) const override { - return starts.PartitionFromPosition(pos); + return starts.PartitionFromPosition(static_cast(pos)); } Sci::Position LineStart(Sci::Line line) const override { - return starts.PositionFromPartition(line); + return starts.PositionFromPartition(static_cast(line)); } }; @@ -368,7 +369,7 @@ CellBuffer::CellBuffer(bool hasStyles_) : readOnly = false; utf8LineEnds = 0; collectingUndo = true; - plv = std::make_unique(); + plv = std::make_unique>(); } CellBuffer::~CellBuffer() { -- cgit v1.2.3