diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-12-10 16:46:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-12-10 16:46:55 +0300 |
commit | 608dfae22e1b5145210314ca6c7268420dd639c8 (patch) | |
tree | 5f7317be7e895a1f8aede182ea69ef56d456c54f /src/gui/widgets/textbox.cpp | |
parent | 9eb389060d44672c311a36348036eab297859e7e (diff) | |
download | plus-608dfae22e1b5145210314ca6c7268420dd639c8.tar.gz plus-608dfae22e1b5145210314ca6c7268420dd639c8.tar.bz2 plus-608dfae22e1b5145210314ca6c7268420dd639c8.tar.xz plus-608dfae22e1b5145210314ca6c7268420dd639c8.zip |
Fix some issues found by automatic checks.
Diffstat (limited to 'src/gui/widgets/textbox.cpp')
-rw-r--r-- | src/gui/widgets/textbox.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index 479349503..edf360b62 100644 --- a/src/gui/widgets/textbox.cpp +++ b/src/gui/widgets/textbox.cpp @@ -116,7 +116,7 @@ void TextBox::setTextWrapped(const std::string &text, const int minDimension) mMinWidth = minDimension; const size_t textSize = text.size(); - size_t spacePos = text.rfind(" ", textSize); + size_t spacePos = text.rfind(' ', textSize); if (spacePos != std::string::npos) { @@ -136,7 +136,7 @@ void TextBox::setTextWrapped(const std::string &text, const int minDimension) do { // Determine next piece of string to wrap - newlinePos = text.find("\n", lastNewlinePos); + newlinePos = text.find('\n', lastNewlinePos); if (newlinePos == std::string::npos) newlinePos = textSize; @@ -151,7 +151,7 @@ void TextBox::setTextWrapped(const std::string &text, const int minDimension) do { - spacePos = line.find(" ", lastSpacePos); + spacePos = line.find(' ', lastSpacePos); if (spacePos == std::string::npos) spacePos = sz; @@ -190,7 +190,7 @@ void TextBox::setTextWrapped(const std::string &text, const int minDimension) wrappedStream.clear(); wrappedStream.str(""); lastNewlinePos = 0; - newlinePos = text.find("\n", lastNewlinePos); + newlinePos = text.find('\n', lastNewlinePos); if (newlinePos == std::string::npos) newlinePos = textSize; line = text.substr(lastNewlinePos, newlinePos - @@ -208,7 +208,7 @@ void TextBox::setTextWrapped(const std::string &text, const int minDimension) } while (spacePos != sz); - if (text.find("\n", lastNewlinePos) != std::string::npos) + if (text.find('\n', lastNewlinePos) != std::string::npos) wrappedStream << "\n"; lastNewlinePos = newlinePos + 1; @@ -240,7 +240,7 @@ void TextBox::setText(const std::string& text) int length; do { - pos = text.find("\n", lastPos); + pos = text.find('\n', lastPos); if (pos != std::string::npos) length = CAST_S32(pos - lastPos); |