diff --git a/Copycat/Copycat.pro b/Copycat/Copycat.pro index 989a628..55af62e 100644 --- a/Copycat/Copycat.pro +++ b/Copycat/Copycat.pro @@ -1,8 +1,5 @@ -# # Copycat.pro -# -# QXlsx, MIT License, https://github.com/QtExcel/QXlsx -# +# QXlsx https://github.com/QtExcel/QXlsx TARGET = Copycat TEMPLATE = app diff --git a/Copycat/XlsxTab.cpp b/Copycat/XlsxTab.cpp index 8c141af..b30895a 100644 --- a/Copycat/XlsxTab.cpp +++ b/Copycat/XlsxTab.cpp @@ -95,7 +95,7 @@ bool XlsxTab::setSheet() CellLocation cl = clList.at(ic); //////////////////////////////////////////////////////////////////// - // First cell of tableWidget is 0. + // First cell index of tableWidget is 0. // But first cell of Qxlsx document is 1. int row = cl.row - 1; int col = cl.col - 1; @@ -117,45 +117,9 @@ bool XlsxTab::setSheet() QString str; Cell::CellType cType = cl.cell->cellType(); - // [dev54] - if ( cType == Cell::DateType ) - { - QString strValue; - QString strDate; - QString strTime; - bool isSetTime = false; + // qDebug() << "(r,c) = " << cl.row << cl.col << var.toString() ; - QDateTime datetimeValue = var.toDateTime(); - - QTime timeValue = datetimeValue.time(); - if ( timeValue.isValid() ) - { - strTime = timeValue.toString(); - - strValue.append( strTime ); - - isSetTime = true; - } - - QDate dateValue = datetimeValue.date(); - if ( ! dateValue.isNull() ) - { - strDate = dateValue.toString(); - - if (isSetTime) - strValue.append( " " ); - - strValue.append( strDate ); - } - - - str = strValue; - - } - else - { - str = var.toString(); - } + str = var.toString(); //////////////////////////////////////////////////////////////////// // set text diff --git a/QXlsx/QXlsx.pri b/QXlsx/QXlsx.pri index 2548242..dabea59 100644 --- a/QXlsx/QXlsx.pri +++ b/QXlsx/QXlsx.pri @@ -93,7 +93,8 @@ $${QXLSX_HEADERPATH}xlsxworksheet.h \ $${QXLSX_HEADERPATH}xlsxworksheet_p.h \ $${QXLSX_HEADERPATH}xlsxzipreader_p.h \ $${QXLSX_HEADERPATH}xlsxzipwriter_p.h \ -$${QXLSX_HEADERPATH}xlsxcelllocation.h +$${QXLSX_HEADERPATH}xlsxcelllocation.h \ +$${QXLSX_HEADERPATH}xlsxdatetype.h SOURCES += \ $${QXLSX_SOURCEPATH}xlsxabstractooxmlfile.cpp \ @@ -127,7 +128,8 @@ $${QXLSX_SOURCEPATH}xlsxworkbook.cpp \ $${QXLSX_SOURCEPATH}xlsxworksheet.cpp \ $${QXLSX_SOURCEPATH}xlsxzipreader.cpp \ $${QXLSX_SOURCEPATH}xlsxzipwriter.cpp \ -$${QXLSX_SOURCEPATH}xlsxcelllocation.cpp +$${QXLSX_SOURCEPATH}xlsxcelllocation.cpp \ +$${QXLSX_SOURCEPATH}xlsxdatetype.cpp ###################################################################### diff --git a/QXlsx/header/xlsxabstractooxmlfile.h b/QXlsx/header/xlsxabstractooxmlfile.h index 0093fbf..f45ec90 100644 --- a/QXlsx/header/xlsxabstractooxmlfile.h +++ b/QXlsx/header/xlsxabstractooxmlfile.h @@ -3,9 +3,6 @@ #ifndef QXLSX_XLSXABSTRACTOOXMLFILE_H #define QXLSX_XLSXABSTRACTOOXMLFILE_H -#include -#include - #include "xlsxglobal.h" QT_BEGIN_NAMESPACE_XLSX diff --git a/QXlsx/header/xlsxabstractooxmlfile_p.h b/QXlsx/header/xlsxabstractooxmlfile_p.h index 0f670d1..30fea98 100644 --- a/QXlsx/header/xlsxabstractooxmlfile_p.h +++ b/QXlsx/header/xlsxabstractooxmlfile_p.h @@ -3,11 +3,11 @@ #ifndef XLSXOOXMLFILE_P_H #define XLSXOOXMLFILE_P_H +#include "xlsxglobal.h" + #include "xlsxabstractooxmlfile.h" #include "xlsxrelationships_p.h" -#include - QT_BEGIN_NAMESPACE_XLSX class AbstractOOXmlFilePrivate @@ -15,11 +15,11 @@ class AbstractOOXmlFilePrivate Q_DECLARE_PUBLIC(AbstractOOXmlFile) public: - AbstractOOXmlFilePrivate(AbstractOOXmlFile *q, AbstractOOXmlFile::CreateFlag flag); + AbstractOOXmlFilePrivate(AbstractOOXmlFile* q, AbstractOOXmlFile::CreateFlag flag); virtual ~AbstractOOXmlFilePrivate(); public: - QString filePathInPackage;//such as "xl/worksheets/sheet1.xml" + QString filePathInPackage; //such as "xl/worksheets/sheet1.xml" Relationships *relationships; AbstractOOXmlFile::CreateFlag flag; diff --git a/QXlsx/header/xlsxabstractsheet.h b/QXlsx/header/xlsxabstractsheet.h index 9410e00..e17e64b 100644 --- a/QXlsx/header/xlsxabstractsheet.h +++ b/QXlsx/header/xlsxabstractsheet.h @@ -3,12 +3,7 @@ #ifndef XLSXABSTRACTSHEET_H #define XLSXABSTRACTSHEET_H -#include -#include -#include -#include -#include - +#include "xlsxglobal.h" #include "xlsxabstractooxmlfile.h" QT_BEGIN_NAMESPACE_XLSX diff --git a/QXlsx/header/xlsxabstractsheet_p.h b/QXlsx/header/xlsxabstractsheet_p.h index d28e54f..9594b3f 100644 --- a/QXlsx/header/xlsxabstractsheet_p.h +++ b/QXlsx/header/xlsxabstractsheet_p.h @@ -1,46 +1,14 @@ -/**************************************************************************** -** Copyright (c) 2013-2014 Debao Zhang -** All right reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining -** a copy of this software and associated documentation files (the -** "Software"), to deal in the Software without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Software, and to -** permit persons to whom the Software is furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -****************************************************************************/ +// + #ifndef XLSXABSTRACTSHEET_P_H #define XLSXABSTRACTSHEET_P_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt Xlsx API. It exists for the convenience -// of the Qt Xlsx. This header file may change from -// version to version without notice, or even be removed. -// -// We mean it. -// - #include #include #include #include "xlsxglobal.h" + #include "xlsxabstractsheet.h" #include "xlsxabstractooxmlfile_p.h" @@ -63,4 +31,5 @@ public: }; QT_END_NAMESPACE_XLSX + #endif // XLSXABSTRACTSHEET_P_H diff --git a/QXlsx/header/xlsxcell.h b/QXlsx/header/xlsxcell.h index cac78d8..c9edccc 100644 --- a/QXlsx/header/xlsxcell.h +++ b/QXlsx/header/xlsxcell.h @@ -6,7 +6,12 @@ #include #include +#include +#include #include +#include +#include +#include #include "xlsxglobal.h" #include "xlsxformat.h" @@ -62,7 +67,8 @@ public: CellFormula formula() const; bool isDateTime() const; - QDateTime dateTime() const; + // QDateTime dateTime() const; + QVariant dateTime() const; bool isRichString() const; diff --git a/QXlsx/header/xlsxcellformula.h b/QXlsx/header/xlsxcellformula.h index 9c0a4f8..a29e1a7 100644 --- a/QXlsx/header/xlsxcellformula.h +++ b/QXlsx/header/xlsxcellformula.h @@ -4,6 +4,7 @@ #define QXLSX_XLSXCELLFORMULA_H #include "xlsxglobal.h" + #include class QXmlStreamWriter; diff --git a/QXlsx/header/xlsxcellformula_p.h b/QXlsx/header/xlsxcellformula_p.h index 6aeddc9..bc87823 100644 --- a/QXlsx/header/xlsxcellformula_p.h +++ b/QXlsx/header/xlsxcellformula_p.h @@ -1,41 +1,8 @@ -/**************************************************************************** -** Copyright (c) 2013-2014 Debao Zhang -** All right reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining -** a copy of this software and associated documentation files (the -** "Software"), to deal in the Software without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Software, and to -** permit persons to whom the Software is furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -****************************************************************************/ +// + #ifndef XLSXCELLFORMULA_P_H #define XLSXCELLFORMULA_P_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt Xlsx API. It exists for the convenience -// of the Qt Xlsx. This header file may change from -// version to version without notice, or even be removed. -// -// We mean it. -// - #include "xlsxglobal.h" #include "xlsxcellformula.h" #include "xlsxcellrange.h" diff --git a/QXlsx/header/xlsxcelllocation.h b/QXlsx/header/xlsxcelllocation.h index 33717af..67b7464 100644 --- a/QXlsx/header/xlsxcelllocation.h +++ b/QXlsx/header/xlsxcelllocation.h @@ -1,14 +1,5 @@ -//-------------------------------------------------------------------- -// -// QXlsx -// MIT License -// https://github.com/j2doll/QXlsx -// -// QtXlsx -// https://github.com/dbzhang800/QtXlsxWriter -// http://qtxlsx.debao.me/ -// MIT License // + #ifndef CELL_LOCATION_H #define CELL_LOCATION_H diff --git a/QXlsx/header/xlsxcellrange.h b/QXlsx/header/xlsxcellrange.h index 0cae3a0..5f0996b 100644 --- a/QXlsx/header/xlsxcellrange.h +++ b/QXlsx/header/xlsxcellrange.h @@ -1,4 +1,5 @@ // xlsxcellrange.h + #ifndef QXLSX_XLSXCELLRANGE_H #define QXLSX_XLSXCELLRANGE_H diff --git a/QXlsx/header/xlsxcolor_p.h b/QXlsx/header/xlsxcolor_p.h index 6d0f725..2ee3041 100644 --- a/QXlsx/header/xlsxcolor_p.h +++ b/QXlsx/header/xlsxcolor_p.h @@ -37,18 +37,19 @@ // We mean it. // -#include "xlsxglobal.h" #include #include +#include "xlsxglobal.h" + class QXmlStreamWriter; class QXmlStreamReader; -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class Styles; -class XlsxColor +class XlsxColor { public: explicit XlsxColor(const QColor &color = QColor()); @@ -85,7 +86,7 @@ private: QDebug operator<<(QDebug dbg, const XlsxColor &c); #endif -} // namespace QXlsx +QT_END_NAMESPACE_XLSX Q_DECLARE_METATYPE(QXlsx::XlsxColor) diff --git a/QXlsx/header/xlsxdatetype.h b/QXlsx/header/xlsxdatetype.h new file mode 100644 index 0000000..f8072df --- /dev/null +++ b/QXlsx/header/xlsxdatetype.h @@ -0,0 +1,48 @@ +// xlsxdatetype.h + +#ifndef QXLSX_XLSXDATETYPE_H +#define QXLSX_XLSXDATETYPE_H + +#include +#include +#include +#include +#include +#include +#include + +#include "xlsxglobal.h" + +QT_BEGIN_NAMESPACE_XLSX + +class DateType +{ +public: + DateType(); +/* + DateType(bool is1904 = false); + DateType(double d, bool is1904 = false); + DateType(QDateTime qdt, bool is1904 = false); + DateType(QDate qd, bool is1904 = false); + DateType(QTime qt, bool is1904 = false); +public: + enum currentDateType { DateAndTimeType, OnlyDateType, OnlyTimeType }; +public: + currentDateType getType(); + bool getValue(QDateTime* pQdt); + bool getValue(QDate* pQd); + bool getValue(QTime* pQt); + bool getValue(double* pD); + +protected: + +protected: + bool isSet; + double dValue; + bool is1904Type; + currentDateType dType; +*/ +}; + +QT_END_NAMESPACE_XLSX +#endif diff --git a/QXlsx/header/xlsxdocpropsapp_p.h b/QXlsx/header/xlsxdocpropsapp_p.h index ccaece4..f0402ef 100644 --- a/QXlsx/header/xlsxdocpropsapp_p.h +++ b/QXlsx/header/xlsxdocpropsapp_p.h @@ -45,7 +45,7 @@ class QIODevice; -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class DocPropsApp : public AbstractOOXmlFile { @@ -68,5 +68,6 @@ private: QMap m_properties; }; -} +QT_END_NAMESPACE_XLSX + #endif // XLSXDOCPROPSAPP_H diff --git a/QXlsx/header/xlsxdocpropscore_p.h b/QXlsx/header/xlsxdocpropscore_p.h index 707fb2e..38177d0 100644 --- a/QXlsx/header/xlsxdocpropscore_p.h +++ b/QXlsx/header/xlsxdocpropscore_p.h @@ -38,14 +38,15 @@ #include "xlsxglobal.h" #include "xlsxabstractooxmlfile.h" + #include #include class QIODevice; -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX -class DocPropsCore : public AbstractOOXmlFile +class DocPropsCore : public AbstractOOXmlFile { public: explicit DocPropsCore(CreateFlag flag); @@ -61,5 +62,6 @@ private: QMap m_properties; }; -} +QT_END_NAMESPACE_XLSX + #endif // XLSXDOCPROPSCORE_H diff --git a/QXlsx/header/xlsxdocument_p.h b/QXlsx/header/xlsxdocument_p.h index 75977c9..1a2ea62 100644 --- a/QXlsx/header/xlsxdocument_p.h +++ b/QXlsx/header/xlsxdocument_p.h @@ -23,13 +23,15 @@ // We mean it. // +#include +#include + +#include "xlsxglobal.h" #include "xlsxdocument.h" #include "xlsxworkbook.h" #include "xlsxcontenttypes_p.h" -#include - -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class DocumentPrivate { @@ -51,6 +53,6 @@ public: bool isLoad; }; -} +QT_END_NAMESPACE_XLSX #endif // XLSXDOCUMENT_P_H diff --git a/QXlsx/header/xlsxdrawing_p.h b/QXlsx/header/xlsxdrawing_p.h index 3afad4d..3c319b3 100644 --- a/QXlsx/header/xlsxdrawing_p.h +++ b/QXlsx/header/xlsxdrawing_p.h @@ -37,17 +37,18 @@ // We mean it. // -#include "xlsxrelationships_p.h" -#include "xlsxabstractooxmlfile.h" - +#include #include #include #include +#include "xlsxrelationships_p.h" +#include "xlsxabstractooxmlfile.h" + class QIODevice; class QXmlStreamWriter; -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class DrawingAnchor; class Workbook; @@ -67,6 +68,6 @@ public: QList anchors; }; -} // namespace QXlsx +QT_END_NAMESPACE_XLSX #endif // QXLSX_DRAWING_H diff --git a/QXlsx/header/xlsxdrawinganchor_p.h b/QXlsx/header/xlsxdrawinganchor_p.h index 354f0d9..a0ecb26 100644 --- a/QXlsx/header/xlsxdrawinganchor_p.h +++ b/QXlsx/header/xlsxdrawinganchor_p.h @@ -32,11 +32,10 @@ #include #include #include +#include +#include -class QXmlStreamReader; -class QXmlStreamWriter; - -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class Drawing; class MediaFile; @@ -171,6 +170,6 @@ public: void saveToXml(QXmlStreamWriter &writer) const; }; -} // namespace QXlsx +QT_END_NAMESPACE_XLSX #endif // QXLSX_XLSXDRAWINGANCHOR_P_H diff --git a/QXlsx/header/xlsxformat_p.h b/QXlsx/header/xlsxformat_p.h index 85752f5..fc79d37 100644 --- a/QXlsx/header/xlsxformat_p.h +++ b/QXlsx/header/xlsxformat_p.h @@ -1,47 +1,14 @@ -/**************************************************************************** -** Copyright (c) 2013-2014 Debao Zhang -** All right reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining -** a copy of this software and associated documentation files (the -** "Software"), to deal in the Software without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Software, and to -** permit persons to whom the Software is furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -****************************************************************************/ +// #ifndef XLSXFORMAT_P_H #define XLSXFORMAT_P_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt Xlsx API. It exists for the convenience -// of the Qt Xlsx. This header file may change from -// version to version without notice, or even be removed. -// -// We mean it. -// - #include "xlsxformat.h" + #include #include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class FormatPrivate : public QSharedData { @@ -156,6 +123,7 @@ public: QMap properties; }; -} -#endif // XLSXFORMAT_P_H +QT_END_NAMESPACE_XLSX + +#endif diff --git a/QXlsx/header/xlsxglobal.h b/QXlsx/header/xlsxglobal.h index 8d9157d..ab1012d 100644 --- a/QXlsx/header/xlsxglobal.h +++ b/QXlsx/header/xlsxglobal.h @@ -1,17 +1,25 @@ // xlsxglobal.h -// QXlsx // MIT License // https://github.com/j2doll/QXlsx -// QtXlsx // MIT License // https://github.com/dbzhang800/QtXlsxWriter // http://qtxlsx.debao.me/ #ifndef XLSXGLOBAL_H #define XLSXGLOBAL_H +#include +#include +#include + #include #include +#include +#include +#include +#include +#include +#include #define QT_BEGIN_NAMESPACE_XLSX namespace QXlsx { - #define QT_END_NAMESPACE_XLSX } #define QXLSX_USE_NAMESPACE using namespace QXlsx; + #endif // XLSXGLOBAL_H diff --git a/QXlsx/header/xlsxmediafile_p.h b/QXlsx/header/xlsxmediafile_p.h index f38dcf2..4b00c7a 100644 --- a/QXlsx/header/xlsxmediafile_p.h +++ b/QXlsx/header/xlsxmediafile_p.h @@ -43,7 +43,7 @@ #include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class MediaFile { @@ -75,6 +75,6 @@ private: QByteArray m_hashKey; }; -} // namespace QXlsx +QT_END_NAMESPACE_XLSX #endif // QXLSX_XLSXMEDIAFILE_H diff --git a/QXlsx/header/xlsxnumformatparser_p.h b/QXlsx/header/xlsxnumformatparser_p.h index ceb0121..dfa81e9 100644 --- a/QXlsx/header/xlsxnumformatparser_p.h +++ b/QXlsx/header/xlsxnumformatparser_p.h @@ -38,7 +38,7 @@ #include "xlsxglobal.h" -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class NumFormatParser { @@ -46,6 +46,6 @@ public: static bool isDateTime(const QString &formatCode); }; -} // namespace QXlsx +QT_END_NAMESPACE_XLSX #endif // QXLSX_NUMFORMATPARSER_H diff --git a/QXlsx/header/xlsxrelationships_p.h b/QXlsx/header/xlsxrelationships_p.h index bff9832..f7259cf 100644 --- a/QXlsx/header/xlsxrelationships_p.h +++ b/QXlsx/header/xlsxrelationships_p.h @@ -37,11 +37,12 @@ // #include "xlsxglobal.h" + #include #include -class QIODevice; +#include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX struct XlsxRelationship { @@ -83,5 +84,6 @@ private: QList m_relationships; }; -} +QT_END_NAMESPACE_XLSX + #endif // XLSXRELATIONSHIPS_H diff --git a/QXlsx/header/xlsxsharedstrings_p.h b/QXlsx/header/xlsxsharedstrings_p.h index cd1e6fa..41911b6 100644 --- a/QXlsx/header/xlsxsharedstrings_p.h +++ b/QXlsx/header/xlsxsharedstrings_p.h @@ -36,18 +36,18 @@ // We mean it. // -#include "xlsxglobal.h" -#include "xlsxrichstring.h" -#include "xlsxabstractooxmlfile.h" #include #include #include +#include +#include +#include -class QIODevice; -class QXmlStreamReader; -class QXmlStreamWriter; +#include "xlsxglobal.h" +#include "xlsxrichstring.h" +#include "xlsxabstractooxmlfile.h" -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class XlsxSharedStringInfo { @@ -94,5 +94,6 @@ private: int m_stringCount; }; -} +QT_END_NAMESPACE_XLSX + #endif // XLSXSHAREDSTRINGS_H diff --git a/QXlsx/header/xlsxsimpleooxmlfile_p.h b/QXlsx/header/xlsxsimpleooxmlfile_p.h index 3ee875a..50ef27a 100644 --- a/QXlsx/header/xlsxsimpleooxmlfile_p.h +++ b/QXlsx/header/xlsxsimpleooxmlfile_p.h @@ -38,9 +38,9 @@ #include "xlsxabstractooxmlfile.h" #include -class QIODevice; +#include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class SimpleOOXmlFile : public AbstractOOXmlFile { @@ -55,5 +55,6 @@ public: QByteArray xmlData; }; -} +QT_END_NAMESPACE_XLSX + #endif // XLSXSIMPLEOOXMLFILE_H diff --git a/QXlsx/header/xlsxstyles_p.h b/QXlsx/header/xlsxstyles_p.h index ad5897a..eea1731 100644 --- a/QXlsx/header/xlsxstyles_p.h +++ b/QXlsx/header/xlsxstyles_p.h @@ -36,22 +36,23 @@ // We mean it. // -#include "xlsxglobal.h" -#include "xlsxformat.h" -#include "xlsxabstractooxmlfile.h" #include #include #include #include #include #include +#include +#include +#include -class QXmlStreamWriter; -class QXmlStreamReader; -class QIODevice; -class StylesTest; +// class StylesTest; -namespace QXlsx { +#include "xlsxglobal.h" +#include "xlsxformat.h" +#include "xlsxabstractooxmlfile.h" + +QT_BEGIN_NAMESPACE_XLSX class Format; class XlsxColor; @@ -81,7 +82,7 @@ public: private: friend class Format; - friend class ::StylesTest; + // friend class ::StylesTest; void fixNumFmt(const Format &format); @@ -137,5 +138,6 @@ private: bool m_emptyFormatAdded; }; -} +QT_END_NAMESPACE_XLSX + #endif // XLSXSTYLES_H diff --git a/QXlsx/header/xlsxtheme_p.h b/QXlsx/header/xlsxtheme_p.h index 0b183b2..ef0322a 100644 --- a/QXlsx/header/xlsxtheme_p.h +++ b/QXlsx/header/xlsxtheme_p.h @@ -38,9 +38,9 @@ #include "xlsxabstractooxmlfile.h" #include -class QIODevice; +#include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class Theme : public AbstractOOXmlFile { @@ -55,5 +55,6 @@ public: QByteArray xmlData; }; -} +QT_END_NAMESPACE_XLSX + #endif // XLSXTHEME_H diff --git a/QXlsx/header/xlsxutility_p.h b/QXlsx/header/xlsxutility_p.h index 60f830d..a2b9d22 100644 --- a/QXlsx/header/xlsxutility_p.h +++ b/QXlsx/header/xlsxutility_p.h @@ -37,12 +37,18 @@ // #include "xlsxglobal.h" -class QPoint; -class QString; -class QStringList; -class QColor; -class QDateTime; -class QTime; + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE_XLSX @@ -54,7 +60,7 @@ QStringList splitPath(const QString &path); QString getRelFilePath(const QString &filePath); double datetimeToNumber(const QDateTime &dt, bool is1904=false); -QDateTime datetimeFromNumber(double num, bool is1904=false); +QVariant datetimeFromNumber(double num, bool is1904=false); double timeToNumber(const QTime &t); QString createSafeSheetName(const QString &nameProposal); diff --git a/QXlsx/header/xlsxworkbook_p.h b/QXlsx/header/xlsxworkbook_p.h index c3a7c60..d94c451 100644 --- a/QXlsx/header/xlsxworkbook_p.h +++ b/QXlsx/header/xlsxworkbook_p.h @@ -1,41 +1,8 @@ -/**************************************************************************** -** Copyright (c) 2013-2014 Debao Zhang -** All right reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining -** a copy of this software and associated documentation files (the -** "Software"), to deal in the Software without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Software, and to -** permit persons to whom the Software is furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -****************************************************************************/ +// + #ifndef XLSXWORKBOOK_P_H #define XLSXWORKBOOK_P_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt Xlsx API. It exists for the convenience -// of the Qt Xlsx. This header file may change from -// version to version without notice, or even be removed. -// -// We mean it. -// - #include "xlsxworkbook.h" #include "xlsxabstractooxmlfile_p.h" #include "xlsxtheme_p.h" @@ -46,7 +13,7 @@ #include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX struct XlsxDefineNameData { @@ -102,6 +69,6 @@ public: int last_sheet_id; }; -} +QT_END_NAMESPACE_XLSX #endif // XLSXWORKBOOK_P_H diff --git a/QXlsx/header/xlsxworksheet_p.h b/QXlsx/header/xlsxworksheet_p.h index 54f0169..a1a88a3 100644 --- a/QXlsx/header/xlsxworksheet_p.h +++ b/QXlsx/header/xlsxworksheet_p.h @@ -137,16 +137,30 @@ struct XlsxRowInfo struct XlsxColumnInfo { - XlsxColumnInfo(int firstColumn=0, int lastColumn=1, double width=0, const Format &format=Format(), bool hidden=false) : - firstColumn(firstColumn), lastColumn(lastColumn), customWidth(false), width(width), format(format), hidden(hidden) - , outlineLevel(0), collapsed(false) + XlsxColumnInfo( int firstColumn, // = 0, + int lastColumn, // = 1, + bool isSetWidth, + double width = 0, + const Format &format = Format(), + bool hidden = false) + : firstColumn(firstColumn), + lastColumn(lastColumn), + customWidth(false), + isSetWidth(isSetWidth), + width(width), + format(format), + hidden(hidden), + outlineLevel(0), + collapsed(false) { } + int firstColumn; int lastColumn; bool customWidth; - double width; + double width; + bool isSetWidth; Format format; bool hidden; int outlineLevel; diff --git a/QXlsx/header/xlsxzipreader_p.h b/QXlsx/header/xlsxzipreader_p.h index 48332b5..d11824e 100644 --- a/QXlsx/header/xlsxzipreader_p.h +++ b/QXlsx/header/xlsxzipreader_p.h @@ -38,15 +38,18 @@ // #include "xlsxglobal.h" + #include #include -#if QT_VERSION >= 0x050600 -#include -#endif -class QZipReader; -class QIODevice; +#include -namespace QXlsx { +#if QT_VERSION >= 0x050600 + #include +#endif + +class QZipReader; + +QT_BEGIN_NAMESPACE_XLSX class ZipReader { @@ -65,6 +68,6 @@ private: QStringList m_filePaths; }; -} // namespace QXlsx +QT_END_NAMESPACE_XLSX #endif // QXLSX_XLSXZIPREADER_P_H diff --git a/QXlsx/header/xlsxzipwriter_p.h b/QXlsx/header/xlsxzipwriter_p.h index 87463fd..2a69a7a 100644 --- a/QXlsx/header/xlsxzipwriter_p.h +++ b/QXlsx/header/xlsxzipwriter_p.h @@ -37,10 +37,13 @@ // #include -class QIODevice; +#include + +#include "xlsxglobal.h" + class QZipWriter; -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX class ZipWriter { @@ -58,6 +61,6 @@ private: QZipWriter *m_writer; }; -} // namespace QXlsx +QT_END_NAMESPACE_XLSX #endif // QXLSX_ZIPWRITER_H diff --git a/QXlsx/source/xlsxabstractooxmlfile.cpp b/QXlsx/source/xlsxabstractooxmlfile.cpp index 36d15a0..0238f13 100644 --- a/QXlsx/source/xlsxabstractooxmlfile.cpp +++ b/QXlsx/source/xlsxabstractooxmlfile.cpp @@ -1,27 +1,4 @@ -/**************************************************************************** -** Copyright (c) 2013-2014 Debao Zhang -** All right reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining -** a copy of this software and associated documentation files (the -** "Software"), to deal in the Software without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Software, and to -** permit persons to whom the Software is furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -****************************************************************************/ +// #include "xlsxabstractooxmlfile.h" #include "xlsxabstractooxmlfile_p.h" @@ -32,7 +9,7 @@ QT_BEGIN_NAMESPACE_XLSX AbstractOOXmlFilePrivate::AbstractOOXmlFilePrivate(AbstractOOXmlFile *q, AbstractOOXmlFile::CreateFlag flag=AbstractOOXmlFile::F_NewFromScratch) - :relationships(new Relationships), flag(flag), q_ptr(q) + : relationships(new Relationships), flag(flag), q_ptr(q) { } diff --git a/QXlsx/source/xlsxcell.cpp b/QXlsx/source/xlsxcell.cpp index 4bd7e80..5a847ff 100644 --- a/QXlsx/source/xlsxcell.cpp +++ b/QXlsx/source/xlsxcell.cpp @@ -119,64 +119,87 @@ QVariant Cell::readValue() const if (isDateTime()) { - QDateTime dt = dateTime(); - ret = dt; + QVariant vDT = dateTime(); + if ( vDT.isNull() ) + { + return QVariant(); + } + + if ( vDT.type() == QVariant::DateTime ) + { + ret = vDT; + } + else if ( vDT.type() == QVariant::Date ) + { + ret = vDT; + } + else if ( vDT.type() == QVariant::Time ) + { + ret = vDT; + } + else + { + return QVariant(); + } + + // QDateTime dt = dateTime(); + // ret = dt; - QString strFormat = fmt.numberFormat(); - if (!strFormat.isEmpty()) - { - // TODO: use number format - } + // QString strFormat = fmt.numberFormat(); + // if (!strFormat.isEmpty()) + // { + // // TODO: use number format + // } - qint32 styleNo = d->styleNumber; + // qint32 styleNo = d->styleNumber; - if (styleNo == 10) - { - } + // if (styleNo == 10) + // { + // } - if (styleNo == 11) - { + // if (styleNo == 11) + // { // QTime timeValue = dt.time(); // only time. (HH:mm:ss) // ret = timeValue; // return ret; - } + // } - if (styleNo == 12) - { - } + // if (styleNo == 12) + // { + // } - if (styleNo == 13) // (HH:mm:ss) - { - double dValue = d->value.toDouble(); - int day = int(dValue); // unit is day. - double deciamlPointValue1 = dValue - double(day); + // if (styleNo == 13) // (HH:mm:ss) + // { + // double dValue = d->value.toDouble(); + // int day = int(dValue); // unit is day. + // double deciamlPointValue1 = dValue - double(day); - double dHour = deciamlPointValue1 * (double(1.0) / double(24.0)); - int hour = int(dHour); + // double dHour = deciamlPointValue1 * (double(1.0) / double(24.0)); + // int hour = int(dHour); - double deciamlPointValue2 = deciamlPointValue1 - (double(hour) * (double(1.0) / double(24.0))); - double dMin = deciamlPointValue2 * (double(1.0) / double(60.0)); - int min = int(dMin); + // double deciamlPointValue2 = deciamlPointValue1 - (double(hour) * (double(1.0) / double(24.0))); + // double dMin = deciamlPointValue2 * (double(1.0) / double(60.0)); + // int min = int(dMin); - double deciamlPointValue3 = deciamlPointValue2 - (double(min) * (double(1.0) / double(60.0))); - double dSec = deciamlPointValue3 * (double(1.0) / double(60.0)); - int sec = int(dSec); + // double deciamlPointValue3 = deciamlPointValue2 - (double(min) * (double(1.0) / double(60.0))); + // double dSec = deciamlPointValue3 * (double(1.0) / double(60.0)); + // int sec = int(dSec); - int totalHour = hour + (day * 24); + // int totalHour = hour + (day * 24); - QString strTime; - strTime = QString("%1:%2:%3").arg(totalHour).arg(min).arg(sec); - ret = strTime; + // QString strTime; + // strTime = QString("%1:%2:%3").arg(totalHour).arg(min).arg(sec); + // ret = strTime; - return ret; - } + // return ret; + // } - return ret; + // return ret; + // */ } if (hasFormula()) { - // QVariant::Type vt = ret.type(); // it's double type. QString formulaString = this->formula().formulaText(); ret = formulaString; return ret; // return formula string @@ -246,6 +269,7 @@ bool Cell::isDateTime() const /*! * Return the data time value. */ +/* QDateTime Cell::dateTime() const { Q_D(const Cell); @@ -255,6 +279,16 @@ QDateTime Cell::dateTime() const return datetimeFromNumber(d->value.toDouble(), d->parent->workbook()->isDate1904()); } +*/ +QVariant Cell::dateTime() const +{ + Q_D(const Cell); + + if (!isDateTime()) + return QVariant(); + + return datetimeFromNumber( d->value.toDouble(), d->parent->workbook()->isDate1904() ); +} /*! * Returns whether the cell is probably a rich string or not diff --git a/QXlsx/source/xlsxcolor.cpp b/QXlsx/source/xlsxcolor.cpp index 7e1dabe..cb37bee 100644 --- a/QXlsx/source/xlsxcolor.cpp +++ b/QXlsx/source/xlsxcolor.cpp @@ -18,8 +18,7 @@ #include #include -namespace QXlsx { - +QT_BEGIN_NAMESPACE_XLSX XlsxColor::XlsxColor(const QColor &color) { @@ -206,4 +205,5 @@ QDebug operator<<(QDebug dbg, const XlsxColor &c) #endif -} // namespace QXlsx + +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxcontenttypes.cpp b/QXlsx/source/xlsxcontenttypes.cpp index 8a500ac..6a1bf3e 100644 --- a/QXlsx/source/xlsxcontenttypes.cpp +++ b/QXlsx/source/xlsxcontenttypes.cpp @@ -30,7 +30,7 @@ #include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX ContentTypes::ContentTypes(CreateFlag flag) :AbstractOOXmlFile(flag) @@ -202,4 +202,4 @@ bool ContentTypes::loadFromXmlFile(QIODevice *device) return true; } -} //namespace QXlsx +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxdatetype.cpp b/QXlsx/source/xlsxdatetype.cpp new file mode 100644 index 0000000..4037aa7 --- /dev/null +++ b/QXlsx/source/xlsxdatetype.cpp @@ -0,0 +1,83 @@ +// xlsxdatetype.cpp + +#include "xlsxglobal.h" +#include "xlsxutility_p.h" +#include "xlsxdatetype.h" + +QT_BEGIN_NAMESPACE_XLSX + +DateType::DateType() +{ +} + +/* +DateType::DateType(bool is1904) +{ + isSet = false; +} + +DateType::DateType(double d, bool is1904) +{ + // TODO: check date + + // int iVaue = (int) d; + // double surplus = d - double(iVaue); + + dValue = d; + is1904Type = is1904; + isSet = true; +} + +DateType::DateType(QDateTime qdt, bool is1904) +{ + double ret = datetimeToNumber( qdt, is1904 ); + dValue = ret; + is1904Type = is1904; + isSet = true; +} + +DateType::DateType(QDate qd, bool is1904) +{ + + is1904Type = is1904; + isSet = true; +} + +DateType::DateType(QTime qt, bool is1904) +{ + double ret = timeToNumber( qt ); + dValue = ret; + is1904Type = is1904; + isSet = true; +} + +// enum currentDateType { DateAndTimeType, OnlyDateType, OnlyTimeType }; + +DateType::currentDateType DateType::getType() +{ + +} + +bool DateType::getValue(QDateTime* pQdt) +{ + +} + + +bool DateType::getValue(QDate* pQd) +{ + +} + +bool DateType::getValue(QTime* pQt) +{ + +} + +bool DateType::getValue(double* pD) +{ + +} +*/ + +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxdrawing.cpp b/QXlsx/source/xlsxdrawing.cpp index ae7d2d7..6fe5a7a 100644 --- a/QXlsx/source/xlsxdrawing.cpp +++ b/QXlsx/source/xlsxdrawing.cpp @@ -31,7 +31,7 @@ #include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX Drawing::Drawing(AbstractSheet *sheet, CreateFlag flag) :AbstractOOXmlFile(flag), sheet(sheet) @@ -84,4 +84,4 @@ bool Drawing::loadFromXmlFile(QIODevice *device) return true; } -} // namespace QXlsx +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxdrawinganchor.cpp b/QXlsx/source/xlsxdrawinganchor.cpp index c7cb26f..735aec1 100644 --- a/QXlsx/source/xlsxdrawinganchor.cpp +++ b/QXlsx/source/xlsxdrawinganchor.cpp @@ -35,7 +35,7 @@ #include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX /* The vertices that define the position of a graphical object @@ -971,4 +971,4 @@ bool DrawingTwoCellAnchor::loadFromXml(QXmlStreamReader &reader) } -} // namespace QXlsx +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxmediafile.cpp b/QXlsx/source/xlsxmediafile.cpp index 39fbc03..4f49b4c 100644 --- a/QXlsx/source/xlsxmediafile.cpp +++ b/QXlsx/source/xlsxmediafile.cpp @@ -24,9 +24,10 @@ ****************************************************************************/ #include "xlsxmediafile_p.h" + #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX MediaFile::MediaFile(const QByteArray &bytes, const QString &suffix, const QString &mimeType) : m_contents(bytes), m_suffix(suffix), m_mimeType(mimeType) @@ -96,4 +97,4 @@ QByteArray MediaFile::hashKey() const return m_hashKey; } -} // namespace QXlsx +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxnumformatparser.cpp b/QXlsx/source/xlsxnumformatparser.cpp index 6e2a686..154e350 100644 --- a/QXlsx/source/xlsxnumformatparser.cpp +++ b/QXlsx/source/xlsxnumformatparser.cpp @@ -1,32 +1,11 @@ -/**************************************************************************** -** Copyright (c) 2013-2014 Debao Zhang -** All right reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining -** a copy of this software and associated documentation files (the -** "Software"), to deal in the Software without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Software, and to -** permit persons to whom the Software is furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -****************************************************************************/ +// + #include "xlsxnumformatparser_p.h" +#include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX bool NumFormatParser::isDateTime(const QString &formatCode) { @@ -91,4 +70,4 @@ bool NumFormatParser::isDateTime(const QString &formatCode) return false; } -} // namespace QXlsx +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxrelationships.cpp b/QXlsx/source/xlsxrelationships.cpp index 2616182..d0c5c78 100644 --- a/QXlsx/source/xlsxrelationships.cpp +++ b/QXlsx/source/xlsxrelationships.cpp @@ -29,7 +29,7 @@ #include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX const QString schema_doc = QStringLiteral("http://schemas.openxmlformats.org/officeDocument/2006/relationships"); const QString schema_msPackage = QStringLiteral("http://schemas.microsoft.com/office/2006/relationships"); @@ -186,4 +186,4 @@ bool Relationships::isEmpty() const return m_relationships.isEmpty(); } -} //namespace +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxsharedstrings.cpp b/QXlsx/source/xlsxsharedstrings.cpp index e7e91b7..1e456ff 100644 --- a/QXlsx/source/xlsxsharedstrings.cpp +++ b/QXlsx/source/xlsxsharedstrings.cpp @@ -1,32 +1,11 @@ -/**************************************************************************** -** Copyright (c) 2013-2014 Debao Zhang -** All right reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining -** a copy of this software and associated documentation files (the -** "Software"), to deal in the Software without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Software, and to -** permit persons to whom the Software is furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -****************************************************************************/ +// + #include "xlsxrichstring.h" #include "xlsxsharedstrings_p.h" #include "xlsxutility_p.h" #include "xlsxformat_p.h" #include "xlsxcolor_p.h" + #include #include #include @@ -34,7 +13,7 @@ #include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX /* * Note that, when we open an existing .xlsx file (broken file?), @@ -398,4 +377,4 @@ bool SharedStrings::loadFromXmlFile(QIODevice *device) return true; } -} //namespace +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxsimpleooxmlfile.cpp b/QXlsx/source/xlsxsimpleooxmlfile.cpp index 76855bb..d4fba31 100644 --- a/QXlsx/source/xlsxsimpleooxmlfile.cpp +++ b/QXlsx/source/xlsxsimpleooxmlfile.cpp @@ -1,31 +1,12 @@ -/**************************************************************************** -** Copyright (c) 2013-2014 Debao Zhang -** All right reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining -** a copy of this software and associated documentation files (the -** "Software"), to deal in the Software without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Software, and to -** permit persons to whom the Software is furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -****************************************************************************/ +// + #include "xlsxsimpleooxmlfile_p.h" + +#include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX + SimpleOOXmlFile::SimpleOOXmlFile(CreateFlag flag) :AbstractOOXmlFile(flag) { @@ -53,4 +34,4 @@ bool SimpleOOXmlFile::loadFromXmlFile(QIODevice *device) return true; } -} +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxstyles.cpp b/QXlsx/source/xlsxstyles.cpp index 06c2f89..0a48b18 100644 --- a/QXlsx/source/xlsxstyles.cpp +++ b/QXlsx/source/xlsxstyles.cpp @@ -23,7 +23,7 @@ #include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX /* When loading from existing .xlsx file. we should create a clean styles object. @@ -1343,4 +1343,4 @@ QColor Styles::getColorByIndex(int idx) return m_indexedColors[idx]; } -} //namespace QXlsx +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxtheme.cpp b/QXlsx/source/xlsxtheme.cpp index d0c0758..3e1b4dc 100644 --- a/QXlsx/source/xlsxtheme.cpp +++ b/QXlsx/source/xlsxtheme.cpp @@ -1,31 +1,10 @@ -/**************************************************************************** -** Copyright (c) 2013-2014 Debao Zhang -** All right reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining -** a copy of this software and associated documentation files (the -** "Software"), to deal in the Software without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Software, and to -** permit persons to whom the Software is furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -****************************************************************************/ +// + #include "xlsxtheme_p.h" + #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX const char *defaultXmlData = "\n" @@ -234,4 +213,4 @@ bool Theme::loadFromXmlFile(QIODevice *device) return true; } -} +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxutility.cpp b/QXlsx/source/xlsxutility.cpp index b44d6d7..e1bd59d 100644 --- a/QXlsx/source/xlsxutility.cpp +++ b/QXlsx/source/xlsxutility.cpp @@ -34,6 +34,9 @@ #include #include +#include +#include + QT_BEGIN_NAMESPACE_XLSX bool parseXsdBoolean(const QString &value, bool defaultValue) @@ -100,24 +103,49 @@ double timeToNumber(const QTime &time) return QTime(0,0).msecsTo(time) / (1000*60*60*24.0); } -QDateTime datetimeFromNumber(double num, bool is1904) +QVariant datetimeFromNumber(double num, bool is1904) { - if (!is1904 && num > 60) + if (!is1904 && num > 60) // for mac os excel + { num = num - 1; + } qint64 msecs = static_cast(num * 1000*60*60*24.0 + 0.5); QDateTime epoch(is1904 ? QDate(1904, 1, 1): QDate(1899, 12, 31), QTime(0,0)); - QDateTime dt = epoch.addMSecs(msecs); + QDateTime dt; + + QDateTime dt1 = epoch.addMSecs(msecs); + dt = dt1; #if QT_VERSION >= 0x050200 // Remove one hour to see whether the date is Daylight QDateTime dt2 = dt.addMSecs(-3600); if (dt2.isDaylightTime()) - return dt2; + { + dt = dt2; + } #endif - return dt; + float whole = 0; + float fractional = std::modf(num, &whole); + + if ( num < double(1) ) + { + // only time + QTime t = dt.time(); + return QVariant(t); + } + + if ( fractional == 0.0 ) + { + // only date + // qDebug() << "[debug] " << num << whole << fractional; + QDate onlyDT = dt.date(); + return QVariant(onlyDT); + } + + return QVariant(dt); } /* diff --git a/QXlsx/source/xlsxworksheet.cpp b/QXlsx/source/xlsxworksheet.cpp index bb41289..4a8f87b 100644 --- a/QXlsx/source/xlsxworksheet.cpp +++ b/QXlsx/source/xlsxworksheet.cpp @@ -558,14 +558,18 @@ QVariant Worksheet::read(int row, int column) const } } - if (cell->isDateTime()) { - double val = cell->value().toDouble(); - QDateTime dt = cell->dateTime(); - if (val < 1) - return dt.time(); - if (fmod(val, 1.0) < 1.0/(1000*60*60*24)) //integer - return dt.date(); - return dt; + if (cell->isDateTime()) + { + QVariant vDateTime = cell->dateTime(); + + // double val = cell->value().toDouble(); + // QDateTime dt = cell->dateTime(); + // if (val < 1) + // return dt.time(); + // if (fmod(val, 1.0) < 1.0/(1000*60*60*24)) //integer + // return dt.date(); + + return vDateTime; } return cell->value(); @@ -1714,10 +1718,13 @@ QList WorksheetPrivate ::getColumnIndexes(int colFirst, int colLast) QList nodes; nodes.append(colFirst); - for (int col = colFirst; col <= colLast; ++col) { - if (colsInfo.contains(col)) { + for (int col = colFirst; col <= colLast; ++col) + { + if (colsInfo.contains(col)) + { if (nodes.last() != col) nodes.append(col); + int nextCol = colsInfo[col]->lastColumn + 1; if (nextCol <= colLast) nodes.append(nextCol); @@ -1775,7 +1782,9 @@ bool Worksheet::setColumnWidth(int colFirst, int colLast, double width) QList > columnInfoList = d->getColumnInfoList(colFirst, colLast); foreach(QSharedPointer columnInfo, columnInfoList) + { columnInfo->width = width; + } return (columnInfoList.count() > 0); } @@ -1823,11 +1832,30 @@ double Worksheet::columnWidth(int column) { Q_D(Worksheet); - QList > columnInfoList = d->getColumnInfoList(column, column); - if (columnInfoList.count() == 1) - return columnInfoList.at(0)->width ; + QList< QSharedPointer > columnInfoList = d->getColumnInfoList(column, column); - return d->sheetFormatProps.defaultColWidth; + // [dev54] + if ( columnInfoList.size() == 0 ) + { + // column information is not found + // qDebug() << "[debug]" << __FUNCTION__ << "column (info) is not found. " << column; + } + + if (columnInfoList.count() == 1) + { + // column information is found + // qDebug() << "[debug]" << __FUNCTION__ << "column (info) is found. " << column << oneColWidth; + double oneColWidth = columnInfoList.at(0)->width; + bool isSetWidth = columnInfoList.at(0)->isSetWidth; + if ( isSetWidth ) + { + return oneColWidth; + } + } + + // use default width + double defaultColWidth = d->sheetFormatProps.defaultColWidth; + return defaultColWidth; } /*! @@ -1924,8 +1952,9 @@ double Worksheet::rowHeight(int row) int min_col = d->dimension.isValid() ? d->dimension.firstColumn() : 1; if (d->checkDimensions(row, min_col, false, true) || !d->rowsInfo.contains(row)) + { return d->sheetFormatProps.defaultRowHeight; //return default on invalid row - + } return d->rowsInfo[row]->height; } @@ -2019,16 +2048,20 @@ bool Worksheet::groupColumns(int colFirst, int colLast, bool collapsed) } } - for (int idx = 0; idx < nodes.size(); ++idx) { + for (int idx = 0; idx < nodes.size(); ++idx) + { int colStart = nodes[idx]; - if (d->colsInfo.contains(colStart)) { + if (d->colsInfo.contains(colStart)) + { QSharedPointer info = d->colsInfo[colStart]; info->outlineLevel += 1; if (collapsed) info->hidden = true; - } else { + } + else + { int colEnd = (idx == nodes.size() - 1) ? colLast : nodes[idx+1] - 1; - QSharedPointer info(new XlsxColumnInfo(colStart, colEnd)); + QSharedPointer info(new XlsxColumnInfo(colStart, colEnd, false)); info->outlineLevel += 1; d->colsInfo.insert(colFirst, info); if (collapsed) @@ -2044,7 +2077,7 @@ bool Worksheet::groupColumns(int colFirst, int colLast, bool collapsed) if (d->colsInfo.contains(col)) d->colsInfo[col]->collapsed = true; else { - QSharedPointer info(new XlsxColumnInfo(col, col)); + QSharedPointer info(new XlsxColumnInfo(col, col, false)); info->collapsed = true; d->colsInfo.insert(col, info); d->colsInfoHelper[col] = info; @@ -2123,15 +2156,19 @@ void WorksheetPrivate::loadXmlSheetData(QXmlStreamReader &reader) { QSharedPointer info(new XlsxRowInfo); - if (attributes.hasAttribute(QLatin1String("customFormat")) && attributes.hasAttribute(QLatin1String("s"))) { + if (attributes.hasAttribute(QLatin1String("customFormat")) && + attributes.hasAttribute(QLatin1String("s"))) + { int idx = attributes.value(QLatin1String("s")).toString().toInt(); info->format = workbook->styles()->xfFormat(idx); } - if (attributes.hasAttribute(QLatin1String("customHeight"))) { + if (attributes.hasAttribute(QLatin1String("customHeight"))) + { info->customHeight = attributes.value(QLatin1String("customHeight")) == QLatin1String("1"); //Row height is only specified when customHeight is set - if(attributes.hasAttribute(QLatin1String("ht"))) { + if(attributes.hasAttribute(QLatin1String("ht"))) + { info->height = attributes.value(QLatin1String("ht")).toString().toDouble(); } } @@ -2144,7 +2181,8 @@ void WorksheetPrivate::loadXmlSheetData(QXmlStreamReader &reader) info->outlineLevel = attributes.value(QLatin1String("outlineLevel")).toString().toInt(); //"r" is optional too. - if (attributes.hasAttribute(QLatin1String("r"))) { + if (attributes.hasAttribute(QLatin1String("r"))) + { int row = attributes.value(QLatin1String("r")).toString().toInt(); rowsInfo[row] = info; } @@ -2231,7 +2269,8 @@ void WorksheetPrivate::loadXmlSheetData(QXmlStreamReader &reader) { CellFormula &formula = cell->d_func()->formula; formula.loadFromXml(reader); - if (formula.formulaType() == CellFormula::SharedType && !formula.formulaText().isEmpty()) + if (formula.formulaType() == CellFormula::SharedType && + !formula.formulaText().isEmpty()) { int si = formula.sharedIndex(); sharedFormulaMap[ si ] = formula; @@ -2239,8 +2278,6 @@ void WorksheetPrivate::loadXmlSheetData(QXmlStreamReader &reader) } else if (reader.name() == QLatin1String("v")) // Value { - // NOTICE: CHECK POINT - QString value = reader.readElementText(); if (cellType == Cell::SharedStringType) { @@ -2264,29 +2301,11 @@ void WorksheetPrivate::loadXmlSheetData(QXmlStreamReader &reader) { // [dev54] DateType - double dValue = value.toDouble(); // days from 1900 - int iValue = (int) dValue; // days from 1900 (integer) - double dTime = dValue - double(dValue); // time (under date) - + double dValue = value.toDouble(); // days from 1900(or 1904) bool bIsDate1904 = q->workbook()->isDate1904(); - QDateTime datetimeValue = datetimeFromNumber( dValue, bIsDate1904 ); - cell->d_func()->value = datetimeValue; - - if ( dValue < double(1) ) // only time - { - QDate nullDate; - QTime timeValue = datetimeValue.time(); - cell->d_func()->value = QDateTime( nullDate, timeValue ); - } - - double cmpDValue = double(iValue); - if ( dValue == cmpDValue ) // only date - { - QDate dateValue = datetimeValue.date(); - QTime nullTime; // null time is (Hout:Minute:Second)=(0:0:0). - cell->d_func()->value = QDateTime( dateValue, nullTime ); - } + QVariant vDatetimeValue = datetimeFromNumber( dValue, bIsDate1904 ); + cell->d_func()->value = vDatetimeValue; } else { @@ -2335,11 +2354,16 @@ void WorksheetPrivate::loadXmlColumnsInfo(QXmlStreamReader &reader) { Q_ASSERT(reader.name() == QLatin1String("cols")); - while (!reader.atEnd() && !(reader.name() == QLatin1String("cols") && reader.tokenType() == QXmlStreamReader::EndElement)) { + while (!reader.atEnd() && + !(reader.name() == QLatin1String("cols") && + reader.tokenType() == QXmlStreamReader::EndElement)) + { reader.readNextStartElement(); - if (reader.tokenType() == QXmlStreamReader::StartElement) { - if (reader.name() == QLatin1String("col")) { - QSharedPointer info(new XlsxColumnInfo); + if (reader.tokenType() == QXmlStreamReader::StartElement) + { + if (reader.name() == QLatin1String("col")) + { + QSharedPointer info(new XlsxColumnInfo(0, 1, false)); QXmlStreamAttributes colAttrs = reader.attributes(); int min = colAttrs.value(QLatin1String("min")).toString().toInt(); @@ -2349,28 +2373,41 @@ void WorksheetPrivate::loadXmlColumnsInfo(QXmlStreamReader &reader) //Flag indicating that the column width for the affected column(s) is different from the // default or has been manually set - if(colAttrs.hasAttribute(QLatin1String("customWidth"))) { + if(colAttrs.hasAttribute(QLatin1String("customWidth"))) + { info->customWidth = colAttrs.value(QLatin1String("customWidth")) == QLatin1String("1"); } + //Note, node may have "width" without "customWidth" - if (colAttrs.hasAttribute(QLatin1String("width"))) { + // [dev54] + if (colAttrs.hasAttribute(QLatin1String("width"))) + { double width = colAttrs.value(QLatin1String("width")).toString().toDouble(); info->width = width; + info->isSetWidth = true; // [dev54] } info->hidden = colAttrs.value(QLatin1String("hidden")) == QLatin1String("1"); info->collapsed = colAttrs.value(QLatin1String("collapsed")) == QLatin1String("1"); - if (colAttrs.hasAttribute(QLatin1String("style"))) { + if (colAttrs.hasAttribute(QLatin1String("style"))) + { int idx = colAttrs.value(QLatin1String("style")).toString().toInt(); info->format = workbook->styles()->xfFormat(idx); } + if (colAttrs.hasAttribute(QLatin1String("outlineLevel"))) + { info->outlineLevel = colAttrs.value(QLatin1String("outlineLevel")).toString().toInt(); + } + + // qDebug() << "[debug] " << __FUNCTION__ << min << max << info->width << hasWidth; colsInfo.insert(min, info); - for (int col=min; col<=max; ++col) + for (int col = min ; col <= max ; ++col) + { colsInfoHelper[col] = info; + } } } } @@ -2445,42 +2482,73 @@ void WorksheetPrivate::loadXmlSheetViews(QXmlStreamReader &reader) void WorksheetPrivate::loadXmlSheetFormatProps(QXmlStreamReader &reader) { Q_ASSERT(reader.name() == QLatin1String("sheetFormatPr")); + QXmlStreamAttributes attributes = reader.attributes(); XlsxSheetFormatProps formatProps; + bool isSetWidth = false; - //Retain default values - foreach (QXmlStreamAttribute attrib, attributes) { - if(attrib.name() == QLatin1String("baseColWidth") ) { + // Retain default values + foreach (QXmlStreamAttribute attrib, attributes) + { + if(attrib.name() == QLatin1String("baseColWidth") ) + { formatProps.baseColWidth = attrib.value().toString().toInt(); - } else if(attrib.name() == QLatin1String("customHeight")) { + } + else if(attrib.name() == QLatin1String("customHeight")) + { formatProps.customHeight = attrib.value() == QLatin1String("1"); - } else if(attrib.name() == QLatin1String("defaultColWidth")) { - formatProps.defaultColWidth = attrib.value().toString().toDouble(); - } else if(attrib.name() == QLatin1String("defaultRowHeight")) { + } + else if(attrib.name() == QLatin1String("defaultColWidth")) + { + double dDefaultColWidth = attrib.value().toString().toDouble(); + formatProps.defaultColWidth = dDefaultColWidth; + isSetWidth = true; + } + else if(attrib.name() == QLatin1String("defaultRowHeight")) + { formatProps.defaultRowHeight = attrib.value().toString().toDouble(); - } else if(attrib.name() == QLatin1String("outlineLevelCol")) { + } + else if(attrib.name() == QLatin1String("outlineLevelCol")) + { formatProps.outlineLevelCol = attrib.value().toString().toInt(); - } else if(attrib.name() == QLatin1String("outlineLevelRow")) { + } + else if(attrib.name() == QLatin1String("outlineLevelRow")) + { formatProps.outlineLevelRow = attrib.value().toString().toInt(); - } else if(attrib.name() == QLatin1String("thickBottom")) { + } + else if(attrib.name() == QLatin1String("thickBottom")) + { formatProps.thickBottom = attrib.value() == QLatin1String("1"); - } else if(attrib.name() == QLatin1String("thickTop")) { + } + else if(attrib.name() == QLatin1String("thickTop")) + { formatProps.thickTop = attrib.value() == QLatin1String("1"); - } else if(attrib.name() == QLatin1String("zeroHeight")) { + } + else if(attrib.name() == QLatin1String("zeroHeight")) + { formatProps.zeroHeight = attrib.value() == QLatin1String("1"); } } - if(formatProps.defaultColWidth == 0.0) { //not set - formatProps.defaultColWidth = WorksheetPrivate::calculateColWidth(formatProps.baseColWidth); + // if (formatProps.defaultColWidth == 0.0) + if ( !isSetWidth ) + { + //not set + double dCalcWidth = WorksheetPrivate::calculateColWidth(formatProps.baseColWidth); + formatProps.defaultColWidth = dCalcWidth; } + // [dev54] + // Where is code of setting 'formatProps'? + this->sheetFormatProps = formatProps; + } double WorksheetPrivate::calculateColWidth(int characters) { - //!Todo + // //!Todo //Take normal style' font maximum width and add padding and margin pixels - return characters + 0.5; + // return characters + 0.5; + return characters; } void WorksheetPrivate::loadXmlHyperlinks(QXmlStreamReader &reader) @@ -2516,22 +2584,28 @@ void WorksheetPrivate::loadXmlHyperlinks(QXmlStreamReader &reader) QList > WorksheetPrivate::getColumnInfoList(int colFirst, int colLast) { QList > columnsInfoList; - if(isColumnRangeValid(colFirst,colLast)) + if (isColumnRangeValid(colFirst,colLast)) { QList nodes = getColumnIndexes(colFirst, colLast); - for (int idx = 0; idx < nodes.size(); ++idx) { + for (int idx = 0; idx < nodes.size(); ++idx) + { int colStart = nodes[idx]; - if (colsInfo.contains(colStart)) { + if (colsInfo.contains(colStart)) + { QSharedPointer info = colsInfo[colStart]; columnsInfoList.append(info); - } else { + } + else + { int colEnd = (idx == nodes.size() - 1) ? colLast : nodes[idx+1] - 1; - QSharedPointer info(new XlsxColumnInfo(colStart, colEnd)); + QSharedPointer info(new XlsxColumnInfo(colStart, colEnd, false)); colsInfo.insert(colFirst, info); columnsInfoList.append(info); for (int c = colStart; c <= colEnd; ++c) + { colsInfoHelper[c] = info; + } } } } diff --git a/QXlsx/source/xlsxzipreader.cpp b/QXlsx/source/xlsxzipreader.cpp index 641c3dc..5e039eb 100644 --- a/QXlsx/source/xlsxzipreader.cpp +++ b/QXlsx/source/xlsxzipreader.cpp @@ -27,7 +27,7 @@ #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX ZipReader::ZipReader(const QString &filePath) : m_reader(new QZipReader(filePath)) @@ -74,4 +74,4 @@ QByteArray ZipReader::fileData(const QString &fileName) const return m_reader->fileData(fileName); } -} // namespace QXlsx +QT_END_NAMESPACE_XLSX diff --git a/QXlsx/source/xlsxzipwriter.cpp b/QXlsx/source/xlsxzipwriter.cpp index 9b6839c..625057e 100644 --- a/QXlsx/source/xlsxzipwriter.cpp +++ b/QXlsx/source/xlsxzipwriter.cpp @@ -1,32 +1,12 @@ -/**************************************************************************** -** Copyright (c) 2013-2014 Debao Zhang -** All right reserved. -** -** Permission is hereby granted, free of charge, to any person obtaining -** a copy of this software and associated documentation files (the -** "Software"), to deal in the Software without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Software, and to -** permit persons to whom the Software is furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -****************************************************************************/ +// + #include "xlsxzipwriter_p.h" + +#include #include #include -namespace QXlsx { +QT_BEGIN_NAMESPACE_XLSX ZipWriter::ZipWriter(const QString &filePath) { @@ -65,4 +45,4 @@ void ZipWriter::close() m_writer->close(); } -} // namespace QXlsx +QT_END_NAMESPACE_XLSX diff --git a/README.ko.md b/README.ko.md index 63e22eb..4dcb00e 100644 --- a/README.ko.md +++ b/README.ko.md @@ -30,13 +30,10 @@ Travis CI | AppVeyor | CodeFactor - [테스트된 환경](TestEnv.md) 참조 -## 이슈 - -[![Waffle.io - Columns and their card count](https://badge.waffle.io/QtExcel/QXlsx.svg?columns=all)](https://waffle.io/QtExcel/QXlsx) - ## 할 일 - [테스트 할 일](ToTest.md) - [업그레이드 할 일](ToUpgrade.md) +- [비전](Vision.md) ## 컨트리뷰터 - [컨트리뷰터](https://github.com/QtExcel/QXlsx/graphs/contributors) 참조. diff --git a/README.md b/README.md index d3d20e5..8fded46 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,10 @@ Travis CI | AppVeyor | CodeFactor - See [tested environments](TestEnv.md) -## Issue - -[![Waffle.io - Columns and their card count](https://badge.waffle.io/QtExcel/QXlsx.svg?columns=all)](https://waffle.io/QtExcel/QXlsx) - ## To Do - [To test](ToTest.md) - [What to upgrade](ToUpgrade.md). +- [Vision](Vision.md) ## Contributions - See [contributors](https://github.com/QtExcel/QXlsx/graphs/contributors). diff --git a/Vision.md b/Vision.md new file mode 100644 index 0000000..f707968 --- /dev/null +++ b/Vision.md @@ -0,0 +1,12 @@ +# Vision of QXlsx + +- I will prepare the QtExcel library for Qt6. + +## Qt6Excel + +- cmake support (change main maker) +- based on modern C++(C++17) and new compiler + + + +