mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
fix to the lyxstring bug, better searching for dep files in latex log, use \hfil in lyxlist envir
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@785 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f16cee2cff
commit
c5d617710f
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
||||
2000-05-31 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* src/support/lyxstring.C (begin): fix a "shared" string bug. use
|
||||
rep->get_own_copy()
|
||||
(end): ditto
|
||||
|
||||
* src/LaTeX.C (deplog): better searching for dependency files in
|
||||
the latex log. Uses now regexps.
|
||||
|
||||
* lib/layouts/stdlists.inc (lyxlist): fix the label to use \hfil
|
||||
instead of the box hack or \hfill.
|
||||
|
||||
2000-05-31 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* src/lyxfunc.C (doImportHelper): do not create the file before
|
||||
|
@ -88,7 +88,7 @@ Style List
|
||||
{\settowidth{\labelwidth}{#1}
|
||||
\setlength{\leftmargin}{\labelwidth}
|
||||
\addtolength{\leftmargin}{\labelsep}
|
||||
\renewcommand{\makelabel}[1]{\makebox[\labelwidth][l]{##1}}}}
|
||||
\renewcommand{\makelabel}[1]{##1\hfil}}}
|
||||
{\end{list}}
|
||||
EndPreamble
|
||||
|
||||
|
50
src/LaTeX.C
50
src/LaTeX.C
@ -619,39 +619,49 @@ void LaTeX::deplog(DepTable & head)
|
||||
// dependency file.
|
||||
|
||||
string logfile = OnlyFilename(ChangeExtension(file, ".log"));
|
||||
|
||||
|
||||
LRegex reg1(")* *\\(([^ ]+).*");
|
||||
LRegex reg2("File: ([^ ]+).*");
|
||||
|
||||
ifstream ifs(logfile.c_str());
|
||||
while (ifs) {
|
||||
// Now we read chars until we find a '('
|
||||
char c = 0;
|
||||
while(ifs.get(c)) {
|
||||
if (c == '(') break;
|
||||
};
|
||||
if (!ifs) break;
|
||||
|
||||
// We now have c == '(', we now read the the sequence of
|
||||
// chars until reaching EOL, ' ' or ')' and put that
|
||||
// into a string.
|
||||
// Ok, the scanning of files here is not sufficient.
|
||||
// Sometimes files are named by "File: xxx" only
|
||||
// So I think we should use some regexps to find files instead.
|
||||
// "(\([^ ]+\)" should match the "(file " variant
|
||||
// "File: \([^ ]+\)" should match the "File: file" variant
|
||||
string foundfile;
|
||||
while (ifs.get(c)) {
|
||||
if (c == '\n' || c == ' ' || c == ')')
|
||||
break;
|
||||
foundfile += c;
|
||||
string token;
|
||||
getline(ifs, token);
|
||||
if (token.empty()) continue;
|
||||
|
||||
if (reg1.exact_match(token)) {
|
||||
LRegex::SubMatches const & sub = reg1.exec(token);
|
||||
foundfile = LSubstring(token, sub[1].first,
|
||||
sub[1].second);
|
||||
} else if (reg2.exact_match(token)) {
|
||||
LRegex::SubMatches const & sub = reg2.exec(token);
|
||||
foundfile = LSubstring(token, sub[1].first,
|
||||
sub[1].second);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
lyxerr[Debug::DEPEND] << "Found file: "
|
||||
<< foundfile << endl;
|
||||
|
||||
// Ok now we found a file.
|
||||
// Now we should make sure that
|
||||
// this is a file that we can
|
||||
// access through the normal
|
||||
// paths:
|
||||
// Now we should make sure that this is a file that we can
|
||||
// access through the normal paths.
|
||||
// We will not try any fance search methods to
|
||||
// find the file.
|
||||
|
||||
// (1) foundfile is an
|
||||
// absolute path and should
|
||||
// be inserted.
|
||||
if (AbsolutePath(foundfile)) {
|
||||
lyxerr[Debug::DEPEND] << "AbsolutePath file: "
|
||||
<< foundfile << endl;
|
||||
<< foundfile << endl;
|
||||
// On inital insert we want to do the update at once
|
||||
// since this file can not be a file generated by
|
||||
// the latex run.
|
||||
|
@ -460,6 +460,7 @@ lyxstring::~lyxstring()
|
||||
|
||||
lyxstring::iterator lyxstring::begin()
|
||||
{
|
||||
rep = rep->get_own_copy();
|
||||
return rep->s;
|
||||
}
|
||||
|
||||
@ -472,6 +473,7 @@ lyxstring::const_iterator lyxstring::begin() const
|
||||
|
||||
lyxstring::iterator lyxstring::end()
|
||||
{
|
||||
rep = rep->get_own_copy();
|
||||
return rep->s + rep->sz;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user