英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论