From 3959b4a20e951a937c4753c9950bf2269d8d09fe Mon Sep 17 00:00:00 2001 From: chengli <783535094@qq.com> Date: Thu, 11 Aug 2022 18:11:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=AD=A3=E6=96=87=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E5=92=8C=E7=BB=93=E6=9D=9F=E6=A0=87=E8=AF=86=E3=80=82?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=9A=E8=A1=8C=E6=96=87=E6=9C=AC=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E6=A0=87=E8=AF=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pal/datamigration/util/readword/WordUtilXWPF.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readword/WordUtilXWPF.java b/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readword/WordUtilXWPF.java index 87453531..fba5ae00 100644 --- a/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readword/WordUtilXWPF.java +++ b/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readword/WordUtilXWPF.java @@ -179,7 +179,7 @@ public class WordUtilXWPF { if (shapefirst != null && type == 0) { isstart = false; } - if ("内容".equals(para.getParagraphText()) && numlevel == null && isstart) { + if ("内容*".equals(para.getParagraphText() ) && isstart ){//&& numlevel == null && isstart) { isstart = false; continue; } @@ -312,7 +312,7 @@ public class WordUtilXWPF { if (paratmp.getParagraphText().matches("附件\\d{1,}:")) { islast = true; } - if ("相关文件".equals(para.getParagraphText()) && numlevel == null) { + if ("正文结束*".equals(para.getParagraphText())) { islast = true; isend = true; } @@ -322,7 +322,7 @@ public class WordUtilXWPF { } } - if (islast) { + if (islast && !isend) { strb.append(para.getParagraphText()); //拼接富文本标签 richSbuild.append(DocToHtml.getHtml(0, para.getParagraphText())); @@ -347,7 +347,7 @@ public class WordUtilXWPF { //根据上一个位置计算当前位置 shap = getSharp(x, y, countall, len, tmpshap, strb.toString()); shap.put("id", shapeId1); - shap.put("text", getShowText(strb.toString())); + shap.put("text", getShowText(strb.toString()).replaceAll("\n", "")); //shap.put("p", pnode); shap.put("level", 0); @@ -358,7 +358,7 @@ public class WordUtilXWPF { elements.put(shapeId1, shap); strb = new StringBuilder(); } else { - strb.append(para.getParagraphText()); + strb.append(para.getParagraphText()).append("\n"); //拼接富文本标签 richSbuild.append(DocToHtml.getHtml(0, para.getParagraphText())); }