[Libreoffice-commits] core.git: cui/source editeng/source include/editeng sd/qa sd/source sw/inc sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 15 19:20:52 UTC 2018


 cui/source/tabpages/numpages.cxx        |    4 ++--
 editeng/source/editeng/editdbg.cxx      |    2 +-
 editeng/source/items/numitem.cxx        |   11 ++++++++---
 editeng/source/outliner/outliner.cxx    |    2 +-
 editeng/source/uno/unonrule.cxx         |    2 +-
 include/editeng/numitem.hxx             |    6 +++---
 sd/qa/unit/export-tests-ooxml1.cxx      |    2 +-
 sd/source/core/drawdoc4.cxx             |    2 +-
 sd/source/core/stlpool.cxx              |    4 ++--
 sd/source/ui/view/drviews3.cxx          |    2 +-
 sw/inc/editsh.hxx                       |    2 +-
 sw/inc/numrule.hxx                      |    2 +-
 sw/source/core/doc/number.cxx           |    9 ++++-----
 sw/source/core/edit/autofmt.cxx         |    4 ++--
 sw/source/core/edit/ednumber.cxx        |    2 +-
 sw/source/core/unocore/unosett.cxx      |    2 +-
 sw/source/filter/html/htmlcss1.cxx      |    2 +-
 sw/source/filter/html/htmlnumreader.cxx |    2 +-
 sw/source/filter/ww8/wrtw8nds.cxx       |    2 +-
 sw/source/filter/ww8/wrtw8num.cxx       |    2 +-
 sw/source/filter/ww8/wrtww8.hxx         |    2 +-
 sw/source/filter/ww8/ww8atr.cxx         |    2 +-
 sw/source/filter/ww8/ww8par.cxx         |    2 +-
 sw/source/filter/ww8/ww8par3.cxx        |    2 +-
 sw/source/ui/misc/num.cxx               |    4 ++--
 25 files changed, 41 insertions(+), 37 deletions(-)

New commits:
commit 0d227c96e11d7d03829144183bc66d229e059a4b
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Aug 15 16:48:09 2018 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Aug 15 21:20:26 2018 +0200

    SvxNumberFormat::nAbsLSpace should have a larger type
    
    ...as is seen when executing CppunitTest_sd_filters_test with Clang's new
    -fsanitize=implicit-conversion (see below).  The next larger natural choice
    after short is sal_Int32, and some of the code calling GetAbsLSpace actually
    already supported the value to be as wide (but not wider than) sal_Int32; code
    calling GetAbsLSpace that expected the value to be no wider than short has
    either been adapted or at least been marked with a TODO.  (Other choices could
    have been sal_Int64 or long.)
    
    Some dependent function's parameter types have also been changed accordingly.
    
    > Testing file:///home/sbergman/lo/core/sd/qa/unit/data/ppt/pass/hang-10.ppt:
    [...]
    > filter/source/msfilter/svdfppt.cxx:3792:33: runtime error: implicit conversion from type 'sal_uInt32' (aka 'unsigned int') of value 144780 (32-bit, unsigned) to type 'short' changed the value to 13708 (16-bit, signed)
    >  #0 in PPTNumberFormatCreator::ImplGetNumberFormat(SdrPowerPointImport const&, SvxNumberFormat&) at filter/source/msfilter/svdfppt.cxx:3792:33 (instdir/program/libmsfilterlo.so +0x7992cc)
    >  #1 in PPTNumberFormatCreator::GetNumberFormat(SdrPowerPointImport const&, SvxNumberFormat&, unsigned int, PPTParaLevel const&, PPTCharLevel const&, TSS_Type) at filter/source/msfilter/svdfppt.cxx:3674:5 (instdir/program/libmsfilterlo.so +0x797c6d)
    >  #2 in PPTStyleSheet::PPTStyleSheet(DffRecordHeader const&, SvStream&, SdrPowerPointImport&, PPTTextParagraphStyleAtomInterpreter const&, PPTTextSpecInfo const&) at filter/source/msfilter/svdfppt.cxx:4395:13 (instdir/program/libmsfilterlo.so +0x7ac38d)
    >  #3 in SdrPowerPointImport::SdrPowerPointImport(PowerPointImportParam&, rtl::OUString const&) at filter/source/msfilter/svdfppt.cxx:1618:59 (instdir/program/libmsfilterlo.so +0x74762f)
    >  #4 in ImplSdPPTImport::ImplSdPPTImport(SdDrawDocument*, SotStorage&, SfxMedium&, PowerPointImportParam&) at sd/source/filter/ppt/pptin.cxx:175:7 (instdir/program/libsdfiltlo.so +0x5f2be8)
    >  #5 in SdPPTImport::SdPPTImport(SdDrawDocument*, SvStream&, SotStorage&, SfxMedium&) at sd/source/filter/ppt/pptin.cxx:162:23 (instdir/program/libsdfiltlo.so +0x5ce2bb)
    >  #6 in ImportPPT at sd/source/filter/ppt/pptin.cxx:2760:47 (instdir/program/libsdfiltlo.so +0x617c79)
    >  #7 in SdPPTFilter::Import() at sd/source/filter/sdpptwrp.cxx:106:32 (instdir/program/libsdlo.so +0x2878413)
    >  #8 in sd::DrawDocShell::ConvertFrom(SfxMedium&) at sd/source/ui/docshell/docshel4.cxx:474:46 (instdir/program/libsdlo.so +0x2e165bc)
    >  #9 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:786:23 (instdir/program/libsfxlo.so +0x2c8cb12)
    >  #10 in SdFiltersTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) at sd/qa/unit/filters-test.cxx:75:31 (workdir/LinkTarget/CppunitTest/libtest_sd_filters_test.so +0x19771)
    >  #11 in test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at unotest/source/cpp/filters-test.cxx:130:20 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x5724c)
    >  #12 in test::FiltersTest::testDir(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at unotest/source/cpp/filters-test.cxx:155:5 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x57ec9)
    >  #13 in SdFiltersTest::testCVEs() at sd/qa/unit/filters-test.cxx:83:5 (workdir/LinkTarget/CppunitTest/libtest_sd_filters_test.so +0x19d6d)
    
    Change-Id: Ifa298a51bb62b7cbee9249b8289963f3427721f5
    Reviewed-on: https://gerrit.libreoffice.org/59116
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 439086981462..799898390702 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -3224,7 +3224,7 @@ IMPL_LINK( SvxNumPositionTabPage, DistanceHdl_Impl, SpinField&, rFld, void )
                 }
                 else
                 {
-                    aNumFmt.SetAbsLSpace( static_cast<short>(nValue) - aNumFmt.GetFirstLineOffset());
+                    aNumFmt.SetAbsLSpace( nValue - aNumFmt.GetFirstLineOffset());
                 }
             }
             else if (&rFld == m_pDistNumMF)
@@ -3235,7 +3235,7 @@ IMPL_LINK( SvxNumPositionTabPage, DistanceHdl_Impl, SpinField&, rFld, void )
             {
                 // together with the FirstLineOffset the AbsLSpace must be changed, too
                 long nDiff = nValue + aNumFmt.GetFirstLineOffset();
-                long nAbsLSpace = aNumFmt.GetAbsLSpace();
+                auto const nAbsLSpace = aNumFmt.GetAbsLSpace();
                 aNumFmt.SetAbsLSpace(nAbsLSpace + nDiff);
                 aNumFmt.SetFirstLineOffset( -static_cast<short>(nValue) );
             }
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index 3a8232e4be34..51bf4a63498f 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -90,7 +90,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem)
                     aDebStr.append('(');
                     aDebStr.append(static_cast<sal_Int32>(pFmt->GetFirstLineOffset()));
                     aDebStr.append(',');
-                    aDebStr.append(static_cast<sal_Int32>(pFmt->GetAbsLSpace()));
+                    aDebStr.append(pFmt->GetAbsLSpace());
                     aDebStr.append(',');
                     if ( pFmt->GetNumberingType() == SVX_NUM_BITMAP )
                         aDebStr.append("Bitmap");
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index ae2c584ff83e..0001e6f1af6f 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -24,6 +24,7 @@
 #include <com/sun/star/text/VertOrientation.hpp>
 #include <com/sun/star/text/RelOrientation.hpp>
 #include <editeng/brushitem.hxx>
+#include <o3tl/clamp.hxx>
 #include <vcl/font.hxx>
 #include <vcl/settings.hxx>
 #include <editeng/editids.hrc>
@@ -197,7 +198,9 @@ SvxNumberFormat::SvxNumberFormat( SvStream &rStream )
     rStream.ReadUInt16( nTmp16 ); cBullet = static_cast<sal_Unicode>(nTmp16);
 
     rStream.ReadInt16( nFirstLineOffset );
-    rStream.ReadInt16( nAbsLSpace );
+    sal_Int16 temp;
+    rStream.ReadInt16( temp );
+    nAbsLSpace = temp;
     rStream.SeekRel(2); //skip old now unused nLSpace;
 
     rStream.ReadInt16( nCharTextDistance );
@@ -259,7 +262,9 @@ void SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverte
     rStream.WriteUInt16( cBullet );
 
     rStream.WriteInt16( nFirstLineOffset );
-    rStream.WriteInt16( nAbsLSpace );
+    rStream.WriteInt16(
+        sal_Int16(o3tl::clamp<sal_Int32>(nAbsLSpace, SAL_MIN_INT16, SAL_MAX_INT16)) );
+        //TODO: better way to handle out-of-bounds value?
     rStream.WriteInt16( 0 ); // write a dummy for old now unused nLSpace
 
     rStream.WriteInt16( nCharTextDistance );
@@ -441,7 +446,7 @@ void SvxNumberFormat::SetPositionAndSpaceMode( SvxNumPositionAndSpaceMode ePosit
     mePositionAndSpaceMode = ePositionAndSpaceMode;
 }
 
-short SvxNumberFormat::GetAbsLSpace() const
+sal_Int32 SvxNumberFormat::GetAbsLSpace() const
 {
     return mePositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
            ? nAbsLSpace
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 09397d45f6b6..186a1c17daca 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1512,7 +1512,7 @@ tools::Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, bool bAdjust, boo
         bool bOutlineMode = bool( pEditEngine->GetControlWord() & EEControlBits::OUTLINER );
 
         // the ODF attribute text:space-before which holds the spacing to add to the left of the label
-        const short nSpaceBefore = pFmt->GetAbsLSpace() + pFmt->GetFirstLineOffset();
+        const auto nSpaceBefore = pFmt->GetAbsLSpace() + pFmt->GetFirstLineOffset();
 
         const SvxLRSpaceItem& rLR = pEditEngine->GetParaAttrib( nPara, bOutlineMode ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE );
         aTopLeft.setX( rLR.GetTextLeft() + rLR.GetTextFirstLineOfst() + nSpaceBefore );
diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index 3acef998e3d1..30c7deab2e94 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -245,7 +245,7 @@ Sequence<beans::PropertyValue> SvxUnoNumberingRules::getNumberingRuleByIndex(sal
     aVal <<= static_cast<sal_Int16>(rFmt.GetStart());
     pArray[nIdx++] = beans::PropertyValue(UNO_NAME_NRULE_START_WITH, -1, aVal, beans::PropertyState_DIRECT_VALUE);
 
-    aVal <<= static_cast<sal_Int32>(rFmt.GetAbsLSpace());
+    aVal <<= rFmt.GetAbsLSpace();
     pArray[nIdx++] = beans::PropertyValue(UNO_NAME_NRULE_LEFT_MARGIN, -1, aVal, beans::PropertyState_DIRECT_VALUE);
 
     aVal <<= static_cast<sal_Int32>(rFmt.GetFirstLineOffset());
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 9c434419058e..ec0e78248d3c 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -125,7 +125,7 @@ private:
     SvxNumPositionAndSpaceMode mePositionAndSpaceMode;
 
     short               nFirstLineOffset;   // First line indent
-    short               nAbsLSpace;         // Distance Border<->Number
+    sal_Int32           nAbsLSpace;         // Distance Border<->Number
     short               nCharTextDistance;  // Distance Number<->Text
 
     // specifies what follows the list label before the text of the first line
@@ -195,8 +195,8 @@ public:
     SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const { return mePositionAndSpaceMode;}
     void SetPositionAndSpaceMode( SvxNumPositionAndSpaceMode ePositionAndSpaceMode );
 
-    void            SetAbsLSpace(short nSet) {nAbsLSpace = nSet;}
-    short           GetAbsLSpace() const;
+    void            SetAbsLSpace(sal_Int32 nSet) {nAbsLSpace = nSet;}
+    sal_Int32       GetAbsLSpace() const;
     void            SetFirstLineOffset(short nSet) { nFirstLineOffset = nSet;}
     short           GetFirstLineOffset() const;
     void            SetCharTextDistance(short nSet) { nCharTextDistance = nSet; }
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index db58aaf77e34..38ea1323d4a4 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -663,7 +663,7 @@ void SdOOXMLExportTest1::testBulletMarginAndIndentation()
     const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
     CPPUNIT_ASSERT(pNumFmt);
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's left margin is wrong!", short(1000),pNumFmt->GetNumRule()->GetLevel(0).GetAbsLSpace() ); // left margin is 0.79 cm
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's left margin is wrong!", sal_Int32(1000),pNumFmt->GetNumRule()->GetLevel(0).GetAbsLSpace() ); // left margin is 0.79 cm
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's indentation is wrong!", sal_Int32(-998),sal_Int32(pNumFmt->GetNumRule()->GetLevel(0). GetFirstLineOffset()));
 
     xDocShRef->DoClose();
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 202f4e88b875..1dfb1fd93e61 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -1220,7 +1220,7 @@ void SdDrawDocument::SetTextDefaults() const
 
     for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
     {
-        const short nLSpace = (i + 1) * 600;
+        const auto nLSpace = (i + 1) * 600;
         aNumberFormat.SetAbsLSpace(nLSpace);
         aNumberFormat.SetFirstLineOffset(-600);
         aNumRule.SetLevel( i, aNumberFormat );
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index b73fe06877a2..905073f548f5 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -1038,7 +1038,7 @@ void SdStyleSheetPool::setDefaultOutlineNumberFormatBulletAndIndent(sal_uInt16 i
 {
     rNumberFormat.SetBulletChar( 0x25CF );  // StarBats: 0xF000 + 34
     rNumberFormat.SetBulletRelSize(45);
-    const short nLSpace = (i + 1) * 1200;
+    const auto nLSpace = (i + 1) * 1200;
     rNumberFormat.SetAbsLSpace(nLSpace);
     short nFirstLineOffset = -600;
 
@@ -1100,7 +1100,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
 
             for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
             {
-                const short nLSpace = (i + 1) * 600;
+                const auto nLSpace = (i + 1) * 600;
                 aNumberFormat.SetAbsLSpace(nLSpace);
                 aNumberFormat.SetFirstLineOffset(-600);
                 aNumRule.SetLevel( i, aNumberFormat );
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 068aa6f8a637..0aa59655c577 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -785,7 +785,7 @@ void  DrawViewShell::ExecRuler(SfxRequest& rReq)
                     // n#707779 (previously, LRSpace left indent could
                     // become negative - EditEngine really does not
                     // like that.
-                    const short nAbsLSpace=aFormat.GetAbsLSpace();
+                    const auto nAbsLSpace=aFormat.GetAbsLSpace();
                     const long  nTxtLeft=rItem.GetTextLeft();
                     const long  nLeftIndent=std::max(0L,nTxtLeft - nAbsLSpace);
                     aLRSpaceItem.SetTextLeft(nLeftIndent);
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 05c6c7962c04..b0692592213a 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -529,7 +529,7 @@ public:
     // #i90078#
     /// Remove unused default parameter <nLevel> and <bRelative>.
     // Adjust method name and parameter name
-    void ChangeIndentOfAllListLevels( short nDiff );
+    void ChangeIndentOfAllListLevels( sal_Int32 nDiff );
     // Adjust method name
     void SetIndent(short nIndent, const SwPosition & rPos);
     bool IsFirstOfNumRuleAtCursorPos() const;
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index 7d9da21ad0f7..35d304dff012 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -254,7 +254,7 @@ public:
     SvxNumRule  MakeSvxNumRule() const;
 
     /// change indent of all list levels by given difference
-    void ChangeIndent( const short nDiff );
+    void ChangeIndent( const sal_Int32 nDiff );
     /// set indent of certain list level to given value
     void SetIndent( const short nNewIndent,
                     const sal_uInt16 nListLevel );
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 9f33fda5d738..72ba7126e3dd 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -879,7 +879,7 @@ void SwNumRule::SetInvalidRule(bool bFlag)
 }
 
 /// change indent of all list levels by given difference
-void SwNumRule::ChangeIndent( const short nDiff )
+void SwNumRule::ChangeIndent( const sal_Int32 nDiff )
 {
     for ( sal_uInt16 i = 0; i < MAXLEVEL; ++i )
     {
@@ -889,7 +889,7 @@ void SwNumRule::ChangeIndent( const short nDiff )
                                         aTmpNumFormat.GetPositionAndSpaceMode() );
         if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
         {
-            short nNewIndent = nDiff +
+            auto nNewIndent = nDiff +
                                aTmpNumFormat.GetAbsLSpace();
             if ( nNewIndent < 0 )
             {
@@ -951,7 +951,7 @@ void SwNumRule::SetIndentOfFirstListLevelAndChangeOthers( const short nNewIndent
 {
     SwNumFormat aTmpNumFormat( Get(0) );
 
-    short nDiff( 0 );
+    sal_Int32 nDiff( 0 );
     const SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode(
                                         aTmpNumFormat.GetPositionAndSpaceMode() );
     if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
@@ -962,8 +962,7 @@ void SwNumRule::SetIndentOfFirstListLevelAndChangeOthers( const short nNewIndent
     }
     else if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
     {
-        nDiff = static_cast<short>(nNewIndent
-                                   - aTmpNumFormat.GetIndentAt());
+        nDiff = nNewIndent - aTmpNumFormat.GetIndentAt();
     }
     if ( nDiff != 0  )
     {
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 80d7754ef848..26e2593c9ca2 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1435,7 +1435,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
                         }
                     }
 
-                    short nAbsPos = lBullIndent;
+                    sal_Int32 nAbsPos = lBullIndent;
                     SwTwips nSpaceSteps = nLvl
                                             ? nLeftTextPos / nLvl
                                             : lBullIndent;
@@ -1519,7 +1519,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
                 }
                 else
                 {
-                    sal_uInt16 nSpaceSteps = nLvl ? sal_uInt16(nLeftTextPos / nLvl) : 0;
+                    auto const nSpaceSteps = nLvl ? nLeftTextPos / nLvl : 0;
                     sal_uInt16 n;
                     for( n = 0; n <= nLvl; ++n )
                     {
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index efff4b427ef4..8f49775846c0 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -334,7 +334,7 @@ bool SwEditShell::IsFirstOfNumRuleAtCursorPos() const
 }
 
 // -> #i23725#, #i90078#
-void SwEditShell::ChangeIndentOfAllListLevels( const short nDiff )
+void SwEditShell::ChangeIndentOfAllListLevels( const sal_Int32 nDiff )
 {
     StartAllAction();
 
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index ca01c7e9de37..a608eaac3031 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1723,7 +1723,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
                     sal_Int32 nValue = 0;
                     pProp->Value >>= nValue;
                     // #i23727# nValue can be negative
-                    aFormat.SetAbsLSpace(static_cast<short>(convertMm100ToTwip(nValue)));
+                    aFormat.SetAbsLSpace(convertMm100ToTwip(nValue));
                 }
                 break;
                 case 7: //UNO_NAME_SYMBOL_TEXT_DISTANCE,
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index bddccc481084..db9e2fb562e7 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -2187,7 +2187,7 @@ void SwHTMLParser::GetMarginsFromContextWithNumBul( sal_uInt16& nLeft,
         sal_uInt8 nLevel = static_cast<sal_uInt8>( (rInfo.GetDepth() <= MAXLEVEL ? rInfo.GetDepth()
                                                             : MAXLEVEL) - 1 );
         const SwNumFormat& rNumFormat = rInfo.GetNumRule()->Get(nLevel);
-        nLeft = nLeft + rNumFormat.GetAbsLSpace();
+        nLeft = nLeft + rNumFormat.GetAbsLSpace(); //TODO: overflow
         nIndent = rNumFormat.GetFirstLineOffset();
     }
 }
diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx
index 262b3d4bf7a1..a910324b4aa6 100644
--- a/sw/source/filter/html/htmlnumreader.cxx
+++ b/sw/source/filter/html/htmlnumreader.cxx
@@ -105,7 +105,7 @@ void SwHTMLParser::NewNumBulList( HtmlTokenId nToken )
             nChrFormatPoolId = RES_POOLCHR_BUL_LEVEL;
         }
 
-        short nAbsLSpace = HTML_NUMBUL_MARGINLEFT;
+        sal_Int32 nAbsLSpace = HTML_NUMBUL_MARGINLEFT;
 
         short nFirstLineIndent  = HTML_NUMBUL_INDENT;
         if( nLevel > 0 )
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 745f7f157dcd..1be3d5557355 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2724,7 +2724,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
                                             SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
                     {
                         if (bParaRTL)
-                            aLR.SetTextFirstLineOfstValue(pFormat->GetAbsLSpace() - pFormat->GetFirstLineOffset());
+                            aLR.SetTextFirstLineOfstValue(pFormat->GetAbsLSpace() - pFormat->GetFirstLineOffset()); //TODO: overflow
                         else
                             aLR.SetTextFirstLineOfst(GetWordFirstLineOffset(*pFormat));
                     }
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index 011ae61990dd..120a3b97be68 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -514,7 +514,7 @@ void MSWordExportBase::AbstractNumberingDefinitions()
             // #i86652#
             if ( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
             {
-                nIndentAt = nListTabPos = rFormat.GetAbsLSpace();
+                nIndentAt = nListTabPos = rFormat.GetAbsLSpace(); //TODO: overflow
                 nFirstLineIndex = GetWordFirstLineOffset(rFormat);
             }
             else if ( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index d7854815bae9..cec21326bec3 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -891,7 +891,7 @@ public:
 
     // TODO move as much as possible here from WW8Export! ;-)
 
-    static void CorrectTabStopInSet( SfxItemSet& rSet, short nAbsLeft );
+    static void CorrectTabStopInSet( SfxItemSet& rSet, sal_Int32 nAbsLeft );
 
 private:
     MSWordExportBase( const MSWordExportBase& ) = delete;
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 774684ee91b6..9dbb588c24d4 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -643,7 +643,7 @@ void WW8Export::PrepareNewPageDesc( const SfxItemSet*pSet,
     }
 }
 
-void MSWordExportBase::CorrectTabStopInSet( SfxItemSet& rSet, short nAbsLeft )
+void MSWordExportBase::CorrectTabStopInSet( SfxItemSet& rSet, sal_Int32 nAbsLeft )
 {
     if (const SvxTabStopItem *pItem = rSet.GetItem<SvxTabStopItem>(RES_PARATR_TABSTOP))
     {
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index c6f7248de8d3..2db9fe80322d 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1200,7 +1200,7 @@ static long lcl_GetTrueMargin(const SvxLRSpaceItem &rLR, const SwNumFormat &rFor
     const long nFirstLineDiff = rLR.GetTextFirstLineOfst();
     rFirstLinePos = nBodyIndent + nFirstLineDiff;
 
-    const long nPseudoListBodyIndent = rFormat.GetAbsLSpace();
+    const auto nPseudoListBodyIndent = rFormat.GetAbsLSpace();
     const long nReverseListIndented = GetListFirstLineIndent(rFormat);
     long nExtraListIndent = nPseudoListBodyIndent + nReverseListIndented;
 
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 7802f07190f9..9d77bb574592 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1684,7 +1684,7 @@ void UseListIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
     // #i86652#
     if ( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
     {
-        const long nAbsLSpace = rFormat.GetAbsLSpace();
+        const auto nAbsLSpace = rFormat.GetAbsLSpace();
         const long nListFirstLineIndent = GetListFirstLineIndent(rFormat);
         SvxLRSpaceItem aLR(ItemGet<SvxLRSpaceItem>(*rStyle.m_pFormat, RES_LR_SPACE));
         aLR.SetTextLeft(nAbsLSpace);
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 89d748a826ef..1fe4198aee8a 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -637,7 +637,7 @@ IMPL_LINK(SwNumPositionTabPage, DistanceHdl, weld::MetricSpinButton&, rField, vo
                 }
                 else
                 {
-                    aNumFormat.SetAbsLSpace( static_cast<short>(nValue) - aNumFormat.GetFirstLineOffset());
+                    aNumFormat.SetAbsLSpace( nValue - aNumFormat.GetFirstLineOffset());
                 }
             }
             else if (&rField == m_xDistNumMF.get())
@@ -648,7 +648,7 @@ IMPL_LINK(SwNumPositionTabPage, DistanceHdl, weld::MetricSpinButton&, rField, vo
             {
                 // now AbsLSpace also has to be modified by FirstLineOffset
                 long nDiff = nValue + aNumFormat.GetFirstLineOffset();
-                long nAbsLSpace = aNumFormat.GetAbsLSpace();
+                auto const nAbsLSpace = aNumFormat.GetAbsLSpace();
                 aNumFormat.SetAbsLSpace( nAbsLSpace + nDiff );
                 aNumFormat.SetFirstLineOffset( -nValue );
             }


More information about the Libreoffice-commits mailing list