From daef10ae82240649f2bb9bd849812e175d0ffc1e Mon Sep 17 00:00:00 2001 From: Jay Two Date: Sat, 29 Dec 2018 21:57:10 +0900 Subject: [PATCH] duplicate function name : isloadpack..() and load() --- Example.md | 4 ++-- HelloWorld/main.cpp | 18 ++++-------------- QXlsx/header/xlsxdocument.h | 1 + QXlsx/source/xlsxdocument.cpp | 5 +++++ TestEnv.md | 1 + 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Example.md b/Example.md index 304dc13..75c4040 100644 --- a/Example.md +++ b/Example.md @@ -36,14 +36,14 @@ int main(int argc, char *argv[]) // [2] Reading excel file(*.xlsx) Document xlsxR("Test.xlsx"); // load excel file - if (xlsxR.isLoadPackage()) + if (xlsxR.load()) { int row = 1; int col = 1; Cell* cell = xlsxR.cellAt(row, col); // get cell pointer. if ( cell != NULL ) { QVariant var = cell->readValue(); // read cell value (number(double), QDateTime, QString ...) - qDebug() << var; // display value + qDebug() << var; // display value. it is 'Hello Qt!'. } } diff --git a/HelloWorld/main.cpp b/HelloWorld/main.cpp index ee7b41c..688a141 100644 --- a/HelloWorld/main.cpp +++ b/HelloWorld/main.cpp @@ -1,14 +1,5 @@ -// QXlsx -// MIT License -// https://github.com/j2doll/QXlsx -// -// QtXlsx -// https://github.com/dbzhang800/QtXlsxWriter -// http://qtxlsx.debao.me/ -// MIT License - -// // main.cpp +// QXlsx // MIT License // https://github.com/j2doll/QXlsx // #include @@ -37,7 +28,7 @@ int main(int argc, char *argv[]) // [1] Writing excel file(*.xlsx) QXlsx::Document xlsxW; xlsxW.write("A1", "Hello Qt!"); // write "Hello Qt!" to cell(A,1). it's shared string. - if (xlsxW.saveAs("Test.xlsx")) // save the document as 'Test.xlsx' + if ( xlsxW.saveAs("Test.xlsx") ) // save the document as 'Test.xlsx' { qDebug() << "[debug] success to write xlsx file"; } @@ -50,7 +41,7 @@ int main(int argc, char *argv[]) // [2] Reading excel file(*.xlsx) Document xlsxR("Test.xlsx"); // load excel file - if (xlsxR.isLoadPackage()) + if ( xlsxR.load() ) { qDebug() << "[debug] success to load xlsx file."; @@ -59,8 +50,7 @@ int main(int argc, char *argv[]) if ( cell != NULL ) { QVariant var = cell->readValue(); // read cell value (number(double), QDateTime, QString ...) - - qDebug() << var; // display value + qDebug() << "[debug] cell(1,1) is " << var; // Display value. It is 'Hello Qt!'. } else { diff --git a/QXlsx/header/xlsxdocument.h b/QXlsx/header/xlsxdocument.h index f7952f8..1db5585 100644 --- a/QXlsx/header/xlsxdocument.h +++ b/QXlsx/header/xlsxdocument.h @@ -111,6 +111,7 @@ public: bool saveAs(QIODevice *device) const; bool isLoadPackage() const; + bool load() const; // equals to isLoadPackage() bool changeimage(int filenoinmidea,QString newfile); // add by liufeijin20181025 diff --git a/QXlsx/source/xlsxdocument.cpp b/QXlsx/source/xlsxdocument.cpp index c4e00c1..633b658 100644 --- a/QXlsx/source/xlsxdocument.cpp +++ b/QXlsx/source/xlsxdocument.cpp @@ -1066,6 +1066,11 @@ bool Document::isLoadPackage() const return d->isLoad; } +bool Document::load() const +{ + return isLoadPackage(); +} + /*! * Destroys the document and cleans up. */ diff --git a/TestEnv.md b/TestEnv.md index 8daf2e8..bf4d4de 100644 --- a/TestEnv.md +++ b/TestEnv.md @@ -4,6 +4,7 @@ | Qt | Tool | OS | Build | | ------ | ------------------ | ------------------------- | ------- | +| 5.12.0 | Visual Studio 2017 | Windows 64bit | :smile: | | 5.12.0 | MingW 64 bit | Windows 64bit | :smile: | | 5.11.2 | Visual Studio 2017 | Windows 64bit | :smile: | | 5.10.1 | MingW | Windows 32bit | :smile: |