umya-spreadsheet icon indicating copy to clipboard operation
umya-spreadsheet copied to clipboard

`get_hyperlink()` doesn't work in combination with `get_lazy_read_sheet_cells()`

Open 0chroma opened this issue 6 months ago • 3 comments

When getting cells lazily, hyperlinks don't seem to be read. For example, this works:

let book = umya_spreadsheet::reader::xlsx::read(path.clone())?;
let sheet = book.get_sheet(&0).unwrap();
let cells = sheet.get_collection_by_row(&2);
let links = cells
    .iter()
    .filter_map(|cell| {
        cell.get_hyperlink().map(|hl| hl.get_url().to_string())
    })
    .collect::<Vec<_>>();
dbg!(links);

But this does not:

let book = umya_spreadsheet::reader::xlsx::lazy_read(path.as_ref())?;
let sheet = book.get_lazy_read_sheet_cells(&0).unwrap();
let cells = sheet.get_collection_by_row(&2);
let links = cells
    .iter()
    .filter_map(|cell| {
        cell.get_hyperlink().map(|hl| hl.get_url().to_string())
    })
    .collect::<Vec<_>>();
dbg!(links);

0chroma avatar Jun 04 '25 05:06 0chroma