ODS: incorrect range calculation if first row is empty and repeated
dimastbk opened this issue · comments
If first row in ODS contains table:number-rows-repeated
> 1, then row_min of Range is wrong.
#[test]
fn ods_number_rows_repeated() {
setup();
let path = format!(
"{}/tests/number_rows_repeated.ods",
env!("CARGO_MANIFEST_DIR")
);
let mut ods: Ods<_> = open_workbook(&path).unwrap();
let range = ods.worksheet_range_at(0).unwrap().unwrap();
let range = range.range((0, 0), range.end().unwrap());
range_eq!(
range,
[
[String("A".to_string()), String("B".to_string())],
[String("C".to_string()), String("D".to_string())],
[String("C".to_string()), String("D".to_string())],
[Empty, Empty],
[Empty, Empty],
[String("C".to_string()), String("D".to_string())],
[Empty, Empty],
[String("C".to_string()), String("D".to_string())],
]
);
let range = ods.worksheet_range_at(1).unwrap().unwrap();
let range = range.range((0, 0), range.end().unwrap());
range_eq!(
range,
[
[Empty, Empty],
[String("A".to_string()), String("B".to_string())],
[String("C".to_string()), String("D".to_string())],
[String("C".to_string()), String("D".to_string())],
[Empty, Empty],
[Empty, Empty],
[String("C".to_string()), String("D".to_string())],
[Empty, Empty],
[String("C".to_string()), String("D".to_string())],
]
);
let range = ods.worksheet_range_at(2).unwrap().unwrap();
let range = range.range((0, 0), range.end().unwrap());
range_eq!( // failed
range,
[
[Empty, Empty],
[Empty, Empty],
[String("A".to_string()), String("B".to_string())],
[String("C".to_string()), String("D".to_string())],
[String("C".to_string()), String("D".to_string())],
[Empty, Empty],
[Empty, Empty],
[String("C".to_string()), String("D".to_string())],
[Empty, Empty],
[String("C".to_string()), String("D".to_string())],
]
);
}