使用Umya电子表格为特定单元格创建注释。

huangapple go评论59阅读模式
英文:

Creating comments with umya spreadsheet for specific cell

问题

我使用umya电子表格编辑xlsx文件并想在更改的单元格中添加注释。
我对Rust非常陌生,可能是我漏掉了什么,但我找不到指定注释坐标的方法。

我正在使用umya电子表格版本0.9.1。

文档
如您所见,没有“set_coordinate”的实现,我对此感到非常困惑。
我没有问题创建和添加注释Comment::default(),但它只出现在A1。

英文:

Im using umya spreadsheet to edit a xlsx file and want to add a comment with the changed cells.
I am very new to rust and it could be that i am missing something, but i cantf find a way to specify coordinate of a comment.

I am using umya spreadsheet version 0.9.1

docs
As you can see, there is no implementation for "set_coordinate" and i am very confused as to why.
I have no problem creating and adding a comment with Comment::default(), but it only appears on A1.

答案1

得分: 1

get_coordinate_mut方法是你要找的。这返回坐标的可变引用,你可以用它来修改坐标:

let coord = comment.get_coordinate_mut();
coord.set_col_num(3);
coord.set_row_num(12);

// comment现在位于C12
英文:

The get_coordinate_mut method is what you're looking for. This returns a mutable reference to the coordinates, which you can use to modify the coordinates:

let coord = comment.get_coordinate_mut();
coord.set_col_num(3);
coord.set_row_num(12);

// comment is now at C12

huangapple
  • 本文由 发表于 2023年4月20日 05:00:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76058775.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定