Skip to content

Commit

Permalink
Remove German texts, fix some typos, remove unnecessary overiden meth…
Browse files Browse the repository at this point in the history
…ods, improve error handling
  • Loading branch information
hvbtup committed Nov 18, 2024
1 parent 4b0ce5d commit b749f86
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -953,10 +953,10 @@ private byte[] createXmpMetadataBytes() {
continue;
if (PdfName.TITLE.equals(key)) {
// The XMPMetadata allows defining the title for different languages.
// We add the title in the default language
// and a german translation of the title.
// We add the title in the default language.
LangAlt langAlt = new LangAlt(((PdfString) obj).toUnicodeString());
langAlt.addLanguage("de_DE", "Das ist der Titel für deutsche Leser");
// Example: How to add a translation of the title in a different language.
// langAlt.addLanguage("de_DE", "Das ist der Titel für deutsche Leser");
dc.setProperty(DublinCoreSchema.TITLE, langAlt);
}
if (PdfName.AUTHOR.equals(key)) {
Expand Down Expand Up @@ -1076,7 +1076,7 @@ private void setPdfIccXmp() {
}

try {
// PDF create the xmp metaddata based on the document information
// PDF create the XMP metadata based on the document information
byte[] xmpMetadata = this.createXmpMetadataBytes();
writer.setXmpMetadata(xmpMetadata);
} catch (Exception e) {
Expand Down Expand Up @@ -1192,7 +1192,6 @@ public void pushTag(String tagType, IArea area) {
if (!writer.isTagged()) {
return;
}
// logger.finest("pushTag " + tagType);
if ("pageHeader".equals(tagType)) {
currentPage.beginArtifact();
} else if ("pageFooter".equals(tagType)) {
Expand Down Expand Up @@ -1280,8 +1279,7 @@ private PdfName pdfScope(String scope) {
if ("row".equals(scope)) {
return new PdfName("Row");
}
// FIXME better error handling
System.err.println("Unsupported scope: " + scope);
logger.warning("Unsupported scope: " + scope);
return null;
}

Expand All @@ -1292,7 +1290,6 @@ public void popTag(String tagType) {
if (!writer.isTagged()) {
return;
}
// logger.finest("popTag " + tagType);
if ("pageHeader".equals(tagType)) {
currentPage.endArtifact();
} else if ("pageFooter".equals(tagType)) {
Expand All @@ -1305,7 +1302,7 @@ public void popTag(String tagType) {
}

/**
* if the writer is expected to create tagged PDF..
* Is the writer is expected to create tagged PDF or not?
*/
public boolean isTagged() {
return writer.isTagged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ public void visitImage(IImageArea imageArea) {

@Override
public void visitText(ITextArea textArea) {
// if (logger.isLoggable(Level.FINEST))
// logger.finest("visitText " + textArea.getText());
super.visitText(textArea);
int x = currentX + getX(textArea);
int y = currentY + getY(textArea);
Expand Down Expand Up @@ -157,13 +155,9 @@ public void end(IReportContent rc) {

@Override
protected void drawContainer(IContainerArea container) {

// FIXME Warum wird das zweimal aufgerufen?

super.drawContainer(container);
int x = currentX + getX(container);
int y = currentY + getY(container);

createBookmark(container, x, y);
createHyperlink(container, x, y);
}
Expand Down Expand Up @@ -275,18 +269,8 @@ protected void createBookmark(IArea area, int x, int y) {
}
}

@Override
public void visitContainer(IContainerArea container) {
// if (logger.isLoggable(Level.FINEST))
// logger.finest("visitContainer " + container.toString() + " tagType=" + container.getTagType());
super.visitContainer(container);
}

@Override
protected void visitChildren(IContainerArea container) {
// if (logger.isLoggable(Level.FINEST))
// logger.finest("visitChildren " + container.toString() + " tagType=" + container.getTagType());

String tagType = null;
if (currentPageDevice.isTagged()) {
if (container.getChildrenCount() > 0) {
Expand All @@ -302,20 +286,6 @@ protected void visitChildren(IContainerArea container) {
}
}

@Override
protected void startContainer(IContainerArea container) {
// if (logger.isLoggable(Level.FINEST))
// logger.finest("startContainer " + container.toString() + " tagType=" + container.getTagType());
super.startContainer(container);
}

@Override
protected void endContainer(IContainerArea container) {
// if (logger.isLoggable(Level.FINEST))
// logger.finest("endContainer " + container.toString() + " tagType=" + container.getTagType());
super.endContainer(container);
}

private void createTOC() {
currentPageDevice.createTOC(bookmarks);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class CellContent extends AbstractContent implements ICellContent {
protected int column = -1;

/**
* Flag indicading if this cell is the start of a group.
* Flag indicating if this cell is the start of a group.
*/
protected Boolean displayGroupIcon;

Expand Down Expand Up @@ -198,7 +198,7 @@ public int getRow() {
}

/**
* Set te drop property
* Set the drop property
*
* @param drop drop value
*/
Expand Down Expand Up @@ -645,7 +645,7 @@ public String getHeaders() {
return (String) exeContext.evaluate(expr);
} catch (BirtException be) {
be.printStackTrace();
// FIXME correct error handling
exeContext.addException(be);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,4 @@ public boolean isLastInLine() {
return lastInLine;
}

}
}

0 comments on commit b749f86

Please sign in to comment.