Skip to content

Commit 3d0d3ac

Browse files
committed
Merge branch 'develop-JRL-2054' into develop
2 parents 3541a3e + bb61b7b commit 3d0d3ac

File tree

7 files changed

+72
-54
lines changed

7 files changed

+72
-54
lines changed

core/pom-common.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<dependency>
8585
<groupId>com.ibm.icu</groupId>
8686
<artifactId>icu4j</artifactId>
87-
<version>74.2</version>
87+
<version>77.1</version>
8888
<scope>compile</scope>
8989
<optional>true</optional>
9090
</dependency>

core/src/main/java/net/sf/jasperreports/engine/export/ooxml/DocxDocumentHelper.java

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,37 +85,50 @@ public void exportSection(PrintPageFormat pageFormat, JRGridLayout pageGridLayou
8585
int pageWidth = 0;
8686
int pageHeight = 0;
8787

88-
if (isSizePageToContent)
88+
if (xCuts.size() == 0)
8989
{
90+
// empty page
9091
leftMargin = pageFormat.getLeftMargin();
9192
rightMargin = pageFormat.getRightMargin();
92-
pageWidth =
93-
Math.max(
94-
pageFormat.getPageWidth(),
95-
Math.max(leftMargin, xCuts.getCutOffset(0)) + xCuts.getTotalLength() + rightMargin
96-
);
97-
9893
topMargin = pageFormat.getTopMargin();
9994
bottomMargin = pageFormat.getBottomMargin();
100-
pageHeight =
101-
Math.max(
102-
pageFormat.getPageHeight(),
103-
Math.max(topMargin, yCuts.getCutOffset(0)) + yCuts.getTotalLength() + bottomMargin
104-
);
95+
pageWidth = pageFormat.getPageWidth();
96+
pageHeight = pageFormat.getPageHeight();
10597
}
10698
else
10799
{
108-
leftMargin = Math.min(xCuts.getCutOffset(0), pageFormat.getLeftMargin());
109-
leftMargin = leftMargin < 0 ? 0 : leftMargin;
110-
rightMargin = Math.min(pageFormat.getPageWidth() - xCuts.getCutOffset(xCuts.size() - 1), pageFormat.getRightMargin());
111-
rightMargin = rightMargin < 0 ? 0 : rightMargin;
112-
pageWidth = pageFormat.getPageWidth();
100+
if (isSizePageToContent)
101+
{
102+
leftMargin = pageFormat.getLeftMargin();
103+
rightMargin = pageFormat.getRightMargin();
104+
pageWidth =
105+
Math.max(
106+
pageFormat.getPageWidth(),
107+
Math.max(leftMargin, xCuts.getCutOffset(0)) + xCuts.getTotalLength() + rightMargin
108+
);
113109

114-
topMargin = Math.min(yCuts.getCutOffset(0), pageFormat.getTopMargin());
115-
topMargin = topMargin < 0 ? 0 : topMargin;
116-
bottomMargin = Math.min(pageFormat.getPageHeight() - yCuts.getCutOffset(yCuts.size() - 1), pageFormat.getBottomMargin());
117-
bottomMargin = bottomMargin < 0 ? 0 : bottomMargin;
118-
pageHeight = pageFormat.getPageHeight();
110+
topMargin = pageFormat.getTopMargin();
111+
bottomMargin = pageFormat.getBottomMargin();
112+
pageHeight =
113+
Math.max(
114+
pageFormat.getPageHeight(),
115+
Math.max(topMargin, yCuts.getCutOffset(0)) + yCuts.getTotalLength() + bottomMargin
116+
);
117+
}
118+
else
119+
{
120+
leftMargin = Math.min(xCuts.getCutOffset(0), pageFormat.getLeftMargin());
121+
leftMargin = leftMargin < 0 ? 0 : leftMargin;
122+
rightMargin = Math.min(pageFormat.getPageWidth() - xCuts.getCutOffset(xCuts.size() - 1), pageFormat.getRightMargin());
123+
rightMargin = rightMargin < 0 ? 0 : rightMargin;
124+
pageWidth = pageFormat.getPageWidth();
125+
126+
topMargin = Math.min(yCuts.getCutOffset(0), pageFormat.getTopMargin());
127+
topMargin = topMargin < 0 ? 0 : topMargin;
128+
bottomMargin = Math.min(pageFormat.getPageHeight() - yCuts.getCutOffset(yCuts.size() - 1), pageFormat.getBottomMargin());
129+
bottomMargin = bottomMargin < 0 ? 0 : bottomMargin;
130+
pageHeight = pageFormat.getPageHeight();
131+
}
119132
}
120133

121134
if (!lastPage)

core/src/main/java/net/sf/jasperreports/engine/export/ooxml/JRDocxExporter.java

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -675,27 +675,31 @@ protected void exportGrid(JRGridLayout gridLayout, JRPrintElementIndex frameInde
675675
}
676676

677677
// an empty page is encountered;
678-
// if it's the first one in a series of consecutive empty pages, emptyPageState == false, otherwise emptyPageState == true
679-
if (rowCount == 0 && (pageIndex < endPageIndex || !emptyPageState))
678+
if (rowCount == 0)
680679
{
681-
tableHelper =
682-
new DocxTableHelper(
683-
jasperReportsContext,
684-
crtDocWriter,
685-
xCuts,
686-
false,
687-
pageFormat,
688-
frameIndex
689-
);
690-
int maxReportIndex = exporterInput.getItems().size() - 1;
691-
692-
// while the first and last page in the JasperPrint list need single breaks, all the others require double-breaking
693-
boolean twice =
694-
(pageIndex > startPageIndex && pageIndex < endPageIndex && !emptyPageState)
695-
||(reportIndex < maxReportIndex && pageIndex == endPageIndex);
696-
tableHelper.getParagraphHelper().exportEmptyPage(pageAnchor, bookmarkIndex, twice);
697-
bookmarkIndex++;
698-
emptyPageState = true;
680+
// if it's the first one in a series of consecutive empty pages, emptyPageState == false, otherwise emptyPageState == true
681+
if (pageIndex < endPageIndex || !emptyPageState)
682+
{
683+
tableHelper =
684+
new DocxTableHelper(
685+
jasperReportsContext,
686+
crtDocWriter,
687+
xCuts,
688+
false,
689+
pageFormat,
690+
frameIndex
691+
);
692+
int maxReportIndex = exporterInput.getItems().size() - 1;
693+
694+
// while the first and last page in the JasperPrint list need single breaks, all the others require double-breaking
695+
boolean twice =
696+
(pageIndex > startPageIndex && pageIndex < endPageIndex && !emptyPageState)
697+
||(reportIndex < maxReportIndex && pageIndex == endPageIndex);
698+
tableHelper.getParagraphHelper().exportEmptyPage(pageAnchor, bookmarkIndex, twice);
699+
bookmarkIndex++;
700+
emptyPageState = true;
701+
}
702+
699703
return;
700704
}
701705

demo/samples/pom-common.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<version>${revision}</version>
2323
<scope>runtime</scope>
2424
<optional>false</optional>
25+
<!-- to allow switching to jasperreports-javaflow -->
2526
<exclusions>
2627
<exclusion>
2728
<groupId>net.sf.jasperreports</groupId>
@@ -42,6 +43,7 @@
4243
<version>${revision}</version>
4344
<scope>compile</scope>
4445
<optional>false</optional>
46+
<!-- to allow switching to jasperreports-javaflow -->
4547
<exclusions>
4648
<exclusion>
4749
<groupId>net.sf.jasperreports</groupId>
@@ -55,6 +57,7 @@
5557
<version>${revision}</version>
5658
<scope>compile</scope>
5759
<optional>false</optional>
60+
<!-- to allow switching to jasperreports-javaflow -->
5861
<exclusions>
5962
<exclusion>
6063
<groupId>net.sf.jasperreports</groupId>

ext/pdf/src/main/java/net/sf/jasperreports/pdf/classic/ClassicPdfProducer.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
import java.util.Locale;
3333
import java.util.Map;
3434

35-
import org.apache.commons.logging.Log;
36-
import org.apache.commons.logging.LogFactory;
37-
3835
import com.lowagie.text.Chunk;
3936
import com.lowagie.text.Document;
4037
import com.lowagie.text.DocumentException;
@@ -94,8 +91,6 @@
9491
public class ClassicPdfProducer implements PdfProducer
9592
{
9693

97-
private static final Log log = LogFactory.getLog(ClassicPdfProducer.class);
98-
9994
/**
10095
* Flag that determines whether glyph substitution based on Apache FOP is enabled.
10196
*

ext/pdf/src/main/java/net/sf/jasperreports/pdf/classic/ClassicRadioCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void addToGroup() throws IOException
9191
PdfFormField radioGroup = pdfProducer.getRadioGroup(radioCheckField);
9292
try
9393
{
94-
radioGroup.addKid(radioCheckField.getRadioField());
94+
radioGroup.addKid(radioCheckField.getKidField());
9595
}
9696
catch (DocumentException e)
9797
{

pom-parent.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<url>${scmUrl}</url>
7878
</scm>
7979
<properties>
80-
<revision>develop-JRL-2039-SNAPSHOT</revision>
80+
<revision>develop-JRL-2054-SNAPSHOT</revision>
8181
<scmConnection>scm:git:https://github.com/Jaspersoft/jasperreports.git</scmConnection>
8282
<scmUrl>https://github.com/Jaspersoft/jasperreports</scmUrl>
8383
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -92,6 +92,7 @@
9292
<maven.javadoc.skip>true</maven.javadoc.skip>
9393
<maven.source.skip>true</maven.source.skip>
9494
<maven.test.skip>true</maven.test.skip>
95+
<owasp.ossindex.enabled>true</owasp.ossindex.enabled>
9596
<source.version>8</source.version>
9697
<target.version>8</target.version>
9798
<!--
@@ -122,7 +123,7 @@
122123
-->
123124
<ant.version>1.10.14</ant.version>
124125
<antlr.version>2.7.7</antlr.version>
125-
<batik.version>1.18</batik.version>
126+
<batik.version>1.19</batik.version>
126127
<castor.version>1.4.1</castor.version>
127128
<commons-beanutils2.version>2.0.0-M2</commons-beanutils2.version>
128129
<commons-collections4.version>4.5.0</commons-collections4.version>
@@ -136,11 +137,11 @@
136137
<javax.persistence-api.version>2.2</javax.persistence-api.version>
137138
<jaxen.version>2.0.0</jaxen.version>
138139
<log4j.version>2.24.3</log4j.version>
139-
<jfreechart.version>1.5.4</jfreechart.version>
140-
<openpdf.version>1.3.32</openpdf.version>
140+
<jfreechart.version>1.5.6</jfreechart.version>
141+
<openpdf.version>1.3.43</openpdf.version>
141142
<poi.version>5.4.1</poi.version>
142143
<rhino.version>1.7.14</rhino.version>
143-
<spring.version>6.2.3</spring.version>
144+
<spring.version>6.2.11</spring.version>
144145
<xchart.version>3.2.2</xchart.version>
145146
<xml-apis-ext.version>1.3.04</xml-apis-ext.version>
146147
</properties>
@@ -257,6 +258,8 @@
257258
<version>${dependency-check-maven.version}</version>
258259
<configuration>
259260
<suppressionFile>${jasperreports.root.dir}/owasp-suppressions.xml</suppressionFile>
261+
<ossindexAnalyzerEnabled>${owasp.ossindex.enabled}</ossindexAnalyzerEnabled>
262+
<ossIndexServerId>ossindex</ossIndexServerId>
260263
</configuration>
261264
</plugin>
262265
<plugin>

0 commit comments

Comments
 (0)