diff --git a/src/xlsx/xlsxworksheet.cpp b/src/xlsx/xlsxworksheet.cpp index 7d5ce8f..3fc50e3 100755 --- a/src/xlsx/xlsxworksheet.cpp +++ b/src/xlsx/xlsxworksheet.cpp @@ -1702,8 +1702,9 @@ double Worksheet::rowHeight(int row) Q_D(Worksheet); int min_col = d->dimension.firstColumn() < 0 ? 0 : d->dimension.firstColumn(); - if (d->checkDimensions(row, min_col, false, true)) - return d->sheetFormatProps.defaultRowHeight; //return default on invalid row? + if (d->checkDimensions(row, min_col, false, true) || !d->rowsInfo.contains(row)) + return d->sheetFormatProps.defaultRowHeight; //return default on invalid row + return d->rowsInfo[row]->height; } @@ -1966,21 +1967,21 @@ void WorksheetPrivate::loadXmlSheetData(QXmlStreamReader &reader) } } - } else if (reader.name() == QLatin1String("c")) { + } else if (reader.name() == QLatin1String("c")) { //Cell QXmlStreamAttributes attributes = reader.attributes(); QString r = attributes.value(QLatin1String("r")).toString(); CellReference pos(r); //get format Format format; - if (attributes.hasAttribute(QLatin1String("s"))) { + if (attributes.hasAttribute(QLatin1String("s"))) { //"s" == style index int idx = attributes.value(QLatin1String("s")).toString().toInt(); format = workbook->styles()->xfFormat(idx); if (!format.isValid()) qDebug()<Invalid style index: ").arg(idx)<