aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextBox.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-01-08 22:07:58 (GMT)
committerfluxgen <fluxgen>2004-01-08 22:07:58 (GMT)
commitf25aab19562fe50c36fac186f2eb5bd3383e2173 (patch)
tree6b509dfbf50285a378122812a78f7c6a319b4b46 /src/FbTk/TextBox.cc
parent5643caa65520c7410a87e6daaa55e3b7adb005f8 (diff)
downloadfluxbox_pavel-f25aab19562fe50c36fac186f2eb5bd3383e2173.zip
fluxbox_pavel-f25aab19562fe50c36fac186f2eb5bd3383e2173.tar.bz2
cleaning
Diffstat (limited to 'src/FbTk/TextBox.cc')
-rw-r--r--src/FbTk/TextBox.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/FbTk/TextBox.cc b/src/FbTk/TextBox.cc
index 75778f6..1608076 100644
--- a/src/FbTk/TextBox.cc
+++ b/src/FbTk/TextBox.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: TextBox.cc,v 1.5 2003/12/30 18:26:18 fluxgen Exp $ 22// $Id: TextBox.cc,v 1.6 2004/01/08 22:02:52 fluxgen Exp $
23 23
24#include "TextBox.hh" 24#include "TextBox.hh"
25#include "Font.hh" 25#include "Font.hh"
@@ -140,7 +140,7 @@ void TextBox::insertText(const std::string &val) {
140} 140}
141 141
142void TextBox::killToEnd() { 142void TextBox::killToEnd() {
143 if (cursorPosition() < text().size()) { 143 if (cursorPosition() >= 0 && cursorPosition() < static_cast<signed>(text().size())) {
144 m_text.erase(cursorPosition()); 144 m_text.erase(cursorPosition());
145 setText(m_text); 145 setText(m_text);
146 } 146 }
@@ -262,7 +262,7 @@ void TextBox::setCursorPosition(int pos) {
262void TextBox::adjustEndPos() { 262void TextBox::adjustEndPos() {
263 m_end_pos = text().size(); 263 m_end_pos = text().size();
264 int text_width = font().textWidth(text().c_str() + m_start_pos, m_end_pos - m_start_pos); 264 int text_width = font().textWidth(text().c_str() + m_start_pos, m_end_pos - m_start_pos);
265 while (text_width > width()) { 265 while (text_width > static_cast<signed>(width())) {
266 m_end_pos--; 266 m_end_pos--;
267 text_width = font().textWidth(text().c_str() + m_start_pos, m_end_pos - m_start_pos); 267 text_width = font().textWidth(text().c_str() + m_start_pos, m_end_pos - m_start_pos);
268 } 268 }
@@ -270,12 +270,12 @@ void TextBox::adjustEndPos() {
270 270
271void TextBox::adjustStartPos() { 271void TextBox::adjustStartPos() {
272 int text_width = font().textWidth(text().c_str() + m_start_pos, m_end_pos - m_start_pos); 272 int text_width = font().textWidth(text().c_str() + m_start_pos, m_end_pos - m_start_pos);
273 if (text_width < width()) 273 if (text_width < static_cast<signed>(width()))
274 return; 274 return;
275 275
276 int start_pos = 0; 276 int start_pos = 0;
277 text_width = font().textWidth(text().c_str() + start_pos, m_end_pos - start_pos); 277 text_width = font().textWidth(text().c_str() + start_pos, m_end_pos - start_pos);
278 while (text_width > width()) { 278 while (text_width > static_cast<signed>(width())) {
279 start_pos++; 279 start_pos++;
280 text_width = font().textWidth(text().c_str() + start_pos, m_end_pos - start_pos); 280 text_width = font().textWidth(text().c_str() + start_pos, m_end_pos - start_pos);
281 } 281 }