OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

table borders

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
jelaih
OOo Enthusiast
OOo Enthusiast


Joined: 23 Feb 2005
Posts: 152

PostPosted: Fri Dec 09, 2005 3:19 am    Post subject: table borders Reply with quote

Is it a bug on 1.1.4? I have used Danny's function "MakeCellBorderLine" to create my own border

Code:

Sub tbl_border_onerow 'blue
   Dim oSels,oTables,oCells   
   oSels = ThisComponent.getCurrentController().getSelection()
   oVC = ThisComponent.getCurrentController().getViewCursor()   
   oVC.cell.BottomBorder = MakeCellBorderLine( RGB(0,0,255), 150, 150, 100)         
End sub


Sub tbl_border_halfrow 'red
   Dim oSels,oTables,oCells   
   oSels = ThisComponent.getCurrentController().getSelection()
   oVC = ThisComponent.getCurrentController().getViewCursor()   
   oVC.cell.BottomBorder = MakeCellBorderLine( RGB(255,0,0), 0, 150, 0)
End sub


Function MakeCellBorderLine( nColor, nInnerLineWidth, nOuterLineWidth, nLineDistance ) _
         As com.sun.star.table.BorderLine
   oBorderLine = createUnoStruct( "com.sun.star.table.BorderLine" )
   With oBorderLine
      .Color = nColor
      .InnerLineWidth = nInnerLineWidth
      .OuterLineWidth = nOuterLineWidth
      .LineDistance = nLineDistance
   End With
   MakeCellBorderLine = oBorderLine
End Function


"tbl_border_halfrow" works fine, my prob is with "tbl_border_onerow" because whenever I close and open the document again, the double border lines became a single line. Then when I close and re-open it again, its borders finally disappeared. How come it won't work on double borders while it works on a single one? I'm I missing something? Thanks
_________________
codebits... Smile
Back to top
View user's profile Send private message
jelaih
OOo Enthusiast
OOo Enthusiast


Joined: 23 Feb 2005
Posts: 152

PostPosted: Sun Dec 11, 2005 5:13 pm    Post subject: Reply with quote

perhaps its a bug, i just can't see anything wrong here...
_________________
codebits... Smile
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Sun Dec 11, 2005 8:25 pm    Post subject: Reply with quote

Which version are you using? It sounds like you are saying that you are using version 1.1.4. I tested with well, it is at least version 2.0, I might be using a 2.01 release candidate, I do not remember. But... the following seemed to work for me:

Code:
Sub tbl_border_onerow 'blue
   Dim oSels,oTables,oCells
   Dim oVC
   oSels = ThisComponent.getCurrentController().getSelection()
   oVC = ThisComponent.getCurrentController().getViewCursor()   
   'oVC.cell.BottomBorder = MakeCellBorderLine( RGB(0,0,255), 150, 150, 100)         
   Dim oBorderLine
   oBorderLine = oVC.cell.BottomBorder
   With oBorderLine
      .Color = RGB(255,0,0)
      .InnerLineWidth = 150
      .OuterLineWidth = 150
      .LineDistance = 0
   End With
   oVC.cell.BottomBorder = oBorderLine
End sub

Changing the line distance to 100 and it will fail. I will file a bug report.


http://qa.openoffice.org/issues/show_bug.cgi?id=59222
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
jelaih
OOo Enthusiast
OOo Enthusiast


Joined: 23 Feb 2005
Posts: 152

PostPosted: Sun Dec 11, 2005 11:49 pm    Post subject: Reply with quote

yes, 1.1.4, Thanks, although the double border still disappears and became only one instead of two borders, it is much better than none at all
_________________
codebits... Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group