Exemple #1
0
        /**
         * Remove the comment at cellRef location, if one exists
         *
         * @param cellRef the location of the comment to remove
         * @return returns true if a comment was removed
         */
        public bool RemoveComment(CellAddress cellRef)
        {
            String         stringRef = cellRef.FormatAsString();
            CT_CommentList lst       = comments.commentList;

            if (lst != null)
            {
                CT_Comment[] commentArray = lst.GetCommentArray();
                for (int i = 0; i < commentArray.Length; i++)
                {
                    CT_Comment comment = commentArray[i];
                    if (stringRef.Equals(comment.@ref))
                    {
                        lst.RemoveComment(i);

                        if (commentRefs != null)
                        {
                            commentRefs.Remove(cellRef);
                        }
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemple #2
0
        public bool RemoveComment(string cellRef)
        {
            CT_CommentList commentList = this.comments.commentList;

            if (commentList != null)
            {
                for (int index = 0; index < commentList.SizeOfCommentArray(); ++index)
                {
                    CT_Comment commentArray = commentList.GetCommentArray(index);
                    if (cellRef.Equals(commentArray.@ref))
                    {
                        commentList.RemoveComment(index);
                        if (this.commentRefs != null)
                        {
                            this.commentRefs.Remove(cellRef);
                        }
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemple #3
0
        public bool RemoveComment(String cellRef)
        {
            CT_CommentList lst = comments.commentList;

            if (lst != null)
            {
                for (int i = 0; i < lst.SizeOfCommentArray(); i++)
                {
                    CT_Comment comment = lst.GetCommentArray(i);
                    if (cellRef.Equals(comment.@ref))
                    {
                        lst.RemoveComment(i);

                        if (commentRefs != null)
                        {
                            commentRefs.Remove(cellRef);
                        }
                        return(true);
                    }
                }
            }
            return(false);
        }