]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
cosmetics
[lyx.git] / src / LyXFunc.cpp
index 0300b52b7597f5c216f8ceb985aca50f244fb15c..ce6df25bcc8f1715441fe7cdaabaa556ba0a9ba7 100644 (file)
@@ -29,6 +29,7 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "CmdDef.h"
+#include "Color.h"
 #include "Converter.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
@@ -87,7 +88,6 @@
 #include "support/environment.h"
 #include "support/FileFilterList.h"
 #include "support/filetools.h"
-#include "support/fs_extras.h"
 #include "support/lstrings.h"
 #include "support/Path.h"
 #include "support/Package.h"
@@ -96,7 +96,6 @@
 #include "support/os.h"
 
 #include <boost/current_function.hpp>
-#include <boost/filesystem/operations.hpp>
 
 #include <sstream>
 
@@ -109,8 +108,6 @@ using std::ostringstream;
 using std::find;
 using std::vector;
 
-namespace fs = boost::filesystem;
-
 namespace lyx {
 
 using frontend::LyXView;
@@ -219,7 +216,7 @@ void reconfigure(LyXView & lv, string const & option)
        lv.message(_("Running configure..."));
 
        // Run configure in user lyx directory
-       support::Path p(package().user_support());
+       support::PathChanger p(package().user_support());
        string configure_command = package().configure_command();
        configure_command += option;
        Systemcall one;
@@ -603,7 +600,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                enable = buf->lyxvc().inUse();
                break;
        case LFUN_BUFFER_RELOAD:
-               enable = !buf->isUnnamed() && fs::exists(buf->absFileName())
+               enable = !buf->isUnnamed() && buf->fileName().exists()
                        && (!buf->isClean() || buf->isExternallyModified(Buffer::timestamp_method));
                break;
 
@@ -855,7 +852,7 @@ bool LyXFunc::ensureBufferClean(BufferView * bv)
        if (buf.isClean())
                return true;
 
-       docstring const file = makeDisplayPath(buf.absFileName(), 30);
+       docstring const file = buf.fileName().displayName(30);
        docstring text = bformat(_("The document %1$s has unsaved "
                                             "changes.\n\nDo you want to save "
                                             "the document?"), file);
@@ -1179,7 +1176,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        string const path = buffer->temppath();
                        // Prevent the compiler from optimizing away p
                        FileName pp(path);
-                       support::Path p(pp);
+                       support::PathChanger p(pp);
 
                        // there are three cases here:
                        // 1. we print to a file
@@ -1843,7 +1840,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                    && (inset_code == NO_CODE
                                    || inset_code == it->lyxCode())) {
                                        Cursor tmpcur = cur;
-                                       tmpcur.pushLeft(*it);
+                                       tmpcur.pushBackward(*it);
                                        it->dispatch(tmpcur, fr);
                                }
                        }
@@ -2016,6 +2013,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                        actOnUpdatedPrefs(lyxrc_orig, lyxrc);
 
+                       if (lyx_view_ && lyx_view_->buffer())
+                               lyx_view_->updateLayoutChoice(true);
+
                        /// We force the redraw in any case because there might be
                        /// some screen font changes.
                        /// FIXME: only the current view will be updated. the Gui
@@ -2101,7 +2101,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        theSelection().haveSelection(view()->cursor().selection());
 
                        if (view()->cursor().inTexted()) {
-                               lyx_view_->updateLayoutChoice();
+                               lyx_view_->updateLayoutChoice(false);
                        }
                }
        }
@@ -2141,7 +2141,7 @@ void LyXFunc::sendDispatchMessage(docstring const & msg, FuncRequest const & cmd
                }
        }
 
-       docstring const shortcuts = theTopLevelKeymap().printbindings(cmd);
+       docstring const shortcuts = theTopLevelKeymap().printBindings(cmd);
 
        if (!shortcuts.empty())
                comname += ": " + shortcuts;
@@ -2499,6 +2499,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_DATE_INSERT_FORMAT:
        case LyXRC::RC_DEFAULT_LANGUAGE:
        case LyXRC::RC_DEFAULT_PAPERSIZE:
+       case LyXRC::RC_DEFFILE:
        case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
        case LyXRC::RC_DISPLAY_GRAPHICS:
        case LyXRC::RC_DOCUMENTPATH:
@@ -2587,8 +2588,10 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_USE_ESC_CHARS:
        case LyXRC::RC_USE_INP_ENC:
        case LyXRC::RC_USE_PERS_DICT:
+       case LyXRC::RC_USE_PIXMAP_CACHE:
        case LyXRC::RC_USE_SPELL_LIB:
        case LyXRC::RC_VIEWDVI_PAPEROPTION:
+       case LyXRC::RC_SORT_LAYOUTS:
        case LyXRC::RC_VIEWER:
        case LyXRC::RC_LAST:
                break;