[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

Petr Mladek pmladek at kemper.freedesktop.org
Wed Jan 25 08:29:03 PST 2012


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

New commits:
commit 6cc0bf1394ef9d6941d38a55a6155688a6f9bd43
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Tue Jan 24 16:32:10 2012 -0500

    fdo#45067: Differentiate numeric and non-numeric field member values.
    
    Signed-off-by: Petr Mladek <pmladek at suse.cz>

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


More information about the Libreoffice-commits mailing list