]> git.lyx.org Git - features.git/commitdiff
Recreate citation label after paste
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 6 Dec 2017 08:11:18 +0000 (09:11 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 6 Dec 2017 08:11:18 +0000 (09:11 +0100)
Fixes: #10829
src/CutAndPaste.cpp
src/insets/InsetCitation.h

index 6d9bf101f40a8cf918b486ce9a18a03cd896d0f9..6c0f9fad0e35fa751c0442cb4ec406383db9aeee 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "insets/InsetBibitem.h"
 #include "insets/InsetBranch.h"
+#include "insets/InsetCitation.h"
 #include "insets/InsetCommand.h"
 #include "insets/InsetFlex.h"
 #include "insets/InsetGraphics.h"
@@ -322,6 +323,16 @@ pasteSelectionHelper(DocIterator const & cur, ParagraphList const & parlist,
                        break;
                }
 
+               case CITE_CODE: {
+                       InsetCitation & cit = static_cast<InsetCitation &>(*it);
+                       // This actually only needs to be done if the cite engine
+                       // differs, but we do it in general.
+                       cit.redoLabel();
+                       // We need to update the list of citations.
+                       need_update = true;
+                       break;
+               }
+
                case BIBITEM_CODE: {
                        // check for duplicates
                        InsetBibitem & bib = static_cast<InsetBibitem &>(*it);
index 992a85ee2198978927472592a595daf32a4d6f4a..3e5e3baa35a4cec485b0aa585659b3a7993382aa 100644 (file)
@@ -82,6 +82,8 @@ public:
        static bool isCompatibleCommand(std::string const &);
        //@}
        ///
+       void redoLabel() { cache.recalculate = true; }
+       ///
        CitationStyle getCitationStyle(BufferParams const & bp, std::string const & input,
                                       std::vector<CitationStyle> const & valid_styles) const;
        ///