]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.cpp
Probably fix #10850 compiler warnings.
[lyx.git] / src / CutAndPaste.cpp
index d79ef5a655defd744cc98ac6adf26c561194d143..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);
@@ -422,7 +433,7 @@ pasteSelectionHelper(DocIterator const & cur, ParagraphList const & parlist,
        // Set paragraph buffers. It's important to do this right away
        // before something calls Inset::buffer() and causes a crash.
        for (pit_type p = startpit; p <= pit; ++p)
-               pars[p].setBuffer(const_cast<Buffer &>(buffer));
+               pars[p].setInsetBuffers(const_cast<Buffer &>(buffer));
 
        // Join (conditionally) last pasted paragraph with next one, i.e.,
        // the tail of the spliced document paragraph
@@ -631,7 +642,7 @@ void copySelectionHelper(Buffer const & buf, Text const & text,
                // do not have a proper buffer reference. It makes
                // sense to add them temporarily, because the
                // operations below depend on that (acceptChanges included).
-               it->setBuffer(const_cast<Buffer &>(buf));
+               it->setInsetBuffers(const_cast<Buffer &>(buf));
                // PassThru paragraphs have the Language
                // latex_language. This is invalid for others, so we
                // need to change it to the buffer language.
@@ -690,7 +701,7 @@ docstring grabAndEraseSelection(Cursor & cur)
 }
 
 
-bool reduceSelectionToOneCell(Cursor & cur)
+bool reduceSelectionToOneCell(CursorData & cur)
 {
        if (!cur.selection() || !cur.inMathed())
                return false;
@@ -712,7 +723,7 @@ bool reduceSelectionToOneCell(Cursor & cur)
 }
 
 
-bool multipleCellsSelected(Cursor const & cur)
+bool multipleCellsSelected(CursorData const & cur)
 {
        if (!cur.selection() || !cur.inMathed())
                return false;
@@ -827,7 +838,7 @@ vector<docstring> availableSelections(Buffer const * buf)
                for (; pit != pend; ++pit) {
                        Paragraph par(*pit, 0, 46);
                        // adapt paragraph to current buffer.
-                       par.setBuffer(const_cast<Buffer &>(*buf));
+                       par.setInsetBuffers(const_cast<Buffer &>(*buf));
                        textSel += par.asString(AS_STR_INSETS);
                        if (textSel.size() > 45) {
                                support::truncateWithEllipsis(textSel,45);
@@ -969,7 +980,7 @@ void copyInset(Cursor const & cur, Inset * inset, docstring const & plaintext)
 
 namespace {
 
-void copySelectionToStack(Cursor const & cur, CutStack & cutstack)
+void copySelectionToStack(CursorData const & cur, CutStack & cutstack)
 {
        // this doesn't make sense, if there is no selection
        if (!cur.selection())
@@ -1369,7 +1380,7 @@ void selClearOrDel(Cursor & cur)
 }
 
 
-docstring grabSelection(Cursor const & cur)
+docstring grabSelection(CursorData const & cur)
 {
        if (!cur.selection())
                return docstring();