sc/source/core/data/validat.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit e848d91a1d060558e89029b6beecfa796105d962 Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Wed May 3 13:00:09 2023 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat May 13 13:55:55 2023 +0200 sc: use the current cell's numfmt to format... to format the values in the validation list when the items are numbers. This is better than applying no formatting since we lost track of the source formatting when values are passed through a matrix. Change-Id: I06432bd93ef8d01181dd16d2f5ee99eb0477c094 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151313 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Henry Castro <hcas...@collabora.com> (cherry picked from commit 2f6d1cefc184fda3ba292f1718b034202989d7b3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151521 Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 43ebb8faea58..01c864934821 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -764,6 +764,7 @@ bool ScValidationData::GetSelectionFromFormula( rMatch = -1; SvNumberFormatter* pFormatter = GetDocument()->GetFormatTable(); + sal_uInt32 nDestFormat = pDocument->GetNumberFormat(rPos.Col(), rPos.Row(), rPos.Tab()); SCSIZE nCol, nRow, nCols, nRows, n = 0; pValues->GetDimensions( nCols, nRows ); @@ -865,7 +866,7 @@ bool ScValidationData::GetSelectionFromFormula( } else { - pFormatter->GetInputLineString( nMatVal.fVal, 0, aValStr ); + pFormatter->GetInputLineString( nMatVal.fVal, nDestFormat, aValStr ); } }