LibXL version: 5.2.0 x64
OS: Windows 10/11
Compiler: VS 2022
Problem:
Calling sheet->defaultRowHeight() when setDefaultRowHeight() was never called behaves incorrectly in both formats:
XLSX (xlCreateXMLBook): crashes with 0xC0000005 (access violation)
XLS (xlCreateBook): returns 0 instead of Excel default (~14.25)
Must call setDefaultRowHeight() once first to initialize internal state, then reading works correctly in both formats.
Reproduce (XLSX, crashes):
Book* book = xlCreateXMLBook();
book->setKey(L"name", L"key");
Sheet* sheet = book->addSheet(L"Sheet1", NULL);
// CRASH here: 0xC0000005
double h = sheet->defaultRowHeight();
Reproduce (XLS, returns 0):
Book* book = xlCreateBook();
book->setKey(L"name", L"key");
Sheet* sheet = book->addSheet(L"Sheet1", NULL);
double h = sheet->defaultRowHeight(); // returns 0, should be ~14.25
Works fine (set first, then read):
sheet->setDefaultRowHeight(15.0);
double h = sheet->defaultRowHeight(); // returns 15.0, correct
Also crashes/returns 0 after loading a file that doesn’t explicitly store default row height (most files don’t, they use Excel’s built-in default 14.25).
Expected: Return Excel default row height (~14.25) when never set, in both XLSX and XLS. No crash.
Root cause: Likely missing NULL-check / uninitialized internal default-row-height pointer in defaultRowHeight(). setDefaultRowHeight() allocates/initializes it, so reading after set works.
Please fix. Thanks.