From 0d2bd5e004b657be9bd66e26161f1cf7299707ea Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 17 Jun 2012 13:38:21 +1000 Subject: Use std::string instead of fixed size strings. Decrease direct access to the autocompletion list box from outside AutoComplete. --- src/Editor.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index 2bc89ba1f..c424cd278 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5845,6 +5845,18 @@ char *Editor::CopyRange(int start, int end) { return text; } +std::string Editor::RangeText(int start, int end) const { + if (start < end) { + int len = end - start; + std::string ret(len, '\0'); + for (int i = 0; i < len; i++) { + ret[i] = pdoc->CharAt(start + i); + } + return ret; + } + return std::string(); +} + void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) { if (sel.Empty()) { if (allowLineCopy) { -- cgit v1.2.3