diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-01-27 08:38:37 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-01-27 10:08:12 +0100 |
commit | 1b5a4da9100675243b14f2d9b07f23010d94aa82 (patch) | |
tree | 2c56aa50be33916d05066973db5d4c528bfffc8d /vcl/source/edit | |
parent | 6f3678f377d532860c0aed4ab97e151927e5b938 (diff) |
Use more appropriate variable types, spare explicit casts
Change-Id: I51114cf6c87b9368e72d5186fec457d307c25c09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87480
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/source/edit')
-rw-r--r-- | vcl/source/edit/textundo.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx index adbf8be9076c..b910be11257b 100644 --- a/vcl/source/edit/textundo.cxx +++ b/vcl/source/edit/textundo.cxx @@ -35,17 +35,17 @@ namespace // Shorten() -- inserts ellipsis (...) in the middle of a long text void Shorten (OUString& rString) { - unsigned nLen = rString.getLength(); + auto const nLen = rString.getLength(); if (nLen > 48) { // If possible, we don't break a word, hence first we look for a space. // Space before the ellipsis: - int iFirst = rString.lastIndexOf(' ', 32); - if (iFirst == -1 || unsigned(iFirst) < 16) + auto iFirst = rString.lastIndexOf(' ', 32); + if (iFirst == -1 || iFirst < 16) iFirst = 24; // not possible // Space after the ellipsis: - int iLast = rString.indexOf(' ', nLen - 16); - if (iLast == -1 || unsigned(iLast) > nLen - 4) + auto iLast = rString.indexOf(' ', nLen - 16); + if (iLast == -1 || iLast > nLen - 4) iLast = nLen - 8; // not possible // finally: rString = |