formula/source/core/api/FormulaCompiler.cxx |    4 ++--
 sc/source/core/tool/calcconfig.cxx          |    2 +-
 sc/source/core/tool/compiler.cxx            |    8 ++++----
 sc/source/filter/excel/xeformula.cxx        |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 1ed1b639fc80909cb006d74ac25516bcdd409041
Author: Jochen Nitschke <j.nitschke+loger...@ok.de>
Date:   Sat Apr 1 00:27:17 2017 +0200

    remove redundant OpCode casts
    
    Change-Id: I75389b213ebf74aa35f935134e4f8122d28d2045
    Reviewed-on: https://gerrit.libreoffice.org/35996
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Jochen Nitschke <j.nitschke+loger...@ok.de>

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 8f86ce54af25..b70af7dc3152 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -964,7 +964,7 @@ OpCode FormulaCompiler::GetEnglishOpCode( const OUString& 
rName ) const
 
     formula::OpCodeHashMap::const_iterator iLook( xMap->getHashMap()->find( 
rName ) );
     bool bFound = (iLook != xMap->getHashMap()->end());
-    return bFound ? (*iLook).second : OpCode(ocNone);
+    return bFound ? (*iLook).second : ocNone;
 }
 
 bool FormulaCompiler::IsOpCodeVolatile( OpCode eOp )
@@ -2306,7 +2306,7 @@ void FormulaCompiler::AppendDouble( OUStringBuffer& 
rBuffer, double fVal ) const
 
 void FormulaCompiler::AppendBoolean( OUStringBuffer& rBuffer, bool bVal ) const
 {
-    rBuffer.append( mxSymbols->getSymbol( static_cast<OpCode>(bVal ? ocTrue : 
ocFalse)) );
+    rBuffer.append( mxSymbols->getSymbol( bVal ? ocTrue : ocFalse ) );
 }
 
 void FormulaCompiler::AppendString( OUStringBuffer& rBuffer, const OUString & 
rStr )
diff --git a/sc/source/core/tool/calcconfig.cxx 
b/sc/source/core/tool/calcconfig.cxx
index 2a0b1f305276..97863bbacd23 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -192,7 +192,7 @@ ScCalcConfig::OpCodeSet ScStringToOpCodeSet(const OUString& 
rOpCodes)
             {
                 auto opcode(pHashMap->find(element));
                 if (opcode != pHashMap->end())
-                    result->insert(static_cast<OpCode>(opcode->second));
+                    result->insert(opcode->second);
                 else
                     SAL_WARN("sc.opencl", "Unrecognized OpCode " << element << 
" in OpCode set string");
             }
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index e5cef31ca269..3fc28488dc5b 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4708,8 +4708,8 @@ bool ScCompiler::HandleRange()
             // in short: if it isn't a self-contained expression.
             FormulaToken* p1 = pArr->PeekPrevNoSpaces();
             FormulaToken* p2 = pArr->PeekNextNoSpaces();
-            OpCode eOp1 = (p1 ? p1->GetOpCode() : static_cast<OpCode>( ocSep ) 
);
-            OpCode eOp2 = (p2 ? p2->GetOpCode() : static_cast<OpCode>( ocSep ) 
);
+            OpCode eOp1 = (p1 ? p1->GetOpCode() : ocSep);
+            OpCode eOp2 = (p2 ? p2->GetOpCode() : ocSep);
             bool bBorder1 = (eOp1 == ocSep || eOp1 == ocOpen);
             bool bBorder2 = (eOp2 == ocSep || eOp2 == ocClose);
             bool bAddPair = !(bBorder1 && bBorder2);
@@ -5353,8 +5353,8 @@ bool ScCompiler::HandleColRowName()
             FormulaToken* p1 = pArr->PeekPrevNoSpaces();
             FormulaToken* p2 = pArr->PeekNextNoSpaces();
             // begin/end of a formula => single
-            OpCode eOp1 = p1 ? p1->GetOpCode() : static_cast<OpCode>( ocAdd );
-            OpCode eOp2 = p2 ? p2->GetOpCode() : static_cast<OpCode>( ocAdd );
+            OpCode eOp1 = p1 ? p1->GetOpCode() : ocAdd;
+            OpCode eOp2 = p2 ? p2->GetOpCode() : ocAdd;
             if ( eOp1 != ocColRowName && eOp1 != ocIntersect
                 && eOp2 != ocColRowName && eOp2 != ocIntersect )
             {
diff --git a/sc/source/filter/excel/xeformula.cxx 
b/sc/source/filter/excel/xeformula.cxx
index 79dce1e5bdc6..97e1907df15b 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -60,7 +60,7 @@ struct XclExpScToken
     explicit     XclExpScToken() : mpScToken( nullptr ), mnSpaces( 0 ) {}
     bool         Is() const { return mpScToken != nullptr; }
     StackVar     GetType() const { return mpScToken ? mpScToken->GetType() : 
static_cast< StackVar >( svUnknown ); }
-    OpCode       GetOpCode() const { return mpScToken ? mpScToken->GetOpCode() 
: static_cast< OpCode >( ocNone ); }
+    OpCode       GetOpCode() const { return mpScToken ? mpScToken->GetOpCode() 
: ocNone; }
 };
 
 /** Effective token class conversion types. */
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to