summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-01-24 16:32:10 -0500
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-01-25 22:14:19 +0100
commitbe8e049d01f05773ac595b5ee32b262540381a44 (patch)
treee5f06d11d962af8e6abd9568bce821ae9450017e
parentd4260355159afda5d91e9f9072e239ffe4ca7a2f (diff)
fdo#45067: Differentiate numeric and non-numeric field member values.
Signed-off-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/source/core/data/dpoutput.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index 990e2126d7ed..32179e3807aa 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);
}