]> git.lyx.org Git - features.git/blobdiff - src/lyxfunc.C
more changes to get insetfloat working + some other things. Read the ChangeLog
[features.git] / src / lyxfunc.C
index 164a193fb89cb8d3fbd67091716f60439b8db878..f3972ac900956a5b7a6b3e7e08dbd7290381471a 100644 (file)
@@ -62,6 +62,7 @@ using std::istringstream;
 #include "insets/insetlist.h"
 #include "insets/insettabular.h"
 #include "insets/insettheorem.h"
+#include "insets/insetcaption.h"
 #include "mathed/formulamacro.h"
 #include "toolbar.h"
 #include "spellchecker.h" // RVDK_PATCH_5
@@ -2102,12 +2103,32 @@ string LyXFunc::Dispatch(int ac,
        }
        break;
 
+       case LFUN_INSET_CAPTION:
+       {
+               // Do we have a locking inset...
+               if (owner->view()->the_locking_inset) {
+                       lyxerr << "Locking inset code: "
+                              << owner->view()->the_locking_inset->LyxCode();
+                       InsetCaption * new_inset = new InsetCaption;
+                       new_inset->setOwner(owner->view()->the_locking_inset);
+                       new_inset->SetAutoBreakRows(true);
+                       new_inset->SetDrawFrame(0, InsetText::LOCKED);
+                       new_inset->SetFrameColor(0, LColor::footnoteframe);
+                       if (owner->view()->insertInset(new_inset))
+                               new_inset->Edit(owner->view(), 0, 0, 0);
+                       else
+                               delete new_inset;
+               }
+       }
+       break;
+       
        case LFUN_INSET_TABULAR:
        {
                int r = 2, c = 2;
                if (!argument.empty())
-                       sscanf(argument.c_str(),"%d%d",&r,&c);
-               InsetTabular * new_inset = new InsetTabular(owner->buffer(),r,c);
+                       sscanf(argument.c_str(),"%d%d", &r, &c);
+               InsetTabular * new_inset =
+                       new InsetTabular(owner->buffer(), r, c);
                if (owner->view()->insertInset(new_inset))
                        new_inset->Edit(owner->view(), 0, 0, 0);
                else