Browse Source

Merge pull request #270 in CORE/base-third from bugfix/10.0 to release/10.0

* commit '0b3a3efd7bc16cc9c4ef5c3206833ebdd80d0141':
  REPORT-20433 html片段导出table表格被压缩
  DEC-8889 jackson高危漏洞
  KERNER-724 j2v8升级
  DEC-8173 脏数据导致quartz启动失败
  DEC-7569 定时调度模块启动异常
  无JIRA任务 打包失败,job未初始化
  DEC-7376 定时调度任务表中存在脏数据的时候,不能影响整个scheduler
  DEC-7376 定时调度任务表中存在脏数据的时候,不能影响整个scheduler
  无 jira 任务, final --> persist 回复一下
  无 jira 任务, final --> persist 少了一个空行
  无 jira 任务, 解决打包冲突 还是有问题, 删掉 gradle
  无 jira 任务, 解决打包冲突
  升级apache工具类
  build.third_step0.gradle edited online with Bitbucket
release/10.0
Harrison 5 years ago
parent
commit
d6f6537c35
  1. 2
      build.third_step0.gradle
  2. 22
      fine-itext/src/com/fr/third/v2/lowagie/text/html/simpleparser/IncTable.java

2
build.third_step0.gradle

@ -41,7 +41,7 @@ def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.s
def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1) def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1)
def srcDir="." def srcDir="."
def maven_version="${version}-RELEASE-SNAPSHOT" def maven_version="${version}-FINAL-SNAPSHOT"
def jar_version = version def jar_version = version
configurations { configurations {

22
fine-itext/src/com/fr/third/v2/lowagie/text/html/simpleparser/IncTable.java

@ -105,16 +105,24 @@ public class IncTable {
int ncol = 0; int ncol = 0;
ArrayList c0 = (ArrayList)rows.get(0); ArrayList c0 = (ArrayList)rows.get(0);
ArrayList<Float> colWidths = new ArrayList<Float>(); ArrayList<Float> colWidths = new ArrayList<Float>();
float widthSum = 0;
for (int k = 0; k < c0.size(); ++k) { for (int k = 0; k < c0.size(); ++k) {
PdfPCell pCell = ((PdfPCell)c0.get(k)); PdfPCell pCell = ((PdfPCell)c0.get(k));
int cellCols = pCell.getColspan(); int cellCols = pCell.getColspan();
ncol += cellCols; ncol += cellCols;
//不取 0 ,后面可能需要求比值
float styleWidth = pCell.getStyleWidth();
if(cellCols > 1){ if(cellCols > 1){
float avgWidth = styleWidth / cellCols;
float width = 0 == avgWidth ? 1 : avgWidth;
widthSum = width * cellCols;
for(int a = 0; a < cellCols ; a++){ for(int a = 0; a < cellCols ; a++){
colWidths.add(pCell.getStyleWidth()/cellCols); colWidths.add(width);
} }
}else { }else {
colWidths.add(pCell.getStyleWidth()); float width = 0 == styleWidth ? 1 : styleWidth;
widthSum += width;
colWidths.add(width);
} }
} }
@ -132,8 +140,8 @@ public class IncTable {
//解析单元格宽度 //解析单元格宽度
float totalWidth = CSSUtils.parseFloat(width); float totalWidth = CSSUtils.parseFloat(width);
float[] floats = new float[colWidths.size()]; float[] floats = new float[colWidths.size()];
for (int a = 0; a < colWidths.size(); a++){ for (int a = 0; a < colWidths.size(); a++) {
floats[a] = colWidths.get(a); floats[a] = totalWidth * colWidths.get(a) / widthSum;
} }
//解析px数值 //解析px数值
table.setTotalWidth(totalWidth); table.setTotalWidth(totalWidth);
@ -161,11 +169,11 @@ public class IncTable {
return table; return table;
} }
public void processRowHeight(PdfPTable table){ public void processRowHeight(PdfPTable table) {
Float height = CSSUtils.parseFloat((String)props.get("height")); Float height = CSSUtils.parseFloat((String) props.get("height"));
Float eachHeight = height / table.getRows().size(); Float eachHeight = height / table.getRows().size();
//调整行高 //调整行高
for(int a = 0; a < rowHeights.size(); a++){ for (int a = 0; a < rowHeights.size(); a++) {
table.getRow(a).setStyleHeight(Math.max(eachHeight, rowHeights.get(a))); table.getRow(a).setStyleHeight(Math.max(eachHeight, rowHeights.get(a)));
} }
} }

Loading…
Cancel
Save