List Info

Thread: BorderDistance or Spacing to Contents in a Frame




BorderDistance or Spacing to Contents in a Frame
user name
2006-06-23 11:32:54
Hi Kent,

> If you do not have a border in a frame you are not
> allowed to set what is referred to in the UI as
> Spacing to Contents. I observe that without a border
> LeftBorderDistance, RightBorderDistance, etc are
> ignored.
> 
> Is there no way to get around this? The only success I
> have had is with transparent colors, but then you can
> sometimes see them in pdf outputs. I just want a frame
> with an internal margin and no borders.
> 
> I am thinking of submitting a feature request. The
> code below creates a frame with a border and a large
> spacing to contents. If you leave out the borders it
> puts them in. Zero for the line widths doesn't work
> either.

instead of trying to set the distance to a non existing
border you could 
try to set the margins of the text inside the frame.

Something like the following seems to do what you want

----------------------
  oFrame =
ThisComponent.createInstance("com.sun.star.text.TextFr
ame" )
  oFrame.Width = 16000

  aBorder =
createUnoStruct("com.sun.star.table.BorderLine"
)

  oFrame.TopBorder = aBorder
  oFrame.BottomBorder = aBorder
  oFrame.LeftBorder = aBorder
  oFrame.RightBorder = aBorder

 
ThisComponent.Text.insertTextContent(ThisComponent.Text.Star
t, oFrame, 
false )
  oFrame.Text.String = "Hello, this text is within the
frame."+chr(13)
  xFrameText = oFrame.Text
  xFirstParagraph = xFrameText.createEnumeration.nextElement
  xFirstParagraph.ParaLeftMargin=5000
  xFirstParagraph.ParaRightMargin=5000
  xFirstParagraph.ParaBottomMargin=5000
  xFirstParagraph.ParaTopMargin=5000
----------------------

Hope that helps

Regards

Stephan

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )