[Libreoffice-commits] core.git: solenv/clang-format starmath/inc

dante (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 22 10:48:55 UTC 2020


 solenv/clang-format/excludelist |    2 
 starmath/inc/strings.hrc        |    2 
 starmath/inc/strings.hxx        |    4 
 starmath/inc/token.hxx          |  187 +++++++++++++++++++---------------------
 4 files changed, 96 insertions(+), 99 deletions(-)

New commits:
commit 4ff72e83869b41db9db44eebc9b25259d90a8b5b
Author:     dante <dante19031999 at gmail.com>
AuthorDate: Sat Nov 21 11:20:02 2020 +0100
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Nov 22 11:48:19 2020 +0100

    clang-formated some headers on starmath
    
    Change-Id: I6bb226b7a1554cdc499bcbe3290b56a9b976e788
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106301
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index d910ee5d7cbd..b89112be0c23 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -11109,9 +11109,7 @@ starmath/inc/parse.hxx
 starmath/inc/rect.hxx
 starmath/inc/scrwin.hxx
 starmath/inc/smmod.hxx
-starmath/inc/strings.hxx
 starmath/inc/symbol.hxx
-starmath/inc/token.hxx
 starmath/inc/unomodel.hxx
 starmath/inc/utility.hxx
 starmath/inc/view.hxx
diff --git a/starmath/inc/strings.hrc b/starmath/inc/strings.hrc
index 499d263a4607..9ecaaf1baae4 100644
--- a/starmath/inc/strings.hrc
+++ b/starmath/inc/strings.hrc
@@ -29,6 +29,7 @@
 
 #define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
 
+// clang-format off
 #define RID_PLUSX_HELP                      NC_("RID_PLUSX_HELP", "+ Sign" )
 #define RID_MINUSX_HELP                     NC_("RID_MINUSX_HELP", "- Sign" )
 #define RID_PLUSMINUSX_HELP                 NC_("RID_PLUSMINUSX_HELP", "+- Sign" )
@@ -397,6 +398,7 @@
 #define RID_PRINTUIOPT_ORIGSIZE             NC_("RID_PRINTUIOPT_ORIGSIZE", "O~riginal size" )
 #define RID_PRINTUIOPT_FITTOPAGE            NC_("RID_PRINTUIOPT_FITTOPAGE", "Fit to ~page" )
 #define RID_PRINTUIOPT_SCALING              NC_("RID_PRINTUIOPT_SCALING", "~Scaling" )
+// clang-format on
 
 #endif
 
diff --git a/starmath/inc/strings.hxx b/starmath/inc/strings.hxx
index 22ed16a254d8..db89180937d7 100644
--- a/starmath/inc/strings.hxx
+++ b/starmath/inc/strings.hxx
@@ -16,8 +16,9 @@
 #ifndef INCLUDED_STARMATH_INC_STRINGS_HXX
 #define INCLUDED_STARMATH_INC_STRINGS_HXX
 
-#define RID_UNDOFORMATNAME      "Format"
+#define RID_UNDOFORMATNAME "Format"
 
+// clang-format off
 #define RID_PLUSX               "+<?> "
 #define RID_MINUSX              "-<?> "
 #define RID_PLUSMINUSX          "+-<?> "
@@ -298,6 +299,7 @@
 #define RID_XSUCCEEDSEQUIVY     "<?> succsim <?> "
 #define RID_XNOTPRECEDESY       "<?> nprec <?> "
 #define RID_XNOTSUCCEEDSY       "<?> nsucc <?> "
+// clang-format on
 
 #endif
 
diff --git a/starmath/inc/token.hxx b/starmath/inc/token.hxx
index a1cbe95d214c..cc295cc5fe28 100644
--- a/starmath/inc/token.hxx
+++ b/starmath/inc/token.hxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
- /** The tokens contain the information gathered by the parser.
+/** The tokens contain the information gathered by the parser.
    *
    * They contain:
    *    the data type (~ mathematical operation).
@@ -36,29 +36,33 @@
 #include <tools/color.hxx>
 
 // TokenGroups
-enum class TG {
-    NONE          = 0x000000,
-    Oper          = 0x000001,
-    Relation      = 0x000002,
-    Sum           = 0x000004,
-    Product       = 0x000008,
-    UnOper        = 0x000010,
-    Power         = 0x000020,
-    Attribute     = 0x000040,
-    Align         = 0x000080,
-    Function      = 0x000100,
-    Blank         = 0x000200,
-    LBrace        = 0x000400,
-    RBrace        = 0x000800,
-    Color         = 0x001000,
-    Font          = 0x002000,
-    Standalone    = 0x004000,
-    Limit         = 0x010000,
-    FontAttr      = 0x020000
+enum class TG
+{
+    NONE = 0x000000,
+    Oper = 0x000001,
+    Relation = 0x000002,
+    Sum = 0x000004,
+    Product = 0x000008,
+    UnOper = 0x000010,
+    Power = 0x000020,
+    Attribute = 0x000040,
+    Align = 0x000080,
+    Function = 0x000100,
+    Blank = 0x000200,
+    LBrace = 0x000400,
+    RBrace = 0x000800,
+    Color = 0x001000,
+    Font = 0x002000,
+    Standalone = 0x004000,
+    Limit = 0x010000,
+    FontAttr = 0x020000
 };
 
-namespace o3tl {
-    template<> struct typed_flags<TG> : is_typed_flags<TG, 0x037fff> {};
+namespace o3tl
+{
+template <> struct typed_flags<TG> : is_typed_flags<TG, 0x037fff>
+{
+};
 }
 
 // Tokens identifiers. Allow to know what kind of information the node contains.
@@ -145,101 +149,93 @@ enum SmTokenType
 
 struct SmTokenTableEntry
 {
-    const char*      pIdent;
-    SmTokenType      eType;
-    sal_Unicode      cMathChar;
-    TG               nGroup;
-    sal_uInt16       nLevel;
+    const char* pIdent;
+    SmTokenType eType;
+    sal_Unicode cMathChar;
+    TG nGroup;
+    sal_uInt16 nLevel;
 };
 
 struct SmColorTokenTableEntry
 {
-    const char*      pIdent;
-    const char*      cIdent;
-    SmTokenType      eType;
-    Color            cColor;
+    const char* pIdent;
+    const char* cIdent;
+    SmTokenType eType;
+    Color cColor;
 
     SmColorTokenTableEntry()
-    : pIdent("")
-    , cIdent("")
-    , eType(TERROR)
-    , cColor()
-    {}
-
-    SmColorTokenTableEntry( const SmColorTokenTableEntry * amColorTokenTableEntry )
-    : pIdent(amColorTokenTableEntry->pIdent)
-    , cIdent(amColorTokenTableEntry->cIdent)
-    , eType(amColorTokenTableEntry->eType)
-    , cColor(amColorTokenTableEntry->cColor)
-    {}
-
-    SmColorTokenTableEntry( const std::unique_ptr<SmColorTokenTableEntry> amColorTokenTableEntry )
-    : pIdent(amColorTokenTableEntry->pIdent)
-    , cIdent(amColorTokenTableEntry->cIdent)
-    , eType(amColorTokenTableEntry->eType)
-    , cColor(amColorTokenTableEntry->cColor)
-    {}
-
-    SmColorTokenTableEntry( const char* name, const char* codename, SmTokenType ctype, Color ncolor)
-    : pIdent(name)
-    , cIdent(codename)
-    , eType(ctype)
-    , cColor(ncolor)
-    {}
-
-    SmColorTokenTableEntry( const char* name, const char* codename, SmTokenType ctype, sal_uInt32 ncolor)
-    : pIdent(name)
-    , cIdent(codename)
-    , eType(ctype)
-    , cColor(ncolor)
-    {}
+        : pIdent("")
+        , cIdent("")
+        , eType(TERROR)
+        , cColor()
+    {
+    }
 
-    bool operator == ( const OUString & colorname ) const
+    SmColorTokenTableEntry(const SmColorTokenTableEntry* amColorTokenTableEntry)
+        : pIdent(amColorTokenTableEntry->pIdent)
+        , cIdent(amColorTokenTableEntry->cIdent)
+        , eType(amColorTokenTableEntry->eType)
+        , cColor(amColorTokenTableEntry->cColor)
     {
-        return colorname.compareToIgnoreAsciiCaseAscii( pIdent ) == 0;
     }
 
-    bool operator == ( sal_uInt32 colorcode ) const
+    SmColorTokenTableEntry(const std::unique_ptr<SmColorTokenTableEntry> amColorTokenTableEntry)
+        : pIdent(amColorTokenTableEntry->pIdent)
+        , cIdent(amColorTokenTableEntry->cIdent)
+        , eType(amColorTokenTableEntry->eType)
+        , cColor(amColorTokenTableEntry->cColor)
     {
-        return colorcode == cColor.mValue;
     }
 
-    bool operator == ( Color colorcode ) const
+    SmColorTokenTableEntry(const char* name, const char* codename, SmTokenType ctype, Color ncolor)
+        : pIdent(name)
+        , cIdent(codename)
+        , eType(ctype)
+        , cColor(ncolor)
     {
-        return colorcode == cColor;
     }
 
-    bool equals( const OUString & colorname ) const
+    SmColorTokenTableEntry(const char* name, const char* codename, SmTokenType ctype,
+                           sal_uInt32 ncolor)
+        : pIdent(name)
+        , cIdent(codename)
+        , eType(ctype)
+        , cColor(ncolor)
     {
-        return colorname.compareToIgnoreAsciiCaseAscii( pIdent ) == 0;
     }
 
-    bool equals( sal_uInt32 colorcode ) const
+    bool operator==(const OUString& colorname) const
     {
-        return colorcode == cColor.mValue;
+        return colorname.compareToIgnoreAsciiCaseAscii(pIdent) == 0;
     }
 
-    bool equals( Color colorcode ) const
+    bool operator==(sal_uInt32 colorcode) const { return colorcode == cColor.mValue; }
+
+    bool operator==(Color colorcode) const { return colorcode == cColor; }
+
+    bool equals(const OUString& colorname) const
     {
-        return colorcode == cColor;
+        return colorname.compareToIgnoreAsciiCaseAscii(pIdent) == 0;
     }
 
+    bool equals(sal_uInt32 colorcode) const { return colorcode == cColor.mValue; }
+
+    bool equals(Color colorcode) const { return colorcode == cColor; }
 };
 
 struct SmToken
 {
-
-    OUString        aText;      // token text
-    SmTokenType     eType;      // token info
+    OUString aText; // token text
+    SmTokenType eType; // token info
     sal_Unicode cMathChar;
 
     // parse-help info
-    TG              nGroup;
-    sal_uInt16      nLevel;
+    TG nGroup;
+    sal_uInt16 nLevel;
 
     // token position
-    sal_Int32      nRow; // 1-based
-    sal_Int32      nCol; // 1-based
+    sal_Int32 nRow; // 1-based
+    sal_Int32 nCol; // 1-based
 
     SmToken()
         : eType(TUNKNOWN)
@@ -247,12 +243,11 @@ struct SmToken
         , nGroup(TG::NONE)
         , nLevel(0)
         , nRow(0)
-        , nCol(0) {}
+        , nCol(0)
+    {
+    }
 
-    SmToken(SmTokenType eTokenType,
-            sal_Unicode cMath,
-            const char* pText,
-            TG nTokenGroup = TG::NONE,
+    SmToken(SmTokenType eTokenType, sal_Unicode cMath, const char* pText, TG nTokenGroup = TG::NONE,
             sal_uInt16 nTokenLevel = 0)
         : aText(OUString::createFromAscii(pText))
         , eType(eTokenType)
@@ -260,9 +255,11 @@ struct SmToken
         , nGroup(nTokenGroup)
         , nLevel(nTokenLevel)
         , nRow(0)
-        , nCol(0){}
+        , nCol(0)
+    {
+    }
 
-    void operator = (const SmTokenTableEntry & aTokenTableEntry)
+    void operator=(const SmTokenTableEntry& aTokenTableEntry)
     {
         aText = OUString::createFromAscii(aTokenTableEntry.pIdent);
         eType = aTokenTableEntry.eType;
@@ -273,7 +270,7 @@ struct SmToken
         nCol = 0;
     }
 
-    void operator = (const SmTokenTableEntry * aTokenTableEntry)
+    void operator=(const SmTokenTableEntry* aTokenTableEntry)
     {
         aText = OUString::createFromAscii(aTokenTableEntry->pIdent);
         eType = aTokenTableEntry->eType;
@@ -284,7 +281,7 @@ struct SmToken
         nCol = 0;
     }
 
-    void operator = (const SmColorTokenTableEntry & aTokenTableEntry)
+    void operator=(const SmColorTokenTableEntry& aTokenTableEntry)
     {
         aText = OUString::number(aTokenTableEntry.cColor.mValue, 16);
         eType = aTokenTableEntry.eType;
@@ -295,7 +292,7 @@ struct SmToken
         nCol = 0;
     }
 
-    void operator = (const SmColorTokenTableEntry * aTokenTableEntry)
+    void operator=(const SmColorTokenTableEntry* aTokenTableEntry)
     {
         aText = OUString::number(aTokenTableEntry->cColor.mValue, 16);
         eType = aTokenTableEntry->eType;
@@ -306,7 +303,7 @@ struct SmToken
         nCol = 0;
     }
 
-    void operator = (const std::unique_ptr<SmColorTokenTableEntry> & aTokenTableEntry)
+    void operator=(const std::unique_ptr<SmColorTokenTableEntry>& aTokenTableEntry)
     {
         aText = OUString::number(aTokenTableEntry->cColor.mValue, 16);
         eType = aTokenTableEntry->eType;
@@ -316,8 +313,6 @@ struct SmToken
         nRow = 0;
         nCol = 0;
     }
-
-
 };
 
 #endif


More information about the Libreoffice-commits mailing list