From 9a39909a6e03fc2fcddc06a3e4a1fedf9999346c Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 3 May 2018 07:40:42 +1000 Subject: Eliminate XFromPosition overload for Sci::Position as SelectionPosition overload can always be used. --- src/Editor.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index 01a45e374..09858df74 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -376,11 +376,6 @@ Point Editor::LocationFromPosition(Sci::Position pos, PointEnd pe) { return LocationFromPosition(SelectionPosition(pos), pe); } -int Editor::XFromPosition(Sci::Position pos) { - const Point pt = LocationFromPosition(pos); - return static_cast(pt.x) - vs.textStart + xOffset; -} - int Editor::XFromPosition(SelectionPosition sp) { const Point pt = LocationFromPosition(sp); return static_cast(pt.x) - vs.textStart + xOffset; @@ -2150,8 +2145,8 @@ void Editor::PasteRectangular(SelectionPosition pos, const char *ptr, Sci::Posit } // Pad the end of lines with spaces if required sel.RangeMain().caret.SetPosition(PositionFromLineX(line, xInsert)); - if ((XFromPosition(sel.MainCaret()) < xInsert) && (i + 1 < len)) { - while (XFromPosition(sel.MainCaret()) < xInsert) { + if ((XFromPosition(sel.RangeMain().caret) < xInsert) && (i + 1 < len)) { + while (XFromPosition(sel.RangeMain().caret) < xInsert) { assert(pdoc); const Sci::Position lengthInserted = pdoc->InsertString(sel.MainCaret(), " ", 1); sel.RangeMain().caret.Add(lengthInserted); -- cgit v1.2.3