On Thu, 2004-04-29 at 07:13, Carl Hetherington wrote:
The problem is that sp_text_print() has to decide whether to print text by printing curves, or whether to call sp_print_text() (which in turn calls Extension::text()).
It decides this by doing sp_print_get_param for the "textToPath" parameter. If an extension does not know the parameter, it throws an exception. This is currently not caught, causing the silent exit.
<snip>
Do you think it's right that an exception is thrown if a particular extension doesn't understand some parameter? I'm not really very well up on the extension code.
I don't know - I'm kinda of the thought that you shouldn't use a parameter that you don't know exists in any situation other than an extreme one. So, I wanted to make the error very obvious. (and, in this case it seems to have worked :)
I think, perhaps, a better solution would be having another extension function which is 'bool text_to_path (void)' and then it can be implemented in the implementation class to always return true. Or, have a return value from the text function that says 'hey, don't use me'.
I really never intended parameters to be used generically, like for all print extensions. I've always thought of them as: this parameter goes to this extension. If it needs to be that global, probably putting it into the objects themselves is more proper, perhaps with a definition in the XML file to define whether the print extension supports text printing.
I don't know - thoughts? Should parameters be made more globally accessible?
--Ted