mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-04 22:32:19 +00:00
2007-04-03 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* ExternalSupport.C (doSubstitution): redo the substitution with use_latex_path == false for the filename argument of $$Contents, since the original substitution might have been done with use_latex_path == true, and that can lead to escaped filenames that are only valid for TeX. (bug 3241) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@17705 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e151c023c1
commit
e5f880d050
@ -1,3 +1,11 @@
|
||||
2007-04-03 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
||||
|
||||
* ExternalSupport.C (doSubstitution): redo the substitution with
|
||||
use_latex_path == false for the filename argument of $$Contents,
|
||||
since the original substitution might have been done with
|
||||
use_latex_path == true, and that can lead to escaped filenames
|
||||
that are only valid for TeX. (bug 3241)
|
||||
|
||||
2007-03-26 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||
|
||||
* insetcite.C: really call getEngine()
|
||||
|
@ -168,12 +168,17 @@ string const doSubstitution(InsetExternalParams const & params,
|
||||
|
||||
// Handle the $$Contents(filename) syntax
|
||||
if (support::contains(result, "$$Contents(\"")) {
|
||||
|
||||
string::size_type const pos = result.find("$$Contents(\"");
|
||||
string::size_type const end = result.find("\")", pos);
|
||||
string const file = result.substr(pos + 12, end - (pos + 12));
|
||||
// Since use_latex_path may be true we must extract the file
|
||||
// name from s instead of result and do the substitutions
|
||||
// again, this time with use_latex_path false.
|
||||
string::size_type const spos = s.find("$$Contents(\"");
|
||||
string::size_type const send = s.find("\")", spos);
|
||||
string const file_template = s.substr(spos + 12, send - (spos + 12));
|
||||
string const file = doSubstitution(params, buffer,
|
||||
file_template, false,
|
||||
external_in_tmpdir, what);
|
||||
string contents;
|
||||
|
||||
|
||||
string const filepath = support::IsFileReadable(file) ?
|
||||
buffer.filePath() : m_buffer->temppath();
|
||||
support::Path p(filepath);
|
||||
@ -181,9 +186,9 @@ string const doSubstitution(InsetExternalParams const & params,
|
||||
if (support::IsFileReadable(file))
|
||||
contents = support::GetFileContents(file);
|
||||
|
||||
result = support::subst(result,
|
||||
("$$Contents(\"" + file + "\")").c_str(),
|
||||
contents);
|
||||
string::size_type const pos = result.find("$$Contents(\"");
|
||||
string::size_type const end = result.find("\")", pos);
|
||||
result.replace(pos, end + 2, contents);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -37,6 +37,7 @@ What's new
|
||||
|
||||
- Don't skip lines after noweb chunks in tex2lyx (bug 3052)
|
||||
|
||||
- Fix Date external template in windows (bug 3241)
|
||||
|
||||
* USER INTERFACE:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user