commit d3ee87eea282ca6e8f0a78bc6a0e27b4f0942624
Author: Richard Heck <[email protected]>
Date: Sun Jan 28 23:33:45 2018 -0500
Fix bug #11055.
See also https://marc.info/?l=lyx-devel&m=151709211602688&w=2.
---
src/Buffer.cpp | 5 +++++
src/Buffer.h | 2 ++
src/BufferView.cpp | 32 ++++++++++++++++++++++++++------
src/LayoutModuleList.h | 8 ++++++++
4 files changed, 41 insertions(+), 6 deletions(-)
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 9442f23..ff85f22 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -2440,6 +2440,11 @@ void Buffer::makeCitationLabels() const
}
+void Buffer::invalidateCiteLabels() const
+{
+ masterBuffer()->d->cite_labels_valid_ = false;
+}
+
bool Buffer::citeLabelsValid() const
{
return masterBuffer()->d->cite_labels_valid_;
diff --git a/src/Buffer.h b/src/Buffer.h
index 96fd8e2..d111c2b 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -517,6 +517,8 @@ public:
///
void makeCitationLabels() const;
///
+ void invalidateCiteLabels() const;
+ ///
bool citeLabelsValid() const;
///
void getLabelList(std::vector<docstring> &) const;
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index b64f36d..7659f03 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -1379,25 +1379,45 @@ void BufferView::dispatch(FuncRequest const & cmd,
DispatchResult & dr)
break;
}
- case LFUN_UNDO:
+ case LFUN_UNDO: {
dr.setMessage(_("Undo"));
cur.clearSelection();
+ // We need to find out if the bibliography information
+ // has changed. See bug #11055.
+ // So these should not be references...
+ LayoutModuleList const engines = buffer().params().citeEngine();
+ CiteEngineType const enginetype =
buffer().params().citeEngineType();
if (!cur.textUndo())
dr.setMessage(_("No further undo information"));
- else
+ else {
dr.screenUpdate(Update::Force | Update::FitCursor);
- dr.forceBufferUpdate();
+ dr.forceBufferUpdate();
+ if (buffer().params().citeEngine() != engines ||
+ buffer().params().citeEngineType() != enginetype)
+ buffer().invalidateCiteLabels();
+ }
break;
+ }
- case LFUN_REDO:
+ case LFUN_REDO: {
dr.setMessage(_("Redo"));
cur.clearSelection();
+ // We need to find out if the bibliography information
+ // has changed. See bug #11055.
+ // So these should not be references...
+ LayoutModuleList const engines = buffer().params().citeEngine();
+ CiteEngineType const enginetype =
buffer().params().citeEngineType();
if (!cur.textRedo())
dr.setMessage(_("No further redo information"));
- else
+ else {
dr.screenUpdate(Update::Force | Update::FitCursor);
- dr.forceBufferUpdate();
+ dr.forceBufferUpdate();
+ if (buffer().params().citeEngine() != engines ||
+ buffer().params().citeEngineType() != enginetype)
+ buffer().invalidateCiteLabels();
+ }
break;
+ }
case LFUN_FONT_STATE:
dr.setMessage(cur.currentState(false));
diff --git a/src/LayoutModuleList.h b/src/LayoutModuleList.h
index c56e572..aa99251 100644
--- a/src/LayoutModuleList.h
+++ b/src/LayoutModuleList.h
@@ -75,6 +75,14 @@ public:
/// to be made.
bool adaptToBaseClass(LayoutFile const * const lay,
std::list<std::string> const & removedModules);
+ ///
+ bool operator==(LayoutModuleList const & other) const {
+ return lml_ == other.lml_;
+ }
+ ///
+ bool operator!=(LayoutModuleList const & other) const {
+ return !operator==(other);
+ }
private:
/// Removes modules excluded by, provided by, etc, the base class.
/// \param lay The document class against which to check.