]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/Dialog.C
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / Dialog.C
index 039c1c4f16b937636db561cbca9f1d692b4b493a..23b4ad8d271e6080f6b96e9208e119bc121533ce 100644 (file)
@@ -187,9 +187,14 @@ void Dialog::checkStatus()
        }
 
        // check whether this dialog may be active
-       if (controller().canApply())
-               bc().readOnly(kernel().isBufferReadonly());
-       else
+       if (controller().canApply()) {
+               bool const readonly = kernel().isBufferReadonly();
+               bc().readOnly(readonly);
+               // refreshReadOnly() is too generous in _enabling_ widgets
+               // update dialog to disable disabled widgets again
+               if (!readonly)
+                       view().update();
+       } else
                bc().readOnly(true);
 }