Thanks in the end I wrote up something similiar to
your algorithmn.
What I did is I created a shape, then I do
insertTextContent, and then I do getSize and finally
removeTextContent. Then I at least have the size of
the object so I can calculate if there is room enough.
Then instead of a shape I use a TextFrame because I
need the text flow functionality it gives - ie I can
put them in tables.
Unfortunately leftborderdistance and the other
borderdistance properties don't seem to work. Tomorrow
I will enter a bug report for these problems.
Thanks again for your interest.
--- Fernand Vanrie <[EMAIL PROTECTED]> wrote:
> Had the same problem and solved it with running a
> counter for eevry page
> and keep track off the cursor position on the page
> where we are
> inserting a frame.
> Then you have to place the new frame anywhere on the
> page, fil the frame
> with the text and with the "frame cursor" you can
> measur the hight of
> the filled-frame and then just reposition the frame
> on the page or on a
> new page if there is not enough place (hight) on the
> current page.
> Maybe a peace of OObasic code can help you further
> Dim oFrame As Object
> oFrame =
> oDoc.createInstance("com.sun.star.text.TextFrame")
> oFrame.SetPropertyValue("AnchorPageNo", iPagenr)
> oFrame.AnchorType = lAnchor
> oFrame. BackColorTransparency = 100
> oFrame.PositionProtected = True
> oFrame.SizeProtected = True
> oFrame.ContentProtected = True
> oFrame.width = iFotW - AflpL - AflpR
> oFrame.HoriOrient = NONE
> oFrame.VertOrient = NONE
> oFrame.VertOrientRelation = PAGE_PRINT_AREA
> oFrame.HoriOrientRelation = PAGE_PRINT_AREA
>
> aLBorder.OuterLineWidth = 0
> aRBorder.OuterLineWidth = 0
> aTBorder.OuterLineWidth = 1
> aTBorder.Color = rgb(254,254,254)
> aBBorder.OuterLineWidth = 1
> aBBorder.Color = rgb(254,254,254)
> oFrame.LeftBorder = aLBorder
> oFrame.RightBorder = aRBorder
> oFrame.TopBorder = aTBorder
> oFrame.BottomBorder = aBBorder
> oframe.TopMargin = 200 'wrap aanzetten, anders
> wordt het automatisch 2mm
> oFrame.BottomMargin = 100
> oFrame.LeftMargin = 0
> oFrame.RightMargin = 0
> oFrame.BottomBorderDistance =
> iif(oDialog.Model.OndBoven.State = 1 ,
> 172, 0)
> oFrame.TopBorderDistance =
> iif(oDialog.Model.OndOnder.State = 1 , 172 , 0)
>
> 'oFrame.HoriOrient =
> com.sun.star.text.HoriOrientation.NONE
> 'oFrame.VertOrient =
> com.sun.star.text.VertOrientation.LINE_TOP
>
> oText.insertTextContent(oCursor(), oFrame, false)
>
> sOnderschrift = oTextModel.GetPropertyValue("Text")
>
> dim iStringhoogte as long
> iStringhoogte =
>
Fix((Len(sOnderschrift)/67*9400/(iFotW-AflpR-AflpL)))
> +1
>
> Dim IFramehoogte_alsboven as integer
> Dim iFramehoogte_alsonder as integer
>
> ' iFramehoogte_alsboven = (IStringhoogte *(-345)) -
> 172 -
> ' iFramehoogte_alsonder = iFoth
> oFrame.HoriOrientPosition = iHCpos + 900 'left
> Pagemargin
>
>
> Dim oFrameCursor As Object
> oFrameCursor = oFrame.createTextCursor()
> oFrameCursor.paraStyleName = "6_ondertitel"
> oViewCursor.gotoRange(oFrameCursor,false)
> 'FrameCursor.paraAdjust =
> com.sun.star.style.ParagraphAdjust.CENTER
> 'Dim frameCPos as integer
> Dim FrameCpos as integer
> Dim FrameH as integer
> FrameCpos = oViewCursor.getPosition().Y
>
> 'print FrameCpos
> oFrameCursor.String = sOnderschrift
> 'oFrame.SizeType = 2
> oViewCursor.gotoEnd(false)
>
> FrameH = oViewCursor.getPosition().Y - FrameCpos +
> 345 + 200
>
> iFramehoogte_alsboven = (FrameH * (-1))
> iFramehoogte_alsonder = iFoth
> oFrame.VertOrientPosition = iVCpos - AflpB +
> iif(oDialog.Model.OndBoven.State = 1 ,
> iFramehoogte_alsboven ,
> iFramehoogte_alsonder) +
> iif(oDialog.Model.viaCursor.State = 1 , 1080 ,
> 1100)
> oFrame.Height = FrameH
> oFrame.SizeType = 1
> ' oFrame.VertOrientPosition = iVCpos - AflpB +
> iif(oDialog.Model.OndBoven.State = 1 ,
> iFramehoogte_alsboven ,
> iFramehoogte_alsonder ) +
> iif(oDialog.Model.viaCursor.State = 1 , 1080 ,
> 1100)
>
>
>
> 'oFrame.Name = "Ond" + "_" + iPagenr + "_" + iHCpos
> +"_" + iVCpos + "_"
> + (tot + 1) ' moet telkens uniek zijn
> oFrame.Name = "Ond" + "_" + iPagenr + "_" +
> oFrame.Zorder
>
> oViewCursor.gotoRange(oCursor,false)
>
> fernand
>
>
> Kent Gibson schreef:
> > Is there any way I can ask a frame if any part of
> it
> > is in the non - printable area?
> >
> > If any one has any ideas I would be very
> appreciative
> > and I will be happy to submit a snippet for it. I
> am
> > planning on submitting a couple of frame snippets
> > already.
> >
> > Sorry for the deluge of questions. But this frame
> > problem is turning out to be a real project
> killer.
> >
> > I am having a problem that I cannot get frames to
> > break neatly at the page borders. I have tried
> frames
> > in paragraph styles, frames in frames, tables in
> > tables, frames in tables and frames in sections.
> All
> > these ways have their different quirks but they
> leave
> > something to be desired in the end effect.
> Furthermore
> > I would like these frames to be inside of some
> > container that shows borders (ie paragraphs or
> > tables).
> >
> > The only way I think I can figure it out is if I
> force
> > a page break when one of the frames starts to
> creep
> > outside of the margins. Alternatively if I could
> just
> > ask how big a frames was once it had content then
> I
> > could measure and know it was outside the margins,
> but
> > I can never get this to work. When I query
> absolute
> > height I get a constant back for frames with
> varying
> > height. Maybe I am doing that wrong though.
> >
> > Like I said any help would be great. This is
> probably
> > our last major hurdle with OpenOffice. It is a
> great
> > program. Thanks for your efforts.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]