[Libreoffice-commits] core.git: sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Apr 12 22:37:09 UTC 2016


 sc/source/filter/excel/xecontent.cxx |   59 ++++++++++++++++++++++++-----------
 1 file changed, 42 insertions(+), 17 deletions(-)

New commits:
commit 453adce56ff8d8a9aedc3a175a2eb0afefdb17eb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 12 16:57:50 2016 +0200

    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 at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 914c657..b05bcad 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;


More information about the Libreoffice-commits mailing list