Browse Source

Fix defineName bug

sheetId is used in application inside, when save to/load from xml file,
which will convert to/from localSheetId
master
Debao Zhang 11 years ago
parent
commit
c87413e8ad
  1. 10
      src/xlsx/xlsxworkbook.cpp

10
src/xlsx/xlsxworkbook.cpp

@ -142,10 +142,12 @@ bool Workbook::defineName(const QString &name, const QString &formula, const QSt
formulaString = formula.mid(1); formulaString = formula.mid(1);
int id=-1; int id=-1;
for (int i=0; i<d->worksheets.size(); ++i) { if (!scope.isEmpty()) {
if (d->worksheets[i]->sheetName() == scope) { for (int i=0; i<d->worksheets.size(); ++i) {
id = i; if (d->worksheets[i]->sheetName() == scope) {
break; id = d->worksheets[i]->sheetId();
break;
}
} }
} }

Loading…
Cancel
Save