FileBasedView: Set part before deleting a comment.

The comment to delete is searched inside the selected part on the core
side. We need to indicate the comment's part before we delete it.

Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I248aa375ca6bcb6a1ff6b0456bd1943319147e00
This commit is contained in:
Gökay Şatır 2021-05-26 14:02:09 +03:00 committed by Gökay ŞATIR
parent eaf3772489
commit 8131ea6463

View file

@ -446,11 +446,18 @@ class CommentSection {
value: id
}
};
if (app.file.fileBasedView) // We have to set the part from which the comment will be removed as selected part before the process.
this.map.setPart(this.sectionProperties.docLayer._selectedPart, false);
if (this.sectionProperties.docLayer._docType === 'text')
this.map.sendUnoCommand('.uno:DeleteComment', comment);
else if (this.sectionProperties.docLayer._docType === 'presentation' || this.sectionProperties.docLayer._docType === 'drawing')
this.map.sendUnoCommand('.uno:DeleteAnnotation', comment);
if (app.file.fileBasedView)
this.map.setPart(0, false);
this.unselect();
this.map.focus();
}