summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-05-07 02:10:12 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-06-02 03:25:48 +0200
commitd6b10909221e15c3c33fb354e42a77b03657c51b (patch)
tree548e3fb424bdd8b31c2d0f67666dd45ebc5a8b84
parent64223bda068cc6d82d3c5e359d465014568398bb (diff)
bail out for error cells early
Change-Id: I36581f3b735008dbba6eea5808da654eb8b279e3
-rw-r--r--sc/source/filter/excel/xestream.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index eaeb357822f6..de764b209c44 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -674,22 +674,22 @@ 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 ) );
+
+ return;
+ }
+
switch( rCell.GetFormatType() )
{
case NUMBERFORMAT_NUMBER:
{
// either value or error code
- sal_uInt16 nScErrCode = rCell.GetErrCode();
- if( nScErrCode )
- {
- rsType = "e";
- rsValue = ToOUString( lcl_GetErrorString( nScErrCode ) );
- }
- else
- {
- rsType = "n";
- rsValue = OUString::valueOf( rCell.GetValue() );
- }
+ rsType = "n";
+ rsValue = OUString::valueOf( rCell.GetValue() );
}
break;