Apache OpenOffice (AOO) Bugzilla – Issue 116420
com.sun.star.text.CellProperties.VertOrient do not work
Last modified: 2017-05-20 11:33:24 UTC
oTable = oDoc.createInstance ( "com.sun.star.text.TextTable" ) oTable.initialize( 5, 5 ) oCells = oTable.getCellRangeByPosition ( 0, 0, 4, 4 ) oCells.CharWeight = 150 ' Range vertical centering do not work! oCells.VertOrient = 2
MRU->OS: please have a look; thanks!
Sub Main Dim oSM Dim oDesk, oDoc As Object Dim arg() Dim oTable As Object Dim oCells As Object Dim oText As Object Dim oCursor As Object Dim oCellText As Object Dim oCellCursor As Object Set oSM = CreateObject("com.sun.star.ServiceManager") Set oDesk = oSM.createInstance("com.sun.star.frame.Desktop") Set oDoc = oDesk.loadComponentFromURL("private:factory/swriter","_blank",0,arg ()) Set oText = oDoc.Text Set oCursor = oDoc.CurrentController.GetViewCursor Set oTable = oDoc.createInstance("com.sun.star.text.TextTable") oTable.initialize(1,2) oText.InsertTextContent(oCursor,oTable,false) Set oCells = oTable.getCellRangeByPosition (0,0,1,0) ' Range chars weight works oCells.CharWeight = 150 ' Range vertical centering do not work !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! oCells.VertOrient = 2 Set oCellText = oTable.GetCellByPosition(0,0) Set oCellCursor = oCellText.CreateTextCursor oCellText.InsertString(oCellCursor,"oCells.VertOrient = 2" + chr(13) + "do not" + chr(13) + "work",false) Set oCellText = oTable.GetCellByPosition(1,0) Set oCellCursor = oCellText.CreateTextCursor oCellText.InsertString(oCellCursor,"bolder and vertical centered Text",false) ' amazingly, it works: ' oCellText.VertOrient = 2 End Sub
Created attachment 75652 [details] testcase
Go to attachments for testcase with BASIC code. VertOrient do not work with cellRange ...only with single cell. Amazingly, others properties (eg CharWeight) work with cellRange.
Created attachment 75659 [details] proposed fix
accepted
Reset assigne to the default "issues@openoffice.apache.org".