Make use of clang-format
Change-Id: I71bbf133223931eddb0c7e568cc0b99ecf807fa1
This commit is contained in:
@@ -54,24 +54,28 @@ int main()
|
||||
xlsx.addSheet("ArrayFormula");
|
||||
Worksheet *sheet = xlsx.currentWorksheet();
|
||||
|
||||
for (int row=2; row<20; ++row) {
|
||||
sheet->write(row, 2, row*2); //B2:B19
|
||||
sheet->write(row, 3, row*3); //C2:C19
|
||||
for (int row = 2; row < 20; ++row) {
|
||||
sheet->write(row, 2, row * 2); // B2:B19
|
||||
sheet->write(row, 3, row * 3); // C2:C19
|
||||
}
|
||||
sheet->writeFormula("D2", CellFormula("B2:B19+C2:C19", "D2:D19", CellFormula::ArrayType));
|
||||
sheet->writeFormula("E2", CellFormula("=CONCATENATE(\"The total is \",D2:D19,\" units\")", "E2:E19", CellFormula::ArrayType));
|
||||
sheet->writeFormula("E2",
|
||||
CellFormula("=CONCATENATE(\"The total is \",D2:D19,\" units\")", "E2:E19",
|
||||
CellFormula::ArrayType));
|
||||
//![2]
|
||||
|
||||
//![21]
|
||||
xlsx.addSheet("SharedFormula");
|
||||
sheet = xlsx.currentWorksheet();
|
||||
|
||||
for (int row=2; row<20; ++row) {
|
||||
sheet->write(row, 2, row*2); //B2:B19
|
||||
sheet->write(row, 3, row*3); //C2:C19
|
||||
for (int row = 2; row < 20; ++row) {
|
||||
sheet->write(row, 2, row * 2); // B2:B19
|
||||
sheet->write(row, 3, row * 3); // C2:C19
|
||||
}
|
||||
sheet->writeFormula("D2", CellFormula("=B2+C2", "D2:D19", CellFormula::SharedType));
|
||||
sheet->writeFormula("E2", CellFormula("=CONCATENATE(\"The total is \",D2,\" units\")", "E2:E19", CellFormula::SharedType));
|
||||
sheet->writeFormula("E2",
|
||||
CellFormula("=CONCATENATE(\"The total is \",D2,\" units\")", "E2:E19",
|
||||
CellFormula::SharedType));
|
||||
|
||||
//![21]
|
||||
|
||||
@@ -79,11 +83,11 @@ int main()
|
||||
xlsx.save();
|
||||
//![3]
|
||||
|
||||
//Make sure that read/write works well.
|
||||
// Make sure that read/write works well.
|
||||
Document xlsx2("Book1.xlsx");
|
||||
Worksheet *sharedFormulaSheet = dynamic_cast<Worksheet*>(xlsx2.sheet("SharedFormula"));
|
||||
for (int row=2; row<20; ++row) {
|
||||
qDebug()<<sharedFormulaSheet->read(row, 4);
|
||||
Worksheet *sharedFormulaSheet = dynamic_cast<Worksheet *>(xlsx2.sheet("SharedFormula"));
|
||||
for (int row = 2; row < 20; ++row) {
|
||||
qDebug() << sharedFormulaSheet->read(row, 4);
|
||||
}
|
||||
|
||||
xlsx2.saveAs("Book2.xlsx");
|
||||
|
||||
Reference in New Issue
Block a user