|
@@ -87,7 +87,7 @@ namespace ComPDFKit.Tool
|
|
|
/// </summary>
|
|
|
private Cursor addImageEditCursor = Cursors.Arrow;
|
|
|
|
|
|
- public bool SaveEmptyStickyAnnotSave { get; set; } = true;
|
|
|
+ public bool SaveEmptyStickyAnnot { get; set; } = true;
|
|
|
public void SetActiveCropping(bool isActiveCropping)
|
|
|
{
|
|
|
this.isActiveCropping = isActiveCropping;
|
|
@@ -1456,10 +1456,9 @@ namespace ComPDFKit.Tool
|
|
|
|
|
|
viewerTool.ClearDrawAnnot();
|
|
|
viewerTool.GetCPDFViewer().UpdateAnnotFrame();
|
|
|
-
|
|
|
viewerTool.GetCPDFViewer().UndoManager.AddHistory(annotHistory);
|
|
|
|
|
|
- if (annotation.Type == C_ANNOTATION_TYPE.C_ANNOTATION_TEXT && SaveEmptyStickyAnnotSave == false)
|
|
|
+ if (annotation.Type == C_ANNOTATION_TYPE.C_ANNOTATION_TEXT && SaveEmptyStickyAnnot == false)
|
|
|
{
|
|
|
BaseLayer baseLayer1 = viewerTool.GetCPDFViewer().GetViewForTag(viewerTool.GetCPDFViewer().GetAnnotViewTag());
|
|
|
int checkPageIndex = currentParam.PageIndex;
|
|
@@ -1489,25 +1488,28 @@ namespace ComPDFKit.Tool
|
|
|
private void StickyAnnot_StickyPopupClosed(object sender, EventArgs e)
|
|
|
{
|
|
|
StickyNoteAnnot.StickyPopupClosed -= StickyAnnot_StickyPopupClosed;
|
|
|
- StickyNoteAnnot stickyAnnot =sender as StickyNoteAnnot;
|
|
|
- if(stickyAnnot==null)
|
|
|
+ StickyNoteAnnot stickyAnnot = sender as StickyNoteAnnot;
|
|
|
+ if (stickyAnnot == null)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
- AnnotData annotData= stickyAnnot.GetAnnotData();
|
|
|
+ AnnotData annotData = stickyAnnot.GetAnnotData();
|
|
|
AnnotParam currentParam = ParamConverter.AnnotConverter(viewerTool.GetCPDFViewer().GetDocument(), annotData.Annot);
|
|
|
AnnotHistory annotHistory = ParamConverter.CreateHistory(annotData.Annot);
|
|
|
- string content=annotData.Annot.GetContent();
|
|
|
+ string content = annotData.Annot.GetContent();
|
|
|
if (string.IsNullOrEmpty(content))
|
|
|
{
|
|
|
- annotData.Annot.RemoveAnnot();
|
|
|
- viewerTool.ClearDrawAnnot();
|
|
|
- viewerTool.GetCPDFViewer().UpdateAnnotFrame();
|
|
|
- viewerTool.SelectedAnnotForIndex(-1,-1);
|
|
|
- annotHistory.CurrentParam = currentParam;
|
|
|
- annotHistory.Action = HistoryAction.Remove;
|
|
|
- annotHistory.PDFDoc = viewerTool.PDFViewer.GetDocument();
|
|
|
- viewerTool.GetCPDFViewer().UndoManager.AddHistory(annotHistory);
|
|
|
+ if (annotData.Annot.RemoveAnnot())
|
|
|
+ {
|
|
|
+ viewerTool.ClearDrawAnnot();
|
|
|
+ viewerTool.GetCPDFViewer().UpdateAnnotFrame();
|
|
|
+ viewerTool.SelectedAnnotForIndex(-1, -1);
|
|
|
+ annotHistory.CurrentParam = currentParam;
|
|
|
+ annotHistory.Action = HistoryAction.Remove;
|
|
|
+ annotHistory.PDFDoc = viewerTool.PDFViewer.GetDocument();
|
|
|
+ viewerTool.GetCPDFViewer().UndoManager.AddHistory(annotHistory);
|
|
|
+ }
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
AnnotParam previousParam = ParamConverter.AnnotConverter(viewerTool.GetCPDFViewer().GetDocument(), annotData.Annot);
|