Resetting Tabs
- From: Bob Keeney <bobk@xxxxxxxxxxx>
- To: ftcdev@xxxxxxxxxxxxx
- Date: Fri, 30 May 2008 16:26:41 -0500
I'm working on a tab setting editor with the eventual goal of making
this is control. I've been able to parse the selected paragraphs for
their tab stops and list them properly.
When I delete tabs I'm getting an out of bounds error immediately
after I save the tabs back to the each selected paragraph.
The save is this:
======Code Snip=======
oParagraphs = mFTC.getDoc.getSelectedParagraphs
for j as integer = 0 to oParagraphs.Ubound
oParagraphs(j).clearTabStops
for i as integer = 0 to lbTabs.ListCount-1
oParagraphs(j).addTabStop FTTabStop.TAB_LEFT,
val(lbTabs.cell(i, 1))
next
next
======End Snip=======
So my issue is that after I return from this event, I'm getting a nil
object exception when I click anywhere else or let a timer check text/
paragraph attributes. Immediately after I save the tab stops I'm
calling ftc.fullUpdate.
The error in question occurs is FTParagraph.CopyParagraphStyle.
' Clone the tab stops.
for i = 0 to count
' Clone the tab stop.
tabStops(i) = tabStops(i).clone //tabstops contains nothing but
nil tabstops, but 8 of em!
next
Is there something I need to do differently to flush the tabstops?
Let me know if you need any additional information.
Thanks,
Bob Keeney
BKeeney Software Inc.
FTC Website: www.truenorthsoftware.com/Realbasic/FormattedText.html
Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
List Archive: www.freelists.org/archives/ftcdev
Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in
the subject field.
Other related posts: