From 47c2e77ebfda83cdc1b7b98a4149fdecff045034 Mon Sep 17 00:00:00 2001 From: Uwe Date: Sun, 31 Jul 2022 17:14:43 +0200 Subject: [PATCH] [App] [skip CI] Document: some .clang style fixes - for better readability --- src/App/Document.cpp | 62 +++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 0a44e45365..e2ab951fc1 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -1541,35 +1541,32 @@ Document::Document(const char *name) d->DocumentPythonObject = Py::Object(new DocumentPy(this), true); #ifdef FC_LOGUPDATECHAIN - Console().Log("+App::Document: %p\n",this); + Console().Log("+App::Document: %p\n", this); #endif std::string CreationDateString = Base::TimeInfo::currentDateTimeString(); - std::string Author = App::GetApplication().GetParameterGroupByPath - ("User parameter:BaseApp/Preferences/Document")->GetASCII("prefAuthor",""); - std::string AuthorComp = App::GetApplication().GetParameterGroupByPath - ("User parameter:BaseApp/Preferences/Document")->GetASCII("prefCompany",""); - ADD_PROPERTY_TYPE(Label,("Unnamed"),0,Prop_None,"The name of the document"); - ADD_PROPERTY_TYPE(FileName,(""),0,PropertyType(Prop_Transient|Prop_ReadOnly),"The path to the file where the document is saved to"); - ADD_PROPERTY_TYPE(CreatedBy,(Author.c_str()),0,Prop_None,"The creator of the document"); - ADD_PROPERTY_TYPE(CreationDate,(CreationDateString.c_str()),0,Prop_ReadOnly,"Date of creation"); - ADD_PROPERTY_TYPE(LastModifiedBy,(""),0,Prop_None,0); - ADD_PROPERTY_TYPE(LastModifiedDate,("Unknown"),0,Prop_ReadOnly,"Date of last modification"); - ADD_PROPERTY_TYPE(Company,(AuthorComp.c_str()),0,Prop_None,"Additional tag to save the name of the company"); - ADD_PROPERTY_TYPE(Comment,(""),0,Prop_None,"Additional tag to save a comment"); - ADD_PROPERTY_TYPE(Meta,(),0,Prop_None,"Map with additional meta information"); - ADD_PROPERTY_TYPE(Material,(),0,Prop_None,"Map with material properties"); + std::string Author = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Document")->GetASCII("prefAuthor", ""); + std::string AuthorComp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Document")->GetASCII("prefCompany", ""); + ADD_PROPERTY_TYPE(Label, ("Unnamed"), 0, Prop_None, "The name of the document"); + ADD_PROPERTY_TYPE(FileName, (""), 0, PropertyType(Prop_Transient | Prop_ReadOnly), "The path to the file where the document is saved to"); + ADD_PROPERTY_TYPE(CreatedBy, (Author.c_str()), 0, Prop_None, "The creator of the document"); + ADD_PROPERTY_TYPE(CreationDate, (CreationDateString.c_str()), 0, Prop_ReadOnly, "Date of creation"); + ADD_PROPERTY_TYPE(LastModifiedBy, (""), 0, Prop_None, 0); + ADD_PROPERTY_TYPE(LastModifiedDate, ("Unknown"), 0, Prop_ReadOnly, "Date of last modification"); + ADD_PROPERTY_TYPE(Company, (AuthorComp.c_str()), 0, Prop_None, "Additional tag to save the name of the company"); + ADD_PROPERTY_TYPE(Comment, (""), 0, Prop_None, "Additional tag to save a comment"); + ADD_PROPERTY_TYPE(Meta, (), 0, Prop_None, "Map with additional meta information"); + ADD_PROPERTY_TYPE(Material, (), 0, Prop_None, "Map with material properties"); // create the uuid for the document Base::Uuid id; - ADD_PROPERTY_TYPE(Id,(""),0,Prop_None,"ID of the document"); - ADD_PROPERTY_TYPE(Uid,(id),0,Prop_ReadOnly,"UUID of the document"); + ADD_PROPERTY_TYPE(Id, (""), 0, Prop_None, "ID of the document"); + ADD_PROPERTY_TYPE(Uid, (id), 0, Prop_ReadOnly, "UUID of the document"); // license stuff - ADD_PROPERTY_TYPE(License,("CC-BY 3.0"),0,Prop_None,"License string of the Item"); - ADD_PROPERTY_TYPE(LicenseURL,("https://creativecommons.org/licenses/by/3.0/"),0,Prop_None,"URL to the license text/contract"); + ADD_PROPERTY_TYPE(License, ("CC-BY 3.0"), 0, Prop_None, "License string of the Item"); + ADD_PROPERTY_TYPE(LicenseURL, ("https://creativecommons.org/licenses/by/3.0/"), 0, Prop_None, "URL to the license text/contract"); // license stuff - int licenseId = App::GetApplication().GetParameterGroupByPath - ("User parameter:BaseApp/Preferences/Document")->GetInt("prefLicenseType",0); + int licenseId = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Document")->GetInt("prefLicenseType", 0); std::string license; std::string licenseUrl; switch (licenseId) { @@ -1614,21 +1611,20 @@ Document::Document(const char *name) break; } - licenseUrl = App::GetApplication().GetParameterGroupByPath - ("User parameter:BaseApp/Preferences/Document")->GetASCII("prefLicenseUrl", licenseUrl.c_str()); + licenseUrl = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Document")->GetASCII("prefLicenseUrl", licenseUrl.c_str()); - ADD_PROPERTY_TYPE(License,(license.c_str()),0,Prop_None,"License string of the Item"); - ADD_PROPERTY_TYPE(LicenseURL,(licenseUrl.c_str()),0,Prop_None,"URL to the license text/contract"); - ADD_PROPERTY_TYPE(ShowHidden,(false), 0,PropertyType(Prop_None), - "Whether to show hidden object items in the tree view"); + ADD_PROPERTY_TYPE(License, (license.c_str()), 0, Prop_None, "License string of the Item"); + ADD_PROPERTY_TYPE(LicenseURL, (licenseUrl.c_str()), 0, Prop_None, "URL to the license text/contract"); + ADD_PROPERTY_TYPE(ShowHidden, (false), 0, PropertyType(Prop_None), + "Whether to show hidden object items in the tree view"); // this creates and sets 'TransientDir' in onChanged() - ADD_PROPERTY_TYPE(TransientDir,(""),0,PropertyType(Prop_Transient|Prop_ReadOnly), - "Transient directory, where the files live while the document is open"); - ADD_PROPERTY_TYPE(Tip,(nullptr),0,PropertyType(Prop_Transient), - "Link of the tip object of the document"); - ADD_PROPERTY_TYPE(TipName,(""),0,PropertyType(Prop_Hidden|Prop_ReadOnly), - "Link of the tip object of the document"); + ADD_PROPERTY_TYPE(TransientDir, (""), 0, PropertyType(Prop_Transient | Prop_ReadOnly), + "Transient directory, where the files live while the document is open"); + ADD_PROPERTY_TYPE(Tip, (nullptr), 0, PropertyType(Prop_Transient), + "Link of the tip object of the document"); + ADD_PROPERTY_TYPE(TipName, (""), 0, PropertyType(Prop_Hidden | Prop_ReadOnly), + "Link of the tip object of the document"); Uid.touch(); }