RTFData trigger OutOfBoundsException pass 90K Text

40192 - RTFData trigger OutOfBoundsException pass 90K Text
Status: Needs Review Rank: Not Ranked Product: Xojo Category: N/A

Michel Bujardet Today at 9:41 PM
OS: OS X 10.10.4

Xojo: Xojo 2015r2.2

Steps: A RubberViews customer bumped into a strange OutOfBoundsException with an app where he has a TextArea with a very big amount of text ( > 4,000,000 characters).

I found out that was because I tried to get RTFData from that styled TextArea.

Please see the attached project. It tries to get RTFData for three different text size :

The first one has a text size of 15K. Everything works as planned.

The second has 60 K. Beachball til death do us part…

The third one has 86988 K.
An exception of class OutOfBoundsException was not handled. The application must shut down.

This may simply mean that RTFData is not available for text larger than 15K for technical reasons that cannot be fixed.

But it would be nice to mention that limitation in the LR.

<https://xojo.com/issue/40192>

did you try MBS Plugin functions as workaround?

RTFDataMBS for example?

[quote=201791:@Christian Schmitz]did you try MBS Plugin functions as workaround?

RTFDataMBS for example?[/quote]

The problem just appeared in RubberViews, which is a development class I sell to other developers. So I cannot use an MBS plugin. I will look into advising it, though.

I already use that in Check Writer to load RTF. It is less clear of what else is suitable for what I do.

I will look into the RTF declare set for Mac, but I am not aware of equivalents for Windows and Linux.

At present, until if and when that issue is resolved, I will turn off styled text resize when a TextArea text is over 15K.

you could still have a constant which user can switch to true if MBS is available to them.

So you could in that case use TextArea1.RTFDataMBS (for Mac) and TextArea.WinRTFDataMBS (for Windows).
Or StyledText.RTFDataMBS if you like.

[quote=201869:@Christian Schmitz]you could still have a constant which user can switch to true if MBS is available to them.

So you could in that case use TextArea1.RTFDataMBS (for Mac) and TextArea.WinRTFDataMBS (for Windows).
Or StyledText.RTFDataMBS if you like.[/quote]

I just added a mention in the ReadMe file for RubberViews Version 1.91.1 which now stops resizing styled text when text size exceeds 15K. I advise using RTFDataMBS to be able to manage styled text above this size.

Have you confirmed that RTFDataMBS works with the larger data?

At least it does not go beachball forever :wink:

For really big text, I guess Formatted Text Control is better, but that goes beyond the scope of RubberViews.