You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TableAttributesConverter.java 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. /*
  2. * $Id$
  3. * ============================================================================
  4. * The Apache Software License, Version 1.1
  5. * ============================================================================
  6. *
  7. * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without modifica-
  10. * tion, are permitted provided that the following conditions are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. *
  15. * 2. Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. *
  19. * 3. The end-user documentation included with the redistribution, if any, must
  20. * include the following acknowledgment: "This product includes software
  21. * developed by the Apache Software Foundation (http://www.apache.org/)."
  22. * Alternately, this acknowledgment may appear in the software itself, if
  23. * and wherever such third-party acknowledgments normally appear.
  24. *
  25. * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  26. * endorse or promote products derived from this software without prior
  27. * written permission. For written permission, please contact
  28. * apache@apache.org.
  29. *
  30. * 5. Products derived from this software may not be called "Apache", nor may
  31. * "Apache" appear in their name, without prior written permission of the
  32. * Apache Software Foundation.
  33. *
  34. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  35. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  36. * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  37. * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  38. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  39. * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  40. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  41. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  42. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  43. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  44. * ============================================================================
  45. *
  46. * This software consists of voluntary contributions made by many individuals
  47. * on behalf of the Apache Software Foundation and was originally created by
  48. * James Tauber <jtauber@jtauber.com>. For more information on the Apache
  49. * Software Foundation, please see <http://www.apache.org/>.
  50. */
  51. package org.apache.fop.render.rtf;
  52. //RTF
  53. import org.apache.fop.render.rtf.rtflib.rtfdoc.BorderAttributesConverter;
  54. //FOP
  55. import org.apache.avalon.framework.logger.Logger;
  56. import org.apache.avalon.framework.logger.ConsoleLogger;
  57. import org.apache.fop.apps.FOPException;
  58. import org.apache.fop.fo.EnumProperty;
  59. import org.apache.fop.fo.expr.NCnameProperty;
  60. import org.apache.fop.fo.Constants;
  61. import org.apache.fop.fo.LengthProperty;
  62. import org.apache.fop.fo.ListProperty;
  63. import org.apache.fop.fo.PropertyList;
  64. import org.apache.fop.fo.Property;
  65. import org.apache.fop.fo.ColorTypeProperty;
  66. import org.apache.fop.fo.NumberProperty;
  67. import org.apache.fop.datatypes.ColorType;
  68. import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
  69. import org.apache.fop.render.rtf.rtflib.rtfdoc.ITableAttributes;
  70. import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfColorTable;
  71. /**
  72. * Contributor(s):
  73. * @author Roberto Marra <roberto@link-u.com>
  74. * @author Boris Poudérous <boris.pouderous@eads-telecom.com>
  75. * @author Normand Massé
  76. * @author Peter Herweg <pherweg@web.de>
  77. *
  78. * This class was originally developed for the JFOR project and
  79. * is now integrated into FOP.
  80. -----------------------------------------------------------------------------*/
  81. /**
  82. * Provides methods to convert the attributes to RtfAttributes.
  83. */
  84. public class TableAttributesConverter {
  85. private static Logger log = new ConsoleLogger();
  86. //////////////////////////////////////////////////
  87. // @@ Construction
  88. //////////////////////////////////////////////////
  89. /**
  90. * Constructor.
  91. */
  92. private TableAttributesConverter() {
  93. }
  94. //////////////////////////////////////////////////
  95. // @@ Static converter methods
  96. //////////////////////////////////////////////////
  97. /**
  98. * Converts table-only attributes to rtf attributes.
  99. *
  100. * @param attrs Given attributes
  101. * @param defaultAttributes Default rtf attributes
  102. *
  103. * @return All valid rtf attributes together
  104. *
  105. * @throws ConverterException On convertion error
  106. */
  107. static RtfAttributes convertTableAttributes(PropertyList propertyList)
  108. throws FOPException {
  109. RtfAttributes attrib = new RtfAttributes();
  110. LengthProperty lengthProp = null;
  111. // margin-left
  112. lengthProp = (LengthProperty)propertyList.get(Constants.PR_MARGIN_LEFT);
  113. if (lengthProp != null) {
  114. Float f = new Float(lengthProp.getLength().getValue() / 1000f);
  115. final String sValue = f.toString() + "pt";
  116. attrib.set(
  117. ITableAttributes.ATTR_ROW_LEFT_INDENT,
  118. (int)FoUnitsConverter.getInstance().convertToTwips(sValue));
  119. }
  120. return attrib;
  121. }
  122. /**
  123. * Converts cell attributes to rtf attributes.
  124. * @param attrs Given attributes
  125. * @param defaultAttributes Default rtf attributes
  126. *
  127. * @return All valid rtf attributes together
  128. *
  129. * @throws ConverterException On convertion error
  130. */
  131. static RtfAttributes convertCellAttributes(PropertyList props)
  132. throws FOPException {
  133. Property p;
  134. EnumProperty ep;
  135. RtfColorTable colorTable = RtfColorTable.getInstance();
  136. RtfAttributes attrib = null;
  137. attrib = new RtfAttributes();
  138. boolean isBorderPresent = false;
  139. // Cell background color
  140. if ((p = props.getNearestSpecified(Constants.PR_BACKGROUND_COLOR)) != null) {
  141. ColorType color = p.getColorType();
  142. if (color != null) {
  143. if (color.getAlpha() != 0
  144. || color.getRed() != 0
  145. || color.getGreen() != 0
  146. || color.getBlue() != 0) {
  147. attrib.set(
  148. ITableAttributes.CELL_COLOR_BACKGROUND,
  149. TextAttributesConverter.convertFOPColorToRTF(color));
  150. }
  151. } else {
  152. log.warn("Named color '" + p.toString() + "' not found. ");
  153. }
  154. }
  155. // Cell borders :
  156. if ((p = props.getExplicit(Constants.PR_BORDER_COLOR)) != null) {
  157. ListProperty listprop = (ListProperty) p;
  158. ColorType color = null;
  159. if (listprop.getList().get(0) instanceof NCnameProperty) {
  160. color = new ColorType(((NCnameProperty)listprop.getList().get(0)).getNCname());
  161. } else if (listprop.getList().get(0) instanceof ColorTypeProperty) {
  162. color = ((ColorTypeProperty)listprop.getList().get(0)).getColorType();
  163. }
  164. attrib.set(
  165. BorderAttributesConverter.BORDER_COLOR,
  166. colorTable.getColorNumber((int)color.getRed(), (int)color.getGreen(),
  167. (int)color.getBlue()).intValue());
  168. }
  169. if ((p = props.getExplicit(Constants.PR_BORDER_TOP_COLOR)) != null) {
  170. ColorType color = p.getColorType();
  171. attrib.set(
  172. BorderAttributesConverter.BORDER_COLOR,
  173. colorTable.getColorNumber((int)color.getRed(), (int)color.getGreen(),
  174. (int)color.getBlue()).intValue());
  175. }
  176. if ((p = props.getExplicit(Constants.PR_BORDER_BOTTOM_COLOR)) != null) {
  177. ColorType color = p.getColorType();
  178. attrib.set(
  179. BorderAttributesConverter.BORDER_COLOR,
  180. colorTable.getColorNumber((int)color.getRed(), (int)color.getGreen(),
  181. (int)color.getBlue()).intValue());
  182. }
  183. if ((p = props.getExplicit(Constants.PR_BORDER_LEFT_COLOR)) != null) {
  184. ColorType color = p.getColorType();
  185. attrib.set(
  186. BorderAttributesConverter.BORDER_COLOR,
  187. colorTable.getColorNumber((int)color.getRed(), (int)color.getGreen(),
  188. (int)color.getBlue()).intValue());
  189. }
  190. if ((p = props.getExplicit(Constants.PR_BORDER_RIGHT_COLOR)) != null) {
  191. ColorType color = p.getColorType();
  192. attrib.set(
  193. BorderAttributesConverter.BORDER_COLOR,
  194. colorTable.getColorNumber((int)color.getRed(), (int)color.getGreen(),
  195. (int)color.getBlue()).intValue());
  196. }
  197. // Border styles do not inherit from parent
  198. if ((p = props.get(Constants.PR_BORDER_STYLE)) != null) {
  199. log.warn("border-style not implemented. Please use border-style-left, "
  200. + "...-right, ...-top or ...-bottom");
  201. /*
  202. attrib.set(ITableAttributes.CELL_BORDER_LEFT, "\\"+convertAttributetoRtf(e.getEnum()));
  203. attrib.set(ITableAttributes.CELL_BORDER_RIGHT, "\\"+convertAttributetoRtf(e.getEnum()));
  204. attrib.set(ITableAttributes.CELL_BORDER_BOTTOM,"\\"+convertAttributetoRtf(e.getEnum()));
  205. attrib.set(ITableAttributes.CELL_BORDER_TOP, "\\"+convertAttributetoRtf(e.getEnum()));
  206. isBorderPresent=true;
  207. */
  208. }
  209. ep = (EnumProperty)props.get("border-top-style");
  210. if (ep != null && ep.getEnum() != Constants.NONE) {
  211. attrib.set(ITableAttributes.CELL_BORDER_TOP, "\\"
  212. + convertAttributetoRtf(ep.getEnum()));
  213. isBorderPresent = true;
  214. }
  215. ep = (EnumProperty)props.get("border-bottom-style");
  216. if (ep != null && ep.getEnum() != Constants.NONE) {
  217. attrib.set(ITableAttributes.CELL_BORDER_BOTTOM, "\\"
  218. + convertAttributetoRtf(ep.getEnum()));
  219. isBorderPresent = true;
  220. }
  221. ep = (EnumProperty)props.get("border-left-style");
  222. if (ep != null && ep.getEnum() != Constants.NONE) {
  223. attrib.set(ITableAttributes.CELL_BORDER_LEFT, "\\"
  224. + convertAttributetoRtf(ep.getEnum()));
  225. isBorderPresent = true;
  226. }
  227. ep = (EnumProperty)props.get("border-right-style");
  228. if (ep != null && ep.getEnum() != Constants.NONE) {
  229. attrib.set(ITableAttributes.CELL_BORDER_RIGHT, "\\"
  230. + convertAttributetoRtf(ep.getEnum()));
  231. isBorderPresent = true;
  232. }
  233. if ((p = props.get(Constants.PR_BORDER_WIDTH)) != null) {
  234. ListProperty listprop = (ListProperty)p;
  235. LengthProperty lengthprop = (LengthProperty)listprop.getList().get(0);
  236. Float f = new Float(lengthprop.getLength().getValue() / 1000f);
  237. String sValue = f.toString() + "pt";
  238. attrib.set(BorderAttributesConverter.BORDER_WIDTH,
  239. (int)FoUnitsConverter.getInstance().convertToTwips(sValue));
  240. } else if (isBorderPresent) {
  241. //if not defined, set default border width
  242. //note 20 twips = 1 point
  243. attrib.set(BorderAttributesConverter.BORDER_WIDTH,
  244. (int)FoUnitsConverter.getInstance().convertToTwips("1pt"));
  245. }
  246. // Column spanning :
  247. NumberProperty n = (NumberProperty)props.get("number-columns-spanned");
  248. if (n != null && n.getNumber().intValue() > 1) {
  249. attrib.set(ITableAttributes.COLUMN_SPAN, n.getNumber().intValue());
  250. }
  251. return attrib;
  252. }
  253. /**
  254. * Converts table and row attributes to rtf attributes.
  255. *
  256. * @param attrs Given attributes
  257. * @param defaultAttributes Default rtf attributes
  258. *
  259. * @return All valid rtf attributes together
  260. *
  261. * @throws ConverterException On convertion error
  262. */
  263. static RtfAttributes convertRowAttributes(PropertyList props,
  264. RtfAttributes rtfatts)
  265. throws FOPException {
  266. Property p;
  267. EnumProperty ep;
  268. RtfColorTable colorTable = RtfColorTable.getInstance();
  269. RtfAttributes attrib = null;
  270. if (rtfatts == null) {
  271. attrib = new RtfAttributes();
  272. } else {
  273. attrib = rtfatts;
  274. }
  275. String attrValue;
  276. boolean isBorderPresent = false;
  277. //need to set a default width
  278. //check for keep-together row attribute
  279. if ((p = props.get(Constants.PR_KEEP_TOGETHER | Constants.CP_WITHIN_PAGE)) != null) {
  280. attrib.set(ITableAttributes.ROW_KEEP_TOGETHER);
  281. }
  282. if ((p = props.get(Constants.PR_KEEP_TOGETHER)) != null) {
  283. attrib.set(ITableAttributes.ROW_KEEP_TOGETHER);
  284. }
  285. //Check for keep-with-next row attribute.
  286. if ((p = props.get(Constants.PR_KEEP_WITH_NEXT)) != null) {
  287. attrib.set(ITableAttributes.ROW_KEEP_WITH_NEXT);
  288. }
  289. //Check for keep-with-previous row attribute.
  290. if ((p = props.get(Constants.PR_KEEP_WITH_PREVIOUS)) != null) {
  291. attrib.set(ITableAttributes.ROW_KEEP_WITH_PREVIOUS);
  292. }
  293. //Check for height row attribute.
  294. if ((p = props.get(Constants.PR_HEIGHT)) != null) {
  295. Float f = new Float(p.getLength().getValue() / 1000);
  296. attrValue = f.toString() + "pt";
  297. attrib.set(ITableAttributes.ROW_HEIGHT,
  298. (int)FoUnitsConverter.getInstance().convertToTwips(attrValue));
  299. }
  300. /* to write a border to a side of a cell one must write the directional
  301. * side (ie. left, right) and the inside value if one needs to be taken
  302. * out ie if the cell lies on the edge of a table or not, the offending
  303. * value will be taken out by RtfTableRow. This is because you can't
  304. * say BORDER_TOP and BORDER_HORIZONTAL if the cell lies at the top of
  305. * the table. Similarly using BORDER_BOTTOM and BORDER_HORIZONTAL will
  306. * not work if the cell lies at th bottom of the table. The same rules
  307. * apply for left right and vertical.
  308. * Also, the border type must be written after every control word. Thus
  309. * it is implemented that the border type is the value of the border
  310. * place.
  311. */
  312. if ((p = props.get(Constants.PR_BORDER_STYLE)) != null) {
  313. log.warn("border-style not implemented. Please use border-style-left, "
  314. + "...-right, ...-top or ...-bottom");
  315. /*
  316. attrValue = new String(AbstractBuilder.getValue( attrs, "border-style", defAttrs ));
  317. attrib.set(ITableAttributes.ROW_BORDER_LEFT,"\\"
  318. + BorderAttributesConverter.convertAttributetoRtf(attrValue));
  319. attrib.set(ITableAttributes.ROW_BORDER_RIGHT,"\\"
  320. + BorderAttributesConverter.convertAttributetoRtf(attrValue));
  321. attrib.set(ITableAttributes.ROW_BORDER_HORIZONTAL,"\\"
  322. + BorderAttributesConverter.convertAttributetoRtf(attrValue));
  323. attrib.set(ITableAttributes.ROW_BORDER_VERTICAL,"\\"
  324. + BorderAttributesConverter.convertAttributetoRtf(attrValue));
  325. attrib.set(ITableAttributes.ROW_BORDER_BOTTOM,"\\"
  326. + BorderAttributesConverter.convertAttributetoRtf(attrValue));
  327. attrib.set(ITableAttributes.ROW_BORDER_TOP,"\\"
  328. + BorderAttributesConverter.convertAttributetoRtf(attrValue));
  329. isBorderPresent=true;
  330. */
  331. }
  332. ep = (EnumProperty)props.get("border-top-style");
  333. if (ep != null && ep.getEnum() != Constants.NONE) {
  334. attrib.set(ITableAttributes.ROW_BORDER_TOP, "\\"
  335. + convertAttributetoRtf(ep.getEnum()));
  336. attrib.set(ITableAttributes.ROW_BORDER_HORIZONTAL, "\\"
  337. + convertAttributetoRtf(ep.getEnum()));
  338. isBorderPresent = true;
  339. }
  340. ep = (EnumProperty)props.get("border-bottom-style");
  341. if (ep != null && ep.getEnum() != Constants.NONE) {
  342. attrib.set(ITableAttributes.ROW_BORDER_BOTTOM, "\\"
  343. + convertAttributetoRtf(ep.getEnum()));
  344. attrib.set(ITableAttributes.ROW_BORDER_HORIZONTAL, "\\"
  345. + convertAttributetoRtf(ep.getEnum()));
  346. isBorderPresent = true;
  347. }
  348. ep = (EnumProperty)props.get("border-left-style");
  349. if (ep != null && ep.getEnum() != Constants.NONE) {
  350. attrib.set(ITableAttributes.ROW_BORDER_LEFT, "\\"
  351. + convertAttributetoRtf(ep.getEnum()));
  352. attrib.set(ITableAttributes.ROW_BORDER_VERTICAL, "\\"
  353. + convertAttributetoRtf(ep.getEnum()));
  354. isBorderPresent = true;
  355. }
  356. ep = (EnumProperty)props.get("border-right-style");
  357. if (ep != null && ep.getEnum() != Constants.NONE) {
  358. attrib.set(ITableAttributes.ROW_BORDER_RIGHT, "\\"
  359. + convertAttributetoRtf(ep.getEnum()));
  360. attrib.set(ITableAttributes.ROW_BORDER_VERTICAL, "\\"
  361. + convertAttributetoRtf(ep.getEnum()));
  362. isBorderPresent = true;
  363. }
  364. ep = (EnumProperty)props.get("border-horizontal-style");
  365. if (ep != null && ep.getEnum() != Constants.NONE) {
  366. attrib.set(ITableAttributes.ROW_BORDER_HORIZONTAL, "\\"
  367. + convertAttributetoRtf(ep.getEnum()));
  368. attrib.set(ITableAttributes.ROW_BORDER_TOP, "\\"
  369. + convertAttributetoRtf(ep.getEnum()));
  370. attrib.set(ITableAttributes.ROW_BORDER_BOTTOM, "\\"
  371. + convertAttributetoRtf(ep.getEnum()));
  372. isBorderPresent = true;
  373. }
  374. ep = (EnumProperty)props.get("border-vertical-style");
  375. if (ep != null && ep.getEnum() != Constants.NONE) {
  376. attrib.set(ITableAttributes.ROW_BORDER_VERTICAL, "\\"
  377. + convertAttributetoRtf(ep.getEnum()));
  378. attrib.set(ITableAttributes.ROW_BORDER_LEFT, "\\"
  379. + convertAttributetoRtf(ep.getEnum()));
  380. attrib.set(ITableAttributes.ROW_BORDER_RIGHT, "\\"
  381. + convertAttributetoRtf(ep.getEnum()));
  382. isBorderPresent = true;
  383. }
  384. if ((p = props.get(Constants.PR_BORDER_WIDTH)) != null) {
  385. ListProperty listprop = (ListProperty)p;
  386. LengthProperty lengthprop = (LengthProperty)listprop.getList().get(0);
  387. Float f = new Float(lengthprop.getLength().getValue() / 1000f);
  388. String sValue = f.toString() + "pt";
  389. attrib.set(BorderAttributesConverter.BORDER_WIDTH,
  390. (int)FoUnitsConverter.getInstance().convertToTwips(sValue));
  391. } else if (isBorderPresent) {
  392. //if not defined, set default border width
  393. //note 20 twips = 1 point
  394. attrib.set(BorderAttributesConverter.BORDER_WIDTH,
  395. (int)FoUnitsConverter.getInstance().convertToTwips("1pt"));
  396. }
  397. return attrib;
  398. }
  399. /**
  400. *
  401. * @param iBorderStyle the border style to be converted
  402. * @return String with the converted border style
  403. */
  404. public static String convertAttributetoRtf(int iBorderStyle) {
  405. // Added by Normand Masse
  406. // "solid" is interpreted like "thin"
  407. if (iBorderStyle == Constants.SOLID) {
  408. return BorderAttributesConverter.BORDER_SINGLE_THICKNESS;
  409. /* } else if (iBorderStyle==Constants.THIN) {
  410. return BorderAttributesConverter.BORDER_SINGLE_THICKNESS;
  411. } else if (iBorderStyle==Constants.THICK) {
  412. return BorderAttributesConverter.BORDER_DOUBLE_THICKNESS;
  413. } else if (iBorderStyle==Constants. value.equals("shadowed")) {
  414. return BorderAttributesConverter.BORDER_SHADOWED;*/
  415. } else if (iBorderStyle == Constants.DOUBLE) {
  416. return BorderAttributesConverter.BORDER_DOUBLE;
  417. } else if (iBorderStyle == Constants.DOTTED) {
  418. return BorderAttributesConverter.BORDER_DOTTED;
  419. } else if (iBorderStyle == Constants.DASHED) {
  420. return BorderAttributesConverter.BORDER_DASH;
  421. /* } else if (iBorderStyle==Constants value.equals("hairline")) {
  422. return BorderAttributesConverter.BORDER_HAIRLINE;*/
  423. /* } else if (iBorderStyle==Constant value.equals("dot-dash")) {
  424. return BorderAttributesConverter.BORDER_DOT_DASH;
  425. } else if (iBorderStyle==Constant value.equals("dot-dot-dash")) {
  426. return BorderAttributesConverter.BORDER_DOT_DOT_DASH;
  427. } else if (iBorderStyle==Constant value.equals("triple")) {
  428. return BorderAttributesConverter.BORDER_TRIPLE;
  429. } else if (iBorderStyle==Constant value.equals("wavy")) {
  430. return BorderAttributesConverter.BORDER_WAVY;
  431. } else if (iBorderStyle==Constant value.equals("wavy-double")) {
  432. return BorderAttributesConverter.BORDER_WAVY_DOUBLE;
  433. } else if (iBorderStyle==Constant value.equals("striped")) {
  434. return BorderAttributesConverter.BORDER_STRIPED;
  435. } else if (iBorderStyle==Constant value.equals("emboss")) {
  436. return BorderAttributesConverter.BORDER_EMBOSS;
  437. } else if (iBorderStyle==Constant value.equals("engrave")) {
  438. return BorderAttributesConverter.BORDER_ENGRAVE;*/
  439. } else {
  440. return null;
  441. }
  442. }
  443. }