48 lines
2.0 KiB
Diff
48 lines
2.0 KiB
Diff
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -558,8 +558,8 @@ ENDIF ()
|
|
|
|
### XLSX (Excel) (optional) #############################
|
|
IF (ENABLE_XLSX)
|
|
- FIND_PACKAGE (QXlsx)
|
|
- IF (QXLSX_FOUND)
|
|
+ FIND_PACKAGE (QXlsxQt6)
|
|
+ IF (QXlsxQt6_FOUND)
|
|
MESSAGE (STATUS "QXlsx library FOUND.")
|
|
add_definitions (-DHAVE_QXLSX)
|
|
ELSE ()
|
|
--- a/src/CMakeLists.txt
|
|
+++ b/src/CMakeLists.txt
|
|
@@ -680,8 +680,9 @@ IF (ENABLE_XLSX)
|
|
target_include_directories( labplot2lib PRIVATE ${QXLSX_INCLUDE_DIR} )
|
|
ENDIF ()
|
|
|
|
- IF (QXLSX_FOUND OR BUILD_QXLSX)
|
|
- target_link_libraries( labplot2backendlib QXlsx )
|
|
+ IF (QXLSX_FOUND OR BUILD_QXLSX OR QXlsxQt6_FOUND)
|
|
+ target_link_libraries( labplot2backendlib QXlsx::QXlsx )
|
|
+ target_link_libraries( labplot2lib QXlsx::QXlsx )
|
|
ENDIF ()
|
|
ENDIF ()
|
|
|
|
--- a/src/backend/datasources/filters/XLSXFilter.cpp
|
|
+++ b/src/backend/datasources/filters/XLSXFilter.cpp
|
|
@@ -757,7 +757,7 @@ void XLSXFilterPrivate::parse(const QString& fileName, QTreeWidgetItem* parentIt
|
|
bool XLSXFilterPrivate::dataRangeCanBeExportedToMatrix(const QXlsx::CellRange& range) const {
|
|
for (int i = range.firstRow(); i <= range.lastRow(); ++i) {
|
|
for (int j = range.firstColumn(); j <= range.lastColumn(); ++j) {
|
|
- const auto* cell = m_document->cellAt(i, j);
|
|
+ const std::shared_ptr<QXlsx::Cell> cell = m_document->cellAt(i, j);
|
|
if (cell && cell->cellType() != QXlsx::Cell::CellType::NumberType) {
|
|
if (cell->cellType() == QXlsx::Cell::CellType::CustomType) {
|
|
bool ok = false;
|
|
@@ -792,7 +792,7 @@ QXlsx::Cell::CellType XLSXFilterPrivate::columnTypeInRange(const int column, con
|
|
bool numeric = false, datetime = false;
|
|
if (column >= range.firstColumn() && column <= range.lastColumn()) {
|
|
for (int row = range.firstRow(); row <= range.lastRow(); ++row) {
|
|
- const auto* cell = m_document->cellAt(row, column);
|
|
+ const std::shared_ptr<QXlsx::Cell> cell = m_document->cellAt(row, column);
|
|
if (!cell)
|
|
continue;
|
|
|