summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-rw-r--r--src/gui/widgets/textfield.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index f89d2ead2..342e97ee8 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -253,7 +253,7 @@ void TextField::keyPressed(KeyEvent &event)
{
std::string str = event.getText();
mText.insert(mCaretPosition, str);
- mCaretPosition += str.size();
+ mCaretPosition += static_cast<unsigned int>(str.size());
event.consume();
fixScroll();
if (mSendAlwaysEvents)
@@ -679,7 +679,7 @@ void TextField::fixScroll()
void TextField::setCaretPosition(unsigned int position)
{
- const unsigned int sz = mText.size();
+ const unsigned int sz = static_cast<unsigned int>(mText.size());
if (position > sz)
mCaretPosition = static_cast<int>(sz);
else
@@ -746,7 +746,7 @@ void TextField::setText(const std::string& text)
{
const size_t sz = text.size();
if (sz < mCaretPosition)
- mCaretPosition = sz;
+ mCaretPosition = static_cast<unsigned int>(sz);
mText = text;
}