[Libreoffice-commits] core.git: 2 commits - hwpfilter/source idlc/inc idlc/source idl/source solenv/clang-format

Philipp Hofer (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 13 14:20:33 UTC 2020


 hwpfilter/source/datecode.h         |    5 -
 hwpfilter/source/hfont.cxx          |   18 ++-----
 hwpfilter/source/hstream.cxx        |   12 +---
 hwpfilter/source/hstyle.cxx         |   35 +++++--------
 hwpfilter/source/htags.h            |   12 ++--
 hwpfilter/source/precompile.h       |    6 +-
 hwpfilter/source/solver.h           |   20 +++----
 idl/source/objects/module.cxx       |   13 +----
 idlc/inc/astconstants.hxx           |    3 -
 idlc/inc/astenum.hxx                |    8 +--
 idlc/inc/astexception.hxx           |    5 +
 idlc/inc/astmodule.hxx              |    9 +--
 idlc/inc/astneeds.hxx               |    7 +-
 idlc/inc/astobserves.hxx            |    9 +--
 idlc/inc/astscope.hxx               |   21 +++-----
 idlc/inc/astsequence.hxx            |   17 +++---
 idlc/inc/aststack.hxx               |    4 -
 idlc/inc/asttype.hxx                |    3 -
 idlc/source/astexpression.cxx       |   92 +++++++++++++++++++-----------------
 idlc/source/aststack.cxx            |   12 +---
 idlc/source/attributeexceptions.hxx |   10 ++-
 solenv/clang-format/excludelist     |   21 --------
 22 files changed, 150 insertions(+), 192 deletions(-)

New commits:
commit 9c9a8229201bd134df923420c97db84688a7813c
Author:     Philipp Hofer <philipp.hofer at protonmail.com>
AuthorDate: Thu Nov 12 13:00:40 2020 +0100
Commit:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Fri Nov 13 15:19:47 2020 +0100

    tdf#123936 Formatting files in module idl with clang-format
    
    Change-Id: I0a2681218773288c14b6faf98dd0bb8a7dbac56d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105679
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index fe64287ae8e2..17c483a3243e 100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -22,17 +22,14 @@
 #include <database.hxx>
 #include <osl/file.hxx>
 
+SvMetaModule::SvMetaModule() {}
 
-SvMetaModule::SvMetaModule()
+void SvMetaModule::WriteSfx(SvIdlDataBase& rBase, SvStream& rOutStm)
 {
-}
-
-void SvMetaModule::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
-{
-    for( sal_uLong n = 0; n < aClassList.size(); n++ )
+    for (sal_uLong n = 0; n < aClassList.size(); n++)
     {
-        SvMetaClass * pClass = aClassList[n];
-        pClass->WriteSfx( rBase, rOutStm );
+        SvMetaClass* pClass = aClassList[n];
+        pClass->WriteSfx(rBase, rOutStm);
     }
 }
 
diff --git a/idlc/inc/astconstants.hxx b/idlc/inc/astconstants.hxx
index cf97e2cc6971..6add23a45359 100644
--- a/idlc/inc/astconstants.hxx
+++ b/idlc/inc/astconstants.hxx
@@ -26,7 +26,8 @@ class AstConstants final : public AstModule
 public:
     AstConstants(const OString& name, AstScope* pScope)
         : AstModule(NT_constants, name, pScope)
-    {}
+    {
+    }
 };
 
 #endif // INCLUDED_IDLC_INC_ASTCONSTANTS_HXX
diff --git a/idlc/inc/astenum.hxx b/idlc/inc/astenum.hxx
index 085a397b0f22..dc89d430adb2 100644
--- a/idlc/inc/astenum.hxx
+++ b/idlc/inc/astenum.hxx
@@ -23,23 +23,21 @@
 #include "astscope.hxx"
 #include "astconstant.hxx"
 
-class AstEnum final : public AstType
-              , public AstScope
+class AstEnum final : public AstType, public AstScope
 {
 public:
     AstEnum(const OString& name, AstScope* pScope);
 
     virtual ~AstEnum() override;
 
-    sal_Int32 getEnumValueCount()
-        { return m_enumValueCount++; }
+    sal_Int32 getEnumValueCount() { return m_enumValueCount++; }
 
     AstConstant* checkValue(AstExpression* pExpr);
 
     virtual bool dump(RegistryKey& rKey) override;
 
 private:
-    sal_Int32   m_enumValueCount;
+    sal_Int32 m_enumValueCount;
 };
 
 #endif // INCLUDED_IDLC_INC_ASTENUM_HXX
diff --git a/idlc/inc/astexception.hxx b/idlc/inc/astexception.hxx
index 70c1ffc9c706..6c2d549bc9a2 100644
--- a/idlc/inc/astexception.hxx
+++ b/idlc/inc/astexception.hxx
@@ -24,9 +24,10 @@
 class AstException final : public AstStruct
 {
 public:
-    AstException(const OString& name, AstException const * pBaseType, AstScope* pScope)
+    AstException(const OString& name, AstException const* pBaseType, AstScope* pScope)
         : AstStruct(NT_exception, name, pBaseType, pScope)
-        {}
+    {
+    }
 };
 
 #endif // INCLUDED_IDLC_INC_ASTEXCEPTION_HXX
diff --git a/idlc/inc/astmodule.hxx b/idlc/inc/astmodule.hxx
index df50ac95df5f..6178cfbb63da 100644
--- a/idlc/inc/astmodule.hxx
+++ b/idlc/inc/astmodule.hxx
@@ -22,18 +22,19 @@
 #include "astdeclaration.hxx"
 #include "astscope.hxx"
 
-class AstModule : public AstDeclaration
-                , public AstScope
+class AstModule : public AstDeclaration, public AstScope
 {
 public:
     AstModule(const OString& name, AstScope* pScope)
         : AstDeclaration(NT_module, name, pScope)
         , AstScope(NT_module)
-    {}
+    {
+    }
     AstModule(NodeType type, const OString& name, AstScope* pScope)
         : AstDeclaration(type, name, pScope)
         , AstScope(type)
-    {}
+    {
+    }
 
     virtual bool dump(RegistryKey& rKey) override;
 };
diff --git a/idlc/inc/astneeds.hxx b/idlc/inc/astneeds.hxx
index d0914222a091..13d2dbbef197 100644
--- a/idlc/inc/astneeds.hxx
+++ b/idlc/inc/astneeds.hxx
@@ -27,10 +27,11 @@ public:
     AstNeeds(AstService* pRealService, const OString& name, AstScope* pScope)
         : AstDeclaration(NT_needs, name, pScope)
         , m_pRealService(pRealService)
-        {}
+    {
+    }
+
+    AstService* getRealService() { return m_pRealService; }
 
-    AstService* getRealService()
-        { return m_pRealService; }
 private:
     AstService* m_pRealService;
 };
diff --git a/idlc/inc/astobserves.hxx b/idlc/inc/astobserves.hxx
index 54da873b5631..11bb5a6770b3 100644
--- a/idlc/inc/astobserves.hxx
+++ b/idlc/inc/astobserves.hxx
@@ -27,12 +27,13 @@ public:
     AstObserves(AstInterface* pRealInterface, const OString& name, AstScope* pScope)
         : AstDeclaration(NT_observes, name, pScope)
         , m_pRealInterface(pRealInterface)
-        {}
+    {
+    }
+
+    AstInterface* getRealInterface() { return m_pRealInterface; }
 
-    AstInterface* getRealInterface()
-        { return m_pRealInterface; }
 private:
-    AstInterface*   m_pRealInterface;
+    AstInterface* m_pRealInterface;
 };
 
 #endif // INCLUDED_IDLC_INC_ASTOBSERVES_HXX
diff --git a/idlc/inc/astscope.hxx b/idlc/inc/astscope.hxx
index a258011c9545..5f6ed53f8df1 100644
--- a/idlc/inc/astscope.hxx
+++ b/idlc/inc/astscope.hxx
@@ -31,17 +31,13 @@ public:
     AstScope(NodeType nodeType);
     virtual ~AstScope();
 
-    NodeType getScopeNodeType() const
-        { return m_nodeType; }
+    NodeType getScopeNodeType() const { return m_nodeType; }
 
     AstDeclaration* addDeclaration(AstDeclaration* pDecl);
 
-    sal_uInt32 nMembers() const
-        { return static_cast<sal_uInt32>(m_declarations.size()); }
-    DeclList::const_iterator getIteratorBegin() const
-        { return m_declarations.begin(); }
-    DeclList::const_iterator getIteratorEnd() const
-        { return m_declarations.end(); }
+    sal_uInt32 nMembers() const { return static_cast<sal_uInt32>(m_declarations.size()); }
+    DeclList::const_iterator getIteratorBegin() const { return m_declarations.begin(); }
+    DeclList::const_iterator getIteratorEnd() const { return m_declarations.end(); }
     sal_uInt16 getNodeCount(NodeType nType) const;
 
     // Name look up mechanism
@@ -54,15 +50,14 @@ public:
     // Look up a predefined type by its ExprType
     AstDeclaration* lookupPrimitiveType(ExprType type);
 
-    AstDeclaration* lookupForAdd(AstDeclaration const * pDecl) const;
+    AstDeclaration* lookupForAdd(AstDeclaration const* pDecl) const;
 
 protected:
-    AstDeclaration const * getLast() const
-    { return m_declarations.back(); }
+    AstDeclaration const* getLast() const { return m_declarations.back(); }
 
 private:
-    DeclList    m_declarations;
-    NodeType    m_nodeType;
+    DeclList m_declarations;
+    NodeType m_nodeType;
 };
 
 #endif // INCLUDED_IDLC_INC_ASTSCOPE_HXX
diff --git a/idlc/inc/astsequence.hxx b/idlc/inc/astsequence.hxx
index 41024894f47a..d74f8320f627 100644
--- a/idlc/inc/astsequence.hxx
+++ b/idlc/inc/astsequence.hxx
@@ -24,20 +24,23 @@
 class AstSequence final : public AstType
 {
 public:
-    AstSequence(AstType const * pMemberType, AstScope* pScope)
-        : AstType(NT_sequence, OStringLiteral("[]")+pMemberType->getScopedName(), pScope)
+    AstSequence(AstType const* pMemberType, AstScope* pScope)
+        : AstType(NT_sequence, OStringLiteral("[]") + pMemberType->getScopedName(), pScope)
         , m_pMemberType(pMemberType)
-    {}
+    {
+    }
 
-    AstType const * getMemberType() const
-        { return m_pMemberType; }
+    AstType const* getMemberType() const { return m_pMemberType; }
 
     virtual bool isUnsigned() const override
-    { return m_pMemberType != nullptr && m_pMemberType->isUnsigned(); }
+    {
+        return m_pMemberType != nullptr && m_pMemberType->isUnsigned();
+    }
 
     virtual const char* getRelativName() const override;
+
 private:
-    AstType const * m_pMemberType;
+    AstType const* m_pMemberType;
     mutable std::optional<OString> m_xRelativName;
 };
 
diff --git a/idlc/inc/aststack.hxx b/idlc/inc/aststack.hxx
index bf3575676aa3..d36bd4e48e40 100644
--- a/idlc/inc/aststack.hxx
+++ b/idlc/inc/aststack.hxx
@@ -30,7 +30,7 @@ public:
     AstStack();
     ~AstStack();
 
-    sal_uInt32 depth() const { return m_stack.size();}
+    sal_uInt32 depth() const { return m_stack.size(); }
     AstScope* top();
     AstScope* bottom();
     AstScope* nextToTop();
@@ -40,7 +40,7 @@ public:
     void clear();
 
 private:
-    std::vector<AstScope*>  m_stack;
+    std::vector<AstScope*> m_stack;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idlc/inc/asttype.hxx b/idlc/inc/asttype.hxx
index 7c173197ef8e..8627429cd01a 100644
--- a/idlc/inc/asttype.hxx
+++ b/idlc/inc/asttype.hxx
@@ -26,7 +26,8 @@ class AstType : public AstDeclaration
 public:
     AstType(const NodeType type, const OString& name, AstScope* pScope)
         : AstDeclaration(type, name, pScope)
-        {}
+    {
+    }
 
     virtual bool isUnsigned() const { return false; }
 };
diff --git a/idlc/source/astexpression.cxx b/idlc/source/astexpression.cxx
index cd5a21656ff6..1afa91dbf8b4 100644
--- a/idlc/source/astexpression.cxx
+++ b/idlc/source/astexpression.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 #include <astexpression.hxx>
 #include <astconstant.hxx>
 #include <astscope.hxx>
@@ -30,7 +29,7 @@
 #include <float.h>
 #include <memory>
 
-AstExpression::AstExpression(ExprComb c, AstExpression *pExpr1, AstExpression *pExpr2)
+AstExpression::AstExpression(ExprComb c, AstExpression* pExpr1, AstExpression* pExpr2)
     : m_combOperator(c)
     , m_subExpr1(pExpr1)
     , m_subExpr2(pExpr2)
@@ -40,23 +39,23 @@ AstExpression::AstExpression(ExprComb c, AstExpression *pExpr1, AstExpression *p
 AstExpression::AstExpression(sal_Int32 l)
     : m_combOperator(ExprComb::NONE)
 {
-    m_exprValue.reset( new AstExprValue );
+    m_exprValue.reset(new AstExprValue);
     m_exprValue->et = ET_long;
     m_exprValue->u.lval = l;
 }
 
-AstExpression::AstExpression(sal_Int32  l, ExprType et)
+AstExpression::AstExpression(sal_Int32 l, ExprType et)
     : m_combOperator(ExprComb::NONE)
 {
-    m_exprValue.reset( new AstExprValue );
+    m_exprValue.reset(new AstExprValue);
     m_exprValue->et = et;
     m_exprValue->u.lval = l;
 }
 
-AstExpression::AstExpression(sal_Int64  h)
+AstExpression::AstExpression(sal_Int64 h)
     : m_combOperator(ExprComb::NONE)
 {
-    m_exprValue.reset( new AstExprValue );
+    m_exprValue.reset(new AstExprValue);
     m_exprValue->et = ET_hyper;
     m_exprValue->u.hval = h;
 }
@@ -64,7 +63,7 @@ AstExpression::AstExpression(sal_Int64  h)
 AstExpression::AstExpression(sal_uInt64 uh)
     : m_combOperator(ExprComb::NONE)
 {
-    m_exprValue.reset( new AstExprValue );
+    m_exprValue.reset(new AstExprValue);
     m_exprValue->et = ET_uhyper;
     m_exprValue->u.uhval = uh;
 }
@@ -72,7 +71,7 @@ AstExpression::AstExpression(sal_uInt64 uh)
 AstExpression::AstExpression(double d)
     : m_combOperator(ExprComb::NONE)
 {
-    m_exprValue.reset( new AstExprValue );
+    m_exprValue.reset(new AstExprValue);
     m_exprValue->et = ET_double;
     m_exprValue->u.dval = d;
 }
@@ -84,17 +83,14 @@ AstExpression::AstExpression(OString* scopedName)
         m_xSymbolicName = *scopedName;
 }
 
-AstExpression::~AstExpression()
-{
-}
+AstExpression::~AstExpression() {}
 
 /*
  * Perform the coercion from the given AstExprValue to the requested
  * ExprType. Return an AstExprValue if successful, NULL if failed.
  * must be done for hyper, uhyper
  */
-static bool
-coerce_value(AstExprValue *ev, ExprType t)
+static bool coerce_value(AstExprValue* ev, ExprType t)
 {
     if (ev == nullptr)
         return false;
@@ -735,7 +731,8 @@ coerce_value(AstExprValue *ev, ExprType t)
                     return true;
                 case ET_double:
                 {
-                    if (static_cast<float>(ev->u.dval) > FLT_MAX || static_cast<float>(ev->u.dval) < -FLT_MAX)
+                    if (static_cast<float>(ev->u.dval) > FLT_MAX
+                        || static_cast<float>(ev->u.dval) < -FLT_MAX)
                         return false;
                     auto tmp = static_cast<float>(ev->u.dval);
                     ev->u.fval = tmp;
@@ -944,7 +941,7 @@ bool AstExpression::coerce(ExprType t)
     return m_exprValue != nullptr;
 }
 
-bool AstExpression::compareLong(AstExpression *pExpr)
+bool AstExpression::compareLong(AstExpression* pExpr)
 {
     bool bRet = false;
     if (m_combOperator != pExpr->m_combOperator)
@@ -973,7 +970,7 @@ void AstExpression::evaluate()
     /*
      * Already evaluated?
      */
-    if ( m_exprValue != nullptr )
+    if (m_exprValue != nullptr)
         return;
     /*
      * OK, must evaluate operator
@@ -1010,7 +1007,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_bin_op()
 {
     ExprType eType = ET_double;
 
-    if ( m_combOperator == ExprComb::Mod )
+    if (m_combOperator == ExprComb::Mod)
         eType = ET_hyper;
 
     if (m_subExpr1 == nullptr || m_subExpr2 == nullptr)
@@ -1026,7 +1023,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_bin_op()
     if (!m_subExpr2->coerce(eType))
         return nullptr;
 
-    std::unique_ptr< AstExprValue > retval(new AstExprValue);
+    std::unique_ptr<AstExprValue> retval(new AstExprValue);
     retval->et = eType;
 
     switch (m_combOperator)
@@ -1034,21 +1031,26 @@ std::unique_ptr<AstExprValue> AstExpression::eval_bin_op()
         case ExprComb::Mod:
             if (m_subExpr2->getExprValue()->u.hval == 0)
                 return nullptr;
-            retval->u.hval = m_subExpr1->getExprValue()->u.hval % m_subExpr2->getExprValue()->u.hval;
+            retval->u.hval
+                = m_subExpr1->getExprValue()->u.hval % m_subExpr2->getExprValue()->u.hval;
             break;
         case ExprComb::Add:
-            retval->u.dval = m_subExpr1->getExprValue()->u.dval + m_subExpr2->getExprValue()->u.dval;
+            retval->u.dval
+                = m_subExpr1->getExprValue()->u.dval + m_subExpr2->getExprValue()->u.dval;
             break;
         case ExprComb::Minus:
-            retval->u.dval = m_subExpr1->getExprValue()->u.dval - m_subExpr2->getExprValue()->u.dval;
+            retval->u.dval
+                = m_subExpr1->getExprValue()->u.dval - m_subExpr2->getExprValue()->u.dval;
             break;
         case ExprComb::Mul:
-            retval->u.dval = m_subExpr1->getExprValue()->u.dval * m_subExpr2->getExprValue()->u.dval;
+            retval->u.dval
+                = m_subExpr1->getExprValue()->u.dval * m_subExpr2->getExprValue()->u.dval;
             break;
         case ExprComb::Div:
             if (m_subExpr2->getExprValue()->u.dval == 0.0)
                 return nullptr;
-            retval->u.dval = m_subExpr1->getExprValue()->u.dval / m_subExpr2->getExprValue()->u.dval;
+            retval->u.dval
+                = m_subExpr1->getExprValue()->u.dval / m_subExpr2->getExprValue()->u.dval;
             break;
         default:
             return nullptr;
@@ -1072,25 +1074,30 @@ std::unique_ptr<AstExprValue> AstExpression::eval_bit_op()
     if (!m_subExpr2->coerce(ET_long))
         return nullptr;
 
-    std::unique_ptr< AstExprValue > retval(new AstExprValue);
+    std::unique_ptr<AstExprValue> retval(new AstExprValue);
     retval->et = ET_long;
 
     switch (m_combOperator)
     {
         case ExprComb::Or:
-            retval->u.lval = m_subExpr1->getExprValue()->u.lval | m_subExpr2->getExprValue()->u.lval;
+            retval->u.lval
+                = m_subExpr1->getExprValue()->u.lval | m_subExpr2->getExprValue()->u.lval;
             break;
         case ExprComb::Xor:
-            retval->u.lval = m_subExpr1->getExprValue()->u.lval ^ m_subExpr2->getExprValue()->u.lval;
+            retval->u.lval
+                = m_subExpr1->getExprValue()->u.lval ^ m_subExpr2->getExprValue()->u.lval;
             break;
         case ExprComb::And:
-            retval->u.lval = m_subExpr1->getExprValue()->u.lval & m_subExpr2->getExprValue()->u.lval;
+            retval->u.lval
+                = m_subExpr1->getExprValue()->u.lval & m_subExpr2->getExprValue()->u.lval;
             break;
         case ExprComb::Left:
-            retval->u.lval = m_subExpr1->getExprValue()->u.lval << m_subExpr2->getExprValue()->u.lval;
+            retval->u.lval = m_subExpr1->getExprValue()->u.lval
+                             << m_subExpr2->getExprValue()->u.lval;
             break;
         case ExprComb::Right:
-            retval->u.lval = m_subExpr1->getExprValue()->u.lval >> m_subExpr2->getExprValue()->u.lval;
+            retval->u.lval
+                = m_subExpr1->getExprValue()->u.lval >> m_subExpr2->getExprValue()->u.lval;
             break;
         default:
             return nullptr;
@@ -1109,7 +1116,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_un_op()
     if (!m_subExpr1->coerce(ET_double))
         return nullptr;
 
-    std::unique_ptr< AstExprValue > retval(new AstExprValue);
+    std::unique_ptr<AstExprValue> retval(new AstExprValue);
     retval->et = ET_double;
 
     switch (m_combOperator)
@@ -1129,9 +1136,9 @@ std::unique_ptr<AstExprValue> AstExpression::eval_un_op()
 
 std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
 {
-    AstScope        *pScope = nullptr;
-    AstDeclaration  *pDecl;
-    AstConstant     *pConst;
+    AstScope* pScope = nullptr;
+    AstDeclaration* pDecl;
+    AstConstant* pConst;
 
     /*
      * Is there a symbol stored?
@@ -1146,7 +1153,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
      */
     if (idlc()->scopes()->depth() > 0)
         pScope = idlc()->scopes()->topNonNull();
-    if ( !pScope )
+    if (!pScope)
     {
         ErrorHandler::lookupError(*m_xSymbolicName);
         return nullptr;
@@ -1163,8 +1170,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
     /*
      * Is it a constant?
      */
-    if (pDecl->getNodeType() != NT_const &&
-        pDecl->getNodeType() != NT_enum_val)
+    if (pDecl->getNodeType() != NT_const && pDecl->getNodeType() != NT_enum_val)
     {
         ErrorHandler::constantExpected(pDecl, *m_xSymbolicName);
         return nullptr;
@@ -1176,7 +1182,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
     /*
      * OK, now evaluate the constant we just got, to produce its value
      */
-    pConst = static_cast< AstConstant* >(pDecl);
+    pConst = static_cast<AstConstant*>(pDecl);
     pConst->getConstValue()->evaluate();
     auto const val = pConst->getConstValue()->getExprValue();
     return val == nullptr ? nullptr : std::make_unique<AstExprValue>(*val);
@@ -1185,10 +1191,10 @@ std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
 OString AstExpression::toString()
 {
     OString exprStr;
-    if ( m_combOperator == ExprComb::Symbol )
+    if (m_combOperator == ExprComb::Symbol)
         return m_xSymbolicName ? *m_xSymbolicName : OString("<Undefined Name>");
 
-    if ( m_exprValue )
+    if (m_exprValue)
     {
         switch (m_exprValue->et)
         {
@@ -1211,7 +1217,7 @@ OString AstExpression::toString()
             case ET_byte:
                 return OString::number(m_exprValue->u.byval);
             case ET_boolean:
-                if ( m_exprValue->u.lval == 0)
+                if (m_exprValue->u.lval == 0)
                     return "FALSE";
                 else
                     return "TRUE";
@@ -1232,7 +1238,7 @@ OString AstExpression::toString()
         default:
             break;
     }
-    if ( m_subExpr1 )
+    if (m_subExpr1)
         exprStr += m_subExpr1->toString();
     switch (m_combOperator)
     {
@@ -1270,7 +1276,7 @@ OString AstExpression::toString()
             break;
     }
 
-    if ( m_subExpr2 )
+    if (m_subExpr2)
         exprStr += m_subExpr2->toString();
 
     return exprStr;
diff --git a/idlc/source/aststack.cxx b/idlc/source/aststack.cxx
index 6e01cdabf089..fcddc810dec5 100644
--- a/idlc/source/aststack.cxx
+++ b/idlc/source/aststack.cxx
@@ -21,9 +21,7 @@
 #include <aststack.hxx>
 #include <astscope.hxx>
 
-AstStack::AstStack()
-{
-}
+AstStack::AstStack() {}
 
 AstStack::~AstStack()
 {
@@ -31,7 +29,6 @@ AstStack::~AstStack()
         delete p;
 }
 
-
 AstScope* AstStack::top()
 {
     if (m_stack.empty())
@@ -58,7 +55,7 @@ AstScope* AstStack::topNonNull()
 {
     for (sal_uInt32 i = m_stack.size(); i > 0; i--)
     {
-        if ( m_stack[i - 1] )
+        if (m_stack[i - 1])
             return m_stack[i - 1];
     }
     return nullptr;
@@ -77,9 +74,6 @@ void AstStack::pop()
     m_stack.pop_back();
 }
 
-void AstStack::clear()
-{
-   m_stack.clear();
-}
+void AstStack::clear() { m_stack.clear(); }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idlc/source/attributeexceptions.hxx b/idlc/source/attributeexceptions.hxx
index e1a3033a95bf..82ce1cf19eeb 100644
--- a/idlc/source/attributeexceptions.hxx
+++ b/idlc/source/attributeexceptions.hxx
@@ -22,10 +22,12 @@
 
 #include <rtl/ustring.hxx>
 
-struct AttributeExceptions {
-    struct Part {
-        OUString const * documentation;
-        DeclList const * exceptions;
+struct AttributeExceptions
+{
+    struct Part
+    {
+        OUString const* documentation;
+        DeclList const* exceptions;
     };
     Part get;
     Part set;
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 0aa2000eb913..9c5739ffe451 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -5020,7 +5020,6 @@ idl/source/cmptools/hash.cxx
 idl/source/cmptools/lex.cxx
 idl/source/objects/basobj.cxx
 idl/source/objects/bastype.cxx
-idl/source/objects/module.cxx
 idl/source/objects/object.cxx
 idl/source/objects/slot.cxx
 idl/source/objects/types.cxx
@@ -5032,27 +5031,17 @@ idl/source/prj/svidl.cxx
 idlc/inc/astattribute.hxx
 idlc/inc/astbasetype.hxx
 idlc/inc/astconstant.hxx
-idlc/inc/astconstants.hxx
 idlc/inc/astdeclaration.hxx
-idlc/inc/astenum.hxx
-idlc/inc/astexception.hxx
 idlc/inc/astexpression.hxx
 idlc/inc/astinterface.hxx
 idlc/inc/astinterfacemember.hxx
 idlc/inc/astmember.hxx
-idlc/inc/astmodule.hxx
-idlc/inc/astneeds.hxx
-idlc/inc/astobserves.hxx
 idlc/inc/astoperation.hxx
 idlc/inc/astparameter.hxx
-idlc/inc/astscope.hxx
-idlc/inc/astsequence.hxx
 idlc/inc/astservice.hxx
 idlc/inc/astservicemember.hxx
-idlc/inc/aststack.hxx
 idlc/inc/aststruct.hxx
 idlc/inc/aststructinstance.hxx
-idlc/inc/asttype.hxx
 idlc/inc/asttypedef.hxx
 idlc/inc/errorhandler.hxx
 idlc/inc/fehelper.hxx
@@ -5064,15 +5053,12 @@ idlc/source/astconstant.cxx
 idlc/source/astdeclaration.cxx
 idlc/source/astdump.cxx
 idlc/source/astenum.cxx
-idlc/source/astexpression.cxx
 idlc/source/astinterface.cxx
 idlc/source/astoperation.cxx
 idlc/source/astscope.cxx
 idlc/source/astservice.cxx
-idlc/source/aststack.cxx
 idlc/source/aststruct.cxx
 idlc/source/aststructinstance.cxx
-idlc/source/attributeexceptions.hxx
 idlc/source/errorhandler.cxx
 idlc/source/fehelper.cxx
 idlc/source/idlc.cxx
commit 7721e7a79733a5ac5e029869eeb88638ec00102e
Author:     Philipp Hofer <philipp.hofer at protonmail.com>
AuthorDate: Thu Nov 12 12:59:30 2020 +0100
Commit:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Fri Nov 13 15:19:32 2020 +0100

    tdf#123936 Formatting files in module hwpfilter with clang-format
    
    Change-Id: I0c2d06e03f2fbb15ddb35e3d24f1cf2f926dc4dd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105676
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/hwpfilter/source/datecode.h b/hwpfilter/source/datecode.h
index 0478dcce5e62..900d1e6c9d6b 100644
--- a/hwpfilter/source/datecode.h
+++ b/hwpfilter/source/datecode.h
@@ -20,10 +20,7 @@
 #ifndef INCLUDED_HWPFILTER_SOURCE_DATECODE_H
 #define INCLUDED_HWPFILTER_SOURCE_DATECODE_H
 
-const hchar defaultform[] =
-{
-    '1', 0x9165, 32, '2', 0xB6A9, 32, '3', 0xB7A9, 0
-};
+const hchar defaultform[] = { '1', 0x9165, 32, '2', 0xB6A9, 32, '3', 0xB7A9, 0 };
 
 #endif
 
diff --git a/hwpfilter/source/hfont.cxx b/hwpfilter/source/hfont.cxx
index 71ca23451bd8..cdb77ec776da 100644
--- a/hwpfilter/source/hfont.cxx
+++ b/hwpfilter/source/hfont.cxx
@@ -32,13 +32,9 @@ HWPFont::HWPFont()
     }
 }
 
+HWPFont::~HWPFont() {}
 
-HWPFont::~HWPFont()
-{
-}
-
-
-void HWPFont::AddFont(int lang, const char *font)
+void HWPFont::AddFont(int lang, const char* font)
 {
     int nfonts;
 
@@ -53,8 +49,7 @@ void HWPFont::AddFont(int lang, const char *font)
     nFonts[lang]++;
 }
 
-
-const char *HWPFont::GetFontName(int lang, int id)
+const char* HWPFont::GetFontName(int lang, int id)
 {
     if (lang < 0 || lang >= NLanguage)
         return nullptr;
@@ -63,16 +58,15 @@ const char *HWPFont::GetFontName(int lang, int id)
     return fontnames[lang].get() + id * FONTNAMELEN;
 }
 
-
 static char buffer[FONTNAMELEN];
 
-void HWPFont::Read(HWPFile & hwpf)
+void HWPFont::Read(HWPFile& hwpf)
 {
     int lang = 0;
     short nfonts = 0;
 
-//printf("HWPFont::Read : lang = %d\n",NLanguage);
-    for(lang = 0; lang < NLanguage; lang++)
+    //printf("HWPFont::Read : lang = %d\n",NLanguage);
+    for (lang = 0; lang < NLanguage; lang++)
     {
         hwpf.Read2b(&nfonts, 1);
         if (nfonts <= 0 || nfonts >= MAXFONTS)
diff --git a/hwpfilter/source/hstream.cxx b/hwpfilter/source/hstream.cxx
index 6b5bf98cb35d..a4ef16885c82 100644
--- a/hwpfilter/source/hstream.cxx
+++ b/hwpfilter/source/hstream.cxx
@@ -26,12 +26,9 @@ HStream::HStream()
 {
 }
 
-void HStream::addData(const byte *buf, size_t aToAdd)
-{
-    seq.insert(seq.end(), buf, buf + aToAdd);
-}
+void HStream::addData(const byte* buf, size_t aToAdd) { seq.insert(seq.end(), buf, buf + aToAdd); }
 
-size_t HStream::readBytes(byte * buf, size_t aToRead)
+size_t HStream::readBytes(byte* buf, size_t aToRead)
 {
     auto size = seq.size();
     if (aToRead >= (size - pos))
@@ -50,9 +47,6 @@ size_t HStream::skipBytes(size_t aToSkip)
     return aToSkip;
 }
 
-size_t HStream::available() const
-{
-    return seq.size() - pos;
-}
+size_t HStream::available() const { return seq.size() - pos; }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/hwpfilter/source/hstyle.cxx b/hwpfilter/source/hstyle.cxx
index 88aa73b77ab0..33f143440c32 100644
--- a/hwpfilter/source/hstyle.cxx
+++ b/hwpfilter/source/hstyle.cxx
@@ -26,19 +26,20 @@
 #include "hstyle.h"
 
 enum
-{ MAXSTYLENAME = 20 };
-
-#define DATA static_cast<StyleData *>(style)
+{
+    MAXSTYLENAME = 20
+};
 
-namespace {
+#define DATA static_cast<StyleData*>(style)
 
+namespace
+{
 struct StyleData
 {
     char name[MAXSTYLENAME + 1];
     CharShape cshape;
     ParaShape pshape;
 };
-
 }
 
 static char buffer[MAXSTYLENAME + 1];
@@ -49,23 +50,20 @@ HWPStyle::HWPStyle()
     style = nullptr;
 }
 
-
 HWPStyle::~HWPStyle()
 {
-    delete[]DATA;
+    delete[] DATA;
     nstyles = 0;
 }
 
-
-char *HWPStyle::GetName(int n) const
+char* HWPStyle::GetName(int n) const
 {
     if (n < 0 || n >= nstyles)
         return nullptr;
     return DATA[n].name;
 }
 
-
-void HWPStyle::SetName(int n, char const *name)
+void HWPStyle::SetName(int n, char const* name)
 {
     if (n < 0 || n >= nstyles)
         return;
@@ -87,16 +85,14 @@ void HWPStyle::SetName(int n, char const *name)
         DATA[n].name[0] = 0;
 }
 
-
-CharShape *HWPStyle::GetCharShape(int n) const
+CharShape* HWPStyle::GetCharShape(int n) const
 {
     if (n < 0 || n >= nstyles)
         return nullptr;
     return &DATA[n].cshape;
 }
 
-
-void HWPStyle::SetCharShape(int n, CharShape const * cshapep)
+void HWPStyle::SetCharShape(int n, CharShape const* cshapep)
 {
     if (n >= 0 && n < nstyles)
     {
@@ -107,16 +103,14 @@ void HWPStyle::SetCharShape(int n, CharShape const * cshapep)
     }
 }
 
-
-ParaShape *HWPStyle::GetParaShape(int n) const
+ParaShape* HWPStyle::GetParaShape(int n) const
 {
     if (n < 0 || n >= nstyles)
         return nullptr;
     return &DATA[n].pshape;
 }
 
-
-void HWPStyle::SetParaShape(int n, ParaShape const * pshapep)
+void HWPStyle::SetParaShape(int n, ParaShape const* pshapep)
 {
     if (n >= 0 && n < nstyles)
     {
@@ -127,8 +121,7 @@ void HWPStyle::SetParaShape(int n, ParaShape const * pshapep)
     }
 }
 
-
-void HWPStyle::Read(HWPFile & hwpf)
+void HWPStyle::Read(HWPFile& hwpf)
 {
     CharShape cshape;
     ParaShape pshape;
diff --git a/hwpfilter/source/htags.h b/hwpfilter/source/htags.h
index 3507633b0294..7265f5d11742 100644
--- a/hwpfilter/source/htags.h
+++ b/hwpfilter/source/htags.h
@@ -22,7 +22,7 @@
 
 #include <memory>
 #ifdef _WIN32
-#  include <objidl.h>
+#include <objidl.h>
 #endif
 
 class HWPFile;
@@ -32,8 +32,8 @@ class HWPFile;
 struct EmPicture
 {
     size_t size;
-    char  name[16];
-    char  type[16];
+    char name[16];
+    char type[16];
     std::unique_ptr<uchar[]> data;
 
     explicit EmPicture(size_t size);
@@ -48,7 +48,7 @@ struct HyperText
 {
     kchar filename[256];
     hchar bookmark[16];
-    char  macro[325];
+    char macro[325];
     uchar type;
     char reserve[3];
     bool Read(HWPFile& hwpf);
@@ -58,10 +58,10 @@ struct HyperText
  */
 struct OlePicture
 {
-    int   size;
+    int size;
     uint signature;
 #ifdef _WIN32
-    IStorage *pis;
+    IStorage* pis;
 #endif
     explicit OlePicture(int tsize);
     ~OlePicture(void);
diff --git a/hwpfilter/source/precompile.h b/hwpfilter/source/precompile.h
index 7ef673028a85..1c348f6b96f6 100644
--- a/hwpfilter/source/precompile.h
+++ b/hwpfilter/source/precompile.h
@@ -18,9 +18,9 @@
  */
 
 #ifdef _WIN32
-    #define WIN32_LEAN_AND_MEAN
-    #include <windows.h>
-    #include <crtdbg.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <crtdbg.h>
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/hwpfilter/source/solver.h b/hwpfilter/source/solver.h
index 451ed068142a..85467ff78e1e 100644
--- a/hwpfilter/source/solver.h
+++ b/hwpfilter/source/solver.h
@@ -23,17 +23,17 @@
 class mgcLinearSystemD
 {
 public:
-  static std::unique_ptr<std::unique_ptr<double[]>[]> NewMatrix (int N);
-  static std::unique_ptr<double[]> NewVector (int N);
+    static std::unique_ptr<std::unique_ptr<double[]>[]> NewMatrix(int N);
+    static std::unique_ptr<double[]> NewVector(int N);
 
-  static bool Solve (int N, std::unique_ptr<std::unique_ptr<double[]>[]> const & A, double* b);
-  // Input:
-  //     A[N][N] coefficient matrix, entries are A[row][col]
-  //     b[N] vector, entries are b[row]
-  // Output:
-  //     return value is TRUE if successful, FALSE if pivoting failed
-  //     A[N][N] is inverse matrix
-  //     b[N] is solution x to Ax = b
+    static bool Solve(int N, std::unique_ptr<std::unique_ptr<double[]>[]> const& A, double* b);
+    // Input:
+    //     A[N][N] coefficient matrix, entries are A[row][col]
+    //     b[N] vector, entries are b[row]
+    // Output:
+    //     return value is TRUE if successful, FALSE if pivoting failed
+    //     A[N][N] is inverse matrix
+    //     b[N] is solution x to Ax = b
 };
 
 #endif
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 9f13561ac5bf..0aa2000eb913 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -4813,7 +4813,6 @@ hwpfilter/source/attributes.cxx
 hwpfilter/source/attributes.hxx
 hwpfilter/source/cspline.cxx
 hwpfilter/source/cspline.h
-hwpfilter/source/datecode.h
 hwpfilter/source/drawdef.h
 hwpfilter/source/drawing.h
 hwpfilter/source/fontmap.cxx
@@ -4825,7 +4824,6 @@ hwpfilter/source/hbox.cxx
 hwpfilter/source/hbox.h
 hwpfilter/source/hcode.cxx
 hwpfilter/source/hcode.h
-hwpfilter/source/hfont.cxx
 hwpfilter/source/hfont.h
 hwpfilter/source/hgzip.cxx
 hwpfilter/source/hgzip.h
@@ -4835,12 +4833,9 @@ hwpfilter/source/hiodev.cxx
 hwpfilter/source/hiodev.h
 hwpfilter/source/hpara.cxx
 hwpfilter/source/hpara.h
-hwpfilter/source/hstream.cxx
 hwpfilter/source/hstream.hxx
-hwpfilter/source/hstyle.cxx
 hwpfilter/source/hstyle.h
 hwpfilter/source/htags.cxx
-hwpfilter/source/htags.h
 hwpfilter/source/hutil.cxx
 hwpfilter/source/hutil.h
 hwpfilter/source/hwpeq.cxx
@@ -4856,9 +4851,7 @@ hwpfilter/source/mapping.h
 hwpfilter/source/mzstring.cxx
 hwpfilter/source/mzstring.h
 hwpfilter/source/nodes.h
-hwpfilter/source/precompile.h
 hwpfilter/source/solver.cxx
-hwpfilter/source/solver.h
 i18nlangtag/qa/cppunit/test_languagetag.cxx
 i18nlangtag/source/isolang/inunx.cxx
 i18nlangtag/source/isolang/inwnt.cxx


More information about the Libreoffice-commits mailing list