[Libreoffice-commits] core.git: vcl/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 27 09:08:49 UTC 2020


 vcl/source/edit/textundo.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 1b5a4da9100675243b14f2d9b07f23010d94aa82
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Jan 27 08:38:37 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Jan 27 10:08:12 2020 +0100

    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 at redhat.com>

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 =


More information about the Libreoffice-commits mailing list