diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-04-12 16:57:50 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-04-12 22:36:49 +0000 |
commit | 453adce56ff8d8a9aedc3a175a2eb0afefdb17eb (patch) | |
tree | 957be5b64216747efa5172103068a64ced6ce8a8 | |
parent | b581b8e507107c7a7dfaccc498878d714631ad3a (diff) |
move xls export code from shared xls + xlsx part of code
Change-Id: I016b8981c4399959e76fd5089ab8014b25a31bbe
Reviewed-on: https://gerrit.libreoffice.org/24030
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 914c65783b12..b05bcad30693 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -602,6 +602,7 @@ private: bool mbStrikeUsed; /// true = Font strikeout used. bool mbBorderUsed; /// true = Border attribute used. bool mbPattUsed; /// true = Pattern attribute used. + bool mbFormula2; }; XclExpCFImpl::XclExpCFImpl( const XclExpRoot& rRoot, const ScCondFormatEntry& rFormatEntry, sal_Int32 nPriority ) : @@ -619,7 +620,8 @@ XclExpCFImpl::XclExpCFImpl( const XclExpRoot& rRoot, const ScCondFormatEntry& rF mbItalicUsed( false ), mbStrikeUsed( false ), mbBorderUsed( false ), - mbPattUsed( false ) + mbPattUsed( false ), + mbFormula2(false) { /* Get formatting attributes here, and not in WriteBody(). This is needed to correctly insert all colors into the palette. */ @@ -657,22 +659,48 @@ XclExpCFImpl::XclExpCFImpl( const XclExpRoot& rRoot, const ScCondFormatEntry& rF // *** mode and comparison operator *** - bool bFmla2 = false; switch( rFormatEntry.GetOperation() ) { - case SC_COND_NONE: mnType = EXC_CF_TYPE_NONE; break; - case SC_COND_BETWEEN: mnOperator = EXC_CF_CMP_BETWEEN; bFmla2 = true; break; - case SC_COND_NOTBETWEEN: mnOperator = EXC_CF_CMP_NOT_BETWEEN; bFmla2 = true; break; - case SC_COND_EQUAL: mnOperator = EXC_CF_CMP_EQUAL; break; - case SC_COND_NOTEQUAL: mnOperator = EXC_CF_CMP_NOT_EQUAL; break; - case SC_COND_GREATER: mnOperator = EXC_CF_CMP_GREATER; break; - case SC_COND_LESS: mnOperator = EXC_CF_CMP_LESS; break; - case SC_COND_EQGREATER: mnOperator = EXC_CF_CMP_GREATER_EQUAL; break; - case SC_COND_EQLESS: mnOperator = EXC_CF_CMP_LESS_EQUAL; break; - case SC_COND_DIRECT: mnType = EXC_CF_TYPE_FMLA; break; - default: mnType = EXC_CF_TYPE_NONE; + case SC_COND_NONE: + mnType = EXC_CF_TYPE_NONE; + break; + case SC_COND_BETWEEN: + mnOperator = EXC_CF_CMP_BETWEEN; + mbFormula2 = true; + break; + case SC_COND_NOTBETWEEN: + mnOperator = EXC_CF_CMP_NOT_BETWEEN; + mbFormula2 = true; + break; + case SC_COND_EQUAL: + mnOperator = EXC_CF_CMP_EQUAL; + break; + case SC_COND_NOTEQUAL: + mnOperator = EXC_CF_CMP_NOT_EQUAL; + break; + case SC_COND_GREATER: + mnOperator = EXC_CF_CMP_GREATER; + break; + case SC_COND_LESS: + mnOperator = EXC_CF_CMP_LESS; + break; + case SC_COND_EQGREATER: + mnOperator = EXC_CF_CMP_GREATER_EQUAL; + break; + case SC_COND_EQLESS: + mnOperator = EXC_CF_CMP_LESS_EQUAL; + break; + case SC_COND_DIRECT: + mnType = EXC_CF_TYPE_FMLA; + break; + default: + mnType = EXC_CF_TYPE_NONE; OSL_FAIL( "XclExpCF::WriteBody - unknown condition type" ); } +} + +void XclExpCFImpl::WriteBody( XclExpStream& rStrm ) +{ // *** formulas *** @@ -681,15 +709,12 @@ XclExpCFImpl::XclExpCFImpl( const XclExpRoot& rRoot, const ScCondFormatEntry& rF std::unique_ptr< ScTokenArray > xScTokArr( mrFormatEntry.CreateTokenArry( 0 ) ); mxTokArr1 = rFmlaComp.CreateFormula( EXC_FMLATYPE_CONDFMT, *xScTokArr ); - if( bFmla2 ) + if (mbFormula2) { xScTokArr.reset( mrFormatEntry.CreateTokenArry( 1 ) ); mxTokArr2 = rFmlaComp.CreateFormula( EXC_FMLATYPE_CONDFMT, *xScTokArr ); } -} -void XclExpCFImpl::WriteBody( XclExpStream& rStrm ) -{ // *** mode and comparison operator *** rStrm << mnType << mnOperator; |