We fill up edited insets into cache when editing inset is triggered, but
this cache is never cleared up for dialogs unassociated with some inset
- thus when e.g. graphics dialog is open for completely new image the
old cache is (wrongly) used.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg207192.html
void BufferView::editInset(string const & name, Inset * inset)
{
void BufferView::editInset(string const & name, Inset * inset)
{
- d->edited_insets_[name] = inset;
+ if (inset)
+ d->edited_insets_[name] = inset;
+ else
+ d->edited_insets_.erase(name);
if (dialog) {
bool const visible = dialog->isVisibleView();
dialog->showData(sdata);
if (dialog) {
bool const visible = dialog->isVisibleView();
dialog->showData(sdata);
- if (inset && currentBufferView())
+ if (currentBufferView())
currentBufferView()->editInset(name, inset);
// We only set the focus to the new dialog if it was not yet
// visible in order not to change the existing previous behaviour
currentBufferView()->editInset(name, inset);
// We only set the focus to the new dialog if it was not yet
// visible in order not to change the existing previous behaviour