[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Tue Mar 11 17:10:01 PDT 2014
sc/source/filter/excel/xestream.cxx | 40 +++++++++---------------------------
1 file changed, 11 insertions(+), 29 deletions(-)
New commits:
commit 69ecdad805281b2cb6ec2437da18daa19576deae
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Mon Mar 10 17:25:34 2014 -0400
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 at googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 805629f..3e9935d 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;
}
}
More information about the Libreoffice-commits
mailing list