Hi there,

I've found a better way to fix it.  Attached is tailored specifically
for the 3-5 branch.

I'll port this fix to master separately since master has my earlier
commit that would make this patch not apply without adjusting.

Again, this fixes

https://bugs.freedesktop.org/show_bug.cgi?id=45067

Since we've already branched for 3.5.0, I'll need three sign-off's to
get this piece into 3.5.0 final.  Reviews and sign-off will be
appreciated.

Kohei

P.S. This NUMERIC flag was used exactly for this purpose prior to the
rework of the data pilot data cache code done by IBM/Sun back in the old
days (around the OOo 3.3 release period).  During the rework this check
was unfortunately removed, which probably introduced the original issue
I "fixed" for fdo#42169 (though apparently my fix was not entirely
correct).

-- 
Kohei Yoshida, LibreOffice hacker, Calc
>From 6bdd9f6d5c4bfd9066384539454fad87eeebafc8 Mon Sep 17 00:00:00 2001
From: Kohei Yoshida <kohei.yosh...@suse.com>
Date: Tue, 24 Jan 2012 16:32:10 -0500
Subject: [PATCH] fdo#45067: Differentiate numeric and non-numeric field member values.

---
 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

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to