Apache OpenOffice (AOO) Bugzilla – Issue 49209
Setting the rotation of a text in a cell change the rotation of all the column
Last modified: 2013-07-30 02:37:03 UTC
The problem can be summarize with this steps: - i create with the OOo Api and Java a document Writer with a table; - i enter a text in a cell in the first row; - then i change the properties of the cell/text with this code: XText xCellText=(XText)UnoRuntime.queryInterface( XText.class,xTable.getCellByName(xCellName)); XTextCursor xtc=xCellText.createTextCursor(); XPropertySet xCursorProps=(XPropertySet)UnoRuntime.queryInterface (XPropertySet.class,xtc); xCursorProps.setPropertyValue("CharColor",new Integer(0x000000)); xCursorProps.setPropertyValue("CharFontName","Arial"); xCursorProps.setPropertyValue("CharHeight",new Float(8.0)); xCursorProps.setPropertyValue("CharWeight", new Float(com.sun.star.awt.FontWeight.BOLD)); xCursorProps.setPropertyValue("CharRotation",new Short(900)); xcell=xTable.getCellByName(xCellName); xPropsCell=(XPropertySet)UnoRuntime.queryInterface (XPropertySet.class,xcell); xPropsCell.setPropertyValue("VertOrient",new Short(com.sun.star.text.VertOrientation.CENTER)); xPropsCell.setPropertyValue("BorderDistance",new Integer(75)); - all the property is ok, and is apply only at the cell but the rotation is apply also to all the cell under that i choose to modify, so all the text in the column in which there is the cell, is rotate!!!
I created a document, inserted a 2x3 table, added some content to it and then executed the following macro ... xTable = ThisComponent.TextTables(0) xCellText= xTable.getCellByName("B2") xtc=xCellText.createTextCursor() xtc.gotoEnd(true) xtc.CharRotation = 900 worked like a charm ... only the cell B2 is rotated. What do I miss ?
The problem appear to me when the cell is in the first row, i try to change the rotation of a "middle" cell, and all is ok, i suppose that the problem is in the API and not in Java rather than VB. The problems is the same also with API 1.9.79 and OOo 2.0Beta
mmm I changed the macro so it uses B1 instead of B2 and it still only rotates the one cell ... anything else to keep in mind ?
I could think that the problem is Java... you can try with Java?? The only other thing is that i set this property of the table: xTableProps.setPropertyValue("RepeatHeadline",new Boolean(true));
I tried to set this property too, but the effect stays the same ... I take it that the provided macro works for you too ... could you provide a running java-sample that makes the problem reproducible.
I make a flash movie that show the code that i use and the final result, i hope that is enough for you.. :-)
Created attachment 26188 [details] In the Zip, a flash movie to show the problem
sw->thoriredd: nice movie ;-) ... I did all I could see in this movie and it still works properly here ... can you provide the document that contains the table you try to modify ? Maybe something is unique with the table you use.
I don't try to to modify a document, i create a new document every time taking the informations from a database, so i can eventually attach the final document that i generate, but i don't think that it is important.
Created attachment 26592 [details] The final document that i generate with the Api
sw->thoriredd: you are right it wasn't the structure of ther table as I hoped :-( ... can you create a java class that makes the behaviour reproducible ? ... all attempts I made lead to the expected behaviour that only the cell I wanted was rotated.
Created attachment 26595 [details] The .class to simulate the problem, you must run before soffice.exe
Created attachment 26597 [details] This is the correct file you can test, the other have a different way to create the table
sw-> thoriredd: when I try to execute the class I get the error ... class MacroImpaginazione not found ... seems this class is missing :-(
Created attachment 26622 [details] Sorry.. this version would be ok...
sw->thoriredd: seems someone has a better memory then it should ;-) Adding xCursorProps.setPropertyValue("CharRotation", new Short((short)0)); in the if-statement if(tipo.compareTo("RIGHEMATRICEOO") == 0) seems to solve the problem.
sw->thoriredd: the memory is as it should be ;-) ... if a column exists then in a newly inserted line the columns have the same properties as in the line before. You already reset most properties at the cursor in the mentioned if-clause and now additionally the charotation needs to be added :-)
I have tried to set the "CharRotation" to 0, and with OO all is ok, but i can't use it, because, if i try to save the document as WORD file (and this is what i want) and open it with Word 2000, the program go in loop, counting the page (it's seem to be strange, but it is so...), and give me an error... i think it's a big bug...
Created attachment 28291 [details] the document that loops within ms-office
Created attachment 28292 [details] the same file in the OOo format
sw->flr: seems we create a file that can't be read by ms-office anymore ... OOo doesn't have the slightest problem with it tho ;-) ... I've attached the mso_loop.odt file which is the file in "our" format and mso_loop.doc which is the file saved in the ms-office format. Opening the .doc file in ms-word lets the application loop.
Only a specification: the problem is on Windows XP and Sun Solaris 10
Reset assignee on issues not touched by assignee in more than 1000 days.