Browse Source

Fix NPE when content of an <a> element is empty.


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196072 13f79535-47bb-0310-9956-ffa450edef68
pull/30/head
Jeremias Maerki 21 years ago
parent
commit
a8172ad97e
1 changed files with 10 additions and 8 deletions
  1. 10
    8
      src/java/org/apache/fop/svg/PDFGraphics2D.java

+ 10
- 8
src/java/org/apache/fop/svg/PDFGraphics2D.java View File

@@ -312,14 +312,16 @@ public class PDFGraphics2D extends AbstractGraphics2D {
AffineTransform at = getTransform();
Shape b = at.createTransformedShape(bounds);
b = trans.createTransformedShape(b);
Rectangle rect = b.getBounds();

if (linkType != PDFLink.EXTERNAL) {
String pdfdest = "/FitR " + dest;
resourceContext.addAnnotation(pdfDoc.makeLink(rect, pageRef, pdfdest));
} else {
resourceContext.addAnnotation(pdfDoc.makeLink(rect,
dest, linkType, 0));
if (b != null) {
Rectangle rect = b.getBounds();
if (linkType != PDFLink.EXTERNAL) {
String pdfdest = "/FitR " + dest;
resourceContext.addAnnotation(pdfDoc.makeLink(rect, pageRef, pdfdest));
} else {
resourceContext.addAnnotation(pdfDoc.makeLink(rect,
dest, linkType, 0));
}
}
}


Loading…
Cancel
Save