]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.cpp
Allow using \binom without amsmath and add support for \brace and \brack
[lyx.git] / src / CutAndPaste.cpp
index 0b3e8f5ed89f8a4d8ba460ce2f842349f98b26b2..9d5b97fe546112a4eeafa5525f77b6fa1cdc68db 100644 (file)
 #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)
 {
@@ -842,7 +859,7 @@ void pasteClipboardGraphics(Cursor & cur, ErrorList & /* errorList */,
                return;
 
        // create inset for graphic
-       InsetGraphics * inset = new InsetGraphics;
+       InsetGraphics * inset = new InsetGraphics(cur.buffer());
        InsetGraphicsParams params;
        params.filename = EmbeddedFile(filename.absFilename(), cur.buffer().filePath());
        inset->setParams(params);