Explorar o código

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

liyuxuan hai 2 meses
pai
achega
f19a6e13da
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.FindReplace.cs

+ 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;