From b95fb42a05a7aa4595d1ed34bc62cfbb14a93333 Mon Sep 17 00:00:00 2001 From: Thomas Gutmann <41593722+speckyspooky@users.noreply.github.com> Date: Sat, 16 Nov 2024 20:40:35 +0100 Subject: [PATCH] Fix DOCX calculation of margin and padding (#1979) --- .../org/eclipse/birt/report/engine/emitter/excel/ExcelUtil.java | 2 +- .../org/eclipse/birt/report/engine/emitter/wpml/WordUtil.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/org.eclipse.birt.report.engine.emitter.prototype.excel/src/org/eclipse/birt/report/engine/emitter/excel/ExcelUtil.java b/engine/org.eclipse.birt.report.engine.emitter.prototype.excel/src/org/eclipse/birt/report/engine/emitter/excel/ExcelUtil.java index fd3e4a387ba..f0f21061f78 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.prototype.excel/src/org/eclipse/birt/report/engine/emitter/excel/ExcelUtil.java +++ b/engine/org.eclipse.birt.report.engine.emitter.prototype.excel/src/org/eclipse/birt/report/engine/emitter/excel/ExcelUtil.java @@ -479,7 +479,7 @@ public static int convertToPt(String size) { } else if (size.endsWith("cm")) { return (int) (s / 2.54 * 72); } else if (size.endsWith("mm")) { - return (int) (s * 10 / 2.54 * 72); + return (int) (s / 10 / 2.54 * 72); } else if (size.endsWith("pc")) { return s; } else { diff --git a/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/WordUtil.java b/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/WordUtil.java index ee7a7c06afe..fd3657a4bc6 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/WordUtil.java +++ b/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/WordUtil.java @@ -414,7 +414,7 @@ public static int convertToPt(String size) { } else if (size.endsWith("cm")) { return (int) (s / 2.54 * 72); } else if (size.endsWith("mm")) { - return (int) (s * 10 / 2.54 * 72); + return (int) (s / 10 / 2.54 * 72); } else if (size.endsWith("pc")) { return s; } else {