[Libreoffice-commits] core.git: 2 commits - i18npool/source include/formula sc/source

Tor Lillqvist tml at collabora.com
Mon Mar 27 15:03:15 UTC 2017


 i18npool/source/breakiterator/breakiterator_unicode.cxx |    2 -
 include/formula/token.hxx                               |   32 ++++++++++++++++
 sc/source/core/opencl/formulagroupcl.cxx                |   32 ----------------
 sc/source/core/tool/token.cxx                           |    2 -
 4 files changed, 34 insertions(+), 34 deletions(-)

New commits:
commit 4bb389319ec4510e16a519d229a452211112a04f
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Mar 27 15:33:53 2017 +0300

    loplugin:redundantinline
    
    Change-Id: I3b82d6c6d970545a64b97f84c2c6da8271551a4c

diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index 3f9dce9c81ba..2256755e85be 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -65,7 +65,7 @@ class OOoRuleBasedBreakIterator : public RuleBasedBreakIterator
     public:
 #if (U_ICU_VERSION_MAJOR_NUM < 58)
     // RuleBasedBreakIterator::setBreakType() is private as of ICU 58.
-    inline void publicSetBreakType(int32_t type)
+    void publicSetBreakType(int32_t type)
         {
             setBreakType(type);
         };
commit 88637db0efc1dc56e34627e71e26cc5aab5dc803
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Mar 27 15:08:19 2017 +0300

    Move StackVarEnumToString to <formula/token.hxx> and use in a SAL_INFO
    
    Once StackVarEnum has been changed to a scoped enum, we should
    probably add an operator<< for it, too.
    
    Is 'std::string FooToString(Foo e)' a good return type, signature, and
    naming pattern for functions to turn enums into strings? Would return
    type OUString be better? Is there some consistent existing convention?
    For use only in SAL_INFO and friends, probably just an operator<< is
    enough?
    
    Change-Id: I89abbcb37ba2ab925b0a9d7fc6294d8f9ee5aebd

diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index 7b6e1a77a6b8..8747517ac481 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -88,6 +88,38 @@ typedef sal_uInt8 StackVar;
 typedef StackVarEnum StackVar;
 #endif
 
+inline std::string StackVarEnumToString(StackVar const e)
+{
+    switch (e)
+    {
+        case svByte:              return "Byte";
+        case svDouble:            return "Double";
+        case svString:            return "String";
+        case svSingleRef:         return "SingleRef";
+        case svDoubleRef:         return "DoubleRef";
+        case svMatrix:            return "Matrix";
+        case svIndex:             return "Index";
+        case svJump:              return "Jump";
+        case svExternal:          return "External";
+        case svFAP:               return "FAP";
+        case svJumpMatrix:        return "JumpMatrix";
+        case svRefList:           return "RefList";
+        case svEmptyCell:         return "EmptyCell";
+        case svMatrixCell:        return "MatrixCell";
+        case svHybridCell:        return "HybridCell";
+        case svExternalSingleRef: return "ExternalSingleRef";
+        case svExternalDoubleRef: return "ExternalDoubleRef";
+        case svExternalName:      return "ExternalName";
+        case svSingleVectorRef:   return "SingleVectorRef";
+        case svDoubleVectorRef:   return "DoubleVectorRef";
+        case svError:             return "Error";
+        case svMissing:           return "Missing";
+        case svSep:               return "Sep";
+        case svUnknown:           return "Unknown";
+    }
+    return std::to_string(static_cast<int>(e));
+}
+
 class FORMULA_DLLPUBLIC FormulaToken : public IFormulaToken
 {
     OpCode                      eOp;
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index bf91fcd995c1..a1112e499dbc 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -97,38 +97,6 @@ namespace sc { namespace opencl {
 
 namespace {
 
-std::string StackVarEnumToString(StackVar const e)
-{
-    switch (e)
-    {
-        case svByte:              return "Byte";
-        case svDouble:            return "Double";
-        case svString:            return "String";
-        case svSingleRef:         return "SingleRef";
-        case svDoubleRef:         return "DoubleRef";
-        case svMatrix:            return "Matrix";
-        case svIndex:             return "Index";
-        case svJump:              return "Jump";
-        case svExternal:          return "External";
-        case svFAP:               return "FAP";
-        case svJumpMatrix:        return "JumpMatrix";
-        case svRefList:           return "RefList";
-        case svEmptyCell:         return "EmptyCell";
-        case svMatrixCell:        return "MatrixCell";
-        case svHybridCell:        return "HybridCell";
-        case svExternalSingleRef: return "ExternalSingleRef";
-        case svExternalDoubleRef: return "ExternalDoubleRef";
-        case svExternalName:      return "ExternalName";
-        case svSingleVectorRef:   return "SingleVectorRef";
-        case svDoubleVectorRef:   return "DoubleVectorRef";
-        case svError:             return "Error";
-        case svMissing:           return "Missing";
-        case svSep:               return "Sep";
-        case svUnknown:           return "Unknown";
-    }
-    return std::to_string(static_cast<int>(e));
-}
-
 std::string linenumberify(const std::string& s)
 {
     std::stringstream ss;
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 957bdcd3313f..36928d20a6a1 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1572,7 +1572,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
             case svSep:
             case svUnknown:
                 // We don't support vectorization on these.
-                SAL_INFO("sc.opencl", "opcode ocPush: variable type disables vectorisation for formula group");
+                SAL_INFO("sc.opencl", "opcode ocPush: variable type " << StackVarEnumToString(r.GetType()) << " disables vectorisation for formula group");
                 meVectorState = FormulaVectorDisabled;
             break;
             default:


More information about the Libreoffice-commits mailing list