]> git.lyx.org Git - features.git/commitdiff
support:
authorPavel Sanda <sanda@lyx.org>
Wed, 21 Apr 2010 01:19:31 +0000 (01:19 +0000)
committerPavel Sanda <sanda@lyx.org>
Wed, 21 Apr 2010 01:19:31 +0000 (01:19 +0000)
isLyXFilename -> isLyXFilename
isValidLaTeXFilename -> isValidLaTeXFileName
isSGMLFilename -> isSGMLFileName

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34242 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/LaTeXFeatures.cpp
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiView.cpp
src/insets/ExternalSupport.cpp
src/insets/InsetBibtex.cpp
src/insets/InsetGraphics.cpp
src/insets/InsetInclude.cpp
src/support/filetools.cpp
src/support/filetools.h

index dad081932be7661be9b8926fcd426e0fb73791b7..e3e646232cdab7015684d5494973f57ebc29b7ca 100644 (file)
@@ -771,7 +771,7 @@ bool Buffer::readDocument(Lexer & lex)
        if (!params().master.empty()) {
                FileName const master_file = makeAbsPath(params().master,
                           onlyPath(absFileName()));
-               if (isLyXFilename(master_file.absFileName())) {
+               if (isLyXFileName(master_file.absFileName())) {
                        Buffer * master = 
                                checkAndLoadLyXFile(master_file, true);
                        if (master) {
index 5f39c30a856572e3a9da09084e74106b3acb881c..f3a968afd872650b0781160ab5dc8005cee84e3f 100644 (file)
@@ -1112,7 +1112,7 @@ docstring const LaTeXFeatures::getIncludedFiles(string const & fname) const
             fi != end; ++fi)
                // FIXME UNICODE
                sgmlpreamble << "\n<!ENTITY " << fi->first
-                            << (isSGMLFilename(fi->second) ? " SYSTEM \"" : " \"")
+                            << (isSGMLFileName(fi->second) ? " SYSTEM \"" : " \"")
                             << makeRelPath(from_utf8(fi->second), basename) << "\">";
 
        return sgmlpreamble.str();
index 8b5134a6ea595fc5edcdc47069944d06db0e5c39..f35b90bae01c1f5be2a40bc5fa24e7b123a62ac7 100644 (file)
@@ -3093,7 +3093,7 @@ void GuiDocument::dispatchParams()
        if (!params().master.empty()) {
                FileName const master_file = support::makeAbsPath(params().master,
                           support::onlyPath(buffer().absFileName()));
-               if (isLyXFilename(master_file.absFileName())) {
+               if (isLyXFileName(master_file.absFileName())) {
                        Buffer * master = checkAndLoadLyXFile(master_file);
                        if (master) {
                                if (master->isChild(const_cast<Buffer *>(&buffer())))
index 923b10eb9c97ca8344e16839f019250e96994151..0274edeb03210a2816b3e313d31235123891ee34 100644 (file)
@@ -2092,7 +2092,7 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
                dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
                dlg.setButton2(qt_("Templates|#T#t"), toqstr(lyxrc.template_path));
 
-               if (!isLyXFilename(fname.absFileName()))
+               if (!isLyXFileName(fname.absFileName()))
                        fname.changeExtension(".lyx");
 
                FileDialog::Result result =
@@ -2108,7 +2108,7 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
                if (fname.empty())
                        return false;
 
-               if (!isLyXFilename(fname.absFileName()))
+               if (!isLyXFileName(fname.absFileName()))
                        fname.changeExtension(".lyx");
        }
 
index 5866a98dce08c7e937223bcb9918242a583d4d6c..75b85ddb9d4e903e7a8ed586c926a93ba8c38fe0 100644 (file)
@@ -363,7 +363,7 @@ int writeExternal(InsetExternalParams const & params,
        string const absname = makeAbsPath(
                params.filename.outputFileName(buffer.filePath()), buffer.filePath()).absFileName();
 
-       if (!external_in_tmpdir && !isValidLaTeXFilename(absname)) {
+       if (!external_in_tmpdir && !isValidLaTeXFileName(absname)) {
                lyx::frontend::Alert::warning(_("Invalid filename"),
                                              _("The following filename is likely to cause trouble "
                                                "when running the exported file through LaTeX: ") +
index b932f9173773c06a67831e15ca929a44cde8d5d4..9408fc6124b1c94010701fa3f63ce8cbf1c6822b 100644 (file)
@@ -280,7 +280,7 @@ int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
                                       << endl;
                        }
                } else if (!runparams.inComment && runparams.nice && not_from_texmf &&
-                          !isValidLaTeXFilename(database)) {
+                          !isValidLaTeXFileName(database)) {
                                frontend::Alert::warning(_("Invalid filename"),
                                                         _("The following filename is likely to cause trouble "
                                                           "when running the exported file through LaTeX: ") +
index ba396e59229d3c7eae1c62f03c34bf7e35faae2b..60f6b66644562086b6a4705b7608482dc463e0b5 100644 (file)
@@ -589,7 +589,7 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
                params().filename.outputFileName(masterBuffer->filePath()) :
                onlyFileName(temp_file.absFileName());
 
-       if (runparams.nice && !isValidLaTeXFilename(output_file)) {
+       if (runparams.nice && !isValidLaTeXFileName(output_file)) {
                frontend::Alert::warning(_("Invalid filename"),
                                         _("The following filename is likely to cause trouble "
                                           "when running the exported file through LaTeX: ") +
index 462d2e45e9d0b27b9739a5fdf65a3a63063a4be2..d28ca279641428146fe9ba00327baade0e24e91c 100644 (file)
@@ -423,7 +423,7 @@ Buffer * InsetInclude::loadIfNeeded() const
                child_buffer_ = 0;
        }
 
-       if (!isLyXFilename(included_file.absFileName()))
+       if (!isLyXFileName(included_file.absFileName()))
                return 0;
 
        Buffer * child = theBufferList().getBuffer(included_file);
@@ -505,7 +505,7 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
 
        if (!runparams.nice)
                incfile = mangled;
-       else if (!isValidLaTeXFilename(incfile)) {
+       else if (!isValidLaTeXFileName(incfile)) {
                frontend::Alert::warning(_("Invalid filename"),
                                         _("The following filename is likely to cause trouble "
                                           "when running the exported file through LaTeX: ") +
@@ -519,7 +519,7 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
                //Don't try to load or copy the file if we're
                //in a comment or doing a dryrun
        } else if (isInputOrInclude(params()) &&
-                isLyXFilename(included_file.absFileName())) {
+                isLyXFileName(included_file.absFileName())) {
                //if it's a LyX file and we're inputting or including,
                //try to load it so we can write the associated latex
                if (!loadIfNeeded())
@@ -612,7 +612,7 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
                                                      exportfile);
 
                // \input wants file with extension (default is .tex)
-               if (!isLyXFilename(included_file.absFileName())) {
+               if (!isLyXFileName(included_file.absFileName())) {
                        incfile = latex_path(incfile);
                        // FIXME UNICODE
                        os << '\\' << from_ascii(params().getCmdName())
@@ -679,7 +679,7 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const &rp) const
        // (If we wanted to get really arcane, we could run some tex2html
        // converter on the included file. But that's just masochistic.)
        FileName const included_file = includedFilename(buffer(), params());
-       if (!isLyXFilename(included_file.absFileName())) {
+       if (!isLyXFileName(included_file.absFileName())) {
                frontend::Alert::warning(_("Unsupported Inclusion"),
                                         bformat(_("LyX does not know how to include non-LyX files when "
                                                   "generating HTML output. Offending file:\n%1$s"),
@@ -789,7 +789,7 @@ void InsetInclude::validate(LaTeXFeatures & features) const
        string const included_file =
                includedFilename(buffer(), params()).absFileName();
 
-       if (isLyXFilename(included_file))
+       if (isLyXFileName(included_file))
                writefile = changeExtension(included_file, ".sgml");
        else
                writefile = included_file;
index 5a9a22b8b7f3dafe42cc1ab76eae690f33aa06c6..82854612a00f512c2840f70206fd72994676a400 100644 (file)
@@ -55,19 +55,19 @@ using namespace std;
 namespace lyx {
 namespace support {
 
-bool isLyXFilename(string const & filename)
+bool isLyXFileName(string const & filename)
 {
        return suffixIs(ascii_lowercase(filename), ".lyx");
 }
 
 
-bool isSGMLFilename(string const & filename)
+bool isSGMLFileName(string const & filename)
 {
        return suffixIs(ascii_lowercase(filename), ".sgml");
 }
 
 
-bool isValidLaTeXFilename(string const & filename)
+bool isValidLaTeXFileName(string const & filename)
 {
        string const invalid_chars("#$%{}()[]\"^");
        return filename.find_first_of(invalid_chars) == string::npos;
index 016fb8de7b84e82f67d7d45eda4cd5a1c64be966..da7203cb230be9489dd1797b2907c5b6c85907cc 100644 (file)
@@ -64,13 +64,13 @@ FileName const fileSearch(std::string const & path,
                             search_mode mode = must_exist);
 
 ///
-bool isLyXFilename(std::string const & filename);
+bool isLyXFileName(std::string const & filename);
 
 ///
-bool isSGMLFilename(std::string const & filename);
+bool isSGMLFileName(std::string const & filename);
 
 ///
-bool isValidLaTeXFilename(std::string const & filename);
+bool isValidLaTeXFileName(std::string const & filename);
 
 /** Returns the path of a library data file.
     Search the file name.ext in the subdirectory dir of