0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-10-02 11:54:59 +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

@@ -1,32 +1,36 @@
#include <QPrinter>
#include "lrpdfexporter.h"
#include "lrexportersfactory.h"
#include "lrreportengine_p.h"
namespace{
#include <QPrinter>
LimeReport::ReportExporterInterface* createPDFExporter(LimeReport::ReportEnginePrivate* parent){
namespace {
LimeReport::ReportExporterInterface* createPDFExporter(LimeReport::ReportEnginePrivate* parent)
{
return new LimeReport::PDFExporter(parent);
}
bool VARIABLE_IS_NOT_USED registred = LimeReport::ExportersFactory::instance().registerCreator("PDF", LimeReport::ExporterAttribs(QObject::tr("Export to PDF"), "PDFExporter"), createPDFExporter);
bool VARIABLE_IS_NOT_USED registred = LimeReport::ExportersFactory::instance().registerCreator(
"PDF", LimeReport::ExporterAttribs(QObject::tr("Export to PDF"), "PDFExporter"),
createPDFExporter);
}
} // namespace
namespace LimeReport{
namespace LimeReport {
PDFExporter::PDFExporter(ReportEnginePrivate *parent) : QObject(parent), m_reportEngine(parent)
{}
PDFExporter::PDFExporter(ReportEnginePrivate* parent): QObject(parent), m_reportEngine(parent) { }
bool PDFExporter::exportPages(ReportPages pages, const QString &fileName, const QMap<QString, QVariant> &params)
bool PDFExporter::exportPages(ReportPages pages, const QString& fileName,
const QMap<QString, QVariant>& params)
{
Q_UNUSED(params);
if (!fileName.isEmpty()){
if (!fileName.isEmpty()) {
QPrinter printer;
printer.setOutputFileName(fileName);
printer.setOutputFormat(QPrinter::PdfFormat);
if (!pages.isEmpty()){
if (!pages.isEmpty()) {
m_reportEngine->printPages(pages, &printer);
}
m_reportEngine->emitPrintedToPDF(fileName);
@@ -35,4 +39,4 @@ bool PDFExporter::exportPages(ReportPages pages, const QString &fileName, const
return false;
}
}
} // namespace LimeReport

View File

@@ -1,35 +1,28 @@
#ifndef LRPDFEXPORTER_H
#define LRPDFEXPORTER_H
#include <QObject>
#include "lrexporterintf.h"
namespace LimeReport{
#include <QObject>
namespace LimeReport {
class ReportEnginePrivate;
class PDFExporter : public QObject, public ReportExporterInterface
{
class PDFExporter: public QObject, public ReportExporterInterface {
Q_OBJECT
public:
explicit PDFExporter(ReportEnginePrivate *parent = NULL);
explicit PDFExporter(ReportEnginePrivate* parent = NULL);
// ReportExporterInterface interface
bool exportPages(ReportPages pages, const QString &fileName, const QMap<QString, QVariant> &params);
QString exporterName()
{
return "PDF";
}
QString exporterFileExt()
{
return "pdf";
}
QString hint()
{
return tr("Export to PDF");
}
bool exportPages(ReportPages pages, const QString& fileName,
const QMap<QString, QVariant>& params);
QString exporterName() { return "PDF"; }
QString exporterFileExt() { return "pdf"; }
QString hint() { return tr("Export to PDF"); }
private:
ReportEnginePrivate* m_reportEngine;
};
} //namespace LimeReport
} // namespace LimeReport
#endif // LRPDFEXPORTER_H