From 949b43aabbcbc9974a2caf4081b697022cdf3e0f Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 24 Aug 2022 10:43:56 +0200 Subject: [PATCH] App: [skip ci] whitespace improvements --- src/App/Application.h | 54 ++++++++++++++++----------------- src/App/DocumentObjectPyImp.cpp | 5 ++- src/App/Expression.h | 12 ++++---- src/App/FeaturePython.h | 4 +-- src/App/ObjectIdentifier.cpp | 2 +- src/App/Path.cpp | 7 +---- src/App/Path.h | 14 +++++---- 7 files changed, 47 insertions(+), 51 deletions(-) diff --git a/src/App/Application.h b/src/App/Application.h index 189444d28c..0148a064d5 100644 --- a/src/App/Application.h +++ b/src/App/Application.h @@ -311,9 +311,9 @@ public: /** @name methods for parameter handling */ //@{ /// returns the system parameter - ParameterManager & GetSystemParameter() ; + ParameterManager & GetSystemParameter(); /// returns the user parameter - ParameterManager & GetUserParameter() ; + ParameterManager & GetUserParameter(); /** Gets a parameter group by a full qualified path * It's an easy method to get a group: * \code @@ -326,7 +326,7 @@ public: Base::Reference GetParameterGroupByPath(const char* sName); ParameterManager * GetParameterSet(const char* sName) const; - const std::map & GetParameterSetList() const; + const std::map & GetParameterSetList() const; void AddParameterSet(const char* sName); void RemoveParameterSet(const char* sName); //@} @@ -390,7 +390,7 @@ public: static std::list processFiles(const std::list&); static void runApplication(); friend Application &GetApplication(); - static std::map &Config(){return mConfig;} + static std::map &Config(){return mConfig;} static int GetARGC(){return _argc;} static char** GetARGV(){return _argv;} //@} @@ -480,7 +480,7 @@ protected: /// Helper class for App::Document to signal on close/abort transaction class AppExport TransactionSignaller { public: - TransactionSignaller(bool abort,bool signal); + TransactionSignaller(bool abort, bool signal); ~TransactionSignaller(); private: bool abort; @@ -488,7 +488,7 @@ protected: private: /// Constructor - explicit Application(std::map &mConfig); + explicit Application(std::map &mConfig); /// Destructor virtual ~Application(); @@ -507,27 +507,27 @@ private: static void setupPythonException(PyObject*); // static python wrapper of the exported functions - static PyObject* sGetParam (PyObject *self,PyObject *args); - static PyObject* sSaveParameter (PyObject *self,PyObject *args); - static PyObject* sGetVersion (PyObject *self,PyObject *args); - static PyObject* sGetConfig (PyObject *self,PyObject *args); - static PyObject* sSetConfig (PyObject *self,PyObject *args); - static PyObject* sDumpConfig (PyObject *self,PyObject *args); - static PyObject* sAddImportType (PyObject *self,PyObject *args); - static PyObject* sChangeImportModule(PyObject *self,PyObject *args); - static PyObject* sGetImportType (PyObject *self,PyObject *args); - static PyObject* sAddExportType (PyObject *self,PyObject *args); - static PyObject* sChangeExportModule(PyObject *self,PyObject *args); - static PyObject* sGetExportType (PyObject *self,PyObject *args); - static PyObject* sGetResourcePath (PyObject *self,PyObject *args); - static PyObject* sGetLibraryPath (PyObject *self,PyObject *args); - static PyObject* sGetTempPath (PyObject *self,PyObject *args); - static PyObject* sGetUserCachePath (PyObject *self,PyObject *args); - static PyObject* sGetUserConfigPath (PyObject *self,PyObject *args); - static PyObject* sGetUserAppDataPath(PyObject *self,PyObject *args); - static PyObject* sGetUserMacroPath (PyObject *self,PyObject *args); - static PyObject* sGetHelpPath (PyObject *self,PyObject *args); - static PyObject* sGetHomePath (PyObject *self,PyObject *args); + static PyObject* sGetParam (PyObject *self, PyObject *args); + static PyObject* sSaveParameter (PyObject *self, PyObject *args); + static PyObject* sGetVersion (PyObject *self, PyObject *args); + static PyObject* sGetConfig (PyObject *self, PyObject *args); + static PyObject* sSetConfig (PyObject *self, PyObject *args); + static PyObject* sDumpConfig (PyObject *self, PyObject *args); + static PyObject* sAddImportType (PyObject *self, PyObject *args); + static PyObject* sChangeImportModule(PyObject *self, PyObject *args); + static PyObject* sGetImportType (PyObject *self, PyObject *args); + static PyObject* sAddExportType (PyObject *self, PyObject *args); + static PyObject* sChangeExportModule(PyObject *self, PyObject *args); + static PyObject* sGetExportType (PyObject *self, PyObject *args); + static PyObject* sGetResourcePath (PyObject *self, PyObject *args); + static PyObject* sGetLibraryPath (PyObject *self, PyObject *args); + static PyObject* sGetTempPath (PyObject *self, PyObject *args); + static PyObject* sGetUserCachePath (PyObject *self, PyObject *args); + static PyObject* sGetUserConfigPath (PyObject *self, PyObject *args); + static PyObject* sGetUserAppDataPath(PyObject *self, PyObject *args); + static PyObject* sGetUserMacroPath (PyObject *self, PyObject *args); + static PyObject* sGetHelpPath (PyObject *self, PyObject *args); + static PyObject* sGetHomePath (PyObject *self, PyObject *args); static PyObject* sLoadFile (PyObject *self,PyObject *args); static PyObject* sOpenDocument (PyObject *self,PyObject *args, PyObject *kwd); diff --git a/src/App/DocumentObjectPyImp.cpp b/src/App/DocumentObjectPyImp.cpp index 7410320ae9..5e160296ad 100644 --- a/src/App/DocumentObjectPyImp.cpp +++ b/src/App/DocumentObjectPyImp.cpp @@ -135,7 +135,7 @@ PyObject* DocumentObjectPy::touch(PyObject * args) Py_Return; } auto prop = getDocumentObjectPtr()->getPropertyByName(propName); - if(!prop) + if(!prop) throw Py::RuntimeError("Property not found"); prop->touch(); Py_Return; @@ -267,12 +267,11 @@ Py::List DocumentObjectPy::getInListRecursive() const for (std::vector::iterator It = list.begin(); It != list.end(); ++It) ret.append(Py::Object((*It)->getPyObject(), true)); - } catch (const Base::Exception& e) { throw Py::IndexError(e.what()); } - return ret; + return ret; } Py::List DocumentObjectPy::getOutList() const diff --git a/src/App/Expression.h b/src/App/Expression.h index 6c77aaef59..88bad3e2b8 100644 --- a/src/App/Expression.h +++ b/src/App/Expression.h @@ -72,7 +72,7 @@ protected: const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const; bool updateElementReference(Expression &e, App::DocumentObject *feature,bool reverse); void importSubNames(Expression &e, const ObjectIdentifier::SubNameMap &subNameMap); - void updateLabelReference(Expression &e, App::DocumentObject *obj, + void updateLabelReference(Expression &e, App::DocumentObject *obj, const std::string &ref, const char *newLabel); void moveCells(Expression &e, const CellAddress &address, int rowCount, int colCount); void offsetCells(Expression &e, int rowOffset, int colOffset); @@ -84,7 +84,7 @@ public: : prop(_prop) , propLink(Base::freecad_dynamic_cast(&prop)) , signaller(_prop,false) - , _changed(0) + , _changed(0) {} ~ExpressionModifier() override = default; @@ -150,7 +150,7 @@ public: ExpressionPtr importSubNames(const std::map &nameMap) const; - ExpressionPtr updateLabelReference(App::DocumentObject *obj, + ExpressionPtr updateLabelReference(App::DocumentObject *obj, const std::string &ref, const char *newLabel) const; ExpressionPtr replaceObject(const App::DocumentObject *parent, @@ -186,7 +186,7 @@ public: bool isSame(const Expression &other, bool checkComment=true) const; - friend ExpressionVisitor; + friend class ExpressionVisitor; protected: virtual bool _isIndexable() const {return false;} @@ -198,10 +198,10 @@ protected: virtual bool _relabeledDocument(const std::string &, const std::string &, ExpressionVisitor &) {return false;} virtual void _importSubNames(const ObjectIdentifier::SubNameMap &) {} virtual void _updateLabelReference(App::DocumentObject *, const std::string &, const char *) {} - virtual bool _renameObjectIdentifier(const std::map &, + virtual bool _renameObjectIdentifier(const std::map &, const ObjectIdentifier &, ExpressionVisitor &) {return false;} virtual void _collectReplacement(std::map &, - const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const + const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const { (void)parent; (void)oldObj; diff --git a/src/App/FeaturePython.h b/src/App/FeaturePython.h index 93261bc6e4..9223a7bf28 100644 --- a/src/App/FeaturePython.h +++ b/src/App/FeaturePython.h @@ -56,12 +56,12 @@ public: std::string getViewProviderName(); PyObject *getPyObject(); - bool getSubObject(App::DocumentObject *&ret, const char *subname, PyObject **pyObj, + bool getSubObject(App::DocumentObject *&ret, const char *subname, PyObject **pyObj, Base::Matrix4D *mat, bool transform, int depth) const; bool getSubObjects(std::vector &ret, int reason) const; - bool getLinkedObject(App::DocumentObject *&ret, bool recurse, + bool getLinkedObject(App::DocumentObject *&ret, bool recurse, Base::Matrix4D *mat, bool transform, int depth) const; ValueT canLinkProperties() const; diff --git a/src/App/ObjectIdentifier.cpp b/src/App/ObjectIdentifier.cpp index 48fe555853..595bf72302 100644 --- a/src/App/ObjectIdentifier.cpp +++ b/src/App/ObjectIdentifier.cpp @@ -23,7 +23,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +# include #endif #include diff --git a/src/App/Path.cpp b/src/App/Path.cpp index e4ea5d71e3..39773c0892 100644 --- a/src/App/Path.cpp +++ b/src/App/Path.cpp @@ -28,12 +28,7 @@ using namespace App; -Path::Path() = default; - Path::Path(const std::vector &PathVector) -:_PathVector(PathVector) + : _PathVector(PathVector) { } - -Path::~Path() = default; - diff --git a/src/App/Path.h b/src/App/Path.h index e354575f76..eb77a65af9 100644 --- a/src/App/Path.h +++ b/src/App/Path.h @@ -25,6 +25,7 @@ #define APP_Path_H #include +#include namespace App @@ -35,17 +36,18 @@ namespace App class AppExport Path { protected: - std::vector _PathVector; + std::vector _PathVector; public: /// Constructor - Path(); - explicit Path(const std::vector & PathVector); + Path() = default; + explicit Path(const std::vector & PathVector); - virtual ~Path(); - - const std::vector & getVector()const{return _PathVector;} + virtual ~Path() = default; + const std::vector & getVector() const { + return _PathVector; + } }; } //namespace App