mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Merge pull request #321 from Crzyrndm/Issue#282
Don't set comment size on explicit comment overload
This commit is contained in:
commit
94fd22f492
|
@ -155,12 +155,12 @@ private:
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Width of the comment box.
|
/// Width of the comment box.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int width_ = 0;
|
int width_ = 200;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Height of the comment box.
|
/// Height of the comment box.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int height_ = 0;
|
int height_ = 100;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace xlnt
|
} // namespace xlnt
|
||||||
|
|
|
@ -969,8 +969,7 @@ void cell::comment(const std::string &text, const std::string &author)
|
||||||
|
|
||||||
void cell::comment(const std::string &text, const class font &comment_font, const std::string &author)
|
void cell::comment(const std::string &text, const class font &comment_font, const std::string &author)
|
||||||
{
|
{
|
||||||
xlnt::rich_text rich_comment_text(text, comment_font);
|
comment(xlnt::comment(xlnt::rich_text(text, comment_font), author));
|
||||||
comment(xlnt::comment(rich_comment_text, author));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cell::comment(const class comment &new_comment)
|
void cell::comment(const class comment &new_comment)
|
||||||
|
@ -991,7 +990,6 @@ void cell::comment(const class comment &new_comment)
|
||||||
cell_position.second += 5;
|
cell_position.second += 5;
|
||||||
|
|
||||||
d_->comment_.get()->position(cell_position.first, cell_position.second);
|
d_->comment_.get()->position(cell_position.first, cell_position.second);
|
||||||
d_->comment_.get()->size(200, 100);
|
|
||||||
|
|
||||||
worksheet().register_comments_in_manifest();
|
worksheet().register_comments_in_manifest();
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,11 @@ int comment::height() const
|
||||||
|
|
||||||
bool comment::operator==(const comment &other) const
|
bool comment::operator==(const comment &other) const
|
||||||
{
|
{
|
||||||
return text_ == other.text_ && author_ == other.author_;
|
// not comparing top/left as this is set on a per cell basis
|
||||||
|
return text_ == other.text_
|
||||||
|
&& author_ == other.author_
|
||||||
|
&& width_ == other.width_
|
||||||
|
&& height_ == other.height_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool comment::operator!=(const comment &other) const
|
bool comment::operator!=(const comment &other) const
|
||||||
|
|
|
@ -774,6 +774,11 @@ private:
|
||||||
cell.clear_comment();
|
cell.clear_comment();
|
||||||
xlnt_assert(!cell.has_comment());
|
xlnt_assert(!cell.has_comment());
|
||||||
xlnt_assert_throws(cell.comment(), xlnt::exception);
|
xlnt_assert_throws(cell.comment(), xlnt::exception);
|
||||||
|
|
||||||
|
xlnt::comment comment_with_size("test comment", "author");
|
||||||
|
comment_with_size.size(1000, 30);
|
||||||
|
cell.comment(comment_with_size);
|
||||||
|
xlnt_assert_equals(cell.comment(), comment_with_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_copy_and_compare()
|
void test_copy_and_compare()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user