maxcounter = 0
format = 1
while i < len(lines):
-
# Skip comments and empty lines
if re_Comment.match(lines[i]) or re_Empty.match(lines[i]):
i += 1
# insert file format if not already there
if (only_comment):
- match = re_Format.match(lines[i])
- if match:
- format = int(match.group(4))
- if format > 1 and format < currentFormat:
- lines[i] = "Format %d" % (format + 1)
- only_comment = 0
- elif format == currentFormat:
- # nothing to do
- return format
- else:
- error('Cannot convert file format %s' % format)
+ match = re_Format.match(lines[i])
+ if match:
+ format = int(match.group(4))
+ if format > 1 and format < currentFormat:
+ lines[i] = "Format %d" % (format + 1)
+ only_comment = 0
+ elif format == currentFormat:
+ # nothing to do
+ return format
else:
- lines.insert(i, "Format 2")
- only_comment = 0
- continue
+ error('Cannot convert file format %s' % format)
+ else:
+ lines.insert(i, "Format 2")
+ only_comment = 0
+ continue
# Don't get confused by LaTeX code
if re_Preamble.match(lines[i]):
/// Returns the master counter of this counter.
docstring const & master() const;
/// Returns a LaTeX-like string to format the counter.
- /* This is similar to what one gets in LaTeX when using
- * "\the<counter>".
+ /** This is similar to what one gets in LaTeX when using
+ * "\the<counter>".
*/
docstring const & labelString() const;
/// Returns a LaTeX-like string to format the counter in appendix.
- /* This is similar to what one gets in LaTeX when using
- * "\the<counter>" in an appendix.
+ /** This is similar to what one gets in LaTeX when using
+ * "\the<counter>" in an appendix.
*/
docstring const & labelStringAppendix() const;
private:
///
int value_;
/// contains master counter name.
- /* The master counter is the counter that, if stepped
- * (incremented) zeroes this counter. E.g. "subsection"'s
- * master is "section".
+ /** The master counter is the counter that, if stepped
+ * (incremented) zeroes this counter. E.g. "subsection"'s
+ * master is "section".
*/
docstring master_;
- // Contains a LaTeX-like string to format the counter.
+ /// Contains a LaTeX-like string to format the counter.
docstring labelstring_;
- // The same as labelstring_, but in appendices.
+ /// The same as labelstring_, but in appendices.
docstring labelstringappendix_;
};
int value(docstring const & ctr) const;
/// Increment by one counter named by arg, and zeroes slave
/// counter(s) for which it is the master.
- /* Sub-slaves not zeroed! That happens at slave's first step
- * 0->1. Seems to be sufficient.
+ /** Sub-slaves not zeroed! That happens at slave's first step
+ * 0->1. Seems to be sufficient.
*/
void step(docstring const & ctr);
/// Reset all counters.
std::set<docstring> & callers);
/// Returns the value of the counter according to the
/// numbering scheme numbertype.
- /* Available numbering schemes are arabic (1, 2,...), roman
- * (i, ii,...), Roman (I, II,...), alph (a, b,...), Alpha (A,
- * B,...) and hebrew.
+ /** Available numbering schemes are arabic (1, 2,...), roman
+ * (i, ii,...), Roman (I, II,...), alph (a, b,...), Alpha (A,
+ * B,...) and hebrew.
*/
docstring labelItem(docstring const & ctr,
docstring const & numbertype);
bool TextClass::convertLayoutFormat(support::FileName const & filename, ReadType rt)
{
LYXERR(Debug::TCLASS, "Converting layout file to " << FORMAT);
- FileName const tempfile = FileName::tempName("convert_layout");
- bool success = layout2layout(filename, tempfile);
- if (success)
- success = read(tempfile, rt);
- tempfile.removeFile();
- return success;
+ FileName const tempfile = FileName::tempName("convert_layout");
+ bool success = layout2layout(filename, tempfile);
+ if (success)
+ success = read(tempfile, rt);
+ tempfile.removeFile();
+ return success;
}
bool TextClass::read(FileName const & filename, ReadType rt)
bool const worx = convertLayoutFormat(filename, rt);
if (!worx) {
- lyxerr << "Unable to convert " << filename <<
- " to format " << FORMAT << std::endl;
+ LYXERR0 ("Unable to convert " << filename <<
+ " to format " << FORMAT);
return false;
}
return true;
}
}
else {
- //FIXME Should we also eat the style here? viz:
- //Layout layout;
- //readStyle(lexrc, layout);
- //as above...
lexrc.printError("No name given for style: `$$Token'.");
error = true;
}
floatlist_.erase(nofloat);
}
break;
- }
+ } // end of switch
//Note that this is triggered the first time through the loop unless
//we hit a format tag.