Skip to content

Commit ae1266c

Browse files
Do not set paragraph alignment when align is the default value (#517)
1 parent 4d14540 commit ae1266c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

java/src/main/java/com/genexus/reports/PDFReportItext.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,9 @@ else if (valign == VerticalAlign.BOTTOM.value())
12821282
topAux = (float)convertScale(top);
12831283

12841284
ColumnText Col = new ColumnText(cb);
1285-
Col.setAlignment(columnAlignment((alignment)));
1285+
int colAlignment = columnAlignment(alignment);
1286+
if (colAlignment!=0)
1287+
Col.setAlignment(colAlignment);
12861288
ColumnText simulationCol = new ColumnText(null);
12871289
float drawingPageHeight = (float)this.pageSize.getTop() - topMargin - bottomMargin;
12881290
//Col.setSimpleColumn(llx, lly, urx, ury);
@@ -1308,14 +1310,15 @@ else if (valign == VerticalAlign.BOTTOM.value())
13081310
simulationCol.addElement((Element)objects.get(k));
13091311

13101312
Col = new ColumnText(cb);
1311-
Col.setAlignment(columnAlignment((alignment)));
1313+
if (colAlignment!=0)
1314+
Col.setAlignment(colAlignment);
13121315
Col.setSimpleColumn(leftAux + leftMargin,drawingPageHeight - bottomAux,rightAux + leftMargin,drawingPageHeight - topAux);
13131316

13141317
bottomAux = bottomAux - drawingPageHeight;
13151318
}
13161319
}
1317-
if (objects.get(k) instanceof Paragraph)
1318-
((Paragraph)objects.get(k)).setAlignment(columnAlignment(alignment));
1320+
if (objects.get(k) instanceof Paragraph && colAlignment!=0)
1321+
((Paragraph)objects.get(k)).setAlignment(colAlignment);
13191322

13201323
Col.addElement((Element)objects.get(k));
13211324
Col.go();

0 commit comments

Comments
 (0)