[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2023-09-12 13:03:02 +00:00
committed by WandererFan
parent c469601f95
commit 222a2520b1
435 changed files with 2669 additions and 2645 deletions

View File

@@ -61,7 +61,7 @@ public:
: Py::ExtensionModule<Module>("SpreadsheetGui")
{
add_varargs_method("open", &Module::open);
initialize("This module is the SpreadsheetGui module.");// register with Python
initialize("This module is the SpreadsheetGui module."); // register with Python
}
private:
@@ -98,7 +98,7 @@ PyObject* initModule()
return Base::Interpreter().addModule(new Module);
}
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
/* Python entry */
PyMOD_INIT_FUNC(SpreadsheetGui)

View File

@@ -161,7 +161,7 @@ void DlgBindSheet::accept()
try {
const char* ref = ui->comboBox->itemData(ui->comboBox->currentIndex())
.toByteArray()
.constData();// clazy:exclude=returning-data-from-temporary
.constData(); // clazy:exclude=returning-data-from-temporary
auto obj = sheet;
if (ref[0]) {
const char* sep = strchr(ref, '#');

View File

@@ -55,6 +55,6 @@ private:
Ui::DlgBindSheet* ui;
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// DLG_BINDSHEET_H
#endif // DLG_BINDSHEET_H

View File

@@ -53,6 +53,6 @@ private:
std::unique_ptr<Ui_DlgSettings> ui;
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// SPREADSHEETGUI_DLGSETTINGSIMP_H
#endif // SPREADSHEETGUI_DLGSETTINGSIMP_H

View File

@@ -58,6 +58,6 @@ private:
Ui::DlgSheetConf* ui;
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// DLG_SHEETCONF_H
#endif // DLG_SHEETCONF_H

View File

@@ -51,7 +51,7 @@ bool LineEdit::eventFilter(QObject* object, QEvent* event)
if (completerActive()) {
hideCompleter();
event->accept();
return true;// To make sure this tab press doesn't do anything else
return true; // To make sure this tab press doesn't do anything else
}
else {
lastKeyPressed = keyEvent->key();
@@ -59,7 +59,7 @@ bool LineEdit::eventFilter(QObject* object, QEvent* event)
}
}
}
return false;// We don't usually actually "handle" the tab event, we just keep track of it
return false; // We don't usually actually "handle" the tab event, we just keep track of it
}
bool LineEdit::event(QEvent* event)

View File

@@ -50,6 +50,6 @@ private:
Qt::KeyboardModifiers lastModifiers;
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// LINEEDIT_H
#endif // LINEEDIT_H

View File

@@ -31,7 +31,7 @@
#pragma warning(disable : 4005)
#pragma warning(disable : 4251)
#pragma warning(disable : 4503)
#pragma warning(disable : 4786)// specifier longer then 255 chars
#pragma warning(disable : 4786) // specifier longer then 255 chars
#endif
#ifdef _PreComp_
@@ -51,6 +51,6 @@
#include <Gui/QtAll.h>
#endif
#endif//_PreComp_
#endif //_PreComp_
#endif// SPREADSHEET_PRECOMPILED_H
#endif // SPREADSHEET_PRECOMPILED_H

View File

@@ -77,6 +77,6 @@ private:
bool aliasOk;
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// PROPERTIESDIALOG_H
#endif // PROPERTIESDIALOG_H

View File

@@ -101,7 +101,7 @@ QVariant formatCellDisplay(QString value, const Cell* cell)
}
return QVariant(value);
}
}// namespace
} // namespace
QVariant SheetModel::data(const QModelIndex& index, int role) const
{
@@ -258,7 +258,7 @@ QVariant SheetModel::data(const QModelIndex& index, int role) const
case Qt::ForegroundRole: {
return QColor(0,
0,
255.0);// TODO: Remove this hardcoded color, replace with preference
255.0); // TODO: Remove this hardcoded color, replace with preference
}
case Qt::TextAlignmentRole: {
qtAlignment = Qt::AlignHCenter | Qt::AlignVCenter;

View File

@@ -67,6 +67,6 @@ private:
QColor negativeFgColor;
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// SHEETMODEL_H
#endif // SHEETMODEL_H

View File

@@ -897,7 +897,7 @@ void SheetTableView::finishEditWithMove(int keyPressed,
case Qt::Key_Left:
if (targetColumn == 0) {
break;// Nothing to do, we're already in the first column
break; // Nothing to do, we're already in the first column
}
if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) {
targetColumn--;
@@ -907,13 +907,14 @@ void SheetTableView::finishEditWithMove(int keyPressed,
scanForRegionBoundary(targetRow, targetColumn, 0, -1);
}
else {
targetColumn--;// Unrecognized modifier combination: default to just moving one cell
targetColumn--; // Unrecognized modifier combination: default to just moving one
// cell
}
tabCounter = 0;
break;
case Qt::Key_Right:
if (targetColumn >= this->model()->columnCount() - 1) {
break;// Nothing to do, we're already in the last column
break; // Nothing to do, we're already in the last column
}
if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) {
targetColumn += colSpan;
@@ -924,13 +925,13 @@ void SheetTableView::finishEditWithMove(int keyPressed,
}
else {
targetColumn +=
colSpan;// Unrecognized modifier combination: default to just moving one cell
colSpan; // Unrecognized modifier combination: default to just moving one cell
}
tabCounter = 0;
break;
case Qt::Key_Up:
if (targetRow == 0) {
break;// Nothing to do, we're already in the first column
break; // Nothing to do, we're already in the first column
}
if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) {
targetRow--;
@@ -940,13 +941,13 @@ void SheetTableView::finishEditWithMove(int keyPressed,
scanForRegionBoundary(targetRow, targetColumn, -1, 0);
}
else {
targetRow--;// Unrecognized modifier combination: default to just moving one cell
targetRow--; // Unrecognized modifier combination: default to just moving one cell
}
tabCounter = 0;
break;
case Qt::Key_Down:
if (targetRow >= this->model()->rowCount() - 1) {
break;// Nothing to do, we're already in the last row
break; // Nothing to do, we're already in the last row
}
if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) {
targetRow += rowSpan;
@@ -957,7 +958,7 @@ void SheetTableView::finishEditWithMove(int keyPressed,
}
else {
targetRow +=
rowSpan;// Unrecognized modifier combination: default to just moving one cell
rowSpan; // Unrecognized modifier combination: default to just moving one cell
}
tabCounter = 0;
break;

View File

@@ -128,6 +128,6 @@ protected:
std::set<App::CellAddress> spanChanges;
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// SHEETTABLEVIEW_H
#endif // SHEETTABLEVIEW_H

View File

@@ -87,4 +87,4 @@ QAccessibleInterface* SheetTableViewAccessibleInterface::ifactory(const QString&
}
return nullptr;
}
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui

View File

@@ -54,6 +54,6 @@ public:
static QAccessibleInterface* ifactory(const QString& key, QObject* obj);
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// SHEETTABLEVIEW_INTERFACE_H
#endif // SHEETTABLEVIEW_INTERFACE_H

View File

@@ -63,6 +63,6 @@ private:
Spreadsheet::Sheet* sheet;
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// SPREADSHEETDELEGATE_H
#endif // SPREADSHEETDELEGATE_H

View File

@@ -470,10 +470,10 @@ void SheetView::aliasChanged(const QString& text)
static auto originalStylesheet = ui->cellAlias->styleSheet();
QString warningColor;
if (qApp->styleSheet().contains(QLatin1String("dark"), Qt::CaseInsensitive)) {
warningColor = QLatin1String("rgb(255,90,90)");// Light red for dark mode
warningColor = QLatin1String("rgb(255,90,90)"); // Light red for dark mode
}
else {
warningColor = QLatin1String("rgb(200,0,0)");// Dark red for light mode
warningColor = QLatin1String("rgb(200,0,0)"); // Dark red for light mode
}
if (!text.isEmpty() && !sheet->isValidAlias(Base::Tools::toStdString(text))) {

View File

@@ -42,7 +42,7 @@ namespace App
{
class DocumentObject;
class Property;
}// namespace App
} // namespace App
namespace Ui
{
@@ -167,6 +167,6 @@ protected:
Gui::MDIViewPy base;
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// SpreadsheetView_H
#endif // SpreadsheetView_H

View File

@@ -177,4 +177,4 @@ PROPERTY_SOURCE_TEMPLATE(SpreadsheetGui::ViewProviderSheetPython, SpreadsheetGui
// explicit template instantiation
template class SpreadsheetGuiExport ViewProviderPythonFeatureT<ViewProviderSheet>;
}// namespace Gui
} // namespace Gui

View File

@@ -94,7 +94,7 @@ private:
using ViewProviderSheetPython = Gui::ViewProviderPythonFeatureT<ViewProviderSheet>;
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// SPREADSHEET_ViewProviderSpreadsheet_H
#endif // SPREADSHEET_ViewProviderSpreadsheet_H

View File

@@ -46,7 +46,7 @@ using namespace App;
using namespace SpreadsheetGui;
using namespace Spreadsheet;
#if 0// needed for Qt's lupdate utility
#if 0 // needed for Qt's lupdate utility
qApp->translate("Workbench", "Spreadsheet");
qApp->translate("Workbench", "&Spreadsheet");
qApp->translate("Workbench", "&Alignment");

View File

@@ -66,7 +66,7 @@ protected:
Gui::ToolBarItem* setupCommandBars() const override;
};
}// namespace SpreadsheetGui
} // namespace SpreadsheetGui
#endif// SPREADSHEET_WORKBENCH_H
#endif // SPREADSHEET_WORKBENCH_H