On Tue, 12 Nov 2002, Edwin Leuven wrote:

> Allan,
>
> What are these for in bufferparams?
>
> boost::array<Bullet, 4> temp_bullets;
>
> Sorry if I am being thick.

They are used as temporary storage by the GUI frontend -- well XForms
anyway as seen here:

void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/)
{
        BufferParams & param = lv_.buffer()->params;

        // convert from 1-6 range to -1-4
        param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2);
        fl_set_input(bullets_->input_bullet_latex,
                     param.temp_bullets[current_bullet_depth].getText().c_str());
}


So this also answers your previous comment:

> yes, perhaps I should store a Bullet for this but bulletEntry(int f, int c) is
> private which means that I first need to set the bullet and then get the
> text. not very nice imho.

It's what is already done.  The temporary variables could have been
kept in the dialog implementation but by keeping them in the buffer
params when you switch buffers you got (past tense because it looks
like someone has changed it) what you were editing -- allowing you to
switch back and forth between buffers but keep the state of the dialog
the same upon return to the previous buffer.

Then the temp_bullets are copied to the real bullet settings when the
user applies or okays the dialog.

Allan. (ARRae)

Reply via email to