summaryrefslogtreecommitdiff
path: root/sc/source/core/data/dpoutput.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-10-24 14:35:26 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-10-24 14:42:20 -0400
commit18bff2c2e95218ff629e07369fd8bf2335544aac (patch)
treeb90ba583efefc654dda97ffaaaa2fd3e1391067c /sc/source/core/data/dpoutput.cxx
parentd781ae9ae1aef10927de6ace368b0cc7d48280ad (diff)
fdo#42169: Display caption strings without format detection.
We don't need to auto-detect the formats of caption values; they are already formatted by the time they arrive in to ScDPOutput.
Diffstat (limited to 'sc/source/core/data/dpoutput.cxx')
-rw-r--r--sc/source/core/data/dpoutput.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index e52fbed66432..cfd90933baaa 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -57,6 +57,8 @@
#include "unonames.hxx"
#include "sc.hrc"
#include "dpglobal.hxx"
+#include "stringutil.hxx"
+
#include <com/sun/star/beans/XPropertySet.hpp>
#include <vector>
@@ -795,7 +797,11 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
if ( nFlags & sheet::MemberResultFlags::HASMEMBER )
{
- pDoc->SetString( nCol, nRow, nTab, rData.Caption);
+ // Avoid unwanted automatic format detection.
+ ScSetStringParam aParam;
+ aParam.mbDetectNumberFormat = false;
+ aParam.mbSetTextCellFormat = true;
+ pDoc->SetString(nCol, nRow, nTab, rData.Caption, &aParam);
}
if ( nFlags & sheet::MemberResultFlags::SUBTOTAL )
@@ -827,7 +833,12 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
void ScDPOutput::FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rCaption,
bool bInTable, bool bPopup, bool bHasHiddenMember )
{
- pDoc->SetString( nCol, nRow, nTab, rCaption );
+ // Avoid unwanted automatic format detection.
+ ScSetStringParam aParam;
+ aParam.mbDetectNumberFormat = false;
+ aParam.mbSetTextCellFormat = true;
+ pDoc->SetString(nCol, nRow, nTab, rCaption, &aParam);
+
if (bInTable)
lcl_SetFrame( pDoc,nTab, nCol,nRow, nCol,nRow, 20 );