]> git.lyx.org Git - features.git/commitdiff
When switching classes, warn user about all unapplied document changes
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 21 Dec 2014 10:49:08 +0000 (11:49 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 21 Dec 2014 10:49:08 +0000 (11:49 +0100)
Currently, this is limited to modules.

Part of #9356.

src/frontends/qt4/GuiDocument.cpp

index ec0ffcaa70cfb6fe06203e18441cb7a4637e0a6c..fafa1afc4343179ccfe88a7e636913ca2fc03df2 100644 (file)
@@ -2168,30 +2168,13 @@ void GuiDocument::classChanged()
                return;
        string const classname = fromqstr(latexModule->classCO->getData(idx));
 
-       // check whether the selected modules have changed.
-       bool modules_changed = false;
-       unsigned int const srows = selectedModel()->rowCount();
-       if (srows != bp_.getModules().size())
-               modules_changed = true;
-       else {
-               list<string>::const_iterator mit = bp_.getModules().begin();
-               list<string>::const_iterator men = bp_.getModules().end();
-               for (unsigned int i = 0; i < srows && mit != men; ++i, ++mit)
-                       if (selectedModel()->getIDString(i) != *mit) {
-                               modules_changed = true;
-                               break;
-                       }
-       }
-
-       if (modules_changed || lyxrc.auto_reset_options) {
-               if (applyPB->isEnabled()) {
-                       int const ret = Alert::prompt(_("Unapplied changes"),
-                                       _("Some changes in the dialog were not yet applied.\n"
-                                       "If you do not apply now, they will be lost after this action."),
-                                       1, 1, _("&Apply"), _("&Dismiss"));
-                       if (ret == 0)
-                               applyView();
-               }
+       if (applyPB->isEnabled()) {
+               int const ret = Alert::prompt(_("Unapplied changes"),
+                               _("Some changes in the dialog were not yet applied.\n"
+                               "If you do not apply now, they will be lost after this action."),
+                               1, 1, _("&Apply"), _("&Dismiss"));
+               if (ret == 0)
+                       applyView();
        }
 
        // We load the TextClass as soon as it is selected. This is