On Wednesday 19 September 2001 17:15, Juergen Spitzmueller wrote:
> Hi,
>
> While working on the Document Dialog I detected a bug which seems to be
> there for a long time (it's in 1.1.6 too). It's very easy to reproduce:
>
> Go to the Document Dialog and change the class. The nasty popup pops
> up. Confirm the question: the class options will be reset to default.
> Now change the class back to the first one immediately. Neither the
> popup appears nor will the options be reset (you can see this very easy
> with article -> book -> article, where the Side is set to One -> Two ->
> [still] Two).
>
> I suspect that one of the first lines of the following part of
> FormDocument.C is to blame. Has someone an idea?
> (The bug is probably not very annoying, since it has not been detected
> yet. But if it's easy to fix, I'd like to do this).
Shove a few std::cerr << "Got here" << std::endl; statements into the code to
check the path being followed. Print out a few values to check that they are
as you'd expect. Not rocket science, but you're looking for a flaw in the
logic so you don't need to be subtle.
A
>
> Thanks,
> Jürgen
>
>
>
> void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
> {
> if (!ob)
> ob = class_->choice_doc_class;
>
> lv_->prohibitInput();
>
> unsigned int tc = combo_doc_class->get() - 1;
> if (textclasslist.Load(tc)) {
> // we use a copy of the bufferparams because we do not
> // want to modify them yet.
> BufferParams params = lv_->buffer()->params;
>
> if (params.textclass != tc
> && AskQuestion(_("Should I set some parameters to"),
> _("the defaults of this document class?"))) {
> params.textclass = tc;
> params.useClassDefaults();
> UpdateLayoutDocument(params);
> }
>
>
--
Dr Angus Leeming
Dept. of Bioengineering
Imperial College
London SW7 2BX
Tel +44 (0) 20 7594 5186
Fax +44 (0) 20 7584 6897