Procházet zdrojové kódy

ComPDFKit.Tool(Win) - 文字替换 FindPrevious函数索引增加异常判断

liyuxuan před 2 měsíci
rodič
revize
f19a6e13da

+ 6 - 0
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.FindReplace.cs

@@ -184,6 +184,12 @@ namespace ComPDFKit.Tool
                 }
             }
 
+            if (currentSelectionIndex < 0 || (editTextFindSelectionList!=null && currentSelectionIndex >= editTextFindSelectionList.Count))
+            {
+                isOtherPage = false;
+                canLoop = true;
+                return false;
+            }
             editTextFindSelection = editTextFindSelectionList[currentSelectionIndex];
             GoToFoundDestination(editTextFindSelection);
             isOtherPage = false;