helpcontent2 | 2 +- svl/source/numbers/zforfind.cxx | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-)
New commits: commit 988db36e0992829b01a1341e92d6d2df715a7be5 Author: Eike Rathke <er...@redhat.com> AuthorDate: Fri Jan 12 17:03:35 2024 +0100 Commit: Eike Rathke <er...@redhat.com> CommitDate: Fri Jan 12 18:10:36 2024 +0100 Resolves: tdf#159148 Accept int32 hours:minutes:seconds input ... and detect overflow to result in text instead of 00:00 input loss. Change-Id: Ib2b9f16ab6c3c2963c5a2058c27366219f090096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161977 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index d29a6a025cd8..c1898104a905 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -983,9 +983,9 @@ bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber, ) const { bool bRet = true; - sal_uInt16 nHour; - sal_uInt16 nMinute = 0; - sal_uInt16 nSecond = 0; + sal_Int32 nHour; + sal_Int32 nMinute = 0; + sal_Int32 nSecond = 0; double fSecond100 = 0.0; sal_uInt16 nStartIndex = nIndex; @@ -1000,7 +1000,10 @@ bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber, } else if (nIndex - nStartIndex < nCnt) { - nHour = static_cast<sal_uInt16>(sStrArray[nNums[nIndex++]].toInt32()); + const OUString& rValStr = sStrArray[nNums[nIndex++]]; + nHour = rValStr.toInt32(); + if (nHour == 0 && rValStr != "0" && rValStr != "00") + bRet = false; // overflow -> Text } else { @@ -1031,7 +1034,10 @@ bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber, } else if (nIndex - nStartIndex < nCnt) { - nMinute = static_cast<sal_uInt16>(sStrArray[nNums[nIndex++]].toInt32()); + const OUString& rValStr = sStrArray[nNums[nIndex++]]; + nMinute = rValStr.toInt32(); + if (nMinute == 0 && rValStr != "0" && rValStr != "00") + bRet = false; // overflow -> Text if (!(eInputOptions & SvNumInputOptions::LAX_TIME) && !bAllowDuration && nIndex > 1 && nMinute > 59) bRet = false; // 1:60 or 1:123 is invalid, 123:1 or 0:123 is valid @@ -1040,7 +1046,10 @@ bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber, } if (nIndex - nStartIndex < nCnt) { - nSecond = static_cast<sal_uInt16>(sStrArray[nNums[nIndex++]].toInt32()); + const OUString& rValStr = sStrArray[nNums[nIndex++]]; + nSecond = rValStr.toInt32(); + if (nSecond == 0 && rValStr != "0" && rValStr != "00") + bRet = false; // overflow -> Text if (!(eInputOptions & SvNumInputOptions::LAX_TIME) && !bAllowDuration && nIndex > 1 && nSecond > 59 && !(nHour == 23 && nMinute == 59 && nSecond == 60)) bRet = false; // 1:60 or 1:123 or 1:1:123 is invalid, 123:1 or 123:1:1 or 0:0:123 is valid, or leap second commit 23987653e8f0b6f15f546496b4895cefc0d89a94 Author: Dione Maddern <dionemadd...@gmail.com> AuthorDate: Fri Jan 12 18:10:21 2024 +0100 Commit: Gerrit Code Review <ger...@gerrit.libreoffice.org> CommitDate: Fri Jan 12 18:10:21 2024 +0100 Update git submodules * Update helpcontent2 from branch 'master' to 2039fbabf053a19c9eaeee3db95dc8d710dfeb69 - tdf#155877 Update help page with "how to get" information Change-Id: I1348ad34fc3e6180df2e0396f176dc6badbc529f Reviewed-on: https://gerrit.libreoffice.org/c/help/+/161677 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org> diff --git a/helpcontent2 b/helpcontent2 index 04877b3bb878..2039fbabf053 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 04877b3bb878e30f8df562a35bc97163ee6be9ff +Subproject commit 2039fbabf053a19c9eaeee3db95dc8d710dfeb69