0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-11-25 08:28:06 +03:00

Define code style and format all source file using clang-format-14

except those placed in 3rdparty directories.
This commit is contained in:
Андрей Лухнов
2024-09-04 17:31:16 +03:00
parent c5b9ac265d
commit 0fca7169d3
285 changed files with 19120 additions and 17875 deletions

View File

@@ -27,18 +27,21 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#include <QString>
#include <QDebug>
#include "lrglobal.h"
#include <QDebug>
#include <QString>
namespace LimeReport {
QString extractClassName(QString className)
{
int startPos=className.lastIndexOf("::");
if(startPos==-1) startPos=0;
else startPos+=2;
return className.right(className.length()-startPos);
int startPos = className.lastIndexOf("::");
if (startPos == -1)
startPos = 0;
else
startPos += 2;
return className.right(className.length() - startPos);
}
bool ReportSettings::suppressAbsentFieldsAndVarsWarnings() const
@@ -46,31 +49,34 @@ bool ReportSettings::suppressAbsentFieldsAndVarsWarnings() const
return m_suppressAbsentFieldsAndVarsWarnings;
}
void ReportSettings::setSuppressAbsentFieldsAndVarsWarnings(bool suppressAbsentFieldsAndVarsWarnings)
void ReportSettings::setSuppressAbsentFieldsAndVarsWarnings(
bool suppressAbsentFieldsAndVarsWarnings)
{
m_suppressAbsentFieldsAndVarsWarnings = suppressAbsentFieldsAndVarsWarnings;
}
QString escapeSimbols(const QString &value)
QString escapeSimbols(const QString& value)
{
QString result = value;
result.replace("\"","\\\"");
result.replace('\n',"\\n");
result.replace("\"", "\\\"");
result.replace('\n', "\\n");
return result;
}
QString replaceHTMLSymbols(const QString &value)
QString replaceHTMLSymbols(const QString& value)
{
QString result = value;
result.replace("<","&lt;");
result.replace(">","&gt;");
result.replace("<", "&lt;");
result.replace(">", "&gt;");
return result;
}
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 1))
QVector<QString> normalizeCaptures(const QRegExp& reg){
QVector<QString> normalizeCaptures(const QRegExp& reg)
{
#else
QVector<QString> normalizeCaptures(const QRegularExpressionMatch &reg){
QVector<QString> normalizeCaptures(const QRegularExpressionMatch& reg)
{
#endif
QVector<QString> result;
foreach (QString cap, reg.capturedTexts()) {
@@ -80,13 +86,14 @@ QVector<QString> normalizeCaptures(const QRegularExpressionMatch &reg){
return result;
}
bool isColorDark(QColor color){
qreal darkness = 1-(0.299*color.red() + 0.587*color.green() + 0.114*color.blue())/255;
if(darkness<0.5){
bool isColorDark(QColor color)
{
qreal darkness = 1 - (0.299 * color.red() + 0.587 * color.green() + 0.114 * color.blue()) / 255;
if (darkness < 0.5) {
return false;
} else {
return true;
}
}
} //namespace LimeReport
} // namespace LimeReport