[Libreoffice-commits] core.git: sw/inc sw/source

Stephan Bergmann sbergman at redhat.com
Wed Jan 31 12:17:53 UTC 2018


 sw/inc/swtypes.hxx              |    2 +-
 sw/source/core/edit/autofmt.cxx |   18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit b3ebd1ed63bba9824224c8bb76ab43d4de1cd004
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 31 09:09:11 2018 +0100

    SvxNumberFormat::SetAbsLSpace takes short
    
    ...so there appears to be no good reason to cast from long etc. to sal_uInt16 first
    
    Change-Id: I870e63404bed09cd42673692e08fc12c1c1e2fdf
    Reviewed-on: https://gerrit.libreoffice.org/48958
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index f4a8138d1ed8..4422b214c29f 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -117,7 +117,7 @@ extern SwPathFinder *pPathFinder;
 //  (For more levels the values have to be multiplied with the levels+1;
 //  levels 0 ..4!)
 
-const sal_uInt16 lBullIndent = 1440/4;
+const short lBullIndent = 1440/4;
 const short lBullFirstLineOffset = -lBullIndent;
 const sal_uInt16 lNumIndent = 1440/4;
 const short lNumFirstLineOffset = -lNumIndent;
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 485737ff574a..b1b276c97e4d 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1453,9 +1453,9 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
                         }
                     }
 
-                    sal_uInt16 nAbsPos = lBullIndent;
-                    sal_uInt16 nSpaceSteps = nLvl
-                                            ? sal_uInt16(nLeftTextPos / nLvl)
+                    short nAbsPos = lBullIndent;
+                    SwTwips nSpaceSteps = nLvl
+                                            ? nLeftTextPos / nLvl
                                             : lBullIndent;
                     for( sal_uInt8 n = 0; n < MAXLEVEL; ++n, nAbsPos = nAbsPos + nSpaceSteps )
                     {
@@ -1477,8 +1477,8 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
 
                         if( n == nLvl &&
                             nFrameWidth < ( nSpaceSteps * MAXLEVEL ) )
-                            nSpaceSteps = static_cast<sal_uInt16>(( nFrameWidth - nLeftTextPos ) /
-                                                ( MAXLEVEL - nLvl ));
+                            nSpaceSteps = ( nFrameWidth - nLeftTextPos ) /
+                                                ( MAXLEVEL - nLvl );
                     }
                 }
             }
@@ -1552,7 +1552,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
                         if( n < aNumTypes.getLength() )
                             aFormat.SetNumberingType(static_cast<SvxNumType>(aNumTypes[ n ] - '0'));
 
-                        aFormat.SetAbsLSpace( sal_uInt16( nSpaceSteps * n )
+                        aFormat.SetAbsLSpace( nSpaceSteps * n
                                             + lNumIndent );
 
                         if( !aFormat.GetCharFormat() )
@@ -1570,10 +1570,10 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
                         SwNumFormat aFormat( aRule.Get( n ) );
                         aFormat.SetIncludeUpperLevels( MAXLEVEL );
                         if( bDefStep )
-                            aFormat.SetAbsLSpace( sal_uInt16( (nLeftTextPos +
-                                SwNumRule::GetNumIndent(static_cast<sal_uInt8>(n-nLvl)))));
+                            aFormat.SetAbsLSpace( nLeftTextPos +
+                                SwNumRule::GetNumIndent(static_cast<sal_uInt8>(n-nLvl)));
                         else
-                            aFormat.SetAbsLSpace( sal_uInt16( nSpaceSteps * n )
+                            aFormat.SetAbsLSpace( nSpaceSteps * n
                                                 + lNumIndent );
                         aRule.Set( n, aFormat );
                     }


More information about the Libreoffice-commits mailing list