summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2013-09-11 14:54:23 +0000
committerOliver-Rainer Wittmann <orw@apache.org>2013-09-11 14:54:23 +0000
commit2a3ef82d52df74abf39e17f5e5f9f12f9a985cb3 (patch)
treee36e9fb0edfb2dfe8710c1a9106444287408acdf /sc/source
parent1a078f3584e8a288c0ec33f176638406423ade63 (diff)
122927: adjusting change made for 121126 - allow formatting of boolean formula result as number,
but force it, if formatting code contains string/text section Review by: Clarence Guo <clarence dot guo dot bj at gmail dot com>
Notes
Notes: reject: see 51bac3e464cdd4fb0afb9b7d1c2a2d7f85ec92ed
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/tool/cellform.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 010643c6e474..f8bef323a788 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -28,6 +28,7 @@
#include <sfx2/objsh.hxx>
#include <svl/smplhint.hxx>
#include <svl/zforlist.hxx>
+#include <svl/zformat.hxx>
#include "cellform.hxx"
#include "cell.hxx"
@@ -129,7 +130,9 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rStr
rString.Erase();
else if ( pFCell->IsValue() )
{
- if(pFCell->GetFormatType() == NUMBERFORMAT_LOGICAL)
+ const SvNumberformat* pNumFmt = rFormatter.GetEntry( nFormat );
+ const bool bHasTextFormatCode = pNumFmt != NULL && pNumFmt->HasTextFormatCode();
+ if( pFCell->GetFormatType() == NUMBERFORMAT_LOGICAL && bHasTextFormatCode )
{
String aCellString;
double fValue = pFCell->GetValue();