Fix defineName bug

sheetId is used in application inside, when save to/load from xml file,
which will convert to/from localSheetId
This commit is contained in:
Debao Zhang
2013-10-30 13:37:44 +08:00
parent fd1bf132a8
commit c87413e8ad
+6 -4
View File
@@ -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;
}
} }
} }