Bläddra i källkod

Remove dead code from TextEdit

Paulb23 4 år sedan
förälder
incheckning
abbf14e7f5
2 ändrade filer med 0 tillägg och 26 borttagningar
  1. 0 21
      scene/gui/text_edit.cpp
  2. 0 5
      scene/gui/text_edit.h

+ 0 - 21
scene/gui/text_edit.cpp

@@ -746,8 +746,6 @@ void TextEdit::_notification(int p_what) {
 
 			int cursor_wrap_index = get_cursor_wrap_index();
 
-			//FontDrawer drawer(cache.font, Color(1, 1, 1));
-
 			int first_visible_line = get_first_visible_line() - 1;
 			int draw_amount = visible_rows + (smooth_scroll_enabled ? 1 : 0);
 			draw_amount += times_line_wraps(first_visible_line + 1);
@@ -2823,7 +2821,6 @@ void TextEdit::_base_remove_text(int p_from_line, int p_from_column, int p_to_li
 	}
 	text.set(p_from_line, pre_text + post_text, structured_text_parser(st_parser, st_args, pre_text + post_text));
 
-	//text.set_line_wrap_amount(p_from_line, -1);
 	text.invalidate_cache(p_from_line);
 
 	if (!text_changed_dirty && !setting_text) {
@@ -2942,19 +2939,6 @@ void TextEdit::_remove_text(int p_from_line, int p_from_column, int p_to_line, i
 	current_op = op;
 }
 
-int TextEdit::get_char_count() {
-	int totalsize = 0;
-
-	for (int i = 0; i < text.size(); i++) {
-		if (i > 0) {
-			totalsize++; // Include \n.
-		}
-		totalsize += text[i].length();
-	}
-
-	return totalsize; // Omit last \n.
-}
-
 Size2 TextEdit::get_minimum_size() const {
 	return cache.style_normal->get_minimum_size();
 }
@@ -5371,11 +5355,6 @@ void TextEdit::_bind_methods() {
 	BIND_ENUM_CONSTANT(SELECTION_MODE_WORD);
 	BIND_ENUM_CONSTANT(SELECTION_MODE_LINE);
 
-	/*
-	ClassDB::bind_method(D_METHOD("delete_char"),&TextEdit::delete_char);
-	ClassDB::bind_method(D_METHOD("delete_line"),&TextEdit::delete_line);
-*/
-
 	ClassDB::bind_method(D_METHOD("get_draw_control_chars"), &TextEdit::get_draw_control_chars);
 	ClassDB::bind_method(D_METHOD("set_draw_control_chars", "enable"), &TextEdit::set_draw_control_chars);
 	ClassDB::bind_method(D_METHOD("set_text_direction", "direction"), &TextEdit::set_text_direction);

+ 0 - 5
scene/gui/text_edit.h

@@ -342,7 +342,6 @@ private:
 	void _update_wrap_at(bool p_force = false);
 	Vector<String> get_wrap_rows_text(int p_line) const;
 	int get_cursor_wrap_index() const;
-	int get_char_count();
 
 	double get_scroll_pos_for_line(int p_line, int p_wrap_index = 0) const;
 	void set_line_as_first_visible(int p_line, int p_wrap_index = 0);
@@ -379,7 +378,6 @@ private:
 	void _scroll_lines_up();
 	void _scroll_lines_down();
 
-	//void mouse_motion(const Point& p_pos, const Point& p_rel, int p_button_mask);
 	Size2 get_minimum_size() const override;
 	int _get_control_height() const;
 
@@ -574,9 +572,6 @@ public:
 	void _get_minimap_mouse_row(const Point2i &p_mouse, int &r_row) const;
 	bool is_dragging_cursor() const;
 
-	//void delete_char();
-	//void delete_line();
-
 	void begin_complex_operation();
 	void end_complex_operation();