DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=33470>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=33470 ------- Additional Comments From [EMAIL PROTECTED] 2005-02-09 18:14 ------- The motivation for this patch - my post to [email protected] send on 2004-12-16: Hi There! I saw Victor's modification to Cocoon-POI: http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Orientation.java?r1=1.5&r2=1.6&diff_format=h relased in Cocoon 2.1.6 Can you tell me what is the level of activity of block POI right now? (commits or functional points per month ;)). I am interested in gmr:Style's Orient attibute ("The text orientation" - accoring to http://www.jfree.org/jworkbook/gnumeric-xml.pdf) which defaults to "1". It is a kind of weird attribute: 1) There is a class that represents the attribute: org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements.StyleOrientation having following methods: public boolean isHoriz() public boolean isVertHorizText() public boolean isVertVertText() public boolean isVertVertText2() 2) It is used by: having methods calling representants in StyleOrientation: public boolean isStyleOrientationHoriz() throws IOException { return getStyleOrientation().isHoriz(); } public boolean isStyleOrientationVertHorizText() throws IOException { return getStyleOrientation().isVertHorizText(); } public boolean isStyleOrientationVertVertText() throws IOException { return getStyleOrientation().isVertVertText(); } public boolean isStyleOrientationVertVertText2() throws IOException { return getStyleOrientation().isVertVertText2(); } 3) It could have been used on org.apache.poi.hssf.usermodel.HSSFCellStyle calling its setRotation(short rotation) method 4) BUT no one calls those methods!!! So what the [EMAIL PROTECTED] is going on? Recent Gnumeric still seems not to implement text rotation: http://gnomedesktop.org/node/2020#comment-32238 and it was a problem since a while: http://mail.gnome.org/archives/gnome-office-list/2003-December/msg00008.html so I couldn't find good explanation for "Orient" attibute values. Also the only value written by Gnumeric in Orient attribute is of course "1", since there is no option in Gnumeric's menu to rotate cell's text. According to org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements.StyleOrientation class it seems to be a 4-bit number: "Style orientation is written as an integer, and each bit in the integer specifies a particular boolean attribute. This class deals with all that information in an easily digested form" So there are the bits: 0-bit is horiz - default value ( == 1 ) 1-bit is vert_horiz_text 2-bit is vert_vert_text 3-bit is vert_vert_text2 What do the three upper bits mean? Those bits are also mentioned in http://cvs.gnome.org/viewcvs/gnumeric/gnumeric.xsd?rev=1.11&view=markup as: <xsd:simpleType name="style_orientation"> <xsd:restriction base="xsd:integer"> <!-- this is a bit map as follows: 1 = HORIZ 2 = VERT_HORIZ_TEXT 4 = VERT_VERT_TEXT 8 = VERT_VERT_TEXT2 --> <xsd:minInclusive value="0"/> <xsd:maxInclusive value="15"/> </xsd:restriction> </xsd:simpleType> I guess that to set cell text orientation/rotation there is enough to code it like that: public abstract class EPStyle extends org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements.EPStyle { public void initialize(Attribute[] attributes, ElementProcessor parent) throws IOException { super.initialize(attributes, parent); EPStyleRegion sregion = (EPStyleRegion)parent; if (sregion.isValid()) { HSSFCellStyle style = sregion.getStyle(); boolean horiz = isStyleOrientationHoriz(); boolean vert_horiz_text = isStyleOrientationVertHorizText(); boolean vert_vert_text = isStyleOrientationVertVertText(); boolean vert_vert_text2 = isStyleOrientationVertVertText2(); short rotation = magicallMetodCreatingRotationValue( horiz, vert_horiz_text, vert_vert_text, vert_vert_text2); style.setRotation(rotation); } } public abstract short magicallMetodCreatingRotationValue( boolean horiz, boolean vert_horiz_text, boolean vert_vert_text, boolean vert_vert_text2); } But I need to know how to write magicallMetodCreatingRotationValue!!! Do you know what can help me? -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
