mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
Properly clean cache which binds inset and dialog.
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
This commit is contained in:
parent
af5909beac
commit
99bfe20120
@ -1264,7 +1264,10 @@ Inset * BufferView::editedInset(string const & name) const
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4623,7 +4623,7 @@ void GuiView::doShowDialog(QString const & qname, QString const & qdata,
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user