]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
cleanups: split Paragraph::Private::simpleTeXSpecialChars() in two. Remove two or...
[lyx.git] / src / LyXFunc.cpp
index b8673bb152e4146cdff1501a5552292e4dd7e545..ffcb368da6935c53629489e461cec3ec6f53ce8c 100644 (file)
@@ -124,11 +124,8 @@ using support::FileFilterList;
 using support::FileName;
 using support::fileSearch;
 using support::i18nLibFileSearch;
-using support::isDirWriteable;
-using support::isFileReadable;
-using support::isStrInt;
-using support::makeAbsPath;
 using support::makeDisplayPath;
+using support::makeAbsPath;
 using support::package;
 using support::quoteName;
 using support::rtrim;
@@ -586,7 +583,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                        }
                }
                else if (name == "latexlog")
-                       enable = isFileReadable(FileName(buf->getLogName().second));
+                       enable = FileName(buf->getLogName().second).isFileReadable();
                else if (name == "spellchecker")
 #if defined (USE_ASPELL) || defined (USE_ISPELL) || defined (USE_PSPELL)
                        enable = !buf->isReadonly();
@@ -1412,7 +1409,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        case REF_CODE:
                        case TOC_CODE:
                        case HYPERLINK_CODE: {
-                               InsetCommandParams p(name);
+                               InsetCommandParams p(code);
                                data = InsetCommandMailer::params2string(name, p);
                                break;
                        } 
@@ -1422,7 +1419,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                if (data.empty())
                                        // default type is requested
                                        data = "include";
-                               InsetCommandParams p("include", data);
+                               InsetCommandParams p(INCLUDE_CODE, data);
                                data = InsetIncludeMailer::params2string(p);
                                break;
                        } 
@@ -1438,7 +1435,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                break;
                        } 
                        case CITE_CODE: {
-                               InsetCommandParams p("cite");
+                               InsetCommandParams p(CITE_CODE);
                                data = InsetCommandMailer::params2string(name, p);
                                break;
                        } 
@@ -1542,7 +1539,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                        arg = token(argument, '|', 0);
                                        opt1 = token(argument, '|', 1);
                                }
-                               InsetCommandParams icp("cite");
+                               InsetCommandParams icp(CITE_CODE);
                                icp["key"] = from_utf8(arg);
                                if (!opt1.empty())
                                        icp["before"] = from_utf8(opt1);
@@ -2067,7 +2064,7 @@ void LyXFunc::menuNew(string const & name, bool fromTemplate)
        if (lyx_view_->buffer()) {
                string const trypath = lyx_view_->buffer()->filePath();
                // If directory is writeable, use this as default.
-               if (isDirWriteable(FileName(trypath)))
+               if (FileName(trypath).isDirWritable())
                        initpath = trypath;
        }
 
@@ -2118,7 +2115,7 @@ void LyXFunc::open(string const & fname)
        if (lyx_view_->buffer()) {
                string const trypath = lyx_view_->buffer()->filePath();
                // If directory is writeable, use this as default.
-               if (isDirWriteable(FileName(trypath)))
+               if (FileName(trypath).isDirWritable())
                        initpath = trypath;
        }
 
@@ -2195,7 +2192,7 @@ void LyXFunc::doImport(string const & argument)
                if (lyx_view_->buffer()) {
                        string const trypath = lyx_view_->buffer()->filePath();
                        // If directory is writeable, use this as default.
-                       if (isDirWriteable(FileName(trypath)))
+                       if (FileName(trypath).isDirWritable())
                                initpath = trypath;
                }