From 740d9162c0c8e646c4f8ac91ccbdd1b041239eb6 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 21 Dec 2014 11:49:08 +0100 Subject: [PATCH] When switching classes, warn user about all unapplied document changes Currently, this is limited to modules. Part of #9356. --- src/frontends/qt4/GuiDocument.cpp | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index ec0ffcaa70..fafa1afc43 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -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::const_iterator mit = bp_.getModules().begin(); - list::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 -- 2.39.2