]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
small fix with footnote, use stringstream some more
[lyx.git] / src / BufferView_pimpl.C
index 017cd95f06a8f8cb6cde34f119b18c165082e50b..fb46ea88cc2aa86342592d0291dde68db5c37e92 100644 (file)
@@ -53,6 +53,7 @@
 #include "insets/insettabular.h"
 #include "insets/insettheorem.h"
 #include "insets/insetcaption.h"
+#include "insets/insetfloatlist.h"
 #include "mathed/formulamacro.h"
 #include "gettext.h"
 
@@ -901,7 +902,8 @@ Inset * BufferView::Pimpl::checkInsetHit(LyXText * text, int & x, int & y,
 #if 0
                        if (move_cursor && (tmpinset != bv_->theLockingInset()))
 #endif
-                               text->SetCursor(bv_, cursor.par(),cursor.pos()-1,true);
+                               text->SetCursor(bv_, cursor.par(),
+                                               cursor.pos() - 1, true);
                        x = x - start_x;
                        // The origin of an inset is on the baseline
                        y = y_tmp - (text->cursor.y()); 
@@ -1428,21 +1430,9 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                break;
 
        case LFUN_TOC_INSERT:
-       case LFUN_LOA_INSERT:
-       case LFUN_LOF_INSERT:
-       case LFUN_LOT_INSERT:
        {
                InsetCommandParams p;
-               
-               if (action == LFUN_TOC_INSERT )
-                       p.setCmdName("tableofcontents");
-               else if (action == LFUN_LOA_INSERT )
-                       p.setCmdName("listof{algorithm}{List of Algorithms}");
-               else if (action == LFUN_LOF_INSERT )
-                       p.setCmdName("listoffigures");
-               else
-                       p.setCmdName("listoftables");
-
+               p.setCmdName("tableofcontents");
                Inset * inset = new InsetTOC(p);
                if (!bv_->insertInset(inset, "Standard", true))
                        delete inset;
@@ -1772,10 +1762,10 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                        owner_->getLyXFunc()->setMessage(tmpinset->EditMessage());
                        int y = 0;
                        if (is_rtl) {
-                               LyXFont font = 
+                               LyXFont const font = 
                                        TEXT(bv_)->GetFont(buffer_,
-                                                             TEXT(bv_)->cursor.par(),
-                                                             TEXT(bv_)->cursor.pos()); 
+                                                          TEXT(bv_)->cursor.par(),
+                                                          TEXT(bv_)->cursor.pos());    
                                y = tmpinset->descent(bv_,font);
                        }
                        tmpinset->Edit(bv_, 0, y, 0);
@@ -2119,13 +2109,16 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                
        case LFUN_PROTECTEDSPACE:
        {
-               LyXLayout const & style =
-                       textclasslist.Style(buffer_->params.textclass,
-                                           TEXT(bv_)->cursor.par()->GetLayout());
+               LyXLayout const & style = textclasslist
+                       .Style(buffer_->params.textclass,
+                              TEXT(bv_)->cursor.par()->GetLayout());
 
                if (style.free_spacing) {
                        TEXT(bv_)->InsertChar(bv_, ' ');
-                       update(TEXT(bv_), BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+                       update(TEXT(bv_),
+                              BufferView::SELECT
+                              | BufferView::FITCUR
+                              | BufferView::CHANGE);
                } else {
                        bv_->protectedBlank(TEXT(bv_));
                }
@@ -2136,12 +2129,14 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
        case LFUN_SETMARK:
                if (TEXT(bv_)->mark_set) {
                        beforeChange(TEXT(bv_));
-                       update(TEXT(bv_), BufferView::SELECT|BufferView::FITCUR);
+                       update(TEXT(bv_),
+                              BufferView::SELECT|BufferView::FITCUR);
                        owner_->getLyXFunc()->setMessage(N_("Mark removed"));
                } else {
                        beforeChange(TEXT(bv_));
                        TEXT(bv_)->mark_set = 1;
-                       update(TEXT(bv_), BufferView::SELECT|BufferView::FITCUR);
+                       update(TEXT(bv_),
+                              BufferView::SELECT|BufferView::FITCUR);
                        owner_->getLyXFunc()->setMessage(N_("Mark set"));
                }
                TEXT(bv_)->sel_cursor = TEXT(bv_)->cursor;
@@ -2153,7 +2148,9 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                        TEXT(bv_)->sel_cursor = 
                                TEXT(bv_)->cursor;
                        update(TEXT(bv_),
-                              BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+                              BufferView::SELECT
+                              | BufferView::FITCUR
+                              | BufferView::CHANGE);
                        // It is possible to make it a lot faster still
                        // just comment out the line below...
                        showCursor();
@@ -2868,6 +2865,15 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
        }
        break; 
 
+       case LFUN_FLOAT_LIST:
+       {
+               // We should check the argument for validity. (Lgb)
+               Inset * inset = new InsetFloatList(argument);
+               if (!bv_->insertInset(inset, "Standard", true))
+                       delete inset;
+       }
+       break;
+       
        case LFUN_INSERT_NOTE:
                bv_->insertNote();
                break;