sc/source/core/data/validat.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4adf6852cc3fd0eddf53c2ab4f66efed0668b699
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Wed May 3 13:00:09 2023 +0530
Commit:     Dennis Francis <dennis.fran...@collabora.com>
CommitDate: Tue May 9 17:41:47 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/+/151386
    Tested-by: Jenkins
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>

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 );
                     }
                 }
 

Reply via email to