Skip to content

Commit

Permalink
Sonar cloud fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Aug 20, 2023
1 parent 15ef6b7 commit 89e5313
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PdfTypeHandler extends DocTypeHandlerDefault {
*/
private static final long serialVersionUID = 5459938865782356227L;

public static DocTypeHandler HANDLER = new PdfTypeHandler();
public static final DocTypeHandler HANDLER = new PdfTypeHandler();

public PdfTypeHandler() {
super( OpenPpfDocHandler.DOC_OUTPUT_PDF, OpenPpfDocHandler.MODULE );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,43 @@

public class OpenPdfDocTableHelper {

private OpenPdfDocTableHelper() {}

private static void handleBorderColor( DocBorders docBorders, DocCell docCell, Cell cell ) {
if ( docBorders.getBorderColorBottom() != null ) {
cell.setBorderColorBottom( DocModelUtils.parseHtmlColor( docBorders.getBorderColorBottom() ) );
}
if ( docBorders.getBorderColorTop() != null ) {
cell.setBorderColorTop( DocModelUtils.parseHtmlColor( docBorders.getBorderColorTop() ) );
}
if ( docBorders.getBorderColorLeft() != null ) {
cell.setBorderColorLeft( DocModelUtils.parseHtmlColor( docBorders.getBorderColorLeft() ) );
}
if ( docBorders.getBorderColorRight() != null ) {
cell.setBorderColorRight( DocModelUtils.parseHtmlColor( docBorders.getBorderColorRight() ) );
}
}

private static void handleBorderWidth( DocBorders docBorders, DocCell docCell, Cell cell ) {
if ( docBorders.getBorderWidthBottom() != -1 ) {
cell.setBorderWidthBottom( docBorders.getBorderWidthBottom() );
}
if ( docBorders.getBorderWidthTop() != -1 ) {
cell.setBorderWidthTop( docBorders.getBorderWidthTop() );
}
if ( docBorders.getBorderWidthLeft() != -1 ) {
cell.setBorderWidthLeft( docBorders.getBorderWidthLeft() );
}
if ( docBorders.getBorderWidthRight() != -1 ) {
cell.setBorderWidthRight( docBorders.getBorderWidthRight() );
}
}

private static void handleBolders( DocCell docCell, Cell cell ) {
DocBorders docBorders = docCell.getDocBorders();
if ( docBorders != null ) {
if ( docBorders.getBorderColorBottom() != null ) {
cell.setBorderColorBottom( DocModelUtils.parseHtmlColor( docBorders.getBorderColorBottom() ) );
}
if ( docBorders.getBorderColorTop() != null ) {
cell.setBorderColorTop( DocModelUtils.parseHtmlColor( docBorders.getBorderColorTop() ) );
}
if ( docBorders.getBorderColorLeft() != null ) {
cell.setBorderColorLeft( DocModelUtils.parseHtmlColor( docBorders.getBorderColorLeft() ) );
}
if ( docBorders.getBorderColorRight() != null ) {
cell.setBorderColorRight( DocModelUtils.parseHtmlColor( docBorders.getBorderColorRight() ) );
}
if ( docBorders.getBorderWidthBottom() != -1 ) {
cell.setBorderWidthBottom( docBorders.getBorderWidthBottom() );
}
if ( docBorders.getBorderWidthTop() != -1 ) {
cell.setBorderWidthTop( docBorders.getBorderWidthTop() );
}
if ( docBorders.getBorderWidthLeft() != -1 ) {
cell.setBorderWidthLeft( docBorders.getBorderWidthLeft() );
}
if ( docBorders.getBorderWidthRight() != -1 ) {
cell.setBorderWidthRight( docBorders.getBorderWidthRight() );
}
handleBorderColor(docBorders, docCell, cell);
handleBorderWidth(docBorders, docCell, cell);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@

public class OpenPpfDocHandler {


private static final ParamFinder PARAM_FINDER = ParamFinder.newFinder();

public static final String PARAM_PAGE_CURRENT = "currentPage";
Expand Down

0 comments on commit 89e5313

Please sign in to comment.