From fc32234da871e6a8921acfce90fc0239012dec86 Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Mon, 20 Oct 2014 14:43:37 +0800 Subject: [PATCH] Fix Issue #40 example worksheetoperations crash. The error is caused by SHA: a1e53218bb2076478951e5a3124c0cccdc90ab1c The "Sheet1" will not be cteated Unless the user want to access it, or the user want to save an empty workbook. --- examples/xlsx/worksheetoperations/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/xlsx/worksheetoperations/main.cpp b/examples/xlsx/worksheetoperations/main.cpp index fca8fec..fc86bb3 100644 --- a/examples/xlsx/worksheetoperations/main.cpp +++ b/examples/xlsx/worksheetoperations/main.cpp @@ -5,12 +5,11 @@ int main() { QXlsx::Document xlsx; - xlsx.renameSheet("Sheet1", "TheFirstSheet"); - for (int i=1; i<20; ++i) { for (int j=1; j<15; ++j) xlsx.write(i, j, QString("R %1 C %2").arg(i).arg(j)); } + xlsx.renameSheet("Sheet1", "TheFirstSheet"); xlsx.addSheet("TheSecondSheet"); xlsx.write(2, 2, "Hello Qt Xlsx");