From 49ee2648a31a64069ca7bfdf7d4a97a9cd0ce5f2 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 5 Jan 2006 10:24:18 +0000 Subject: Bugzilla #38132: Bugfix: Certain border styles could lead to a NullPointerException. inset and groove are now mapped to RTF's "engrave", outset and ridge to "emboss". If no mapping can be found the "solid" style is used. Before null was returned which was the cause for the NPE. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@366148 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/render/rtf/BorderAttributesConverter.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/java/org') diff --git a/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java b/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java index 54119c09f..43adc449f 100644 --- a/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java +++ b/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 The Apache Software Foundation. + * Copyright 1999-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -101,6 +101,14 @@ public class BorderAttributesConverter { return IBorderAttributes.BORDER_DOTTED; } else if (iBorderStyle == Constants.EN_DASHED) { return IBorderAttributes.BORDER_DASH; + } else if (iBorderStyle == Constants.EN_GROOVE) { + return IBorderAttributes.BORDER_ENGRAVE; + } else if (iBorderStyle == Constants.EN_RIDGE) { + return IBorderAttributes.BORDER_EMBOSS; + } else if (iBorderStyle == Constants.EN_INSET) { + return IBorderAttributes.BORDER_ENGRAVE; + } else if (iBorderStyle == Constants.EN_OUTSET) { + return IBorderAttributes.BORDER_EMBOSS; /* } else if (iBorderStyle==Constants value.equals("hairline")) { return IBorderAttributes.BORDER_HAIRLINE;*/ /* } else if (iBorderStyle==Constant value.equals("dot-dash")) { @@ -120,7 +128,7 @@ public class BorderAttributesConverter { } else if (iBorderStyle==Constant value.equals("engrave")) { return IBorderAttributes.BORDER_ENGRAVE;*/ } else { - return null; + return IBorderAttributes.BORDER_SINGLE_THICKNESS; } } -- cgit v1.2.3