X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetLabel.cpp;h=e143f83e29b066f54e5a77b826450589908aec85;hb=eb294eadb5e7f22880da399ae082f74567bbfc4e;hp=2c0c1e5194be2844a90267799f966f103516f92f;hpb=813eb0f9f7830c8dc8eec8c16da8512a73e81df8;p=lyx.git diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp index 2c0c1e5194..e143f83e29 100644 --- a/src/insets/InsetLabel.cpp +++ b/src/insets/InsetLabel.cpp @@ -99,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"); @@ -109,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,