[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - svl/source
svl/source/numbers/zforfind.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 738eed58c12e74b1dd0d1d8f8d741448bde17c2c Author: Andreas Heinisch AuthorDate: Tue Mar 7 16:02:22 2023 +0100 Commit: Caolán McNamara CommitDate: Mon Apr 3 21:03:46 2023 +0200 tdf#117037 - Support Unicode minus (0x2212) in the number scanner Change-Id: I5b2cd4f3d6ac23e10dc0745819c7955d0a8ff170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148432 Tested-by: Jenkins Reviewed-by: Eike Rathke (cherry picked from commit 34510e6e57e58fb27071564f546bbd420404e66d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148963 Reviewed-by: Caolán McNamara diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 029b2b556d0f..792766553bf2 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -906,6 +906,7 @@ inline bool ImpSvNumberInputScan::GetTime100SecSep( std::u16string_view rString, * Read a sign including brackets * '+' => 1 * '-' => -1 + * u'−' => -1 * '(' => -1, bNegCheck = 1 * else => 0 */ @@ -921,6 +922,8 @@ int ImpSvNumberInputScan::GetSign( std::u16string_view rString, sal_Int32& nPos bNegCheck = true; [[fallthrough]]; case '-': +// tdf#117037 - unicode minus (0x2212) +case u'−': nPos++; return -1; default:
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - svl/source xmloff/source
svl/source/numbers/zforlist.cxx |5 - xmloff/source/style/xmlnumfe.cxx |3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) New commits: commit a63e69bc69b14f9669cbf7bfd1084f54665c064e Author: Caolán McNamara AuthorDate: Fri Dec 16 11:29:56 2022 + Commit: Caolán McNamara CommitDate: Sun Dec 18 16:37:24 2022 + crashtesting: assert seen with forum-mso-en4-747641.xlsx with LCID F6E0B see on export to ods input .xlsx contains a LCID of F6E0B Change-Id: I543164dba4cc8b1c86508a3e3e39b43900c06484 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144414 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index c43e124bbadd..cee75fc9265e 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -3991,7 +3991,10 @@ const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( bool & bFoundBank, } else { -eExtLang = LanguageType((nExtLang < 0) ? -nExtLang : nExtLang); +if (nExtLang < 0) +nExtLang = -nExtLang; +SAL_WARN_IF(nExtLang > 0x, "svl.numbers", "Out of range Lang Id: " << nExtLang << " from input string: " << OUString(rExtension)); +eExtLang = LanguageType(nExtLang & 0x); } } else diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index a2938b1d998d..01367fe12e55 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -362,7 +362,8 @@ void SvXMLNumFmtExport::WriteCurrencyElement_Impl( const OUString& rString, sal_Int32 nLang = o3tl::toInt32(rExt, 16); if ( nLang < 0 ) nLang = -nLang; -AddLanguageAttr_Impl( LanguageType(nLang) ); // adds to pAttrList +SAL_WARN_IF(nLang > 0x, "xmloff.style", "Out of range Lang Id: " << nLang << " from input string: " << OUString(rExt)); +AddLanguageAttr_Impl( LanguageType(nLang & 0x) ); // adds to pAttrList } SvXMLElementExport aElem( rExport,
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - svl/source
svl/source/numbers/zforlist.cxx | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) New commits: commit 1bde7f216234a356072cca207c99300580931654 Author: Eike Rathke AuthorDate: Wed Dec 14 01:08:25 2022 +0100 Commit: Eike Rathke CommitDate: Wed Dec 14 11:28:55 2022 + It's unnecessary to obtain what's not being used Change-Id: I3b5a2a8a2b095e77f71629910628ca7fe54aac25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144113 Reviewed-by: Eike Rathke Tested-by: Jenkins (cherry picked from commit 0517ef1669dba0e055b8ef3cf09a4b40378e476f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144115 diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index eb360c5b0ad6..c43e124bbadd 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1718,12 +1718,15 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber, bPrecChanged = true; } -sal_uInt32 nKey = GetEditFormat( fOutNumber, nRealKey, eType, pFormat, - bForceSystemLocale ? LANGUAGE_SYSTEM : LANGUAGE_DONTKNOW); // if bFiltering true keep the nRealKey format -if ( nKey != nRealKey && !bFiltering ) +if (!bFiltering) { -pFormat = GetFormatEntry( nKey ); +sal_uInt32 nKey = GetEditFormat( fOutNumber, nRealKey, eType, pFormat, + bForceSystemLocale ? LANGUAGE_SYSTEM : LANGUAGE_DONTKNOW); +if (nKey != nRealKey) +{ +pFormat = GetFormatEntry( nKey ); +} } assert(pFormat); if (pFormat)
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - svl/source
svl/source/numbers/zforlist.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 7f5215e1514bcca114aaf0a2acfcc85dc676b67b Author: Eike Rathke AuthorDate: Tue Dec 13 21:46:23 2022 +0100 Commit: Eike Rathke CommitDate: Wed Dec 14 00:05:36 2022 + crashtesting: (assert) fix treatment of "#FMT" input line value For "#FMT" test the original format type for not being NUMBER, the current format type may be different from finding an edit format. This constellation did not matter until commit 4fd1333ba4bb4f2311e9098291154772bd310429 CommitDate: Thu Mar 25 15:00:31 2021 +0100 tdf#140968 tdf#140978 XLSX import: fix lost rounded filters introduced the bFiltering parameter in which case the edit format is not used (and bFiltering is also set when collecting the filter entries for .xls export). In fact the logic should be changed such that obtaining the edit format isn't even executed in that case. For now just fix the "#FMT" case to be backported. Also, the bool return of SvNumberformat::GetOutputString(double,OUString&,Color**) does not indicate success or failure, but whether the "star" asterisk spreading was inserted or not. Contrary to SvNumberformat::GetOutputString(double,sal_uInt16,OUString&) ... cough. Change-Id: Ic8cbbd283a80c654a9ff22ea36897c9b72b8837d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144110 Reviewed-by: Eike Rathke Tested-by: Jenkins (cherry picked from commit d5986b163276008d2a15a10f7de529d924b60d2f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144073 diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index cfbce503941a..eb360c5b0ad6 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1700,6 +1700,7 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber, * numbers so wouldn't be a safe bet. */ eType = pFormat->GetNumForInfoScannedType(0); } +const SvNumFormatType eTypeOrig = eType; sal_uInt16 nOldPrec = pFormatScanner->GetStandardPrec(); bool bPrecChanged = false; @@ -1732,13 +1733,13 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber, ChangeStandardPrec(INPUTSTRING_PRECISION); bPrecChanged = true; } -const bool bOk = pFormat->GetOutputString(fOutNumber, sOutString, &pColor); +pFormat->GetOutputString(fOutNumber, sOutString, &pColor); // The #FMT error string must not be used for input as it would lead to // data loss. This can happen for at least date(+time). Fall back to a // last resort of plain number in the locale the formatter was // constructed with. -if (!bOk && eType != SvNumFormatType::NUMBER && sOutString == ImpSvNumberformatScan::sErrStr) +if (eTypeOrig != SvNumFormatType::NUMBER && sOutString == ImpSvNumberformatScan::sErrStr) { pFormat = GetFormatEntry(ZF_STANDARD); assert(pFormat);