[LyX/master] Master/Child: do not clean includeonly list while editing (part of #12470)
Juergen Spitzmueller
spitz at lyx.org
Tue Dec 27 13:40:01 UTC 2022
commit 69d54ff9d8571e1f9014c428f2cef805edf7f534
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Tue Dec 27 15:36:36 2022 +0100
Master/Child: do not clean includeonly list while editing (part of #12470)
---
src/frontends/qt/GuiDocument.cpp | 11 ++++++-----
src/frontends/qt/GuiDocument.h | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index 1effaa1..47889ca 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -1989,16 +1989,16 @@ void GuiDocument::includeonlyClicked(QTreeWidgetItem * item, int)
return;
string child = fromqstr(item->text(0));
+
if (child.empty())
return;
- if (std::find(includeonlys_.begin(),
- includeonlys_.end(), child) != includeonlys_.end())
+ if (isChildIncluded(child))
includeonlys_.remove(child);
else
includeonlys_.push_back(child);
- updateIncludeonlys();
+ updateIncludeonlys(false);
change_adaptor();
}
@@ -3768,6 +3768,7 @@ void GuiDocument::applyView()
// Master/Child
bp_.clearIncludedChildren();
+ updateIncludeonlys();
if (masterChildModule->includeonlyRB->isChecked()) {
list<string>::const_iterator it = includeonlys_.begin();
for (; it != includeonlys_.end() ; ++it) {
@@ -4690,7 +4691,7 @@ void GuiDocument::updateIncludeonlyDisplay()
}
-void GuiDocument::updateIncludeonlys()
+void GuiDocument::updateIncludeonlys(bool const cleanup)
{
masterChildModule->childrenTW->clear();
QString const no = qt_("No");
@@ -4716,7 +4717,7 @@ void GuiDocument::updateIncludeonlys()
}
// Both if all children are included and if none is included
// is equal to "include all" (i.e., omit \includeonly).
- if (!has_unincluded || all_unincluded)
+ if (cleanup && (!has_unincluded || all_unincluded))
includeonlys_.clear();
}
diff --git a/src/frontends/qt/GuiDocument.h b/src/frontends/qt/GuiDocument.h
index 745afc3..ef143ab 100644
--- a/src/frontends/qt/GuiDocument.h
+++ b/src/frontends/qt/GuiDocument.h
@@ -215,7 +215,7 @@ private:
///
void updateIncludeonlyDisplay();
///
- void updateIncludeonlys();
+ void updateIncludeonlys(bool const cleanup = true);
///
void updateDefaultBiblio(std::string const & style,
std::string const & which = std::string());
More information about the lyx-cvs
mailing list