ソースを参照

bug-打开注释列表后,打开新文档崩溃问题

zhuyi 1 年間 前
コミット
71b1e0a1be

+ 5 - 3
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListControl/CPDFAnnotationListControl.xaml.cs

@@ -94,7 +94,7 @@ namespace Compdfkit_Tools.PDFControl
             {
 
                 List<AnnotParam> annotList = GetAnnotCommentList(i, pdfViewer.PDFViewTool.GetCPDFViewer().GetDocument());
-                if (annotList != null)
+                if (annotList != null&& annotList.Count>0)
                 {
                     Dispatcher.Invoke(() =>
                     {
@@ -110,7 +110,6 @@ namespace Compdfkit_Tools.PDFControl
                 }
             }
             AnnotationList.SetAnnotationList(bindAnnotationResults);
-            pdfViewer.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
         }
 
         public List<AnnotParam> GetAnnotCommentList(int pageIndex, CPDFDocument currentDoc)
@@ -136,7 +135,10 @@ namespace Compdfkit_Tools.PDFControl
                         continue;
                     }
                     AnnotParam annotParam= ParamConverter.CPDFDataConverterToAnnotParam(currentDoc,pageIndex,annotation);
-                    annotList.Add(annotParam);
+                    if (annotParam!=null)
+                    {
+                        annotList.Add(annotParam);
+                    }
                 }
             }
             return annotList;