Issue 49209

Summary: Setting the rotation of a text in a cell change the rotation of all the column
Product: App Dev Reporter: thoriredd <crfonti>
Component: apiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: Other   
OS: Windows XP   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
In the Zip, a flash movie to show the problem
none
The final document that i generate with the Api
none
The .class to simulate the problem, you must run before soffice.exe
none
This is the correct file you can test, the other have a different way to create the table
none
Sorry.. this version would be ok...
none
the document that loops within ms-office
none
the same file in the OOo format none

Description thoriredd 2005-05-13 08:54:48 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!!!
Comment 1 stephan.wunderlich 2005-05-13 11:26:06 UTC
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 ?
Comment 2 thoriredd 2005-05-13 12:59:03 UTC
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
Comment 3 stephan.wunderlich 2005-05-13 13:14:26 UTC
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 ?
Comment 4 thoriredd 2005-05-13 14:04:31 UTC
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));
Comment 5 stephan.wunderlich 2005-05-13 14:27:54 UTC
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.
Comment 6 thoriredd 2005-05-16 09:15:58 UTC
I make a flash movie that show the code that i use and the final result, i hope
that is enough for you.. :-)

Comment 7 thoriredd 2005-05-16 09:18:16 UTC
Created attachment 26188 [details]
In the Zip, a flash movie to show the problem
Comment 8 stephan.wunderlich 2005-05-26 13:06:34 UTC
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.
Comment 9 thoriredd 2005-05-26 14:56:58 UTC
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.
Comment 10 thoriredd 2005-05-26 14:57:58 UTC
Created attachment 26592 [details]
The final document that i generate with the Api
Comment 11 stephan.wunderlich 2005-05-26 15:25:04 UTC
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. 
Comment 12 thoriredd 2005-05-26 16:06:24 UTC
Created attachment 26595 [details]
The .class to simulate the problem, you must run before soffice.exe
Comment 13 thoriredd 2005-05-26 16:10:08 UTC
Created attachment 26597 [details]
This is the correct file you can test, the other have a different way to create the table
Comment 14 stephan.wunderlich 2005-05-27 14:05:56 UTC
sw-> thoriredd: when I try to execute the class I get the error ... class
MacroImpaginazione not found ... seems this class is missing :-(
Comment 15 thoriredd 2005-05-27 14:15:32 UTC
Created attachment 26622 [details]
Sorry.. this version would be ok...
Comment 16 stephan.wunderlich 2005-07-15 11:50:02 UTC
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.
Comment 17 stephan.wunderlich 2005-07-15 12:00:01 UTC
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 :-)
Comment 18 thoriredd 2005-07-15 15:00:42 UTC
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...
Comment 19 stephan.wunderlich 2005-07-28 15:37:17 UTC
Created attachment 28291 [details]
the document that loops within ms-office
Comment 20 stephan.wunderlich 2005-07-28 15:38:20 UTC
Created attachment 28292 [details]
the same file in the OOo format
Comment 21 stephan.wunderlich 2005-07-28 15:41:33 UTC
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.
Comment 22 thoriredd 2006-03-31 07:50:31 UTC
Only a specification: the problem is on Windows XP and Sun Solaris 10
Comment 23 Rob Weir 2013-07-30 02:37:03 UTC
Reset assignee on issues not touched by assignee in more than 1000 days.