]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLabel.cpp
Strip et al. for citation search
[lyx.git] / src / insets / InsetLabel.cpp
index 73bc21f911325281c25be00501ca4c6f6f5379e8..e143f83e29b066f54e5a77b826450589908aec85 100644 (file)
 
 #include "InsetRef.h"
 
-#include "buffer_funcs.h"
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "BufferView.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "InsetIterator.h"
 #include "Language.h"
 #include "LyX.h"
 #include "ParIterator.h"
@@ -33,7 +29,6 @@
 #include "TextClass.h"
 #include "TocBackend.h"
 
-#include "mathed/InsetMathHull.h"
 #include "mathed/InsetMathRef.h"
 
 #include "frontends/alert.h"
@@ -104,7 +99,8 @@ void InsetLabel::updateLabelAndRefs(docstring const & new_label,
        UndoGroupHelper ugh(&buffer());
        if (cursor)
                cursor->recordUndo();
-       if (buffer().masterParams().track_changes) {
+       bool const changes = buffer().masterParams().track_changes;
+       if (changes) {
                // With change tracking, we insert a new label and
                // delete the old one
                InsetCommandParams p(LABEL_CODE, "label");
@@ -114,15 +110,15 @@ void InsetLabel::updateLabelAndRefs(docstring const & new_label,
                lyx::dispatch(FuncRequest(LFUN_CHAR_DELETE_FORWARD));
        } else
                setParam("name", label);
-       updateReferences(old_label, label);
+       updateReferences(old_label, label, changes);
 }
 
 
 void InsetLabel::updateReferences(docstring const & old_label,
-               docstring const & new_label)
+               docstring const & new_label, bool const changes)
 {
        UndoGroupHelper ugh(nullptr);
-       if (buffer().masterParams().track_changes) {
+       if (changes) {
                // With change tracking, we insert a new ref and
                // delete the old one
                lyx::dispatch(FuncRequest(LFUN_MASTER_BUFFER_FORALL,