diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2023-05-03 13:00:09 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2023-05-09 17:41:47 +0200 |
commit | 4adf6852cc3fd0eddf53c2ab4f66efed0668b699 (patch) | |
tree | 56cded91a401d57dfef0dd67acdc29ab6a8e782b /sc | |
parent | 421d4fc533498d058a91f9686c47b35114e6a6c9 (diff) |
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 <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
(cherry picked from commit 2f6d1cefc184fda3ba292f1718b034202989d7b3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151386
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/validat.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 8fb0f9f7924a..009bc0eaebe7 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -856,6 +856,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 ); @@ -957,7 +958,7 @@ bool ScValidationData::GetSelectionFromFormula( } else { - pFormatter->GetInputLineString( nMatVal.fVal, 0, aValStr ); + pFormatter->GetInputLineString( nMatVal.fVal, nDestFormat, aValStr ); } } |