]> git.lyx.org Git - lyx.git/blobdiff - src/Format.cpp
* sk.po
[lyx.git] / src / Format.cpp
index 74a19eaf23596d05c3127508e23b0ab8a725b679..050af1414f69ae0058849c9f26e35af9c68ca961 100644 (file)
@@ -24,6 +24,7 @@
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Systemcall.h"
+#include "support/textutils.h"
 
 #include <algorithm>
 
@@ -102,7 +103,7 @@ bool Format::isChildFormat() const
 {
        if (name_.empty())
                return false;
-       return isdigit(name_[name_.length() - 1]);
+       return isDigitASCII(name_[name_.length() - 1]);
 }
 
 
@@ -258,28 +259,6 @@ void Formats::setEditor(string const & name, string const & command)
                it->setEditor(command);
 }
 
-bool Formats::viewURL(string const &url){
-       Format const * format = getFormat("html");
-       string command = libScriptSearch(format->viewer());
-
-       if (!contains(command, token_from_format))
-               command += ' ' + token_from_format;
-       command = subst(command, token_from_format, quoteName(url));
-
-       LYXERR(Debug::FILES, "Executing command: " << command);
-       //buffer.message(_("Executing command: ") + from_utf8(command));
-
-       Systemcall one;
-       int const res = one.startscript(Systemcall::DontWait, command);
-
-       if (res) {
-               Alert::error(_("Cannot view URL"),
-                            bformat(_("An error occurred whilst running %1$s"),
-                              makeDisplayPath(command, 50)));
-               return false;
-       }
-       return true;
-}
 
 bool Formats::view(Buffer const & buffer, FileName const & filename,
                   string const & format_name) const
@@ -340,14 +319,9 @@ bool Formats::view(Buffer const & buffer, FileName const & filename,
        buffer.message(_("Executing command: ") + from_utf8(command));
 
        Systemcall one;
-       int const res = one.startscript(Systemcall::DontWait, command);
+       one.startscript(Systemcall::DontWait, command);
 
-       if (res) {
-               Alert::error(_("Cannot view file"),
-                            bformat(_("An error occurred whilst running %1$s"),
-                              makeDisplayPath(command, 50)));
-               return false;
-       }
+       // we can't report any sort of error, since we aren't waiting
        return true;
 }
 
@@ -412,14 +386,9 @@ bool Formats::edit(Buffer const & buffer, FileName const & filename,
        buffer.message(_("Executing command: ") + from_utf8(command));
 
        Systemcall one;
-       int const res = one.startscript(Systemcall::DontWait, command);
+       one.startscript(Systemcall::DontWait, command);
 
-       if (res) {
-               Alert::error(_("Cannot edit file"),
-                            bformat(_("An error occurred whilst running %1$s"),
-                              makeDisplayPath(command, 50)));
-               return false;
-       }
+       // we can't report any sort of error, since we aren't waiting
        return true;
 }