From 46e6d41b7b1efe710a90587b4f248a1a91ab587c Mon Sep 17 00:00:00 2001 From: Jay Two Date: Sun, 6 Jun 2021 21:58:20 +0900 Subject: [PATCH] issue #162 --- IssueTest/test.cpp | 28 +++++----------------------- QXlsx/source/xlsxworkbook.cpp | 2 +- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/IssueTest/test.cpp b/IssueTest/test.cpp index 97d6a84..83b905a 100644 --- a/IssueTest/test.cpp +++ b/IssueTest/test.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include using namespace std; @@ -21,42 +22,23 @@ using namespace std; #include "xlsxrichstring.h" #include "xlsxworkbook.h" -int test95( QVector params ); +int test162( QVector params ); int test( QVector params ) { qDebug() << "[debug] current path : " << QDir::currentPath(); - return test95( params ); + return test162( params ); } -int test95( QVector params ) +int test162( QVector params ) { using namespace QXlsx; Document xlsx; - for (int i=0; i<10; ++i) - { - QImage image(40, 30, QImage::Format_RGB32); - image.fill( uint(qrand() % 16581375) ); - - int index = xlsx.insertImage( 10*i, 5, image ); - - QImage img; - if ( xlsx.getImage( index, img ) ) - { - QString filename; - filename = QString("image %1.png").arg( index ); - img.save( filename ); - - qDebug() << " [image index] " << index; - } - } - - qDebug() << " image count : " << xlsx.getImageCount(); xlsx.saveAs("image1.xlsx"); - QXlsx::Document xlsx2("image1.xlsx"); + Document xlsx2("image1.xlsx"); qDebug() << "xlsx2" ; qDebug() << " image count : " << xlsx.getImageCount(); xlsx2.saveAs("image2.xlsx"); diff --git a/QXlsx/source/xlsxworkbook.cpp b/QXlsx/source/xlsxworkbook.cpp index b15f747..7bd4d06 100644 --- a/QXlsx/source/xlsxworkbook.cpp +++ b/QXlsx/source/xlsxworkbook.cpp @@ -374,7 +374,7 @@ bool Workbook::copySheet(int index, const QString &newName) d->sheets.append(QSharedPointer (sheet)); d->sheetNames.append(sheet->sheetName()); - return false; + return true; // #162 } /*!