]> git.lyx.org Git - features.git/commitdiff
Whitespace and comment cleanup.
authorRichard Heck <rgheck@comcast.net>
Mon, 6 Oct 2008 12:16:17 +0000 (12:16 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 6 Oct 2008 12:16:17 +0000 (12:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26777 a592a061-630c-0410-9148-cb99ea01b6c8

lib/scripts/layout2layout.py
src/Counters.h
src/TextClass.cpp

index e10bfc8118cd701dbe79f5011db6d5cfe2d0acf3..3d27398ecce1bef0f71f24d0b1f041f6d4a66dd8 100644 (file)
@@ -145,7 +145,6 @@ def convert(lines):
     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
@@ -153,21 +152,21 @@ def convert(lines):
 
         # 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]):
index 28e7b686322791d3236f7b056c50a0893965d744..5117ae80b6c79aa1db0c98c6696d3156ba2388a3 100644 (file)
@@ -44,27 +44,27 @@ public:
        /// 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_;
 };
 
@@ -92,8 +92,8 @@ public:
        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.
@@ -129,9 +129,9 @@ private:
                             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);
index 38978a530eb24139210767f4db87caf50a24582e..acf41f505494e14924f52ff8a0f21cade35e74b8 100644 (file)
@@ -224,12 +224,12 @@ namespace {
 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)
@@ -261,8 +261,8 @@ 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;
@@ -398,10 +398,6 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
                                }
                        }
                        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;
                        }
@@ -542,7 +538,7 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
                                floatlist_.erase(nofloat);
                        }
                        break;
-               }
+               } // end of switch
 
                //Note that this is triggered the first time through the loop unless
                //we hit a format tag.