【新增】新增word段落属性
This commit is contained in:
@@ -23,7 +23,6 @@ public class Paragraphs {
|
||||
public static String getParagraphAlignment(P paragraph, StyleDefinitionsPart stylePart) {
|
||||
// 先查段落自身
|
||||
PPr pPr = paragraph.getPPr();
|
||||
String parentId = Convert.getStringRandom();
|
||||
if (pPr != null && pPr.getJc() != null && pPr.getJc().getVal() != null) {
|
||||
return Convert.convertJc(pPr.getJc().getVal().value());
|
||||
}
|
||||
@@ -288,30 +287,45 @@ public class Paragraphs {
|
||||
return "未知";
|
||||
}
|
||||
/// 段落 编号列表 项目符号
|
||||
/// 段落 编号列表 列表类型
|
||||
|
||||
// 段落-编号列表
|
||||
public static List<JudgementWordsVO> getParagraphList(P paragraph, NumberingDefinitionsPart ndp, List<JudgementWordsVO> judgementWordsVOS, int betoLong, String firstId) {
|
||||
if (paragraph == null) {
|
||||
return judgementWordsVOS;
|
||||
}
|
||||
String name = "【第" + betoLong + "段】";
|
||||
String parentId = Convert.getStringRandom();
|
||||
// 先查询自身段落数据
|
||||
public static String getParagraphListLvlFuHao(P paragraph, NumberingDefinitionsPart ndp) {
|
||||
PPr pPr = paragraph.getPPr();
|
||||
if (pPr != null && pPr.getNumPr() != null && pPr.getNumPr().getNumId() != null) {
|
||||
PPrBase.NumPr numPr = pPr.getNumPr();
|
||||
BigInteger numId = numPr.getNumId() != null ? numPr.getNumId().getVal() : null;
|
||||
BigInteger ilvl = numPr.getIlvl() != null ? numPr.getIlvl().getVal() : null;
|
||||
if (numId != null && ndp != null) {
|
||||
Numbering.Num num = ndp.getJaxbElement().getNum().stream()
|
||||
.filter(n -> n.getNumId().equals(numId))
|
||||
.findFirst().orElse(null);
|
||||
if (num != null) {
|
||||
BigInteger abstractNumId = num.getAbstractNumId().getVal();
|
||||
Numbering.AbstractNum absNum = Convert.getAbstractNumById(ndp, abstractNumId);
|
||||
if (absNum != null && ilvl != null) {
|
||||
Lvl lvl = absNum.getLvl().stream()
|
||||
.filter(l -> l.getIlvl().equals(ilvl))
|
||||
.findFirst().orElse(null);
|
||||
if (lvl != null) {
|
||||
if ("bullet".equals(lvl.getNumFmt().getVal().value())) {
|
||||
return lvl.getLvlText().getVal();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "未知";
|
||||
}
|
||||
/// 段落 编号列表 列表类型
|
||||
public static String getParagraphListLvlType(P paragraph, NumberingDefinitionsPart ndp) {
|
||||
PPr pPr = paragraph.getPPr();
|
||||
if (pPr != null && pPr.getNumPr() != null && pPr.getNumPr().getNumId() != null) {
|
||||
PPrBase.NumPr numPr = pPr.getNumPr();
|
||||
BigInteger numId = numPr.getNumId() != null ? numPr.getNumId().getVal() : null;
|
||||
BigInteger ilvl = numPr.getIlvl() != null ? numPr.getIlvl().getVal() : null;
|
||||
String trueName = "【编号列表】【应用编号列表】存在";
|
||||
judgementWordsVOS = DocxSetInfo.setInfo(judgementWordsVOS, parentId, firstId, name + trueName, name + trueName, name);
|
||||
String jiBieName = "【编号列表】【列表级别】" + (ilvl != null ? ilvl.intValue() : "未知");
|
||||
judgementWordsVOS = DocxSetInfo.setInfo(judgementWordsVOS, parentId, firstId, name + jiBieName, name + jiBieName, name);
|
||||
if (numId != null && ndp != null) {
|
||||
Numbering.Num num = ndp.getJaxbElement().getNum().stream()
|
||||
.filter(n -> n.getNumId().equals(numId))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
if (num != null) {
|
||||
BigInteger abstractNumId = num.getAbstractNumId().getVal();
|
||||
Numbering.AbstractNum absNum = Convert.getAbstractNumById(ndp, abstractNumId);
|
||||
@@ -320,21 +334,11 @@ public class Paragraphs {
|
||||
Lvl lvl = absNum.getLvl().stream()
|
||||
.filter(l -> l.getIlvl().equals(ilvl))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
if (lvl != null) {
|
||||
String bianHaoYangShiName = "【编号列表】【编号样式】" + lvl.getNumFmt().getVal();
|
||||
judgementWordsVOS = DocxSetInfo.setInfo(judgementWordsVOS, parentId, firstId, name + bianHaoYangShiName, name + bianHaoYangShiName, name);
|
||||
String bianHaoGeShiName = "【编号列表】【编号格式】" + lvl.getLvlText().getVal();
|
||||
judgementWordsVOS = DocxSetInfo.setInfo(judgementWordsVOS, parentId, firstId, name + bianHaoGeShiName, name + bianHaoGeShiName, name);
|
||||
if ("bullet".equals(lvl.getNumFmt().getVal().value())) {
|
||||
String xiangMuFuHaoName = "【编号列表】【项目符号】" + lvl.getLvlText().getVal();
|
||||
judgementWordsVOS = DocxSetInfo.setInfo(judgementWordsVOS, parentId, firstId, name + xiangMuFuHaoName, name + xiangMuFuHaoName, name);
|
||||
String lieBiaoName = "【编号列表】【列表类型】无序列表";
|
||||
judgementWordsVOS = DocxSetInfo.setInfo(judgementWordsVOS, parentId, firstId, name + lieBiaoName, name + lieBiaoName, name);
|
||||
|
||||
return "无序列表";
|
||||
} else {
|
||||
String lieBiaoName = "【编号列表】【列表类型】有序列表";
|
||||
judgementWordsVOS = DocxSetInfo.setInfo(judgementWordsVOS, parentId, firstId, name + lieBiaoName, name + lieBiaoName, name);
|
||||
return "有序列表";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -342,8 +346,9 @@ public class Paragraphs {
|
||||
}
|
||||
}
|
||||
}
|
||||
return judgementWordsVOS;
|
||||
return "未知";
|
||||
}
|
||||
|
||||
// 段落-边框
|
||||
// public static List<JudgementWordsVO> getParagraphBorder(P paragraph, StyleDefinitionsPart stylePart, List<JudgementWordsVO> judgementWordsVOS, int betoLong, String firstId) {
|
||||
// if (paragraph == null) {
|
||||
|
Reference in New Issue
Block a user