From 56e7f5ea4d5e267af509ab295077c7fa1ff77ab8 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Sat, 27 May 2017 00:40:17 +0800 Subject: [PATCH] remove deprecated code --- .../gui/widgets/skeletons/text_editor.hpp | 1 - source/gui/widgets/skeletons/text_editor.cpp | 25 ------------------- 2 files changed, 26 deletions(-) diff --git a/include/nana/gui/widgets/skeletons/text_editor.hpp b/include/nana/gui/widgets/skeletons/text_editor.hpp index b95b4fa7..664b07e7 100644 --- a/include/nana/gui/widgets/skeletons/text_editor.hpp +++ b/include/nana/gui/widgets/skeletons/text_editor.hpp @@ -321,7 +321,6 @@ namespace nana{ namespace widgets { nana::upoint caret; //position of caret by text, it specifies the position of a new character nana::upoint shift_begin_caret; - unsigned xpos{0}; //This data is used for move up/down }points_; }; }//end namespace skeletons diff --git a/source/gui/widgets/skeletons/text_editor.cpp b/source/gui/widgets/skeletons/text_editor.cpp index 6bf1bd52..6f50cc83 100644 --- a/source/gui/widgets/skeletons/text_editor.cpp +++ b/source/gui/widgets/skeletons/text_editor.cpp @@ -744,21 +744,6 @@ namespace nana{ namespace widgets auto const width_px = editor_.width_pixels(); pre_calc_line(first, width_px); - - /* - //textbase is implement by using deque, and the linemtr holds the text pointers - //If the textbase is changed, it will check the text pointers. - std::size_t line = 0; - for (auto & mtr: linemtr_) //deprecated - { - auto& linestr = editor_.textbase().getline(line); - auto p = mtr.line_sections.front().begin; - if (p < linestr.c_str() || (linestr.c_str() + linestr.size() < p)) - pre_calc_line(line, width_px); - - ++line; - } - */ } void add_lines(std::size_t pos, std::size_t lines) override @@ -1641,7 +1626,6 @@ namespace nana{ namespace widgets reset_caret(); impl_->try_refresh = sync_graph::refresh; - points_.xpos = 0; //_m_put calcs the lines _m_reset_content_size(false); @@ -1787,7 +1771,6 @@ namespace nana{ namespace widgets { bool new_sel_end = (select_.b != points_.caret); select_.b = points_.caret; - points_.xpos = points_.caret.x; if (new_sel_end || (stay_in_view && this->_m_adjust_view())) impl_->try_refresh = sync_graph::refresh; @@ -1962,7 +1945,6 @@ namespace nana{ namespace widgets reset_caret(); impl_->try_refresh = sync_graph::refresh; _m_reset_content_size(true); - points_.xpos = points_.caret.x; } } @@ -1997,7 +1979,6 @@ namespace nana{ namespace widgets impl_->try_refresh = sync_graph::refresh; _m_reset_content_size(); - points_.xpos = points_.caret.x; } void text_editor::copy() const @@ -2139,7 +2120,6 @@ namespace nana{ namespace widgets if(has_erase) backspace(); _m_reset_content_size(); - points_.xpos = points_.caret.x; } void text_editor::backspace(bool record_undo) @@ -2245,8 +2225,6 @@ namespace nana{ namespace widgets if (pending && this->_m_adjust_view()) impl_->try_refresh = sync_graph::refresh; - - points_.xpos = points_.caret.x; } void text_editor::move_right() @@ -2272,8 +2250,6 @@ namespace nana{ namespace widgets if (do_render) impl_->try_refresh = sync_graph::refresh; - - points_.xpos = points_.caret.x; } void text_editor::_m_handle_move_key(const arg_keyboard& arg) @@ -2394,7 +2370,6 @@ namespace nana{ namespace widgets select_.a = pos; } points_.caret = pos; - points_.xpos = points_.caret.x; impl_->try_refresh = sync_graph::refresh; this->_m_adjust_view(); impl_->cview->sync(true);