[Libreoffice-commits] core.git: 2 commits - sc/source

Stephan Bergmann sbergman at redhat.com
Mon Jan 29 18:44:33 UTC 2018


 sc/source/core/tool/addincol.cxx |    2 +-
 sc/source/core/tool/appoptio.cxx |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit f104fb0b24d1a364a7a711b31b99770e4cd9183d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jan 29 11:36:42 2018 +0100

    Use sal_Int32 for css::uno::Sequence length
    
    Change-Id: I158ed73fcc520c6363baf82461e5220fc12a996b
    Reviewed-on: https://gerrit.libreoffice.org/48837
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index 9da510633b2b..8023c11db3b8 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -130,12 +130,12 @@ static void lcl_SetLastFunctions( ScAppOptions& rOpt, const Any& rValue )
     Sequence<sal_Int32> aSeq;
     if ( rValue >>= aSeq )
     {
-        long nCount = aSeq.getLength();
+        sal_Int32 nCount = aSeq.getLength();
         if ( nCount < USHRT_MAX )
         {
             const sal_Int32* pArray = aSeq.getConstArray();
             std::unique_ptr<sal_uInt16[]> pUShorts(new sal_uInt16[nCount]);
-            for (long i=0; i<nCount; i++)
+            for (sal_Int32 i=0; i<nCount; i++)
                 pUShorts[i] = static_cast<sal_uInt16>(pArray[i]);
 
             rOpt.SetLRUFuncList( pUShorts.get(), sal::static_int_cast<sal_uInt16>(nCount) );
commit 7685ff8eeac55e3ec86421e9a3bc70ea28d337a3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jan 29 11:34:25 2018 +0100

    USHRT_MAX -> SAL_MAX_UINT16
    
    nArgCount apparently must fit into sal_uInt16 for the cast further down when
    assigning it to sal_uInt16 ScFuncDesc::nArgCount
    
    Change-Id: Ie82f864d519589553505015dc577b1e3372293b2
    Reviewed-on: https://gerrit.libreoffice.org/48836
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index 5e33c7323dd8..e2fd421f919c 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -1224,7 +1224,7 @@ bool ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& r
     bool bIncomplete = !rFuncData.GetFunction().is();       //TODO: extra flag?
 
     long nArgCount = rFuncData.GetArgumentCount();
-    if ( nArgCount > USHRT_MAX )
+    if ( nArgCount > SAL_MAX_UINT16 )
         return false;
 
     if ( bIncomplete )


More information about the Libreoffice-commits mailing list