summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-03-10 17:25:34 -0400
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-03-11 19:09:41 -0500
commit69ecdad805281b2cb6ec2437da18daa19576deae (patch)
tree9d46045b96ccc147055392d9616443b83f811cd2 /sc
parent13c4e40ad0b199199e28e01103e0fc67c4a0bf14 (diff)
fdo#74747: Correctly inspect formula result value for xlsx export.
Change-Id: I757a8eb371b432970885e2fbd6aea9dd965ab5c0 (cherry picked from commit c1dc7576c18cc534e1934459f5fb210091a5b484) Reviewed-on: https://gerrit.libreoffice.org/8527 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xestream.cxx40
1 files changed, 11 insertions, 29 deletions
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 805629ff3442..3e9935d604fd 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -679,45 +679,27 @@ static const char* lcl_GetErrorString( sal_uInt16 nScErrCode )
void XclXmlUtils::GetFormulaTypeAndValue( ScFormulaCell& rCell, const char*& rsType, OUString& rsValue )
{
- sal_uInt16 nScErrCode = rCell.GetErrCode();
- if( nScErrCode )
- {
- rsType = "e";
- rsValue = ToOUString( lcl_GetErrorString( nScErrCode ) );
+ sc::FormulaResultValue aResValue = rCell.GetResult();
- return;
- }
-
- switch( rCell.GetFormatType() )
+ switch (aResValue.meType)
{
- case NUMBERFORMAT_NUMBER:
- {
- // either value or error code
+ case sc::FormulaResultValue::Error:
+ rsType = "e";
+ rsValue = ToOUString(lcl_GetErrorString(aResValue.mnError));
+ break;
+ case sc::FormulaResultValue::Value:
rsType = "n";
- rsValue = OUString::number( rCell.GetValue() );
- }
+ rsValue = OUString::number(aResValue.mfValue);
break;
-
- case NUMBERFORMAT_TEXT:
- {
+ case sc::FormulaResultValue::String:
rsType = "str";
rsValue = rCell.GetString().getString();
- }
- break;
-
- case NUMBERFORMAT_LOGICAL:
- {
- rsType = "b";
- rsValue = ToOUString( rCell.GetValue() == 0.0 ? "0" : "1" );
- }
break;
-
+ case sc::FormulaResultValue::Invalid:
default:
- {
+ // TODO : double-check this to see if this is correct.
rsType = "inlineStr";
rsValue = rCell.GetString().getString();
- }
- break;
}
}