diff --git a/src/sys/pango/item.rs b/src/sys/pango/item.rs index aadaf94..f7472b8 100644 --- a/src/sys/pango/item.rs +++ b/src/sys/pango/item.rs @@ -20,12 +20,14 @@ glib_wrapper! { } impl Item { + #[cfg(test)] pub fn new() -> Self { unsafe { from_glib_none(pango_sys::pango_item_new()) } } + #[cfg(test)] pub fn set_offset(&mut self, offset: i32, length: i32, num_chars: i32) { self.0.offset = offset; self.0.length = length; diff --git a/src/ui_model/line.rs b/src/ui_model/line.rs index cd3353d..df039b7 100644 --- a/src/ui_model/line.rs +++ b/src/ui_model/line.rs @@ -60,7 +60,7 @@ impl Line { } fn set_cell_to_empty(&mut self, cell_idx: usize) -> bool { - if self.item_line[cell_idx].is_some() { + if self.is_binded_to_item(cell_idx) { self.item_line[cell_idx] = None; self.cell_to_item[cell_idx] = -1; self.line[cell_idx].dirty = true;