sc/source/core/inc/interpre.hxx  |    4 ++--
 sc/source/core/tool/interpr2.cxx |   22 +++++++++++-----------
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 804d54e5a1a72a95d978cb76e7a53c08c97ffc8c
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Feb 5 11:49:08 2025 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Feb 15 14:13:14 2025 +0100

    ScDde doesn't need GetUInt32
    
    Use GetInt32 instead.
    
    Change-Id: I2e0868dfc548c6378e0dd0c5bb5e3921b0091334
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181698
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index ffd3b96f7193..8aa2883b4027 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2748,8 +2748,8 @@ void ScInterpreter::ScDde()
     sal_uInt8 nMode = SC_DDE_DEFAULT;
     if (nParamCount == 4)
     {
-        sal_uInt32 nTmp = GetUInt32();
-        if (nGlobalError != FormulaError::NONE || nTmp > SAL_MAX_UINT8)
+        sal_Int32 nTmp = GetInt32();
+        if (nGlobalError != FormulaError::NONE || nTmp < 0 || nTmp > 
SAL_MAX_UINT8)
         {
             PushIllegalArgument();
             return;
commit 572fee6ca74f86f094418ec747803ef045901eea
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Feb 5 11:49:06 2025 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Feb 15 14:13:03 2025 +0100

    Getting workdays doesn't need GetUInt32
    
    All other placed in Calc, that take dates, use GetFloor32; switch
    to that for consistency.
    
    Change-Id: If198ab3f6ef3a6a1866bfeed6bca14edcd815bf7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181697
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 6fbbcfbe935b..8173b6742720 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -838,9 +838,9 @@ public:
     void ScGetIsoWeekOfYear();
     void ScWeeknumOOo();
     void ScEasterSunday();
-    FormulaError GetWeekendAndHolidayMasks( const sal_uInt8 nParamCount, const 
sal_uInt32 nNullDate,
+    FormulaError GetWeekendAndHolidayMasks( const sal_uInt8 nParamCount, const 
sal_Int32 nNullDate,
             ::std::vector<double>& rSortArray, bool bWeekendMask[ 7 ] );
-    FormulaError GetWeekendAndHolidayMasks_MS( const sal_uInt8 nParamCount, 
const sal_uInt32 nNullDate,
+    FormulaError GetWeekendAndHolidayMasks_MS( const sal_uInt8 nParamCount, 
const sal_Int32 nNullDate,
             ::std::vector<double>& rSortArray, bool bWeekendMask[ 7 ], bool 
bWorkdayFunction );
     static inline sal_Int16 GetDayOfWeek( sal_Int32 n );
     void ScNetWorkdays( bool bOOXML_Version );
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 81013d3ed099..ffd3b96f7193 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -357,7 +357,7 @@ void ScInterpreter::ScEasterSunday()
 }
 
 FormulaError ScInterpreter::GetWeekendAndHolidayMasks(
-    const sal_uInt8 nParamCount, const sal_uInt32 nNullDate, vector< double >& 
rSortArray,
+    const sal_uInt8 nParamCount, const sal_Int32 nNullDate, vector< double >& 
rSortArray,
     bool bWeekendMask[ 7 ] )
 {
     if ( nParamCount == 4 )
@@ -397,7 +397,7 @@ FormulaError ScInterpreter::GetWeekendAndHolidayMasks(
 }
 
 FormulaError ScInterpreter::GetWeekendAndHolidayMasks_MS(
-    const sal_uInt8 nParamCount, const sal_uInt32 nNullDate, vector< double >& 
rSortArray,
+    const sal_uInt8 nParamCount, const sal_Int32 nNullDate, vector< double >& 
rSortArray,
     bool bWeekendMask[ 7 ], bool bWorkdayFunction )
 {
     FormulaError nErr = FormulaError::NONE;
@@ -522,7 +522,7 @@ void ScInterpreter::ScNetWorkdays( bool bOOXML_Version )
     vector<double> nSortArray;
     bool bWeekendMask[ 7 ];
     const Date& rNullDate = mrContext.NFGetNullDate();
-    sal_uInt32 nNullDate = Date::DateToDays( rNullDate.GetDay(), 
rNullDate.GetMonth(), rNullDate.GetYear() );
+    sal_Int32 nNullDate = Date::DateToDays( rNullDate.GetDay(), 
rNullDate.GetMonth(), rNullDate.GetYear() );
     FormulaError nErr;
     if ( bOOXML_Version )
     {
@@ -538,9 +538,9 @@ void ScInterpreter::ScNetWorkdays( bool bOOXML_Version )
         PushError( nErr );
     else
     {
-        sal_uInt32 nDate2 = GetUInt32();
-        sal_uInt32 nDate1 = GetUInt32();
-        if (nGlobalError != FormulaError::NONE || (nDate1 > SAL_MAX_UINT32 - 
nNullDate) || nDate2 > (SAL_MAX_UINT32 - nNullDate))
+        sal_Int32 nDate2 = GetFloor32();
+        sal_Int32 nDate1 = GetFloor32();
+        if (nGlobalError != FormulaError::NONE || (nDate1 > SAL_MAX_INT32 - 
nNullDate) || nDate2 > (SAL_MAX_INT32 - nNullDate))
         {
             PushIllegalArgument();
             return;
@@ -579,7 +579,7 @@ void ScInterpreter::ScWorkday_MS()
     vector<double> nSortArray;
     bool bWeekendMask[ 7 ];
     const Date& rNullDate = mrContext.NFGetNullDate();
-    sal_uInt32 nNullDate = Date::DateToDays( rNullDate.GetDay(), 
rNullDate.GetMonth(), rNullDate.GetYear() );
+    sal_Int32 nNullDate = Date::DateToDays( rNullDate.GetDay(), 
rNullDate.GetMonth(), rNullDate.GetYear() );
     FormulaError nErr = GetWeekendAndHolidayMasks_MS( nParamCount, nNullDate,
                         nSortArray, bWeekendMask, true );
     if ( nErr != FormulaError::NONE )
@@ -587,8 +587,8 @@ void ScInterpreter::ScWorkday_MS()
     else
     {
         sal_Int32 nDays = GetFloor32();
-        sal_uInt32 nDate = GetUInt32();
-        if (nGlobalError != FormulaError::NONE || (nDate > SAL_MAX_UINT32 - 
nNullDate))
+        sal_Int32 nDate = GetFloor32();
+        if (nGlobalError != FormulaError::NONE || (nDate > SAL_MAX_INT32 - 
nNullDate))
         {
             PushIllegalArgument();
             return;

Reply via email to