[PATCH] fdo#45067: Differentiate numeric and non-numeric field member values.

Kohei Yoshida kohei.yoshida at suse.com
Tue Jan 24 13:32:10 PST 2012


---
 sc/source/core/data/dpoutput.cxx |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index 990e212..32179e3 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -795,10 +795,18 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
 
     if ( nFlags & sheet::MemberResultFlags::HASMEMBER )
     {
-        // Avoid unwanted automatic format detection.
+        bool bNumeric = (nFlags & sheet::MemberResultFlags::NUMERIC) != 0;
         ScSetStringParam aParam;
-        aParam.mbDetectNumberFormat = false;
-        aParam.mbSetTextCellFormat = true;
+        if (bNumeric)
+        {
+            aParam.mbDetectNumberFormat = true;
+            aParam.mbSetTextCellFormat = false;
+        }
+        else
+        {
+            aParam.mbDetectNumberFormat = false;
+            aParam.mbSetTextCellFormat = true;
+        }
         pDoc->SetString(nCol, nRow, nTab, rData.Caption, &aParam);
     }
 
-- 
1.7.3.4


--=-dEsib6ynLPLMdBaUY7UX--



More information about the LibreOffice mailing list