Formatted Text Control - FTIterator

Hi everyone,

If you are using the latest FTC version, can you please do me a favor and take a look at the included HTMLIterator class? Whatever I do, the iterator always recognizes FTCustum objects as FTPicture. This is not wrong in itself, since FTCustom is a subclass of FTPicture, but the iterator explicitly checks the type FTCustom. At least the source code is available, but it cannot find FTCustom subclasses.

Do you have any idea what might be the reason? I see no error in the FTIterator/FTIteratorBase class.

Best regards.

It’s quite possible that the HTMLIterator class never handled the FTCustom class. How would one handle an FTCustom class for HTML output (since all the other formatting stuff was handled) so I probably never went past that point. I think you’ll have to explicitly check for the classes you’re looking for.

Send us a simple example project and we can look at it.

Thank you for your answer. That’s what I’ll do. I already did an export with some custom classes, so I found out that the iterator doesn’t work properly. This topic was already reported in BKeeneys Mantis.

The answer to this is so simple we’ll all be surprised. Since you have an FTCustom subclass you need to add a Clone function to it. Otherwise, when FTIterator gets the paragraphs it gets clones of the paragraph items. If there’s no clone in your class it drops into FTPictures clone function, thus returning an FTPicture.

Oh, that’s interesting. So you think I need to add an empty clone method to the user-defined object class?

Not empty. You have to do the clone yourself.