summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-01-24 16:32:10 -0500
committerPetr Mladek <pmladek@suse.cz>2012-01-25 17:26:45 +0100
commit6cc0bf1394ef9d6941d38a55a6155688a6f9bd43 (patch)
tree63a66f72f3ba85c5ca567a47cce8d226847154f6
parent04caf572d6847ff1efce2942b1ba5058797aef9c (diff)
fdo#45067: Differentiate numeric and non-numeric field member values.
Signed-off-by: Petr Mladek <pmladek@suse.cz>
-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);
}