diff --git a/src/Buffer.cpp b/src/Buffer.cpp index dad081932b..e3e646232c 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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) { diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 5f39c30a85..f3a968afd8 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -1112,7 +1112,7 @@ docstring const LaTeXFeatures::getIncludedFiles(string const & fname) const fi != end; ++fi) // FIXME UNICODE sgmlpreamble << "\nfirst - << (isSGMLFilename(fi->second) ? " SYSTEM \"" : " \"") + << (isSGMLFileName(fi->second) ? " SYSTEM \"" : " \"") << makeRelPath(from_utf8(fi->second), basename) << "\">"; return sgmlpreamble.str(); diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 8b5134a6ea..f35b90bae0 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -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()))) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 923b10eb9c..0274edeb03 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -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"); } diff --git a/src/insets/ExternalSupport.cpp b/src/insets/ExternalSupport.cpp index 5866a98dce..75b85ddb9d 100644 --- a/src/insets/ExternalSupport.cpp +++ b/src/insets/ExternalSupport.cpp @@ -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: ") + diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index b932f91737..9408fc6124 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -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: ") + diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index ba396e5922..60f6b66644 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -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: ") + diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 462d2e45e9..d28ca27964 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -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; diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp index 5a9a22b8b7..82854612a0 100644 --- a/src/support/filetools.cpp +++ b/src/support/filetools.cpp @@ -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; diff --git a/src/support/filetools.h b/src/support/filetools.h index 016fb8de7b..da7203cb23 100644 --- a/src/support/filetools.h +++ b/src/support/filetools.h @@ -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