CommentsPart

Overview

CommentsPart is a class in Aspose.Slides for CPP. Inherits from: CommentsPart.

Manages a slide comments XML part (ppt/comments/slideN.xml). One file exists per slide that has comments. Provides CRUD operations for individual comment elements and static factory/lifecycle methods.

Methods

SignatureDescription
get_comments()std::vector<CommentData>Get all comments in this part.
get_comments_by_author(author_id: int32_t)std::vector<CommentData>Get comments filtered by author ID.
find_comment_by_idx(author_id: int32_t, idx: int32_t)std::optional<CommentData>Find a comment by author ID and index.
find_comment_by_idx_all(idx: int32_t)std::optional<CommentData>Find a comment by index across all authors (for parentCmId lookup).
add_comment(author_id: int32_t, idx: int32_t, text: std::string_view, pos_x: double, pos_y: double, dt_str: std::string_view, parent_idx: std::optional<int32_t>)CommentDataAppend a new comment element and return its CommentData.
insert_comment(index: int32_t, author_id: int32_t, idx: int32_t, text: std::string_view, pos_x: double, pos_y: double, dt_str: std::string_view, parent_idx: std::optional<int32_t>)CommentDataInsert a comment at the given position among existing comments.
remove_comment(author_id: int32_t, idx: int32_t)Remove a specific comment by author ID and index.
remove_comment_elem(elem: pugi::xml_node)Remove a comment by its XML node.
remove_comments_at(index: int32_t)Remove the comment at the given positional index.
clear()Remove all comments from this part.
count()int32_tNumber of comments in this part.
is_empty()boolWhether this part has no comments.
save()Persist the XML back to the package.
create_for_slide(package: opc::OpcPackage, slide_part_name: std::string_view)CommentsPartCreate a new empty comments part for a slide and register all relationships and content types. RelationshipsManager so the relationship survives subsequent saves.
load_for_slide(package: opc::OpcPackage, slide_part_name: std::string_view)std::optional<CommentsPart>Load the comments part for a slide, if one exists.
delete_for_slide(package: opc::OpcPackage, slide_part_name: std::string_view)Delete the comments part associated with a slide.
resolve_target(from_part: std::string_view, target: std::string_view)std::stringResolve a relative target path to an absolute part name.
compute_relative_target(from_part: std::string_view, to_part: std::string_view)std::stringCompute a relative path from one part to another.