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:
Lars Gullik Bjønnes 2000-05-31 17:08:11 +00:00
parent f16cee2cff
commit c5d617710f
4 changed files with 45 additions and 21 deletions

View File

@ -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

View File

@ -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

View File

@ -620,32 +620,42 @@ void LaTeX::deplog(DepTable & head)
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.

View File

@ -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;
}