Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,17 @@
<property name="processJavadoc" value="true"/>
</module>
<module name="OuterTypeFilename"/>

<!-- deactivated: 8 findings -->
<!--
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message"
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
</module>
-->

<!-- deactivated: 513 findings -->
<!-- NOSONAR
Expand All @@ -76,7 +80,11 @@
-->

<!--<module name="AvoidStarImport"/>-->

<!-- deactivated: 14 findings -->
<!--
<module name="OneTopLevelClass"/>
-->
<module name="NoLineWrap">
<property name="tokens" value="PACKAGE_DEF, IMPORT, STATIC_IMPORT"/>
</module>
Expand Down
3 changes: 2 additions & 1 deletion openpdf-html/src/main/java/org/openpdf/css/parser/Lexer.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public BorderRadiusCorner(float left, float right) {

public BorderRadiusCorner(CSSName fromVal, CalculatedStyle style, CssContext ctx) {
FSDerivedValue value = style.valueByName(fromVal);
if (value instanceof ListValue lValues) {
PropertyValue first = (PropertyValue) lValues.getValues().get(0);
PropertyValue second = lValues.getValues().size() > 1 ? (PropertyValue) lValues.getValues().get(1) : first;
if (value instanceof ListValue lv) {
PropertyValue first = (PropertyValue) lv.getValues().get(0);
PropertyValue second = lv.getValues().size() > 1 ? (PropertyValue) lv.getValues().get(1) : first;

if (fromVal.equals(BORDER_TOP_LEFT_RADIUS) || fromVal.equals(BORDER_BOTTOM_RIGHT_RADIUS)) {
_right = calculate(fromVal, style, first, ctx);
Expand Down
24 changes: 12 additions & 12 deletions openpdf-html/src/main/java/org/openpdf/pdf/ITextOutputDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -739,19 +739,19 @@ private void setStrokeDiff(Stroke newStroke, @Nullable Stroke oldStroke) {
if (newStroke == oldStroke) {
return;
}
if (!(newStroke instanceof BasicStroke nStroke)) {
if (!(newStroke instanceof BasicStroke bs)) {
return;
}
boolean oldOk = (oldStroke instanceof BasicStroke);
BasicStroke oStroke = null;
if (oldOk) {
oStroke = (BasicStroke) oldStroke;
}
if (!oldOk || nStroke.getLineWidth() != oStroke.getLineWidth()) {
cb.setLineWidth(nStroke.getLineWidth());
if (!oldOk || bs.getLineWidth() != oStroke.getLineWidth()) {
cb.setLineWidth(bs.getLineWidth());
}
if (!oldOk || nStroke.getEndCap() != oStroke.getEndCap()) {
switch (nStroke.getEndCap()) {
if (!oldOk || bs.getEndCap() != oStroke.getEndCap()) {
switch (bs.getEndCap()) {
case BasicStroke.CAP_BUTT:
cb.setLineCap(0);
break;
Expand All @@ -762,8 +762,8 @@ private void setStrokeDiff(Stroke newStroke, @Nullable Stroke oldStroke) {
cb.setLineCap(1);
}
}
if (!oldOk || nStroke.getLineJoin() != oStroke.getLineJoin()) {
switch (nStroke.getLineJoin()) {
if (!oldOk || bs.getLineJoin() != oStroke.getLineJoin()) {
switch (bs.getLineJoin()) {
case BasicStroke.JOIN_MITER:
cb.setLineJoin(0);
break;
Expand All @@ -774,12 +774,12 @@ private void setStrokeDiff(Stroke newStroke, @Nullable Stroke oldStroke) {
cb.setLineJoin(1);
}
}
if (!oldOk || nStroke.getMiterLimit() != oStroke.getMiterLimit()) {
cb.setMiterLimit(nStroke.getMiterLimit());
if (!oldOk || bs.getMiterLimit() != oStroke.getMiterLimit()) {
cb.setMiterLimit(bs.getMiterLimit());
}
boolean makeDash = isMakeDash(oldOk, nStroke, oStroke);
boolean makeDash = isMakeDash(oldOk, bs, oStroke);
if (makeDash) {
float[] dash = nStroke.getDashArray();
float[] dash = bs.getDashArray();
if (dash == null) {
cb.setLiteral("[]0 d\n");
} else {
Expand All @@ -789,7 +789,7 @@ private void setStrokeDiff(Stroke newStroke, @Nullable Stroke oldStroke) {
cb.setLiteral(' ');
}
cb.setLiteral(']');
cb.setLiteral(nStroke.getDashPhase());
cb.setLiteral(bs.getDashPhase());
cb.setLiteral(" d\n");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@
* <h1>Notes</h1>
* This class was derived from a sample PDF creation listener
* at "http://markmail.org/message/46t3bw7q6mbhvra2"
* by Jesse Keller <jesse.keller@roche.com>.
* by * <a href="mailto:jesse.keller@roche.com">Jesse Keller</a>
*
* @author Tim Telcik <tim.telcik@permeance.com.au>
* @author <a href="mailto:tim.telcik@permeance.com.au">Tim Telcik</a>
* @see DefaultPDFCreationListener
* @see PDFCreationListener
* @see ITextRenderer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ void parseGlyph(Range r, GeneralPath gp, FlPoint pt) {
break;
case 30: // vhcurveto
hold = 4;
//fallthru
case 31: // hvcurveto
for (i = 0; i < this.stackptr;) {
boolean hv = (((i + hold) & 4) == 0);
Expand Down
Loading