X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCutAndPaste.cpp;h=fdf609e6f5bd5502ec3406998bc1dcfc934ab1fe;hb=42eb8a373a35da02c45c0d225d37f5d677ddfc2d;hp=0b3e8f5ed89f8a4d8ba460ce2f842349f98b26b2;hpb=40c4d50c82879cf85a27b7b38b0e7200efde6bad;p=lyx.git diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 0b3e8f5ed8..fdf609e6f5 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -22,11 +22,11 @@ #include "Changes.h" #include "Cursor.h" #include "ErrorList.h" +#include "FuncCode.h" #include "FuncRequest.h" #include "InsetIterator.h" #include "InsetList.h" #include "Language.h" -#include "lfuns.h" #include "LyXFunc.h" #include "LyXRC.h" #include "Text.h" @@ -456,6 +456,23 @@ bool reduceSelectionToOneCell(Cursor & cur) } +bool multipleCellsSelected(Cursor const & cur) +{ + if (!cur.selection() || !cur.inMathed()) + return false; + + CursorSlice i1 = cur.selBegin(); + CursorSlice i2 = cur.selEnd(); + if (!i1.inset().asInsetMath()) + return false; + + if (i1.idx() == i2.idx()) + return false; + + return true; +} + + void switchBetweenClasses(DocumentClass const * const oldone, DocumentClass const * const newone, InsetText & in, ErrorList & errorlist) {