rgh...@lyx.org wrote:
Author: rgheck
Date: Tue Dec 16 17:01:32 2008
New Revision: 27897
URL: http://www.lyx.org/trac/changeset/27897
Log:
Exit early to avoid indentation.
OK for branch, Jurgen? This is actually a lot less than it looks: Just
moving a later test to earlier, per JMarc's suggestion.
rh
Modified:
lyx-devel/trunk/src/TextClass.cpp
Modified: lyx-devel/trunk/src/TextClass.cpp
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/TextClass.cpp?rev=27897
==============================================================================
--- lyx-devel/trunk/src/TextClass.cpp (original)
+++ lyx-devel/trunk/src/TextClass.cpp Tue Dec 16 17:01:32 2008
@@ -372,40 +372,40 @@
}
break;
- case TC_STYLE:
- if (lexrc.next()) {
- docstring const name =
from_utf8(subst(lexrc.getString(),
- '_', ' '));
- if (name.empty()) {
- string s = "Could not read name for style:
`$$Token' "
- + lexrc.getString() + " is probably
not valid UTF-8!";
- lexrc.printError(s.c_str());
- Layout lay;
- // Since we couldn't read the name, we
just scan the rest
- // of the style and discard it.
- error = !readStyle(lexrc, lay);
- } else if (hasLayout(name)) {
- Layout & lay = operator[](name);
- error = !readStyle(lexrc, lay);
- } else {
- Layout layout;
- layout.setName(name);
- error = !readStyle(lexrc, layout);
- if (!error)
- layoutlist_.push_back(layout);
-
- if (defaultlayout_.empty()) {
- // We do not have a default
layout yet, so we choose
- // the first layout we
encounter.
- defaultlayout_ = name;
- }
+ case TC_STYLE: {
+ if (!lexrc.next()) {
+ lexrc.printError("No name given for style:
`$$Token'.");
+ error = true;
+ break;
+ }
+ docstring const name =
from_utf8(subst(lexrc.getString(),
+ '_', ' '));
+ if (name.empty()) {
+ string s = "Could not read name for style: `$$Token'
"
+ + lexrc.getString() + " is probably not
valid UTF-8!";
+ lexrc.printError(s.c_str());
+ Layout lay;
+ // Since we couldn't read the name, we just
scan the rest
+ // of the style and discard it.
+ error = !readStyle(lexrc, lay);
+ } else if (hasLayout(name)) {
+ Layout & lay = operator[](name);
+ error = !readStyle(lexrc, lay);
+ } else {
+ Layout layout;
+ layout.setName(name);
+ error = !readStyle(lexrc, layout);
+ if (!error)
+ layoutlist_.push_back(layout);
+
+ if (defaultlayout_.empty()) {
+ // We do not have a default layout yet,
so we choose
+ // the first layout we encounter.
+ defaultlayout_ = name;
}
}
- else {
- lexrc.printError("No name given for style:
`$$Token'.");
- error = true;
- }
- break;
+ break;
+ }
case TC_NOSTYLE:
if (lexrc.next()) {
_______________________________________________
Cvslog mailing list
cvs...@lyx.org
http://www.lyx.org/mailman/listinfo/cvslog