Skip to content

Commit

Permalink
Fixed a bug where the xlMulti type is returned from an range referenc…
Browse files Browse the repository at this point in the history
…e and it was not converting
  • Loading branch information
ronniec95 committed Apr 23, 2021
1 parent 27d5c38 commit c35b908
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ impl From<&xloper12> for String {
Err(e) => e.to_string(),
}
}
xltypeMulti => unsafe {
let p = v.val.array.lparray;
String::from(&Variant::from(p.offset(0))).clone()
},
xltypeBool => unsafe { v.val.xbool == 1 }.to_string(),
_ => String::new(),
}
Expand All @@ -302,6 +306,10 @@ impl From<&xloper12> for f64 {
xltypeInt => unsafe { v.val.w as f64 },
xltypeStr => 0.0,
xltypeBool => (unsafe { v.val.xbool == 1 }) as i64 as f64,
xltypeMulti => unsafe {
let p = v.val.array.lparray;
f64::from(&*p.offset(0))
},
_ => 0.0,
}
}
Expand Down

0 comments on commit c35b908

Please sign in to comment.