aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextBox.hh
diff options
context:
space:
mode:
authorMathias Gumz <akira@fluxbox.org>2016-05-28 14:57:43 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-05-28 14:57:43 (GMT)
commitb9ed1c16de3cab491dc8a747bcf60a0b8ead7e91 (patch)
tree1ac5f12cd6bdf3586b716b135f25fa73d4131287 /src/FbTk/TextBox.hh
parenta9e17d409164b8141bc4c4cde5af767ce7ac894e (diff)
downloadfluxbox-b9ed1c16de3cab491dc8a747bcf60a0b8ead7e91.zip
fluxbox-b9ed1c16de3cab491dc8a747bcf60a0b8ead7e91.tar.bz2
improve consistency
for a std::string::size_type, the right value to use is not "-1", but std::string::npos.
Diffstat (limited to 'src/FbTk/TextBox.hh')
-rw-r--r--src/FbTk/TextBox.hh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/FbTk/TextBox.hh b/src/FbTk/TextBox.hh
index 2c1ef9d..a3b857f 100644
--- a/src/FbTk/TextBox.hh
+++ b/src/FbTk/TextBox.hh
@@ -39,7 +39,7 @@ public:
39 void setText(const FbTk::BiDiString &text); 39 void setText(const FbTk::BiDiString &text);
40 void setFont(const Font &font); 40 void setFont(const Font &font);
41 void setGC(GC gc); 41 void setGC(GC gc);
42 void setCursorPosition(int cursor); 42 void setCursorPosition(int cursor);
43 void setInputFocus(); 43 void setInputFocus();
44 void cursorEnd(); 44 void cursorEnd();
45 void cursorHome(); 45 void cursorHome();
@@ -65,7 +65,8 @@ public:
65 int cursorPosition() const { return m_cursor_pos; } 65 int cursorPosition() const { return m_cursor_pos; }
66 int textStartPos() const { return m_start_pos; } 66 int textStartPos() const { return m_start_pos; }
67 67
68 bool hasSelection() const { return m_select_pos != -1 && m_select_pos != m_cursor_pos + m_start_pos; } 68 bool hasSelection() const {
69 return (m_select_pos != std::string::npos) && (m_select_pos != m_cursor_pos + m_start_pos); }
69 void select(std::string::size_type pos, int length); 70 void select(std::string::size_type pos, int length);
70 void selectAll(); 71 void selectAll();
71 72