1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-30 05:02:52 +08:00

Remove unused QtGlobal header

This commit is contained in:
Daniel Nicoletti 2024-09-02 16:16:17 -03:00
parent f5d07959d5
commit c643be3647
52 changed files with 27 additions and 89 deletions

View File

@ -14,7 +14,6 @@
#include <QString> #include <QString>
#include <QTime> #include <QTime>
#include <QVariant> #include <QVariant>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -11,7 +11,6 @@
#include <QList> #include <QList>
#include <QObject> #include <QObject>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -12,7 +12,6 @@
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QVector> #include <QVector>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -7,7 +7,6 @@
#include "xlsxglobal.h" #include "xlsxglobal.h"
#include <QObject> #include <QObject>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -5,8 +5,6 @@
#include "xlsxglobal.h" #include "xlsxglobal.h"
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX
const int XLSX_ROW_MAX = 1048576; const int XLSX_ROW_MAX = 1048576;

View File

@ -7,7 +7,6 @@
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -6,7 +6,6 @@
#include "xlsxabstractsheet.h" #include "xlsxabstractsheet.h"
#include <QStringList> #include <QStringList>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -7,8 +7,6 @@
#include "xlsxchartsheet.h" #include "xlsxchartsheet.h"
#include "xlsxglobal.h" #include "xlsxglobal.h"
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX
class ChartsheetPrivate : public AbstractSheetPrivate class ChartsheetPrivate : public AbstractSheetPrivate

View File

@ -9,7 +9,6 @@
#include <QVariant> #include <QVariant>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -13,7 +13,6 @@
#include <QString> #include <QString>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
class ConditionalFormattingTest; class ConditionalFormattingTest;

View File

@ -9,7 +9,6 @@
#include <QMap> #include <QMap>
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -10,7 +10,6 @@
#include <QString> #include <QString>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
class QXmlStreamReader; class QXmlStreamReader;
class QXmlStreamWriter; class QXmlStreamWriter;

View File

@ -6,7 +6,6 @@
#include "xlsxdatavalidation.h" #include "xlsxdatavalidation.h"
#include <QSharedData> #include <QSharedData>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -11,7 +11,6 @@
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QTime> #include <QTime>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -11,7 +11,6 @@
#include <QImage> #include <QImage>
#include <QObject> #include <QObject>
#include <QVariant> #include <QVariant>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -9,7 +9,6 @@
#include "xlsxworkbook.h" #include "xlsxworkbook.h"
#include <QMap> #include <QMap>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -8,7 +8,6 @@
#include <QList> #include <QList>
#include <QString> #include <QString>
#include <QtGlobal>
class QIODevice; class QIODevice;
class QXmlStreamWriter; class QXmlStreamWriter;

View File

@ -7,7 +7,6 @@
#include <QMap> #include <QMap>
#include <QSet> #include <QSet>
#include <QSharedData> #include <QSharedData>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -13,7 +13,6 @@
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QVariant> #include <QVariant>
#include <QtGlobal>
#if defined(QXlsx_SHAREDLIB) #if defined(QXlsx_SHAREDLIB)
# if defined(QXlsx_EXPORTS) # if defined(QXlsx_EXPORTS)

View File

@ -7,7 +7,6 @@
#include <QIODevice> #include <QIODevice>
#include <QString> #include <QString>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -14,7 +14,6 @@
#include <QStringList> #include <QStringList>
#include <QTime> #include <QTime>
#include <QVariant> #include <QVariant>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -13,7 +13,6 @@
#include <QImage> #include <QImage>
#include <QList> #include <QList>
#include <QSharedPointer> #include <QSharedPointer>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -11,7 +11,6 @@
#include <QSharedPointer> #include <QSharedPointer>
#include <QStringList> #include <QStringList>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -18,7 +18,6 @@
#include <QStringList> #include <QStringList>
#include <QUrl> #include <QUrl>
#include <QVariant> #include <QVariant>
#include <QtGlobal>
class WorksheetTest; class WorksheetTest;

View File

@ -227,23 +227,23 @@ public:
public: public:
CellTable cellTable; CellTable cellTable;
QMap<int, QMap<int, QString>> comments; QHash<int, QHash<int, QString>> comments;
QMap<int, QMap<int, QSharedPointer<XlsxHyperlinkData>>> urlTable; QHash<int, QHash<int, QSharedPointer<XlsxHyperlinkData>>> urlTable;
QList<CellRange> merges; QList<CellRange> merges;
QMap<int, QSharedPointer<XlsxRowInfo>> rowsInfo; QHash<int, QSharedPointer<XlsxRowInfo>> rowsInfo;
QMap<int, QSharedPointer<XlsxColumnInfo>> colsInfo; QHash<int, QSharedPointer<XlsxColumnInfo>> colsInfo;
QMap<int, QSharedPointer<XlsxColumnInfo>> colsInfoHelper; QHash<int, QSharedPointer<XlsxColumnInfo>> colsInfoHelper;
QList<DataValidation> dataValidationsList; QList<DataValidation> dataValidationsList;
QList<ConditionalFormatting> conditionalFormattingList; QList<ConditionalFormatting> conditionalFormattingList;
QMap<int, CellFormula> sharedFormulaMap; // shared formula map QHash<int, CellFormula> sharedFormulaMap; // shared formula map
CellRange dimension; CellRange dimension;
mutable QMap<int, QString> row_spans; mutable QHash<int, QString> row_spans;
QMap<int, double> row_sizes; QHash<int, double> row_sizes;
QMap<int, double> col_sizes; QHash<int, double> col_sizes;
// pagesetup and print settings add by liufeijin 20181028, liufeijin // pagesetup and print settings add by liufeijin 20181028, liufeijin
QString PpaperSize; QString PpaperSize;

View File

@ -7,7 +7,6 @@
#include <QIODevice> #include <QIODevice>
#include <QString> #include <QString>
#include <QtGlobal>
class QZipWriter; class QZipWriter;

View File

@ -6,7 +6,6 @@
#include <QBuffer> #include <QBuffer>
#include <QByteArray> #include <QByteArray>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -5,8 +5,6 @@
#include "xlsxabstractsheet_p.h" #include "xlsxabstractsheet_p.h"
#include "xlsxworkbook.h" #include "xlsxworkbook.h"
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX
AbstractSheetPrivate::AbstractSheetPrivate(AbstractSheet *p, AbstractSheet::CreateFlag flag) AbstractSheetPrivate::AbstractSheetPrivate(AbstractSheet *p, AbstractSheet::CreateFlag flag)

View File

@ -15,7 +15,6 @@
#include <QDateTime> #include <QDateTime>
#include <QDebug> #include <QDebug>
#include <QTime> #include <QTime>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -10,7 +10,6 @@
#include <QString> #include <QString>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -9,7 +9,6 @@
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QVector> #include <QVector>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -7,7 +7,6 @@
#include <QPoint> #include <QPoint>
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -10,7 +10,6 @@
#include <QString> #include <QString>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -12,7 +12,6 @@
#include <QDir> #include <QDir>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -10,7 +10,6 @@
#include <QDebug> #include <QDebug>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -8,7 +8,6 @@
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -5,8 +5,6 @@
#include "xlsxglobal.h" #include "xlsxglobal.h"
#include "xlsxutility_p.h" #include "xlsxutility_p.h"
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX
DateType::DateType() DateType::DateType()

View File

@ -9,7 +9,6 @@
#include <QFile> #include <QFile>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -27,7 +27,6 @@
#include <QPointF> #include <QPointF>
#include <QSharedPointer> #include <QSharedPointer>
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QtGlobal>
/* /*
From Wikipedia: The Open Packaging Conventions (OPC) is a From Wikipedia: The Open Packaging Conventions (OPC) is a

View File

@ -7,7 +7,6 @@
#include <QBuffer> #include <QBuffer>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -12,7 +12,6 @@
#include <QDir> #include <QDir>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -8,7 +8,6 @@
#include <QDataStream> #include <QDataStream>
#include <QDebug> #include <QDebug>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -3,7 +3,6 @@
#include "xlsxmediafile_p.h" #include "xlsxmediafile_p.h"
#include <QCryptographicHash> #include <QCryptographicHash>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -3,7 +3,6 @@
#include "xlsxnumformatparser_p.h" #include "xlsxnumformatparser_p.h"
#include <QString> #include <QString>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -7,7 +7,6 @@
#include <QFile> #include <QFile>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -8,7 +8,6 @@
#include <QDebug> #include <QDebug>
#include <QTextDocument> #include <QTextDocument>
#include <QTextFragment> #include <QTextFragment>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -12,7 +12,6 @@
#include <QFile> #include <QFile>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -3,7 +3,6 @@
#include "xlsxsimpleooxmlfile_p.h" #include "xlsxsimpleooxmlfile_p.h"
#include <QIODevice> #include <QIODevice>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -13,7 +13,6 @@
#include <QMap> #include <QMap>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -20,7 +20,6 @@
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtDebug> #include <QtDebug>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX

View File

@ -39,7 +39,6 @@
#include <QVariant> #include <QVariant>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX
@ -1341,9 +1340,8 @@ void Worksheet::saveToXmlFile(QIODevice *device) const
if (!d->colsInfo.isEmpty()) { if (!d->colsInfo.isEmpty()) {
writer.writeStartElement(QStringLiteral("cols")); writer.writeStartElement(QStringLiteral("cols"));
QMapIterator<int, QSharedPointer<XlsxColumnInfo>> it(d->colsInfo);
while (it.hasNext()) { for (auto it = d->colsInfo.begin(); it != d->colsInfo.end(); ++it) {
it.next();
QSharedPointer<XlsxColumnInfo> col_info = it.value(); QSharedPointer<XlsxColumnInfo> col_info = it.value();
writer.writeStartElement(QStringLiteral("col")); writer.writeStartElement(QStringLiteral("col"));
writer.writeAttribute(QStringLiteral("min"), QString::number(col_info->firstColumn)); writer.writeAttribute(QStringLiteral("min"), QString::number(col_info->firstColumn));
@ -1558,17 +1556,20 @@ void WorksheetPrivate::saveXmlCellData(QXmlStreamWriter &writer,
writer.writeStartElement(QStringLiteral("c")); writer.writeStartElement(QStringLiteral("c"));
writer.writeAttribute(QStringLiteral("r"), cell_pos); writer.writeAttribute(QStringLiteral("r"), cell_pos);
QMap<int, QSharedPointer<XlsxRowInfo>>::ConstIterator rIt;
QMap<int, QSharedPointer<XlsxColumnInfo>>::ConstIterator cIt;
// Style used by the cell, row or col // Style used by the cell, row or col
if (!cell->format().isEmpty()) if (!cell->format().isEmpty()) {
writer.writeAttribute(QStringLiteral("s"), QString::number(cell->format().xfIndex())); writer.writeAttribute(QStringLiteral("s"), QString::number(cell->format().xfIndex()));
else if ((rIt = rowsInfo.constFind(row)) != rowsInfo.constEnd() && !(*rIt)->format.isEmpty()) } else {
auto rIt = rowsInfo.constFind(row);
if (rIt != rowsInfo.constEnd() && !(*rIt)->format.isEmpty()) {
writer.writeAttribute(QStringLiteral("s"), QString::number((*rIt)->format.xfIndex())); writer.writeAttribute(QStringLiteral("s"), QString::number((*rIt)->format.xfIndex()));
else if ((cIt = colsInfoHelper.constFind(col)) != colsInfoHelper.constEnd() && } else {
!(*cIt)->format.isEmpty()) auto cIt = colsInfoHelper.constFind(col);
if (cIt != colsInfoHelper.constEnd() && !(*cIt)->format.isEmpty()) {
writer.writeAttribute(QStringLiteral("s"), QString::number((*cIt)->format.xfIndex())); writer.writeAttribute(QStringLiteral("s"), QString::number((*cIt)->format.xfIndex()));
}
}
}
if (cell->cellType() == Cell::SharedStringType) // 's' if (cell->cellType() == Cell::SharedStringType) // 's'
{ {
@ -1719,15 +1720,10 @@ void WorksheetPrivate::saveXmlHyperlinks(QXmlStreamWriter &writer) const
return; return;
writer.writeStartElement(QStringLiteral("hyperlinks")); writer.writeStartElement(QStringLiteral("hyperlinks"));
QMapIterator<int, QMap<int, QSharedPointer<XlsxHyperlinkData>>> it(urlTable); for (auto it = urlTable.begin(); it != urlTable.end(); ++it) {
while (it.hasNext()) {
it.next();
int row = it.key(); int row = it.key();
QMapIterator<int, QSharedPointer<XlsxHyperlinkData>> it2(it.value());
while (it2.hasNext()) { for (auto it2 = it.value().begin(); it2 != it.value().end(); ++it2) {
it2.next();
int col = it2.key(); int col = it2.key();
QSharedPointer<XlsxHyperlinkData> data = it2.value(); QSharedPointer<XlsxHyperlinkData> data = it2.value();
QString ref = CellReference(row, col).toString(); QString ref = CellReference(row, col).toString();
@ -1787,9 +1783,7 @@ void WorksheetPrivate::splitColsInfo(int colFirst, int colLast)
// we are trying to set "B:D", there should be "A", "B:D", "E:H". // we are trying to set "B:D", there should be "A", "B:D", "E:H".
// This will be more complex if we try to set "C:F" after "B:D". // This will be more complex if we try to set "C:F" after "B:D".
{ {
QMapIterator<int, QSharedPointer<XlsxColumnInfo>> it(colsInfo); for (auto it = colsInfo.begin(); it != colsInfo.end(); ++it) {
while (it.hasNext()) {
it.next();
QSharedPointer<XlsxColumnInfo> info = it.value(); QSharedPointer<XlsxColumnInfo> info = it.value();
if (colFirst > info->firstColumn && colFirst <= info->lastColumn) { if (colFirst > info->firstColumn && colFirst <= info->lastColumn) {
// split the range, // split the range,
@ -1805,9 +1799,7 @@ void WorksheetPrivate::splitColsInfo(int colFirst, int colLast)
} }
} }
{ {
QMapIterator<int, QSharedPointer<XlsxColumnInfo>> it(colsInfo); for (auto it = colsInfo.begin(); it != colsInfo.end(); ++it) {
while (it.hasNext()) {
it.next();
QSharedPointer<XlsxColumnInfo> info = it.value(); QSharedPointer<XlsxColumnInfo> info = it.value();
if (colLast >= info->firstColumn && colLast < info->lastColumn) { if (colLast >= info->firstColumn && colLast < info->lastColumn) {
QSharedPointer<XlsxColumnInfo> info2(new XlsxColumnInfo(*info)); QSharedPointer<XlsxColumnInfo> info2(new XlsxColumnInfo(*info));

View File

@ -5,7 +5,6 @@
#include <private/qzipwriter_p.h> #include <private/qzipwriter_p.h>
#include <QDebug> #include <QDebug>
#include <QtGlobal>
QT_BEGIN_NAMESPACE_XLSX QT_BEGIN_NAMESPACE_XLSX