Parcourir la source

修复导入过滤标题bug

宋悦 il y a 8 ans
Parent
commit
3e00a61e35

+ 2 - 6
cqb-comm-utils/src/main/java/com/qmth/cqb/utils/word/DocxProcessUtil.java

@@ -562,11 +562,9 @@ public final class DocxProcessUtil {
 
                             // 过滤题干标题
                             if (tmpText.matches("^\\d{1,}\\.[\\s\\S]*")) {
-                                if (index == 2) {
-                                    return p;
-                                }
                                 tmpText = tmpText.replaceFirst("\\d{1,}\\.","");
                                 text.setValue(tmpText);
+                                return p;
                             } else if(tmpText.matches("^\\d{1,}$")){
                                 tmpText = tmpText.replaceFirst("\\d{1,}","");
                                 text.setValue(tmpText);
@@ -580,11 +578,9 @@ public final class DocxProcessUtil {
 
                             // 过滤选项标题
                             if (tmpText.matches("^[A-Z]\\.[\\s\\S]*")) {
-                                if (index == 2) {
-                                    return p;
-                                }
                                 tmpText = tmpText.replaceFirst("[A-Z]\\.","");
                                 text.setValue(tmpText);
+                                return p;
                             } else if(tmpText.matches("^[A-Z]$")){
                                 tmpText = tmpText.replaceFirst("[A-Z]","");
                                 text.setValue(tmpText);