]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
GUI API Cleanup step 2: merge of the "younes" branch.
[lyx.git] / src / lyxfunc.C
index 325cb1666ca87d2ccbab331f6c7fc3ac330f953b..fa2ecf9cfc1a6fbb47c7e7c8955483db502b328a 100644 (file)
@@ -183,7 +183,7 @@ bool getStatus(LCursor cursor,
  * footnote is deleted).
  * When \param outer is true, the top slice is not looked at.
  */
-Change::Type lookupChange(DocIterator const & dit, bool outer = false)
+Change::Type lookupChangeType(DocIterator const & dit, bool outer = false)
 {
        size_t const depth = dit.depth() - (outer ? 1 : 0);
 
@@ -191,7 +191,7 @@ Change::Type lookupChange(DocIterator const & dit, bool outer = false)
                CursorSlice const & slice = dit[i];
                if (!slice.inset().inMathed()
                    && slice.pos() < slice.paragraph().size()) {
-                       Change::Type const ch = slice.paragraph().lookupChange(slice.pos());
+                       Change::Type const ch = slice.paragraph().lookupChange(slice.pos()).type;
                        if (ch != Change::UNCHANGED)
                                return ch;
                }
@@ -397,7 +397,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        // to handle (Andre')
        bool enable = true;
        switch (cmd.action) {
-       case LFUN_TOGGLE_TOOLTIPS:
+       case LFUN_TOOLTIPS_TOGGLE:
                flag.setOnOff(owner->getDialogs().tooltipsEnabled());
                break;
 
@@ -562,7 +562,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        }
 
        case LFUN_BUFFER_NEW:
-       case LFUN_BUFFER_NEWTMPLT:
+       case LFUN_BUFFER_NEW_TEMPLATE:
        case LFUN_WORD_FIND_FORWARD:
        case LFUN_WORD_FIND_BACKWARD:
        case LFUN_COMMAND_PREFIX:
@@ -611,7 +611,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        case LFUN_BUFFER_SAVE_AS_DEFAULT:
        case LFUN_BUFFER_PARAMS_APPLY:
        case LFUN_LYXRC_APPLY:
-       case LFUN_SCREEN_DOWNBUFFER:
+       case LFUN_BUFFER_NEXT:
        case LFUN_BUFFER_PREVIOUS:
                // these are handled in our dispatch()
                break;
@@ -635,7 +635,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
 
        // Are we in a DELETED change-tracking region?
        if (buf && buf->params().tracking_changes
-           && lookupChange(cur, true) == Change::DELETED
+           && lookupChangeType(cur, true) == Change::DELETED
            && !lyxaction.funcHasFlag(cmd.action, LyXAction::ReadOnly)
            && !lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer)) {
                flag.message(N_("This portion of the document is deleted."));
@@ -724,7 +724,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
        dispatch_buffer.erase();
 
        // redraw the screen at the end (first of the two drawing steps).
-       //This is done unless explicitely requested otherwise 
+       //This is done unless explicitely requested otherwise
        bool update = true;
        // also do the second redrawing step. Only done if requested.
        bool updateforce = false;
@@ -802,7 +802,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        menuNew(argument, false);
                        break;
 
-               case LFUN_BUFFER_NEWTMPLT:
+               case LFUN_BUFFER_NEW_TEMPLATE:
                        menuNew(argument, true);
                        break;
 
@@ -1095,7 +1095,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        view()->setBuffer(bufferlist.getBuffer(argument));
                        break;
 
-               case LFUN_SCREEN_DOWNBUFFER:
+               case LFUN_BUFFER_NEXT:
                        view()->setBuffer(bufferlist.next(view()->buffer()));
                        break;
 
@@ -1157,7 +1157,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                        view()->center();
                        // see BufferView_pimpl::center()
-                       view()->updateScrollbar();
                        break;
                }
 
@@ -1409,7 +1408,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        owner->message(argument);
                        break;
 
-               case LFUN_TOGGLE_TOOLTIPS:
+               case LFUN_TOOLTIPS_TOGGLE:
                        owner->getDialogs().toggleTooltips();
                        break;
 
@@ -1563,7 +1562,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        ErrorList el;
                        lyx::cap::switchBetweenClasses(
                                old_class, new_class,
-                               buffer->paragraphs(), el);
+                               static_cast<InsetText &>(buffer->inset()), el);
 
                        view()->setCursor(backcur.asDocIterator(&(buffer->inset())));
                        bufferErrors(*buffer, el);
@@ -1950,7 +1949,7 @@ string const LyXFunc::viewStatusMessage()
 BufferView * LyXFunc::view() const
 {
        BOOST_ASSERT(owner);
-       return owner->view().get();
+       return owner->view();
 }