0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-11-25 00:18: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

@@ -28,6 +28,7 @@
* GNU General Public License for more details. *
****************************************************************************/
#include "lrdataband.h"
#include "lrdesignelementsfactory.h"
#include "lrglobal.h"
@@ -35,56 +36,51 @@ const QString xmlTag = "Data";
const QString xmlTagHeader = "DataHeader";
const QString xmlTagFooter = "DataFooter";
namespace{
namespace {
LimeReport::BaseDesignIntf * createBand(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::DataBand(owner,parent);
LimeReport::BaseDesignIntf* createBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::DataBand(owner, parent);
}
LimeReport::BaseDesignIntf * createHeader(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::DataHeaderBand(owner,parent);
LimeReport::BaseDesignIntf* createHeader(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::DataHeaderBand(owner, parent);
}
LimeReport::BaseDesignIntf * createFooter(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new LimeReport::DataFooterBand(owner,parent);
LimeReport::BaseDesignIntf* createFooter(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::DataFooterBand(owner, parent);
}
bool VARIABLE_IS_NOT_USED registred = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTag,
LimeReport::ItemAttribs(QObject::tr("Data"),LimeReport::Const::bandTAG),
createBand
);
bool VARIABLE_IS_NOT_USED registredHeader = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagHeader,
LimeReport::ItemAttribs(QObject::tr("DataHeader"),LimeReport::Const::bandTAG),
createHeader
);
bool VARIABLE_IS_NOT_USED registredFooter = LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagFooter,
LimeReport::ItemAttribs(QObject::tr("DataFooter"),LimeReport::Const::bandTAG),
createFooter
);
xmlTag, LimeReport::ItemAttribs(QObject::tr("Data"), LimeReport::Const::bandTAG), createBand);
bool VARIABLE_IS_NOT_USED registredHeader
= LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagHeader,
LimeReport::ItemAttribs(QObject::tr("DataHeader"), LimeReport::Const::bandTAG),
createHeader);
bool VARIABLE_IS_NOT_USED registredFooter
= LimeReport::DesignElementsFactory::instance().registerCreator(
xmlTagFooter,
LimeReport::ItemAttribs(QObject::tr("DataFooter"), LimeReport::Const::bandTAG),
createFooter);
}
} // namespace
namespace LimeReport {
DataBand::DataBand(QObject *owner, QGraphicsItem *parent)
: DataBandDesignIntf(LimeReport::BandDesignIntf::Data,xmlTag,owner,parent) {
setBandTypeText(tr("Data"));
setFixedPos(false);
setMarkerColor(bandColor());
}
bool DataBand::isUnique() const
DataBand::DataBand(QObject* owner, QGraphicsItem* parent):
DataBandDesignIntf(LimeReport::BandDesignIntf::Data, xmlTag, owner, parent)
{
return false;
setBandTypeText(tr("Data"));
setFixedPos(false);
setMarkerColor(bandColor());
}
QColor DataBand::bandColor() const
{
return QColor(Qt::darkGreen);
}
bool DataBand::isUnique() const { return false; }
void DataBand::preparePopUpMenu(QMenu &menu)
QColor DataBand::bandColor() const { return QColor(Qt::darkGreen); }
void DataBand::preparePopUpMenu(QMenu& menu)
{
BandDesignIntf::preparePopUpMenu(menu);
@@ -111,52 +107,49 @@ void DataBand::preparePopUpMenu(QMenu &menu)
currAction = menu.addAction(tr("Start new page"));
currAction->setCheckable(true);
currAction->setChecked(startNewPage());
}
void DataBand::processPopUpAction(QAction *action)
void DataBand::processPopUpAction(QAction* action)
{
BandDesignIntf::processPopUpAction(action);
if (action->text().compare(tr("Keep footer together")) == 0){
setProperty("keepFooterTogether",action->isChecked());
if (action->text().compare(tr("Keep footer together")) == 0) {
setProperty("keepFooterTogether", action->isChecked());
}
if (action->text().compare(tr("Keep subdetail together")) == 0){
setProperty("keepSubdetailTogether",action->isChecked());
if (action->text().compare(tr("Keep subdetail together")) == 0) {
setProperty("keepSubdetailTogether", action->isChecked());
}
if (action->text().compare(tr("Slice last row")) == 0){
setProperty("sliceLastRow",action->isChecked());
if (action->text().compare(tr("Slice last row")) == 0) {
setProperty("sliceLastRow", action->isChecked());
}
if (action->text().compare(tr("Use alternate background color")) == 0){
setProperty("useAlternateBackgroundColor",action->isChecked());
if (action->text().compare(tr("Use alternate background color")) == 0) {
setProperty("useAlternateBackgroundColor", action->isChecked());
}
if (action->text().compare(tr("Start new page")) == 0){
setProperty("startNewPage",action->isChecked());
if (action->text().compare(tr("Start new page")) == 0) {
setProperty("startNewPage", action->isChecked());
}
if (action->text().compare(tr("Start from new page")) == 0){
setProperty("startFromNewPage",action->isChecked());
if (action->text().compare(tr("Start from new page")) == 0) {
setProperty("startFromNewPage", action->isChecked());
}
}
BaseDesignIntf *DataBand::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
BaseDesignIntf* DataBand::createSameTypeItem(QObject* owner, QGraphicsItem* parent)
{
return new DataBand(owner,parent);
return new DataBand(owner, parent);
}
DataHeaderBand::DataHeaderBand(QObject *owner, QGraphicsItem *parent)
:BandDesignIntf(BandDesignIntf::DataHeader,xmlTagHeader,owner,parent)
DataHeaderBand::DataHeaderBand(QObject* owner, QGraphicsItem* parent):
BandDesignIntf(BandDesignIntf::DataHeader, xmlTagHeader, owner, parent)
{
setBandTypeText(tr("DataHeader"));
setMarkerColor(bandColor());
}
void DataHeaderBand::preparePopUpMenu(QMenu &menu)
void DataHeaderBand::preparePopUpMenu(QMenu& menu)
{
BandDesignIntf::preparePopUpMenu(menu);
QAction* currAction = menu.addAction(tr("Reprint on each page"));
@@ -172,30 +165,30 @@ void DataHeaderBand::preparePopUpMenu(QMenu &menu)
currAction->setChecked(printAlways());
}
void DataHeaderBand::processPopUpAction(QAction *action)
void DataHeaderBand::processPopUpAction(QAction* action)
{
BandDesignIntf::processPopUpAction(action);
if (action->text().compare(tr("Reprint on each page")) == 0){
setProperty("reprintOnEachPage",action->isChecked());
if (action->text().compare(tr("Reprint on each page")) == 0) {
setProperty("reprintOnEachPage", action->isChecked());
}
if (action->text().compare(tr("Repeat on each row")) == 0){
setProperty("repeatOnEachRow",action->isChecked());
if (action->text().compare(tr("Repeat on each row")) == 0) {
setProperty("repeatOnEachRow", action->isChecked());
}
if (action->text().compare(tr("Print always")) == 0){
setProperty("printAlways",action->isChecked());
if (action->text().compare(tr("Print always")) == 0) {
setProperty("printAlways", action->isChecked());
}
}
DataFooterBand::DataFooterBand(QObject *owner, QGraphicsItem *parent)
:BandDesignIntf(BandDesignIntf::DataFooter,xmlTagFooter,owner,parent)
DataFooterBand::DataFooterBand(QObject* owner, QGraphicsItem* parent):
BandDesignIntf(BandDesignIntf::DataFooter, xmlTagFooter, owner, parent)
{
setBandTypeText(tr("DataFooter"));
setMarkerColor(bandColor());
}
void DataFooterBand::preparePopUpMenu(QMenu &menu)
void DataFooterBand::preparePopUpMenu(QMenu& menu)
{
BandDesignIntf::preparePopUpMenu(menu);
QAction* currAction = menu.addAction(tr("Print always"));
@@ -203,13 +196,12 @@ void DataFooterBand::preparePopUpMenu(QMenu &menu)
currAction->setChecked(printAlways());
}
void DataFooterBand::processPopUpAction(QAction *action)
void DataFooterBand::processPopUpAction(QAction* action)
{
BandDesignIntf::processPopUpAction(action);
if (action->text().compare(tr("Print always")) == 0){
setProperty("printAlways",action->isChecked());
if (action->text().compare(tr("Print always")) == 0) {
setProperty("printAlways", action->isChecked());
}
}
}
} // namespace LimeReport