]> git.lyx.org Git - features.git/commitdiff
Do not update refs on new label creation (#8147)
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 19 Sep 2012 08:14:56 +0000 (10:14 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 20 Sep 2012 14:01:34 +0000 (16:01 +0200)
This assures that refs to existing labels are not being touched if a new label with a duplicate name is created, and the name then changed by the duplicate checker.

Branch candidate.
(cherry picked from commit 86cccf10771cb00c71fac2becf39dd7e9a301d45)

src/insets/InsetLabel.cpp
status.20x

index c483f9488374731b21e4bf4e36c0bd1590290011..34b7e62d4287caabcf9031fc20a62aad242b9ecb 100644 (file)
@@ -55,9 +55,11 @@ InsetLabel::InsetLabel(Buffer * buf, InsetCommandParams const & p)
 
 void InsetLabel::initView()
 {
-       // FIXME: This seems to be used only for inset creation so
-       // we probably just need to call updateLabel() here.
-       updateLabelAndRefs(getParam("name"));
+       // This seems to be used only for inset creation.
+       // Therefore we do not update refs here, since this would
+       // erroneously change refs from existing duplicate labels
+       // (#8141).
+       updateLabel(getParam("name"));
 }
 
 
index 2b90afa49a772df4a5748c619eb7d0a6e3bd5b8a..689a0c9c5f8a760b318004ff5a9c5462b3b5ef74 100644 (file)
@@ -133,6 +133,9 @@ What's new
 
 - Fix crash when using undo in a paragraph with layout Bibliography (bug 7111).
 
+- Fix bug where references were erroneously changed when a duplicate label
+  name was resolved (bug 8147). 
+
 - Make sure that undo restores environment depth correctly (bug 8159).
 
 - Make sure that undo restores paragraph longest label width correctly