What do you all think about this simple (_TEMPORARY_) solution (in attachment as EPStyle.java.diff)?


Regards, Krystian


-- Krystian Nowak [EMAIL PROTECTED] =========================================== Poznan Supercomputing and Networking Center Poland, 60-814 Poznan, Zwierzyniecka 20 tel. (+48 61) 8582164 fax. (+48 61) 8582151 http://www.man.poznan.pl =========================================== BlueEyes - Human-Operator Monitoring System http://www.blueeyes.prv.pl http://www.cs.put.poznan.pl/csidc/2001 ===========================================
Index: EPStyle.java
===================================================================
RCS file: 
/home/cvspublic/cocoon-2.1/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPStyle.java,v
retrieving revision 1.7
diff -u -r1.7 EPStyle.java
--- EPStyle.java        5 Mar 2004 13:02:04 -0000       1.7
+++ EPStyle.java        17 Dec 2004 10:12:11 -0000
@@ -41,6 +41,7 @@
  *
  * @author Marc Johnson ([EMAIL PROTECTED])
  * @author Andrew C. Oliver ([EMAIL PROTECTED])
+ * @author Krystian Nowak (krystian _a_t_ man _d_o_t_ poznan _d_o_t_ pl)
  * @version CVS $Id: EPStyle.java,v 1.7 2004/03/05 13:02:04 bdelacretaz Exp $
  */
 public class EPStyle extends BaseElementProcessor {
@@ -116,6 +117,11 @@
                 convertVAlignment(getVerticalAlignment().getCode());
             style.setVerticalAlignment(cnvvalign);
             style.setFillPattern((short)getShade());
+            style.setRotation(convertStyleOrientation(
+                    isStyleOrientationHoriz(),
+                    isStyleOrientationVertHorizText(),
+                    isStyleOrientationVertVertText(),
+                    isStyleOrientationVertVertText2()));
 
             Workbook workbook = getWorkbook();
             HSSFDataFormat dataformat = workbook.createDataFormat();
@@ -547,6 +553,20 @@
                     + retval);
         }
         return retval;
+    }
+
+    /**
+     * deal with mismatch between gnumeric style orientation and Excel cell 
style rotation
+     */
+    private short convertStyleOrientation(
+            boolean horiz, boolean vert_horiz_text, boolean vert_vert_text,
+            boolean vert_vert_text2) {
+        
+        if(horiz && (!vert_horiz_text) && (!vert_vert_text) && 
(!vert_vert_text2)) {
+            return 0;
+        } else {
+            return 90;
+        }
     }
 
 } // end public class EPStyle

Reply via email to