]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
Add margin to paragraph dialog.
[lyx.git] / src / lyxfunc.C
index 7d081dea7bf7061f1525f759c099440029d70912..2c68a83f10a081acedb98354156c57812d62eac4 100644 (file)
@@ -1004,8 +1004,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        }
 
                        // Push directory path.
-                       string const path = buffer->temppath();
-                       support::Path p(path);
+                       string const path(buffer->temppath());
+                       // Prevent the compiler from optimizing away p
+                       FileName pp(path);
+                       support::Path p(pp);
 
                        // there are three cases here:
                        // 1. we print to a file
@@ -1227,7 +1229,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        int row;
                        istringstream is(argument);
                        is >> file_name >> row;
-                       if (prefixIs(file_name, package().temp_dir())) {
+                       if (prefixIs(file_name, package().temp_dir().absFilename())) {
                                // Needed by inverse dvi search. If it is a file
                                // in tmpdir, call the apropriated function
                                lyx_view_->setBuffer(theBufferList().getBufferFromTmp(file_name));
@@ -1462,7 +1464,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                case LFUN_PREFERENCES_SAVE: {
                        lyxrc.write(makeAbsPath("preferences",
-                                               package().user_support()),
+                                               package().user_support().absFilename()),
                                    false);
                        break;
                }
@@ -1561,8 +1563,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        InsetIterator it  = inset_iterator_begin(inset);
                        InsetIterator const end = inset_iterator_end(inset);
                        for (; it != end; ++it) {
-                               if (inset_code == InsetBase::NO_CODE
-                                   || inset_code == it->lyxCode()) {
+                               if (!it->asInsetMath()
+                                   && (inset_code == InsetBase::NO_CODE
+                                   || inset_code == it->lyxCode())) {
                                        LCursor tmpcur = cur;
                                        tmpcur.pushLeft(*it);
                                        it->dispatch(tmpcur, fr);
@@ -1588,7 +1591,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                case LFUN_BUFFER_SAVE_AS_DEFAULT: {
                        string const fname =
-                               addName(addPath(package().user_support(), "templates/"),
+                               addName(addPath(package().user_support().absFilename(), "templates/"),
                                        "defaults.lyx");
                        Buffer defaults(fname);
 
@@ -1900,7 +1903,7 @@ void LyXFunc::open(string const & fname)
                FileDialog fileDlg(_("Select document to open"),
                        LFUN_FILE_OPEN,
                        make_pair(_("Documents|#o#O"), from_utf8(lyxrc.document_path)),
-                       make_pair(_("Examples|#E#e"), from_utf8(addPath(package().system_support(), "examples"))));
+                       make_pair(_("Examples|#E#e"), from_utf8(addPath(package().system_support().absFilename(), "examples"))));
 
                FileDialog::Result result =
                        fileDlg.open(from_utf8(initpath),
@@ -1974,7 +1977,7 @@ void LyXFunc::doImport(string const & argument)
                        LFUN_BUFFER_IMPORT,
                        make_pair(_("Documents|#o#O"), from_utf8(lyxrc.document_path)),
                        make_pair(_("Examples|#E#e"),
-                                 from_utf8(addPath(package().system_support(), "examples"))));
+                                 from_utf8(addPath(package().system_support().absFilename(), "examples"))));
 
                docstring filter = formats.prettyName(format);
                filter += " (*.";
@@ -2155,7 +2158,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
                        string const encoded = FileName(
                                lyxrc_new.document_path).toFilesystemEncoding();
                        if (fs::exists(encoded) && fs::is_directory(encoded))
-                               support::package().document_dir() = lyxrc.document_path;
+                               support::package().document_dir() = FileName(lyxrc.document_path);
                }
        case LyXRC::RC_ESC_CHARS:
        case LyXRC::RC_FONT_ENCODING: