Skip to content

Commit

Permalink
Fix bug #72483
Browse files Browse the repository at this point in the history
  • Loading branch information
KhromovNikita committed Jan 16, 2025
1 parent d9001d1 commit 200cada
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
10 changes: 10 additions & 0 deletions pdf/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,16 @@
}

Lock.Set_Type(NewType, true);

if (NewType == AscCommon.c_oAscLockTypes.kLockTypeNone) {
Class.AddToRedraw && Class.AddToRedraw();
if (Class.IsAnnot && Class.IsAnnot()) {
// if annot is comment or annot with comment then release locks for it too
if (Class.IsComment() || (Class.IsUseContentAsComment() && Class.GetContents() != undefined) || Class.GetReply(0) != null) {
Asc.editor.sync_UnLockComment(Class.Get_Id());
}
}
}
}


Expand Down
31 changes: 10 additions & 21 deletions pdf/src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -3099,7 +3099,7 @@ var CPresentation = CPresentation || function(){};
else {
oAnnot.RemoveComment();
}
}, AscDFH.historydescription_Pdf_RemoveComment, this);
}, AscDFH.historydescription_Pdf_RemoveComment, this, Id);
};
CPDFDoc.prototype.RemoveAnnot = function(Id) {
let oController = this.GetController();
Expand Down Expand Up @@ -6091,28 +6091,17 @@ var CPresentation = CPresentation || function(){};
break;
}
case AscCommon.changestype_2_Comment: {
let sCommentId = AdditionalData;
let oTargetAnnot = this.GetAnnotById(AdditionalData);

let selected_objects = oController.selectedObjects.slice();
if (oController.selection.groupSelection) {
selected_objects.push(oController.selection.groupSelection);
}
if (this.mouseDownAnnot) {
selected_objects.push(this.mouseDownAnnot);
}
if (oTargetAnnot) {
let check_obj = {
"type": AscLockTypeElemPDF.Object,
"pageId": oCurPageInfo.GetId(),
"objId": oTargetAnnot.GetId(),
"guid": oTargetAnnot.GetId()
};

for (let i = 0; i < selected_objects.length; ++i) {
if (selected_objects[i].GetId() == sCommentId) {
let check_obj = {
"type": AscLockTypeElemPDF.Object,
"pageId": oCurPageInfo.GetId(),
"objId": selected_objects[i].GetId(),
"guid": selected_objects[i].GetId()
};

selected_objects[i].Lock.Check(check_obj);
break;
}
oTargetAnnot.Lock.Check(check_obj);
}

break;
Expand Down

0 comments on commit 200cada

Please sign in to comment.