]> git.lyx.org Git - features.git/commitdiff
src/*.cpp: reformatting to increase consistency
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 27 Oct 2012 13:45:27 +0000 (15:45 +0200)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 28 Oct 2012 16:42:07 +0000 (17:42 +0100)
55 files changed:
src/AppleSpellChecker.cpp
src/AspellChecker.cpp
src/Author.cpp
src/BiblioInfo.cpp
src/Bidi.cpp
src/BranchList.cpp
src/Buffer.cpp
src/BufferList.cpp
src/BufferParams.cpp
src/BufferView.cpp
src/Changes.cpp
src/Chktex.cpp
src/CmdDef.cpp
src/Color.cpp
src/Compare.cpp
src/ConverterCache.cpp
src/CoordCache.cpp
src/Counters.cpp
src/Cursor.cpp
src/CutAndPaste.cpp
src/DepTable.cpp
src/DocIterator.cpp
src/EnchantChecker.cpp
src/Encoding.cpp
src/FontInfo.cpp
src/Format.cpp
src/FuncStatus.cpp
src/HSpace.cpp
src/HunspellChecker.cpp
src/IndicesList.cpp
src/LaTeXFeatures.cpp
src/Layout.cpp
src/LayoutFile.cpp
src/LyX.cpp
src/ModuleList.cpp
src/Paragraph.cpp
src/ParagraphMetrics.cpp
src/PersonalWordList.cpp
src/Server.cpp
src/ServerSocket.cpp
src/Session.cpp
src/Text.cpp
src/TextClass.cpp
src/Thesaurus.cpp
src/VCBackend.cpp
src/VSpace.cpp
src/WordList.cpp
src/factory.cpp
src/lengthcommon.cpp
src/lyxfind.cpp
src/output_docbook.cpp
src/output_latex.cpp
src/output_plaintext.cpp
src/output_xhtml.cpp
src/rowpainter.cpp

index cb80a60bd18eec21f131c008d1d75a5cb6d1fb9e..189ada71cf730bcc54b642202c355ffe289e48fc 100644 (file)
@@ -55,9 +55,9 @@ AppleSpellChecker::Private::~Private()
 }
 
 
-AppleSpellChecker::AppleSpellChecker(): d(new Private)
-{
-}
+AppleSpellChecker::AppleSpellChecker()
+       : d(new Private)
+{}
 
 
 AppleSpellChecker::~AppleSpellChecker()
index a03dc65759defa19989f3df214ba54fca73ead42..5829612270191f5479265193209d28ce538087d5 100644 (file)
@@ -53,7 +53,8 @@ typedef map<std::string, PersonalWordList *> LangPersonalWordList;
 
 struct AspellChecker::Private
 {
-       Private() {}
+       Private()
+       {}
 
        ~Private();
 
@@ -91,27 +92,38 @@ struct AspellChecker::Private
 
        /// the location below system/user directory
        /// there the rws files lookup will happen
-       const string dictDirectory(void) { return "dicts"; }
+       const string dictDirectory(void)
+       {
+               return "dicts";
+       }
        /// there the dat+cmap files lookup will happen
-       const string dataDirectory(void) { return "data"; }
+       const string dataDirectory(void)
+       {
+               return "data";
+       }
        /// os package directory constants
        /// macports on Mac OS X or
        /// aspell rpms on Linux
-       const string osPackageBase(void) {
+       const string osPackageBase(void)
+       {
 #ifdef USE_MACOSX_PACKAGING
                return "/opt/local";
 #else
                return "/usr";
 #endif
        }
-       const string osPackageDictDirectory(void) {
+       const string osPackageDictDirectory(void)
+       {
 #ifdef USE_MACOSX_PACKAGING
                return "/share/aspell";
 #else
                return "/lib/aspell-0.60";
 #endif
        }
-       const string osPackageDataDirectory(void) { return "/lib/aspell-0.60"; }
+       const string osPackageDataDirectory(void)
+       {
+               return "/lib/aspell-0.60";
+       }
 
 };
 
@@ -404,9 +416,9 @@ bool AspellChecker::Private::learned(WordLangTuple const & word)
 }
 
 
-AspellChecker::AspellChecker(): d(new Private)
-{
-}
+AspellChecker::AspellChecker()
+       : d(new Private)
+{}
 
 
 AspellChecker::~AspellChecker()
@@ -483,12 +495,14 @@ void AspellChecker::suggest(WordLangTuple const & wl,
        delete_aspell_string_enumeration(els);
 }
 
+
 void AspellChecker::remove(WordLangTuple const & word)
 {
        d->remove(word);
        advanceChangeNumber();
 }
 
+
 bool AspellChecker::hasDictionary(Language const * lang) const
 {
        bool have = false;
index 12f7137a5f7587a66ee6732dc5ea9351c52c7078..f4658e61269d020395d5e8d824d3be37ed86c2ce 100644 (file)
@@ -57,6 +57,7 @@ ostream & operator<<(ostream & os, Author const & a)
        return os;
 }
 
+
 istream & operator>>(istream & is, Author & a)
 {
        string s;
@@ -69,15 +70,15 @@ istream & operator>>(istream & is, Author & a)
 }
 
 
-bool author_smaller(Author const & lhs, Author const & rhs) {
+bool author_smaller(Author const & lhs, Author const & rhs)
+{
        return lhs.bufferId() < rhs.bufferId();
 }
 
 
 AuthorList::AuthorList()
        : last_id_(0)
-{
-}
+{}
 
 
 int AuthorList::record(Author const & a)
@@ -133,12 +134,14 @@ AuthorList::Authors::const_iterator AuthorList::end() const
 }
 
 
-void AuthorList::sort() {
+void AuthorList::sort()
+{
        std::sort(authors_.begin(), authors_.end(), author_smaller);
 }
 
 
-ostream & operator<<(ostream & os, AuthorList const & a) {
+ostream & operator<<(ostream & os, AuthorList const & a)
+{
        // Copy the authorlist, because we don't want to sort the original
        AuthorList sorted = a;
        sorted.sort();
index 93094f8bfa0e704e10b584fcfb1dd69d3b0c9af4..7142f7b7e7719f59f8501e26377aeb462cd77732 100644 (file)
@@ -89,6 +89,7 @@ docstring familyName(docstring const & name)
        return retval;
 }
 
+
 // converts a string containing LaTeX commands into unicode
 // for display.
 docstring convertLaTeXCommands(docstring const & str)
@@ -288,115 +289,117 @@ docstring const BibTeXInfo::getXRef() const
 
 
 namespace {
-       string parseOptions(string const & format, string & optkey,
-                       string & ifpart, string & elsepart);
-
-       // Calls parseOptions to deal with an embedded option, such as:
-       //   {%number%[[, no.~%number%]]}
-       // which must appear at the start of format. ifelsepart gets the
-       // whole of the option, and we return what's left after the option.
-       // we return format if there is an error.
-       string parseEmbeddedOption(string const & format, string & ifelsepart)
-       {
-               LASSERT(format[0] == '{' && format[1] == '%', return format);
-               string optkey;
-               string ifpart;
-               string elsepart;
-               string const rest = parseOptions(format, optkey, ifpart, elsepart);
-               if (format == rest) { // parse error
-                       LYXERR0("ERROR! Couldn't parse `" << format <<"'.");
-                       return format;
-               }
-               LASSERT(rest.size() <= format.size(), /* */);
-               ifelsepart = format.substr(0, format.size() - rest.size());
-               return rest;
+
+string parseOptions(string const & format, string & optkey,
+                   string & ifpart, string & elsepart);
+
+// Calls parseOptions to deal with an embedded option, such as:
+//   {%number%[[, no.~%number%]]}
+// which must appear at the start of format. ifelsepart gets the
+// whole of the option, and we return what's left after the option.
+// we return format if there is an error.
+string parseEmbeddedOption(string const & format, string & ifelsepart)
+{
+       LASSERT(format[0] == '{' && format[1] == '%', return format);
+       string optkey;
+       string ifpart;
+       string elsepart;
+       string const rest = parseOptions(format, optkey, ifpart, elsepart);
+       if (format == rest) { // parse error
+               LYXERR0("ERROR! Couldn't parse `" << format <<"'.");
+               return format;
        }
+       LASSERT(rest.size() <= format.size(), /* */);
+       ifelsepart = format.substr(0, format.size() - rest.size());
+               return rest;
+}
 
 
-       // Gets a "clause" from a format string, where the clause is
-       // delimited by '[[' and ']]'. Returns what is left after the
-       // clause is removed, and returns format if there is an error.
-       string getClause(string const & format, string & clause)
-       {
-               string fmt = format;
-               // remove '[['
-               fmt = fmt.substr(2);
-               // we'll remove characters from the front of fmt as we
-               // deal with them
-               while (!fmt.empty()) {
-                       if (fmt[0] == ']' && fmt.size() > 1 && fmt[1] == ']') {
-                               // that's the end
-                               fmt = fmt.substr(2);
-                               break;
+// Gets a "clause" from a format string, where the clause is
+// delimited by '[[' and ']]'. Returns what is left after the
+// clause is removed, and returns format if there is an error.
+string getClause(string const & format, string & clause)
+{
+       string fmt = format;
+       // remove '[['
+       fmt = fmt.substr(2);
+       // we'll remove characters from the front of fmt as we
+       // deal with them
+       while (!fmt.empty()) {
+               if (fmt[0] == ']' && fmt.size() > 1 && fmt[1] == ']') {
+                       // that's the end
+                       fmt = fmt.substr(2);
+                       break;
+               }
+               // check for an embedded option
+               if (fmt[0] == '{' && fmt.size() > 1 && fmt[1] == '%') {
+                       string part;
+                       string const rest = parseEmbeddedOption(fmt, part);
+                       if (fmt == rest) {
+                               LYXERR0("ERROR! Couldn't parse embedded option in `" << format <<"'.");
+                               return format;
                        }
-                       // check for an embedded option
-                       if (fmt[0] == '{' && fmt.size() > 1 && fmt[1] == '%') {
-                               string part;
-                               string const rest = parseEmbeddedOption(fmt, part);
-                               if (fmt == rest) {
-                                       LYXERR0("ERROR! Couldn't parse embedded option in `" << format <<"'.");
-                                       return format;
-                               }
-                               clause += part;
-                               fmt = rest;
-                       } else { // it's just a normal character
+                       clause += part;
+                       fmt = rest;
+               } else { // it's just a normal character
                                clause += fmt[0];
                                fmt = fmt.substr(1);
-                       }
                }
-               return fmt;
        }
+       return fmt;
+}
 
 
-       // parse an options string, which must appear at the start of the
-       // format parameter. puts the parsed bits in optkey, ifpart, and
-       // elsepart and returns what's left after the option is removed.
-       // if there's an error, it returns format itself.
-       string parseOptions(string const & format, string & optkey,
-                       string & ifpart, string & elsepart)
-       {
-               LASSERT(format[0] == '{' && format[1] == '%', return format);
-               // strip '{%'
-               string fmt = format.substr(2);
-               size_t pos = fmt.find('%'); // end of key
-               if (pos == string::npos) {
-                       LYXERR0("Error parsing  `" << format <<"'. Can't find end of key.");
-                       return format;
-               }
-               optkey = fmt.substr(0,pos);
-               fmt = fmt.substr(pos + 1);
-               // [[format]] should be next
-               if (fmt[0] != '[' || fmt[1] != '[') {
-                       LYXERR0("Error parsing  `" << format <<"'. Can't find '[[' after key.");
-                       return format;
-               }
+// parse an options string, which must appear at the start of the
+// format parameter. puts the parsed bits in optkey, ifpart, and
+// elsepart and returns what's left after the option is removed.
+// if there's an error, it returns format itself.
+string parseOptions(string const & format, string & optkey,
+                   string & ifpart, string & elsepart)
+{
+       LASSERT(format[0] == '{' && format[1] == '%', return format);
+       // strip '{%'
+       string fmt = format.substr(2);
+       size_t pos = fmt.find('%'); // end of key
+       if (pos == string::npos) {
+               LYXERR0("Error parsing  `" << format <<"'. Can't find end of key.");
+               return format;
+       }
+       optkey = fmt.substr(0,pos);
+       fmt = fmt.substr(pos + 1);
+       // [[format]] should be next
+       if (fmt[0] != '[' || fmt[1] != '[') {
+               LYXERR0("Error parsing  `" << format <<"'. Can't find '[[' after key.");
+               return format;
+       }
 
-               string curfmt = fmt;
-               fmt = getClause(curfmt, ifpart);
-               if (fmt == curfmt) {
-                       LYXERR0("Error parsing  `" << format <<"'. Couldn't get if clause.");
-                       return format;
-               }
+       string curfmt = fmt;
+       fmt = getClause(curfmt, ifpart);
+       if (fmt == curfmt) {
+               LYXERR0("Error parsing  `" << format <<"'. Couldn't get if clause.");
+               return format;
+       }
 
-               if (fmt[0] == '}') // we're done, no else clause
-                       return fmt.substr(1);
+       if (fmt[0] == '}') // we're done, no else clause
+               return fmt.substr(1);
 
-               // else part should follow
-               if (fmt[0] != '[' || fmt[1] != '[') {
-                       LYXERR0("Error parsing  `" << format <<"'. Can't find else clause.");
-                       return format;
-               }
+       // else part should follow
+       if (fmt[0] != '[' || fmt[1] != '[') {
+               LYXERR0("Error parsing  `" << format <<"'. Can't find else clause.");
+               return format;
+       }
 
-               curfmt = fmt;
-               fmt = getClause(curfmt, elsepart);
-               // we should be done
-               if (fmt == curfmt || fmt[0] != '}') {
-                       LYXERR0("Error parsing  `" << format <<"'. Can't find end of option.");
-                       return format;
-               }
-               return fmt.substr(1);
+       curfmt = fmt;
+       fmt = getClause(curfmt, elsepart);
+       // we should be done
+       if (fmt == curfmt || fmt[0] != '}') {
+               LYXERR0("Error parsing  `" << format <<"'. Can't find end of option.");
+               return format;
+       }
+       return fmt.substr(1);
 }
 
+
 } // anon namespace
 
 
@@ -650,14 +653,16 @@ docstring BibTeXInfo::getValueForKey(string const & key,
 //////////////////////////////////////////////////////////////////////
 
 namespace {
+
 // A functor for use with sort, leading to case insensitive sorting
-       class compareNoCase: public binary_function<docstring, docstring, bool>
-       {
-               public:
-                       bool operator()(docstring const & s1, docstring const & s2) const {
-                               return compare_no_case(s1, s2) < 0;
-                       }
-       };
+class compareNoCase: public binary_function<docstring, docstring, bool>
+{
+public:
+       bool operator()(docstring const & s1, docstring const & s2) const {
+               return compare_no_case(s1, s2) < 0;
+       }
+};
+
 } // namespace anon
 
 
@@ -827,19 +832,21 @@ void BiblioInfo::mergeBiblioInfo(BiblioInfo const & info)
 
 
 namespace {
-       // used in xhtml to sort a list of BibTeXInfo objects
-       bool lSorter(BibTeXInfo const * lhs, BibTeXInfo const * rhs)
-       {
-               docstring const lauth = lhs->getAbbreviatedAuthor();
-               docstring const rauth = rhs->getAbbreviatedAuthor();
-               docstring const lyear = lhs->getYear();
-               docstring const ryear = rhs->getYear();
-               docstring const ltitl = lhs->operator[]("title");
-               docstring const rtitl = rhs->operator[]("title");
-               return  (lauth < rauth)
-                               || (lauth == rauth && lyear < ryear)
-                               || (lauth == rauth && lyear == ryear && ltitl < rtitl);
-       }
+
+// used in xhtml to sort a list of BibTeXInfo objects
+bool lSorter(BibTeXInfo const * lhs, BibTeXInfo const * rhs)
+{
+       docstring const lauth = lhs->getAbbreviatedAuthor();
+       docstring const rauth = rhs->getAbbreviatedAuthor();
+       docstring const lyear = lhs->getYear();
+       docstring const ryear = rhs->getYear();
+       docstring const ltitl = lhs->operator[]("title");
+       docstring const rtitl = rhs->operator[]("title");
+       return  (lauth < rauth)
+               || (lauth == rauth && lyear < ryear)
+               || (lauth == rauth && lyear == ryear && ltitl < rtitl);
+}
+
 }
 
 
index b9d1222931d83f0459b0fc527fb90bf1270e7a6f..a85f3eaddd26d4c64b035293e8abf9b448e953db 100644 (file)
@@ -46,6 +46,7 @@ bool Bidi::inRange(pos_type pos) const
        return start_ == -1 || (start_ <= pos && pos <= end_);
 }
 
+
 bool Bidi::same_direction() const
 {
        return same_direction_;
index 7cb23ef5b499db62d99f25f3e99256c8cdef43cb..4624f19f4da4c2091b0375112bf57d1343d64b77 100644 (file)
@@ -30,7 +30,9 @@ namespace {
 class BranchNamesEqual : public std::unary_function<Branch, bool>
 {
 public:
-       BranchNamesEqual(docstring const & name) : name_(name) {}
+       BranchNamesEqual(docstring const & name)
+               : name_(name)
+       {}
 
        bool operator()(Branch const & branch) const
        {
@@ -39,6 +41,7 @@ public:
 private:
        docstring name_;
 };
+
 }
 
 
index a045deadc97a46cc81ea6c1b9896cc8e704305a4..c5de4c8169adf1ac7c429bead18df300f7ed8c5f 100644 (file)
@@ -282,7 +282,8 @@ public:
 
        /// This is here to force the test to be done whenever parent_buffer
        /// is accessed.
-       Buffer const * parent() const {
+       Buffer const * parent() const
+       {
                // ignore_parent temporarily "orphans" a buffer
                // (e.g. if a child is compiled standalone)
                if (ignore_parent)
@@ -299,7 +300,8 @@ public:
        }
 
        ///
-       void setParent(Buffer const * pb) {
+       void setParent(Buffer const * pb)
+       {
                if (parent_buffer == pb)
                        // nothing to do
                        return;
@@ -324,10 +326,14 @@ public:
        /// \p from initial position
        /// \p to points to the end position
        void updateStatistics(DocIterator & from, DocIterator & to,
-                                                 bool skipNoOutput = true);
+                             bool skipNoOutput = true);
        /// statistics accessor functions
-       int wordCount() const { return word_count_; }
-       int charCount(bool with_blanks) const {
+       int wordCount() const
+       {
+               return word_count_;
+       }
+       int charCount(bool with_blanks) const
+       {
                return char_count_
                + (with_blanks ? blank_count_ : 0);
        }
index f756384bf455a4f9aab2b9b28b50aab3d38f2258..2348ac610348b28d96634f877a79a87bfefa7962 100644 (file)
@@ -265,11 +265,13 @@ bool BufferList::exists(FileName const & fname) const
 
 
 namespace {
+
 struct equivalent_to : public binary_function<FileName, FileName, bool>
 {
        bool operator()(FileName const & x, FileName const & y) const
        { return equivalent(x, y); }
 };
+
 }
 
 
index e3dcb879860ac9edd878c370977e8f44e9cdbcf2..403a2cbbe1fa0d2a46ea3abb3c6f899a58053ab7 100644 (file)
@@ -2127,9 +2127,12 @@ bool BufferParams::isExportable(string const & format) const
 
 
 namespace {
-bool formatSorter(Format const * lhs, Format const * rhs) {
+
+bool formatSorter(Format const * lhs, Format const * rhs)
+{
        return _(lhs->prettyname()) < _(rhs->prettyname());
 }
+
 }
 
 
index bb5ed503871831ede72ed2f1fdeed4f76dc506da..31c95cf764e0803ebe061c6e840bb37c6226e35e 100644 (file)
@@ -105,6 +105,7 @@ T * getInsetByCode(Cursor const & cur, InsetCode code)
        return 0;
 }
 
+
 /// Note that comparing contents can only be used for InsetCommand
 bool findNextInset(DocIterator & dit, vector<InsetCode> const & codes,
        docstring const & contents)
index ea7c5c998ee63da630e8e838dedee1a78fb4cebc..766b698a3ab6019fee063a62c6a0cfca40dc17ac 100644 (file)
@@ -340,6 +340,7 @@ void Changes::merge()
 
 
 namespace {
+
 docstring getLaTeXMarkup(docstring const & macro, docstring const & author,
                         docstring const & chgTime,
                         OutputParams const & runparams)
@@ -379,6 +380,7 @@ docstring getLaTeXMarkup(docstring const & macro, docstring const & author,
 
        return ods.str();
 }
+
 } //namespace anon
 
 
index 8ca70d80be042f550bc7fa4a655414aa0d25c19e..02271e308c603d381c83b089acb81423f30d8853 100644 (file)
@@ -31,8 +31,7 @@ namespace lyx {
 
 Chktex::Chktex(string const & chktex, string const & f, string const & p)
                : cmd(chktex), file(f), path(p)
-{
-}
+{}
 
 
 int Chktex::run(TeXErrors &terr)
index 1a9f42f4800ae21053e61c3963b99612d9c80844..779ac8270a36dbed39b26dbe518431e493cc66d4 100644 (file)
@@ -152,7 +152,7 @@ void CmdDef::release(string const & name)
 
 
 CmdDef::newCmdDefResult CmdDef::newCmdDef(string const & name, 
-                                                                                 string const & def)
+                                         string const & def)
 {
        string const name2 = trim(name);
 
index 290c50a0b2aa6c41c77f2b8215ca0878bd6cc387..609c742e73a28e4f99936a659f85e12276ebb0fe 100644 (file)
@@ -85,6 +85,7 @@ RGBColor rgbFromHexName(string const & x11hexname)
        return c;
 }
 
+
 string const outputLaTeXColor(RGBColor const & color)
 {
        // this routine returns a LaTeX readable color string in the form
index cd54e43bb4b938274276bd539b933af031e507c3..5831f2211114ef6c78e7a313f9e4d3dd1c2958cb 100644 (file)
@@ -97,13 +97,15 @@ size_t DocRange::length() const
 
 class DocPair {
 public:
-       DocPair() {}
+       DocPair()
+       {}
 
        DocPair(DocIterator o_, DocIterator n_)
                : o(o_), n(n_)
        {}
 
-       bool operator!=(DocPair const & rhs) {
+       bool operator!=(DocPair const & rhs)
+       {
                // this might not be intuitive but correct for our purpose
                return o != rhs.o && n != rhs.n;
        }
@@ -146,10 +148,16 @@ public:
        {}
 
        /// Returns the from pair
-       DocPair from() const { return DocPair(o.from, n.from); }
+       DocPair from() const
+       {
+               return DocPair(o.from, n.from);
+       }
 
        /// Returns the to pair
-       DocPair to() const { return DocPair(o.to, n.to); }
+       DocPair to() const
+       {
+               return DocPair(o.to, n.to);
+       }
 
        DocRange o;
        DocRange n;
@@ -181,7 +189,8 @@ static DocRangePair stepIntoInset(DocPair const & inset_location)
 template<class T>
 class compl_vector {
 public:
-       compl_vector() {}
+       compl_vector()
+       {}
 
        void reset(T const & def)
        {
@@ -223,7 +232,8 @@ public:
        {}
 
        ///
-       ~Impl() {}
+       ~Impl()
+       {}
 
        // Algorithm to find the shortest edit string. This algorithm 
        // only needs a linear amount of memory (linear with the sum
@@ -235,7 +245,8 @@ public:
        bool abort_;
 
        ///
-       QString status() {
+       QString status()
+       {
                QString status;
                status += toqstr("recursion level:") + " " + QString::number(recursion_level_)
                        + " " + toqstr("differences:") + " " + QString::number(D_);
@@ -444,7 +455,8 @@ static bool equal(Inset const * i_o, Inset const * i_n)
 }
 
 
-static bool equal(DocIterator & o, DocIterator & n) {
+static bool equal(DocIterator & o, DocIterator & n)
+{
        // Explicitly check for this, so we won't call
        // Paragraph::getChar for the last pos.
        bool const o_lastpos = o.pos() == o.lastpos();
index 76721835e61f271c181082ad7e3e04f0bf3c193f..61df9d062dbb8e136d1154cb7b2e4d592c264100 100644 (file)
@@ -54,7 +54,8 @@ static FileName cache_dir;
 
 class CacheItem {
 public:
-       CacheItem() {}
+       CacheItem()
+       {}
        CacheItem(FileName const & orig_from, string const & to_format,
                  time_t t, unsigned long c)
                : timestamp(t), checksum(c)
@@ -67,7 +68,8 @@ public:
                                     << ' ' << to_format << ' ' << cache_name
                                     << ' ' << long(timestamp) << ' ' << checksum << '.');
        }
-       ~CacheItem() {}
+       ~CacheItem()
+       {}
        FileName cache_name;
        time_t timestamp;
        unsigned long checksum;
index 4c9e8800927058d6dd0548d92579e19be9eb1f59..6926dab322a86a99dd2c01dcf501f9d1287ddf37 100644 (file)
@@ -32,6 +32,7 @@ Point::Point(int x, int y)
        LASSERT(y <  1000000, /**/);
 }
 
+
 // just a helper to be able to set a breakpoint
 void lyxbreaker(void const * data, const char * hint, int size)
 {
index 1349c3dcbe300656c522682514850ed9c4363fe0..21331e8e1878ba0333c49dec58232f83cab225f9 100644 (file)
@@ -109,6 +109,7 @@ bool Counter::read(Lexer & lex)
        return getout;
 }
 
+
 void Counter::set(int v)
 {
        value_ = v;
@@ -363,7 +364,6 @@ char hebrewCounter(int const n)
 }
 
 
-
 // On the special cases, see http://mathworld.wolfram.com/RomanNumerals.html
 // and for a list of roman numerals up to and including 3999, see 
 // http://www.research.att.com/~njas/sequences/a006968.txt. (Thanks to Joost
index e38ca5ec1319db52428917da794d0c2b56daafdf..8afbdf3cb45942aa580b6bf5c9a356c567b7077d 100644 (file)
@@ -214,9 +214,10 @@ bool bruteFind3(Cursor & cur, int x, int y, bool up)
        for ( ; it != et; it.forwardPos()) {
                // avoid invalid nesting when selecting
                if (bv.cursorStatus(it) == CUR_INSIDE
-                               && (!cur.selection() || positionable(it, cur.realAnchor()))) {
-                       // If this function is ever used again, check whether this
-                       // is the same as "bv.getPos(it, false)" with boundary = false.
+                   && (!cur.selection() || positionable(it, cur.realAnchor()))) {
+                       // If this function is ever used again, check
+                       // whether this is the same as "bv.getPos(it,
+                       // false)" with boundary = false.
                        Point p = bv.getPos(it);
                        int xo = p.x_;
                        int yo = p.y_;
@@ -638,8 +639,9 @@ bool Cursor::posVisRight(bool skip_inset)
        new_cur.boundary(false);
        if (!skip_inset &&
                text()->checkAndActivateInsetVisual(new_cur, right_pos >= pos(), false)) {
-               // we actually move the cursor at the end of this function, for now
-               // we just keep track of the new position in new_cur...
+               // we actually move the cursor at the end of this
+               // function, for now we just keep track of the new
+               // position in new_cur...
                LYXERR(Debug::RTL, "entering inset at: " << new_cur.pos());
        }
 
@@ -652,8 +654,9 @@ bool Cursor::posVisRight(bool skip_inset)
                        return false;
                }
                
-               // we actually move the cursor at the end of this function, for now 
-               // just keep track of the new position in new_cur...
+               // we actually move the cursor at the end of this
+               // function, for now just keep track of the new
+               // position in new_cur...
                LYXERR(Debug::RTL, "right edge, moving: " << int(new_cur.pit()) << "," 
                        << int(new_cur.pos()) << "," << (new_cur.boundary() ? 1 : 0));
 
@@ -661,28 +664,33 @@ bool Cursor::posVisRight(bool skip_inset)
        // normal movement to the right
        else {
                new_cur = *this;
-               // Recall, if the cursor is at position 'x', that means *before* 
-               // the character at position 'x'. In RTL, "before" means "to the 
-               // right of", in LTR, "to the left of". So currently our situation
-               // is this: the position to our right is 'right_pos' (i.e., we're 
-               // currently to the left of 'right_pos'). In order to move to the 
-               // right, it depends whether or not the character at 'right_pos' is RTL.
+               // Recall, if the cursor is at position 'x', that
+               // means *before* the character at position 'x'. In
+               // RTL, "before" means "to the right of", in LTR, "to
+               // the left of". So currently our situation is this:
+               // the position to our right is 'right_pos' (i.e.,
+               // we're currently to the left of 'right_pos'). In
+               // order to move to the right, it depends whether or
+               // not the character at 'right_pos' is RTL.
                new_pos_is_RTL = paragraph().getFontSettings(
                        buffer()->params(), right_pos).isVisibleRightToLeft();
-               // If the character at 'right_pos' *is* LTR, then in order to move to
-               // the right of it, we need to be *after* 'right_pos', i.e., move to
-               // position 'right_pos' + 1.
+               // If the character at 'right_pos' *is* LTR, then in
+               // order to move to the right of it, we need to be
+               // *after* 'right_pos', i.e., move to position
+               // 'right_pos' + 1.
                if (!new_pos_is_RTL) {
                        new_cur.pos() = right_pos + 1;
                        // set the boundary to true in two situations:
                        if (
-                       // 1. if new_pos is now lastpos, and we're in an RTL paragraph
-                       // (this means that we're moving right to the end of an LTR chunk
+                       // 1. if new_pos is now lastpos, and we're in
+                       // an RTL paragraph (this means that we're
+                       // moving right to the end of an LTR chunk
                        // which is at the end of an RTL paragraph);
                                (new_cur.pos() == lastpos()
                                 && paragraph().isRTL(buffer()->params()))
-                       // 2. if the position *after* right_pos is RTL (we want to be 
-                       // *after* right_pos, not before right_pos + 1!)
+                       // 2. if the position *after* right_pos is RTL
+                       // (we want to be *after* right_pos, not
+                       // before right_pos + 1!)
                                || paragraph().getFontSettings(buffer()->params(),
                                                new_cur.pos()).isVisibleRightToLeft()
                        )
@@ -690,9 +698,9 @@ bool Cursor::posVisRight(bool skip_inset)
                        else // set the boundary to false
                                new_cur.boundary(false);
                }
-               // Otherwise (if the character at position 'right_pos' is RTL), then
-               // moving to the right of it is as easy as setting the new position
-               // to 'right_pos'.
+               // Otherwise (if the character at position 'right_pos'
+               // is RTL), then moving to the right of it is as easy
+               // as setting the new position to 'right_pos'.
                else {
                        new_cur.pos() = right_pos;
                        new_cur.boundary(false);
@@ -731,8 +739,9 @@ bool Cursor::posVisLeft(bool skip_inset)
        new_cur.boundary(false);
        if (!skip_inset && 
                text()->checkAndActivateInsetVisual(new_cur, left_pos >= pos(), true)) {
-               // we actually move the cursor at the end of this function, for now 
-               // we just keep track of the new position in new_cur...
+               // we actually move the cursor at the end of this
+               // function, for now we just keep track of the new
+               // position in new_cur...
                LYXERR(Debug::RTL, "entering inset at: " << new_cur.pos());
        }
 
@@ -745,8 +754,9 @@ bool Cursor::posVisLeft(bool skip_inset)
                        return false;
                }
                
-               // we actually move the cursor at the end of this function, for now 
-               // just keep track of the new position in new_cur...
+               // we actually move the cursor at the end of this
+               // function, for now just keep track of the new
+               // position in new_cur...
                LYXERR(Debug::RTL, "left edge, moving: " << int(new_cur.pit()) << "," 
                        << int(new_cur.pos()) << "," << (new_cur.boundary() ? 1 : 0));
 
@@ -754,28 +764,33 @@ bool Cursor::posVisLeft(bool skip_inset)
        // normal movement to the left
        else {
                new_cur = *this;
-               // Recall, if the cursor is at position 'x', that means *before* 
-               // the character at position 'x'. In RTL, "before" means "to the 
-               // right of", in LTR, "to the left of". So currently our situation
-               // is this: the position to our left is 'left_pos' (i.e., we're 
-               // currently to the right of 'left_pos'). In order to move to the 
-               // left, it depends whether or not the character at 'left_pos' is RTL.
+               // Recall, if the cursor is at position 'x', that
+               // means *before* the character at position 'x'. In
+               // RTL, "before" means "to the right of", in LTR, "to
+               // the left of". So currently our situation is this:
+               // the position to our left is 'left_pos' (i.e., we're
+               // currently to the right of 'left_pos'). In order to
+               // move to the left, it depends whether or not the
+               // character at 'left_pos' is RTL.
                new_pos_is_RTL = paragraph().getFontSettings(
                        buffer()->params(), left_pos).isVisibleRightToLeft();
-               // If the character at 'left_pos' *is* RTL, then in order to move to
-               // the left of it, we need to be *after* 'left_pos', i.e., move to
-               // position 'left_pos' + 1.
+               // If the character at 'left_pos' *is* RTL, then in
+               // order to move to the left of it, we need to be
+               // *after* 'left_pos', i.e., move to position
+               // 'left_pos' + 1.
                if (new_pos_is_RTL) {
                        new_cur.pos() = left_pos + 1;
                        // set the boundary to true in two situations:
                        if (
-                       // 1. if new_pos is now lastpos and we're in an LTR paragraph
-                       // (this means that we're moving left to the end of an RTL chunk
+                       // 1. if new_pos is now lastpos and we're in
+                       // an LTR paragraph (this means that we're
+                       // moving left to the end of an RTL chunk
                        // which is at the end of an LTR paragraph);
                                (new_cur.pos() == lastpos()
                                 && !paragraph().isRTL(buffer()->params()))
-                       // 2. if the position *after* left_pos is not RTL (we want to be 
-                       // *after* left_pos, not before left_pos + 1!)
+                       // 2. if the position *after* left_pos is not
+                       // RTL (we want to be *after* left_pos, not
+                       // before left_pos + 1!)
                                || !paragraph().getFontSettings(buffer()->params(),
                                                new_cur.pos()).isVisibleRightToLeft()
                        )
@@ -783,9 +798,9 @@ bool Cursor::posVisLeft(bool skip_inset)
                        else // set the boundary to false
                                new_cur.boundary(false);
                }
-               // Otherwise (if the character at position 'left_pos' is LTR), then
-               // moving to the left of it is as easy as setting the new position
-               // to 'left_pos'.
+               // Otherwise (if the character at position 'left_pos'
+               // is LTR), then moving to the left of it is as easy
+               // as setting the new position to 'left_pos'.
                else {
                        new_cur.pos() = left_pos;
                        new_cur.boundary(false);
@@ -818,14 +833,16 @@ void Cursor::getSurroundingPos(pos_type & left_pos, pos_type & right_pos)
 
        LYXERR(Debug::RTL, "bidi: " << row.pos() << "--" << row.endpos());
 
-       // The cursor is painted *before* the character at pos(), or, if 'boundary'
-       // is true, *after* the character at (pos() - 1). So we already have one
-       // known position around the cursor:
+       // The cursor is painted *before* the character at pos(), or,
+       // if 'boundary' is true, *after* the character at (pos() -
+       // 1). So we already have one known position around the
+       // cursor:
        pos_type const known_pos = boundary() && pos() > 0 ? pos() - 1 : pos();
        
-       // edge case: if we're at the end of the paragraph, things are a little 
-       // different (because lastpos is a position which does not really "exist" 
-       // --- there's no character there yet).
+       // edge case: if we're at the end of the paragraph, things are
+       // a little different (because lastpos is a position which
+       // does not really "exist" --- there's no character there
+       // yet).
        if (known_pos == lastpos()) {
                if (par.isRTL(buf.params())) {
                        left_pos = -1;
@@ -838,28 +855,31 @@ void Cursor::getSurroundingPos(pos_type & left_pos, pos_type & right_pos)
                return;
        }
        
-       // Whether 'known_pos' is to the left or to the right of the cursor depends
-       // on whether it is an RTL or LTR character...
+       // Whether 'known_pos' is to the left or to the right of the
+       // cursor depends on whether it is an RTL or LTR character...
        bool const cur_is_RTL = 
                par.getFontSettings(buf.params(), known_pos).isVisibleRightToLeft();
        // ... in the following manner:
-       // For an RTL character, "before" means "to the right" and "after" means
-       // "to the left"; and for LTR, it's the reverse. So, 'known_pos' is to the
-       // right of the cursor if (RTL && boundary) or (!RTL && !boundary):
+       // For an RTL character, "before"
+       // means "to the right" and "after" means "to the left"; and
+       // for LTR, it's the reverse. So, 'known_pos' is to the right
+       // of the cursor if (RTL && boundary) or (!RTL && !boundary):
        bool const known_pos_on_right = cur_is_RTL == boundary();
 
-       // So we now know one of the positions surrounding the cursor. Let's 
-       // determine the other one:     
+       // So we now know one of the positions surrounding the cursor.
+       // Let's determine the other one:
        if (known_pos_on_right) {
                right_pos = known_pos;
                // *visual* position of 'left_pos':
                pos_type v_left_pos = bidi.log2vis(right_pos) - 1;
-               // If the position we just identified as 'left_pos' is a "skipped 
-               // separator" (a separator which is at the logical end of a row,
-               // except for the last row in a paragraph; such separators are not
-               // painted, so they "are not really there"; note that in bidi text,
-               // such a separator could appear visually in the middle of a row),
-               // set 'left_pos' to the *next* position to the left.
+               // If the position we just identified as 'left_pos' is
+               // a "skipped separator" (a separator which is at the
+               // logical end of a row, except for the last row in a
+               // paragraph; such separators are not painted, so they
+               // "are not really there"; note that in bidi text,
+               // such a separator could appear visually in the
+               // middle of a row), set 'left_pos' to the *next*
+               // position to the left.
                if (bidi.inRange(v_left_pos) 
                                && bidi.vis2log(v_left_pos) + 1 == row.endpos() 
                                && row.endpos() < lastpos()
@@ -871,8 +891,9 @@ void Cursor::getSurroundingPos(pos_type & left_pos, pos_type & right_pos)
                        left_pos = -1;
                else
                        left_pos = bidi.vis2log(v_left_pos);
-               // If the position we identified as 'right_pos' is a "skipped 
-               // separator", set 'right_pos' to the *next* position to the right.
+               // If the position we identified as 'right_pos' is a
+               // "skipped separator", set 'right_pos' to the *next*
+               // position to the right.
                if (right_pos + 1 == row.endpos() && row.endpos() < lastpos() 
                                && par.isSeparator(right_pos)) {
                        pos_type const v_right_pos = bidi.log2vis(right_pos) + 1;
@@ -886,8 +907,9 @@ void Cursor::getSurroundingPos(pos_type & left_pos, pos_type & right_pos)
                left_pos = known_pos;
                // *visual* position of 'right_pos'
                pos_type v_right_pos = bidi.log2vis(left_pos) + 1;
-               // If the position we just identified as 'right_pos' is a "skipped 
-               // separator", set 'right_pos' to the *next* position to the right.
+               // If the position we just identified as 'right_pos'
+               // is a "skipped separator", set 'right_pos' to the
+               // *next* position to the right.
                if (bidi.inRange(v_right_pos) 
                                && bidi.vis2log(v_right_pos) + 1 == row.endpos() 
                                && row.endpos() < lastpos()
@@ -899,8 +921,9 @@ void Cursor::getSurroundingPos(pos_type & left_pos, pos_type & right_pos)
                        right_pos = -1;
                else
                        right_pos = bidi.vis2log(v_right_pos);
-               // If the position we identified as 'left_pos' is a "skipped 
-               // separator", set 'left_pos' to the *next* position to the left.
+               // If the position we identified as 'left_pos' is a
+               // "skipped separator", set 'left_pos' to the *next*
+               // position to the left.
                if (left_pos + 1 == row.endpos() && row.endpos() < lastpos() 
                                && par.isSeparator(left_pos)) {
                        pos_type const v_left_pos = bidi.log2vis(left_pos) - 1;
@@ -921,16 +944,16 @@ bool Cursor::posVisToNewRow(bool movingLeft)
        Row const & row = textRow();
        bool par_is_LTR = !par.isRTL(buf.params());
 
-       // Inside a table, determining whether to move to the next or previous row
-       // should be done based on the table's direction. 
+       // Inside a table, determining whether to move to the next or
+       // previous row should be done based on the table's direction.
        int s = depth() - 1;
        if (s >= 1 && (*this)[s].inset().asInsetTabular()) {
                par_is_LTR = !(*this)[s].inset().asInsetTabular()->isRightToLeft(*this);
                LYXERR(Debug::RTL, "Inside table! par_is_LTR=" << (par_is_LTR ? 1 : 0));
        }
        
-       // if moving left in an LTR paragraph or moving right in an RTL one, 
-       // move to previous row
+       // if moving left in an LTR paragraph or moving right in an
+       // RTL one, move to previous row
        if (par_is_LTR == movingLeft) {
                if (row.pos() == 0) { // we're at first row in paragraph
                        if (pit() == 0) // no previous paragraph! don't move
@@ -944,8 +967,8 @@ bool Cursor::posVisToNewRow(bool movingLeft)
                        boundary(false);
                }
        }
-       // if moving left in an RTL paragraph or moving right in an LTR one, 
-       // move to next row
+       // if moving left in an RTL paragraph or moving right in an
+       // LTR one, move to next row
        else {
                if (row.endpos() == lastpos()) { // we're at last row in paragraph
                        if (pit() == lastpit()) // last paragraph! don't move
@@ -987,30 +1010,43 @@ void Cursor::posVisToRowExtremity(bool left)
                else {
                        pos() = bidi.vis2log(row.pos());
 
-                       // Moving to the leftmost position in the row, the cursor should
-                       // normally be placed to the *left* of the leftmost position.
-                       // A very common exception, though, is if the leftmost character 
-                       // also happens to be the separator at the (logical) end of the row
-                       // --- in this case, the separator is positioned beyond the left 
-                       // margin, and we don't want to move the cursor there (moving to 
-                       // the left of the separator is equivalent to moving to the next
-                       // line). So, in this case we actually want to place the cursor 
-                       // to the *right* of the leftmost position (the separator). 
-                       // Another exception is if we're moving to the logically last 
-                       // position in the row, which is *not* a separator: this means
-                       // that the entire row has no separators (if there were any, the 
-                       // row would have been broken there); and therefore in this case
-                       // we also move to the *right* of the last position (this indicates
-                       // to the user that there is no space after this position, and is 
-                       // consistent with the behavior in the middle of a row --- moving
-                       // right or left moves to the next/previous character; if we were
-                       // to move to the *left* of this position, that would simulate 
-                       // a separator which is not really there!). 
-                       // Finally, there is an exception to the previous exception: if 
-                       // this non-separator-but-last-position-in-row is an inset, then
-                       // we *do* want to stay to the left of it anyway: this is the 
+                       // Moving to the leftmost position in the row,
+                       // the cursor should normally be placed to the
+                       // *left* of the leftmost position. A very
+                       // common exception, though, is if the
+                       // leftmost character also happens to be the
+                       // separator at the (logical) end of the row
+                       // --- in this case, the separator is
+                       // positioned beyond the left margin, and we
+                       // don't want to move the cursor there (moving
+                       // to the left of the separator is equivalent
+                       // to moving to the next line). So, in this
+                       // case we actually want to place the cursor
+                       // to the *right* of the leftmost position
+                       // (the separator). Another exception is if
+                       // we're moving to the logically last position
+                       // in the row, which is *not* a separator:
+                       // this means that the entire row has no
+                       // separators (if there were any, the row
+                       // would have been broken there); and
+                       // therefore in this case we also move to the
+                       // *right* of the last position (this
+                       // indicates to the user that there is no
+                       // space after this position, and is
+                       // consistent with the behavior in the middle
+                       // of a row --- moving right or left moves to
+                       // the next/previous character; if we were to
+                       // move to the *left* of this position, that
+                       // would simulate a separator which is not
+                       // really there!). Finally, there is an
+                       // exception to the previous exception: if
+                       // this non-separator-but-last-position-in-row
+                       // is an inset, then we *do* want to stay to
+                       // the left of it anyway: this is the
                        // "boundary" which we simulate at insets.
-                       // Another exception is when row.endpos() is 0.
+                       
+                       // Another exception is when row.endpos() is
+                       // 0.
                        
                        // do we want to be to the right of pos?
                        // as explained above, if at last pos in row, stay to the right
@@ -1036,30 +1072,41 @@ void Cursor::posVisToRowExtremity(bool left)
                else {
                        pos() = row.endpos() > 0 ? bidi.vis2log(row.endpos() - 1) : 0;
 
-                       // Moving to the rightmost position in the row, the cursor should
-                       // normally be placed to the *right* of the rightmost position.
-                       // A very common exception, though, is if the rightmost character 
-                       // also happens to be the separator at the (logical) end of the row
-                       // --- in this case, the separator is positioned beyond the right 
-                       // margin, and we don't want to move the cursor there (moving to 
-                       // the right of the separator is equivalent to moving to the next
-                       // line). So, in this case we actually want to place the cursor 
-                       // to the *left* of the rightmost position (the separator). 
-                       // Another exception is if we're moving to the logically last 
-                       // position in the row, which is *not* a separator: this means
-                       // that the entire row has no separators (if there were any, the 
-                       // row would have been broken there); and therefore in this case
-                       // we also move to the *left* of the last position (this indicates
-                       // to the user that there is no space after this position, and is 
-                       // consistent with the behavior in the middle of a row --- moving
-                       // right or left moves to the next/previous character; if we were
-                       // to move to the *right* of this position, that would simulate 
-                       // a separator which is not really there!). 
-                       // Finally, there is an exception to the previous exception: if 
-                       // this non-separator-but-last-position-in-row is an inset, then
-                       // we *do* want to stay to the right of it anyway: this is the 
-                       // "boundary" which we simulate at insets.
-                       // Another exception is when row.endpos() is 0.
+                       // Moving to the rightmost position in the
+                       // row, the cursor should normally be placed
+                       // to the *right* of the rightmost position. A
+                       // very common exception, though, is if the
+                       // rightmost character also happens to be the
+                       // separator at the (logical) end of the row
+                       // --- in this case, the separator is
+                       // positioned beyond the right margin, and we
+                       // don't want to move the cursor there (moving
+                       // to the right of the separator is equivalent
+                       // to moving to the next line). So, in this
+                       // case we actually want to place the cursor
+                       // to the *left* of the rightmost position
+                       // (the separator). Another exception is if
+                       // we're moving to the logically last position
+                       // in the row, which is *not* a separator:
+                       // this means that the entire row has no
+                       // separators (if there were any, the row
+                       // would have been broken there); and
+                       // therefore in this case we also move to the
+                       // *left* of the last position (this indicates
+                       // to the user that there is no space after
+                       // this position, and is consistent with the
+                       // behavior in the middle of a row --- moving
+                       // right or left moves to the next/previous
+                       // character; if we were to move to the
+                       // *right* of this position, that would
+                       // simulate a separator which is not really
+                       // there!). Finally, there is an exception to
+                       // the previous exception: if this
+                       // non-separator-but-last-position-in-row is
+                       // an inset, then we *do* want to stay to the
+                       // right of it anyway: this is the "boundary"
+                       // which we simulate at insets. Another
+                       // exception is when row.endpos() is 0.
                        
                        // do we want to be to the left of pos?
                        // as explained above, if at last pos in row, stay to the left,
@@ -1915,6 +1962,7 @@ bool Cursor::atFirstOrLastRow(bool up)
        return false;
 }
 
+
 bool Cursor::upDownInText(bool up, bool & updateNeeded)
 {
        LASSERT(text(), /**/);
@@ -1932,14 +1980,16 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
                setTargetX(xo);
        else if (xo - textTargetOffset() != x_target() &&
                                         depth() == beforeDispatchCursor_.depth()) {
-               // In text mode inside the line (not left or right) possibly set a new target_x,
-               // but only if we are somewhere else than the previous target-offset.
+               // In text mode inside the line (not left or right)
+               // possibly set a new target_x, but only if we are
+               // somewhere else than the previous target-offset.
                
-               // We want to keep the x-target on subsequent up/down movements
-               // that cross beyond the end of short lines. Thus a special
-               // handling when the cursor is at the end of line: Use the new
-               // x-target only if the old one was before the end of line
-               // or the old one was after the beginning of the line
+               // We want to keep the x-target on subsequent up/down
+               // movements that cross beyond the end of short lines.
+               // Thus a special handling when the cursor is at the
+               // end of line: Use the new x-target only if the old
+               // one was before the end of line or the old one was
+               // after the beginning of the line
                bool inRTL = isWithinRtlParagraph(*this);
                bool left;
                bool right;
@@ -2128,6 +2178,7 @@ void Cursor::errorMessage(docstring const & msg) const
 
 
 namespace {
+
 docstring parbreak(Cursor const * cur)
 {
        odocstringstream os;
@@ -2138,6 +2189,7 @@ docstring parbreak(Cursor const * cur)
                os << '\n';
        return os.str();
 }
+
 }
 
 
@@ -2267,9 +2319,9 @@ void Cursor::noScreenUpdate() const
 
 Font Cursor::getFont() const
 {
-       // The logic here should more or less match to the Cursor::setCurrentFont
-       // logic, i.e. the cursor height should give a hint what will happen
-       // if a character is entered.
+       // The logic here should more or less match to the
+       // Cursor::setCurrentFont logic, i.e. the cursor height should
+       // give a hint what will happen if a character is entered.
        
        // HACK. far from being perfect...
 
index 9a336a194a389b11263bd808feed7425285b9882..65344758855b9d5041fe1d0d3e517579497c519a 100644 (file)
@@ -848,6 +848,7 @@ void copyInset(Cursor const & cur, Inset * inset, docstring const & plaintext)
        putClipboard(theCuts[0].first, theCuts[0].second, plaintext);
 }
 
+
 namespace {
 
 void copySelectionToStack(Cursor const & cur, CutStack & cutstack)
index fdbbd46a0665dc504ff67508cb41208b8a39f5b6..835130717fc253a33a74d343a95ddd70718210ee 100644 (file)
@@ -108,7 +108,8 @@ bool DepTable::sumchange() const
        DepList::const_iterator cit = deplist.begin();
        DepList::const_iterator end = deplist.end();
        for (; cit != end; ++cit) {
-               if (cit->second.changed()) return true;
+               if (cit->second.changed())
+                       return true;
        }
        return false;
 }
@@ -144,9 +145,8 @@ bool DepTable::ext_exist(string const & ext) const
        DepList::const_iterator cit = deplist.begin();
        DepList::const_iterator end = deplist.end();
        for (; cit != end; ++cit) {
-               if (suffixIs(cit->first.absFileName(), ext)) {
+               if (suffixIs(cit->first.absFileName(), ext))
                        return true;
-               }
        }
        return false;
 }
index 420c782c37de8dc01092502150a71ee41c749c3a..35b23a98b72f147018160be7941fc18002805c98 100644 (file)
@@ -42,6 +42,7 @@ DocIterator::DocIterator()
        : boundary_(false), inset_(0), buffer_(0)
 {}
 
+
 // We could be able to get rid of this if only every BufferView were
 // associated to a buffer on construction.
 DocIterator::DocIterator(Buffer * buf)
index 61127108a44765e72a9f22ebe9ddb818844467b4..77c9e309ed1c79fbb60ec94f5e266e5741ddf971 100644 (file)
@@ -40,7 +40,8 @@ typedef map<string, Speller> Spellers;
 
 struct EnchantChecker::Private
 {
-       Private() {}
+       Private()
+       {}
 
        ~Private();
 
@@ -60,9 +61,8 @@ EnchantChecker::Private::~Private()
        Spellers::iterator it = spellers_.begin();
        Spellers::iterator end = spellers_.end();
 
-       for (; it != end; ++it) {
+       for (; it != end; ++it)
                delete it->second.speller;
-       }
 }
 
 
@@ -97,9 +97,9 @@ enchant::Dict * EnchantChecker::Private::speller(string const & lang)
 }
 
 
-EnchantChecker::EnchantChecker(): d(new Private)
-{
-}
+EnchantChecker::EnchantChecker()
+       : d(new Private)
+{}
 
 
 EnchantChecker::~EnchantChecker()
index 3325301a7c579082ca3844c087f536cf6802749d..298fc6a0ae5e4e56c452c708980212a3e3526269 100644 (file)
@@ -852,8 +852,7 @@ Encoding const * Encodings::fromLaTeXName(string const & n) const
 
 
 Encodings::Encodings()
-{
-}
+{}
 
 
 void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
index 27b6a51ba37a03c28c3fc375d22125a0fe06acdc..d7494707d2ee5dcaba9d939aa48db67d861196d2 100644 (file)
@@ -101,6 +101,7 @@ FontInfo::FontInfo()
        *this = sane_font;
 }
 
+
 /// Decreases font size_ by one
 FontInfo & FontInfo::decSize()
 {
@@ -346,115 +347,116 @@ Color FontInfo::realColor() const
 
 namespace {
 
-       void appendSep(string & s1, string const & s2) {
-               if (s2.empty()) 
-                       return;
-               s1 += s1.empty() ? "" : "\n";
-               s1 += s2;
-       }
+void appendSep(string & s1, string const & s2)
+{
+       if (s2.empty())
+               return;
+       s1 += s1.empty() ? "" : "\n";
+       s1 += s2;
+}
 
 
-       string makeCSSTag(string const & key, string const & val)
-       {
-               return key + ": " + val + ";";
-       }
+string makeCSSTag(string const & key, string const & val)
+{
+       return key + ": " + val + ";";
+}
 
 
-       string getFamilyCSS(FontFamily const & f)
-       {
-               switch (f) {
-               case ROMAN_FAMILY: 
-                       return "serif";
-               case SANS_FAMILY: 
-                       return "sans-serif";
-               case TYPEWRITER_FAMILY: 
-                       return "monospace";
-               case SYMBOL_FAMILY:
-               case CMR_FAMILY:
-               case CMSY_FAMILY:
-               case CMM_FAMILY:
-               case CMEX_FAMILY:
-               case MSA_FAMILY:
-               case MSB_FAMILY:
-               case EUFRAK_FAMILY:
-               case RSFS_FAMILY:
-               case WASY_FAMILY:
-               case ESINT_FAMILY:
-               case INHERIT_FAMILY:
-               case IGNORE_FAMILY:
-                       break;
-               }
-               return "";
+string getFamilyCSS(FontFamily const & f)
+{
+       switch (f) {
+       case ROMAN_FAMILY:
+               return "serif";
+       case SANS_FAMILY:
+               return "sans-serif";
+       case TYPEWRITER_FAMILY:
+               return "monospace";
+       case SYMBOL_FAMILY:
+       case CMR_FAMILY:
+       case CMSY_FAMILY:
+       case CMM_FAMILY:
+       case CMEX_FAMILY:
+       case MSA_FAMILY:
+       case MSB_FAMILY:
+       case EUFRAK_FAMILY:
+       case RSFS_FAMILY:
+       case WASY_FAMILY:
+       case ESINT_FAMILY:
+       case INHERIT_FAMILY:
+       case IGNORE_FAMILY:
+               break;
        }
+       return "";
+}
 
 
-       string getSeriesCSS(FontSeries const & s)
-       {
-               switch (s) {
-               case MEDIUM_SERIES: 
-                       return "normal";
-               case BOLD_SERIES: 
-                       return "bold";
-               case INHERIT_SERIES:
-               case IGNORE_SERIES:
-                 break;
-               }
-               return "";
+string getSeriesCSS(FontSeries const & s)
+{
+       switch (s) {
+       case MEDIUM_SERIES:
+               return "normal";
+       case BOLD_SERIES:
+               return "bold";
+       case INHERIT_SERIES:
+       case IGNORE_SERIES:
+               break;
        }
+       return "";
+}
 
 
-       string getShapeCSS(FontShape const & s)
-       {
-               string fs = "normal";
-               string fv = "normal";
-               switch (s) {
-               case UP_SHAPE: break;
-               case ITALIC_SHAPE: fs = "italic"; break;
-               case SLANTED_SHAPE: fs = "oblique"; break;
-               case SMALLCAPS_SHAPE: fv = "small-caps"; break;
-               case IGNORE_SHAPE: 
-               case INHERIT_SHAPE:
-                       fs = ""; fv = ""; break;
-               }
-               string retval;
-               if (!fs.empty())
-                       appendSep(retval, makeCSSTag("font-style", fs));
-               if (!fv.empty())
-                       appendSep(retval, makeCSSTag("font-variant", fv));
-               return retval;
+string getShapeCSS(FontShape const & s)
+{
+       string fs = "normal";
+       string fv = "normal";
+       switch (s) {
+       case UP_SHAPE: break;
+       case ITALIC_SHAPE: fs = "italic"; break;
+       case SLANTED_SHAPE: fs = "oblique"; break;
+       case SMALLCAPS_SHAPE: fv = "small-caps"; break;
+       case IGNORE_SHAPE:
+       case INHERIT_SHAPE:
+               fs = ""; fv = ""; break;
        }
+       string retval;
+       if (!fs.empty())
+               appendSep(retval, makeCSSTag("font-style", fs));
+       if (!fv.empty())
+               appendSep(retval, makeCSSTag("font-variant", fv));
+       return retval;
+}
 
 
-       string getSizeCSS(FontSize const & s)
-       {
-               switch (s) {
-               case FONT_SIZE_TINY: 
-                       return "xx-small";
-               case FONT_SIZE_SCRIPT: 
-                       return "x-small";
-               case FONT_SIZE_FOOTNOTE: 
-               case FONT_SIZE_SMALL: 
-                       return "small";
-               case FONT_SIZE_NORMAL: 
-                       return "medium";
-               case FONT_SIZE_LARGE: 
-                       return "large";
-               case FONT_SIZE_LARGER: 
-               case FONT_SIZE_LARGEST: 
-                       return "x-large";
-               case FONT_SIZE_HUGE: 
-               case FONT_SIZE_HUGER: 
-                       return "xx-large";
-               case FONT_SIZE_INCREASE: 
-                       return "larger";
-               case FONT_SIZE_DECREASE: 
-                       return "smaller";
-               case FONT_SIZE_IGNORE: 
-               case FONT_SIZE_INHERIT: 
-                               break;
-               }       
-               return "";
+string getSizeCSS(FontSize const & s)
+{
+       switch (s) {
+       case FONT_SIZE_TINY:
+               return "xx-small";
+       case FONT_SIZE_SCRIPT:
+               return "x-small";
+       case FONT_SIZE_FOOTNOTE:
+       case FONT_SIZE_SMALL:
+               return "small";
+       case FONT_SIZE_NORMAL:
+               return "medium";
+       case FONT_SIZE_LARGE:
+               return "large";
+       case FONT_SIZE_LARGER:
+       case FONT_SIZE_LARGEST:
+               return "x-large";
+       case FONT_SIZE_HUGE:
+       case FONT_SIZE_HUGER:
+               return "xx-large";
+       case FONT_SIZE_INCREASE:
+               return "larger";
+       case FONT_SIZE_DECREASE:
+               return "smaller";
+       case FONT_SIZE_IGNORE:
+       case FONT_SIZE_INHERIT:
+               break;
        }
+       return "";
+}
        
 } // namespace anonymous
 
index 71699d64adc11708aaeb2075705793b1ba0f9c2f..7e634b48becd98a8d3799ee3b80f47379d88a3d1 100644 (file)
@@ -59,7 +59,8 @@ string const token_socket_format("$$a");
 class FormatNamesEqual : public unary_function<Format, bool> {
 public:
        FormatNamesEqual(string const & name)
-               : name_(name) {}
+               : name_(name)
+       {}
        bool operator()(Format const & f) const
        {
                return f.name() == name_;
@@ -72,7 +73,8 @@ private:
 class FormatExtensionsEqual : public unary_function<Format, bool> {
 public:
        FormatExtensionsEqual(string const & extension)
-               : extension_(extension) {}
+               : extension_(extension)
+       {}
        bool operator()(Format const & f) const
        {
                return f.hasExtension(extension_);
@@ -85,7 +87,8 @@ private:
 class FormatMimeEqual : public unary_function<Format, bool> {
 public:
        FormatMimeEqual(string const & mime)
-               : mime_(mime) {}
+               : mime_(mime)
+       {}
        bool operator()(Format const & f) const
        {
                // The test for empty mime strings is needed since we allow
@@ -100,7 +103,8 @@ private:
 class FormatPrettyNameEqual : public unary_function<Format, bool> {
 public:
        FormatPrettyNameEqual(string const & prettyname)
-               : prettyname_(prettyname) {}
+               : prettyname_(prettyname)
+       {}
        bool operator()(Format const & f) const
        {
                return f.prettyname() == prettyname_;
@@ -763,8 +767,10 @@ string const Formats::extensions(string const & name) const
 
 
 namespace {
+
 typedef Translator<OutputParams::FLAVOR, string> FlavorTranslator;
 
+
 FlavorTranslator initFlavorTranslator()
 {
        FlavorTranslator f(OutputParams::LATEX, "latex");
@@ -784,6 +790,7 @@ FlavorTranslator const & flavorTranslator()
        static FlavorTranslator translator = initFlavorTranslator();
        return translator;
 }
+
 }
 
 
index 576376a4eec20ad5d4196d4410c188ece136541f..9b936869ac5280777abc38d21c8a70e1d0450518 100644 (file)
@@ -17,8 +17,7 @@ namespace lyx {
 
 FuncStatus::FuncStatus()
        : v_(OK)
-{
-}
+{}
 
 
 void FuncStatus::clear()
index 5a2b16695fbfcc9f552258d956e82c8b74d13382..b29b4d50fc7d2dbc98e6af97e52affa74db6263a 100644 (file)
@@ -142,6 +142,7 @@ string HSpace::asHTMLLength() const
        return result;
 }
 
+
 int HSpace::inPixels(BufferView const & bv) const
 {
        switch (kind_) {
index a2d2c95e05250c6976d25bdef81f57e42faac338..31b629671e653350e1b00a857fc022d0e5e756ba 100644 (file)
@@ -56,7 +56,7 @@ struct HunspellChecker::Private
        ~Private();
 
        void cleanCache();
-       void setUserPath(std::string path);
+       void setUserPath(std::string const & path);
        const string dictPath(int selector);
        bool haveLanguageFiles(string const & hpath);
        bool haveDictionary(Language const * lang, string & hpath);
@@ -107,7 +107,7 @@ HunspellChecker::Private::~Private()
 }
 
 
-void HunspellChecker::Private::setUserPath(std::string path)
+void HunspellChecker::Private::setUserPath(std::string const & path)
 {
        if (user_path_ != lyxrc.hunspelldir_path) {
                cleanCache();
@@ -167,9 +167,8 @@ const string HunspellChecker::Private::dictPath(int selector)
 
 bool HunspellChecker::Private::haveDictionary(Language const * lang, string & hpath)
 {
-       if (hpath.empty()) {
+       if (hpath.empty())
                return false;
-       }
 
        LYXERR(Debug::FILES, "check hunspell path: " << hpath
                                << " for language " << (lang ? lang->lang() : "NULL" ));
@@ -183,9 +182,8 @@ bool HunspellChecker::Private::haveDictionary(Language const * lang, string & hp
        }
        // another try with code, '_' replaced by '-'
        h_path = addName(hpath, subst(lang->code(), '_', '-'));
-       if (!haveLanguageFiles(h_path)) {
+       if (!haveLanguageFiles(h_path))
                return false;
-       }
        LYXERR(Debug::FILES, "  found " << h_path);
        hpath = h_path;
        return true;
@@ -197,7 +195,7 @@ bool HunspellChecker::Private::haveDictionary(Language const * lang)
        bool result = false;
 
        setUserPath(lyxrc.hunspelldir_path);
-       for ( int p = 0; !result && p < maxLookupSelector(); p++ ) {
+       for (int p = 0; !result && p < maxLookupSelector(); ++p) {
                string lpath = dictPath(p);
                result = haveDictionary(lang, lpath);
        }
@@ -213,9 +211,8 @@ Hunspell * HunspellChecker::Private::speller(Language const * lang)
 {
        setUserPath(lyxrc.hunspelldir_path);
        Spellers::iterator it = spellers_.find(lang->lang());
-       if (it != spellers_.end()) {
+       if (it != spellers_.end())
                return it->second;
-       }
        return addSpeller(lang);
 }
 
@@ -239,11 +236,11 @@ Hunspell * HunspellChecker::Private::addSpeller(Language const * lang,string & p
 Hunspell * HunspellChecker::Private::addSpeller(Language const * lang)
 {
        Hunspell * h = 0;
-       for ( int p = 0; p < maxLookupSelector() && 0 == h; p++ ) {
+       for (int p = 0; p < maxLookupSelector() && 0 == h; ++p) {
                string lpath = dictPath(p);
                h = addSpeller(lang, lpath);
        }
-       if (0 != h) {
+       if (h) {
                string const encoding = h->get_dic_encoding();
                PersonalWordList * pd = new PersonalWordList(lang->lang());
                pd->load();
@@ -265,9 +262,8 @@ int HunspellChecker::Private::numDictionaries() const
        Spellers::const_iterator it = spellers_.begin();
        Spellers::const_iterator et = spellers_.end();
 
-       for (; it != et; ++it) {
+       for (; it != et; ++it)
                result += it->second != 0;
-       }
        return result;
 }
 
@@ -276,9 +272,9 @@ bool HunspellChecker::Private::isIgnored(WordLangTuple const & wl) const
 {
        IgnoreList::const_iterator it = ignored_.begin();
        for (; it != ignored_.end(); ++it) {
-               if ((*it).lang()->code() != wl.lang()->code())
+               if (it->lang()->code() != wl.lang()->code())
                        continue;
-               if ((*it).word() == wl.word())
+               if (it->word() == wl.word())
                        return true;
        }
        return false;
@@ -324,9 +320,9 @@ bool HunspellChecker::Private::learned(WordLangTuple const & wl)
 }
 
 
-HunspellChecker::HunspellChecker(): d(new Private)
-{
-}
+HunspellChecker::HunspellChecker()
+       : d(new Private)
+{}
 
 
 HunspellChecker::~HunspellChecker()
@@ -436,7 +432,7 @@ bool HunspellChecker::hasDictionary(Language const * lang) const
 {
        if (!lang)
                return false;
-       return (d->haveDictionary(lang));
+       return d->haveDictionary(lang);
 }
 
 
index 9f22373f3ab906f55af1b731fc27842bad8d8b13..26881549a179edd908ebcece02b22347362fb084 100644 (file)
@@ -30,7 +30,9 @@ namespace {
 class IndexNamesEqual : public std::unary_function<Index, bool>
 {
 public:
-       IndexNamesEqual(docstring const & name) : name_(name) {}
+       IndexNamesEqual(docstring const & name)
+               : name_(name)
+       {}
 
        bool operator()(Index const & index) const
        {
@@ -44,7 +46,9 @@ private:
 class IndexHasShortcut : public std::unary_function<Index, bool>
 {
 public:
-       IndexHasShortcut(docstring const & shortcut) : shortc_(shortcut) {}
+       IndexHasShortcut(docstring const & shortcut)
+               : shortc_(shortcut)
+       {}
 
        bool operator()(Index const & index) const
        {
index 94cdb637d03bb0a077867a3d03f2bb6e6098de20..bbc76d18523eb714573fdc7dc874e90baf90e8e5 100644 (file)
@@ -501,6 +501,7 @@ bool LaTeXFeatures::isProvided(string const & name) const
                                                                       nomath);
 }
 
+
 bool LaTeXFeatures::mustProvide(string const & name) const
 {
        return isRequired(name) && !isProvided(name);
@@ -1280,6 +1281,7 @@ docstring const LaTeXFeatures::getTClassHTMLStyles() const
 
 
 namespace {
+
 docstring const getFloatI18nPreamble(docstring const & type,
                        docstring const & name, Language const * lang,
                        Encoding const & enc, bool const polyglossia)
index 48726d07024fa0e412cc064a0a6bd68bab69519c..97594b706e0991c594450251e2ae58be061db2b5 100644 (file)
@@ -911,7 +911,8 @@ string const & Layout::htmllabelattr() const
 }
 
 
-docstring Layout::htmlstyle() const {
+docstring Layout::htmlstyle() const
+{
        if (!htmlstyle_.empty() && !htmlforcecss_)
                return htmlstyle_;
        if (htmldefaultstyle_.empty()) 
@@ -951,15 +952,19 @@ string Layout::defaultCSSClass() const
 
 
 namespace {
-       string makeMarginValue(char const * side, double d) {
-               ostringstream os;
-               os << "margin-" << side << ": " << d << "ex;\n";
-               return os.str();
-       }
+
+string makeMarginValue(char const * side, double d)
+{
+       ostringstream os;
+       os << "margin-" << side << ": " << d << "ex;\n";
+       return os.str();
+}
+
 }
 
 
-void Layout::makeDefaultCSS() const {
+void Layout::makeDefaultCSS() const
+{
        // this never needs to be redone, since reloading layouts will
        // wipe out what we did before.
        if (!htmldefaultstyle_.empty()) 
index 4337956170496b3c3715f58945377657b4d96fe7..5f2f0d3db8d4819ee106e29bae6316f1ef30e364 100644 (file)
@@ -182,7 +182,8 @@ std::vector<LayoutFileIndex> LayoutFileList::classList() const
 }
 
 
-void LayoutFileList::reset(LayoutFileIndex const & classname) {
+void LayoutFileList::reset(LayoutFileIndex const & classname)
+{
        LASSERT(haveClass(classname), /**/);
        LayoutFile * tc = classmap_[classname];
        LayoutFile * tmpl = 
@@ -216,6 +217,7 @@ string layoutpost =
        
 }
 
+
 LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
 {
        FileName const tempLayout = FileName::tempName("basic_layout");
@@ -257,8 +259,8 @@ LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
 }
 
 
-LayoutFileIndex 
-       LayoutFileList::addLocalLayout(string const & textclass, string const & path)
+LayoutFileIndex  LayoutFileList::addLocalLayout(
+       string const & textclass, string const & path)
 {
        // FIXME  There is a bug here: 4593
        //
@@ -321,7 +323,8 @@ LayoutFileIndex
                        return textclass;
                }
        }
-       // If .layout is not in local directory, or an invalid layout is found, return null
+       // If .layout is not in local directory, or an invalid layout
+       // is found, return null
        return string();
 }
 
index 2962207241cc613f1c78e918817bad6812f76dbf..8c9fdbcb02b8433ded8909e5329bb3139bf11997 100644 (file)
@@ -138,11 +138,10 @@ void reconfigureUserLyXDir()
 } // namespace anon
 
 /// The main application class private implementation.
-struct LyX::Impl
-{
-       Impl() : latexfonts_(0), spell_checker_(0), apple_spell_checker_(0), aspell_checker_(0), enchant_checker_(0), hunspell_checker_(0)
-       {
-       }
+struct LyX::Impl {
+       Impl()
+               : latexfonts_(0), spell_checker_(0), apple_spell_checker_(0), aspell_checker_(0), enchant_checker_(0), hunspell_checker_(0)
+       {}
 
        ~Impl()
        {
@@ -205,6 +204,7 @@ struct LyX::Impl
        SpellChecker * hunspell_checker_;
 };
 
+
 ///
 frontend::Application * theApp()
 {
index f5d5dd54b47efeb81323efeea9cd2ec208f82140..6b693b16e624a93fa3c71651c9bb5d3ed1f2a63b 100644 (file)
@@ -46,7 +46,8 @@ LyXModule::LyXModule(string const & n, string const & i,
 }
 
 
-vector<string> LyXModule::prerequisites() const {
+vector<string> LyXModule::prerequisites() const
+{
 #ifdef TEX2LYX
        return vector<string>();
 #else
@@ -57,7 +58,8 @@ vector<string> LyXModule::prerequisites() const {
 }
 
 
-bool LyXModule::isAvailable() const {
+bool LyXModule::isAvailable() const
+{
 #ifdef TEX2LYX
        return true;
 #else
@@ -115,8 +117,7 @@ bool LyXModule::areCompatible(string const & mod1, string const & mod2)
 
 
 // used when sorting the module list.
-class ModuleSorter
-{
+class ModuleSorter {
 public:
        int operator()(LyXModule const & lm1, LyXModule const & lm2) const
        {
@@ -265,6 +266,7 @@ LyXModule const * ModuleList::operator[](string const & str) const
        return 0;
 }
 
+
 LyXModule * ModuleList::operator[](string const & str)
 {
        LyXModuleList::iterator it = modlist_.begin();
index 5a6804785094daa4a51b3ed1776763c1d279918e..223d2eb53eb2942e2ab2cd29461bd551527ce9f6 100644 (file)
@@ -69,8 +69,10 @@ using namespace lyx::support;
 namespace lyx {
 
 namespace {
+
 /// Inset identifier (above 0x10ffff, for ucs-4)
 char_type const META_INSET = 0x200001;
+
 }
 
 
@@ -129,7 +131,8 @@ private:
 
 class SpellCheckerState {
 public:
-       SpellCheckerState() {
+       SpellCheckerState()
+       {
                needs_refresh_ = true;
                current_change_number_ = 0;
        }
@@ -209,20 +212,24 @@ public:
                return empty_;
        }
 
-       bool needsRefresh() const {
+       bool needsRefresh() const
+       {
                return needs_refresh_;
        }
 
-       SpellChecker::ChangeNumber currentChangeNumber() const {
+       SpellChecker::ChangeNumber currentChangeNumber() const
+       {
                return current_change_number_;
        }
 
-       void refreshRange(pos_type & first, pos_type & last) const {
+       void refreshRange(pos_type & first, pos_type & last) const
+       {
                first = refresh_.first;
                last = refresh_.last;
        }
 
-       void needsRefresh(pos_type pos) {
+       void needsRefresh(pos_type pos)
+       {
                if (needs_refresh_ && pos != -1) {
                        if (pos < refresh_.first)
                                refresh_.first = pos;
@@ -237,13 +244,13 @@ public:
                needs_refresh_ = pos != -1;
        }
 
-       void needsCompleteRefresh(SpellChecker::ChangeNumber change_number) {
+       void needsCompleteRefresh(SpellChecker::ChangeNumber change_number)
+       {
                needs_refresh_ = true;
                refresh_.first = 0;
                refresh_.last = -1;
                current_change_number_ = change_number;
        }
-
 private:
        typedef vector<SpellResultRange> Ranges;
        typedef Ranges::const_iterator RangesIterator;
@@ -384,9 +391,10 @@ public:
        Language * getSpellLanguage(pos_type const from) const;
 
        Language * locateSpellRange(pos_type & from, pos_type & to,
-                                                               SkipPositions & skips) const;
+                                   SkipPositions & skips) const;
 
-       bool hasSpellerChange() const {
+       bool hasSpellerChange() const
+       {
                SpellChecker::ChangeNumber speller_change_number = 0;
                if (theSpellChecker())
                        speller_change_number = theSpellChecker()->changeNumber();
@@ -405,14 +413,16 @@ public:
                speller_state_.setRange(fp, state);
        }
 
-       void requestSpellCheck(pos_type pos) {
+       void requestSpellCheck(pos_type pos)
+       {
                if (pos == -1)
                        speller_state_.needsCompleteRefresh(speller_state_.currentChangeNumber());
                else
                        speller_state_.needsRefresh(pos);
        }
 
-       void readySpellCheck() {
+       void readySpellCheck()
+       {
                speller_state_.needsRefresh(-1);
        }
 
index 85e57683df9208f20dfe80f3199d330eaf198cec..e6541fdb0b3090958fe89c035d9eb05b93cb98a1 100644 (file)
@@ -257,9 +257,8 @@ bool ParagraphMetrics::hfillExpansion(Row const & row, pos_type pos) const
        }
 
        // expand at the beginning of a row only if it is the first row of a paragraph
-       if (pos == row.pos()) {
+       if (pos == row.pos())
                return pos == 0;
-       }
 
        // do not expand in some labels
        if (par_->layout().margintype != MARGIN_MANUAL && pos < par_->beginOfBody())
index 75dcda6aa70d8d2a786520c4fbc090e17666e23e..665eb331b573ba45ecebbeb8dab558ec165bdf80 100644 (file)
@@ -92,6 +92,7 @@ void PersonalWordList::save()
        LYXERR(Debug::FILES, "count of saved items: " << words_.size());
 }
 
+
 bool PersonalWordList::equalwords(docstring const & w1, docstring const & w2) const
 {
        return w1 == w2;
index 1e673e6f8708e9fa1701b74dc0572dcc0d271c42..1de758a5f46bd1b9507c9e2ad9b213d9a015c550 100644 (file)
@@ -695,6 +695,7 @@ string const LyXComm::pipeName(DWORD index) const
 LyXComm::LyXComm(string const &, Server *, ClientCallbackfct)
 {}
 
+
 void LyXComm::openConnection()
 {}
 
@@ -716,6 +717,7 @@ void LyXComm::endPipe(int & fd, string const & filename, bool write)
 void LyXComm::emergencyCleanup()
 {}
 
+
 void LyXComm::read_ready()
 {}
 
@@ -726,7 +728,6 @@ void LyXComm::send(string const & msg)
 
 #else // defined (HAVE_MKFIFO)
 
-
 LyXComm::LyXComm(string const & pip, Server * cli, ClientCallbackfct ccb)
        : pipename_(pip), client_(cli), clientcb_(ccb)
 {
@@ -915,7 +916,6 @@ void LyXComm::read_ready()
        int status;
        // the single = is intended here.
        while ((status = ::read(infd_, charbuf, charbuf_size - 1))) {
-
                if (status > 0) {
                        charbuf[status] = '\0'; // turn it into a c string
                        read_buffer_ += rtrim(charbuf, "\r");
@@ -966,7 +966,8 @@ void LyXComm::send(string const & msg)
 
        LYXERR(Debug::LYXSERVER, "LyXComm: Sending '" << msg << '\'');
 
-       if (pipename_.empty()) return;
+       if (pipename_.empty())
+               return;
 
        if (!ready_) {
                LYXERR0("LyXComm: Pipes are closed. Could not send " << msg);
@@ -1068,7 +1069,6 @@ Server::~Server()
 
 int compare(char const * a, char const * b, unsigned int len)
 {
-       using namespace std;
        return strncmp(a, b, len);
 }
 
index 4c34212cb52b597f55e7793974392299abca0053..3d73a67ed6d955c08318323357856f5ec10aa8f9 100644 (file)
@@ -41,7 +41,6 @@ using namespace std;
 using namespace lyx::support;
 
 
-
 namespace lyx {
 
 // Address is the unix address for the socket.
index aff0628fbf54dd0823f30fb8f1c4642812f0f1f2..6cdf1f724842558011503954a8b084eba43299f5 100644 (file)
@@ -40,7 +40,6 @@ string const sec_lastcommands = "[last commands]";
 
 namespace lyx {
 
-
 LastFilesSection::LastFilesSection(unsigned int num) :
        default_num_last_files(4),
        absolute_max_last_files(100)
index c61e9e1bb1f87a55e7c27b5f73b7fad6d6507cca..390b69d7146da96eaf30dcf704caf07011df7fd7 100644 (file)
@@ -1812,6 +1812,7 @@ bool Text::read(Lexer & lex,
        return res;
 }
 
+
 // Returns the current font and depth as a message.
 docstring Text::currentState(Cursor const & cur) const
 {
index 93eae96b9c2dfb24d86a56a8285002b0c761846b..55b90c6cfe6f32f0610931d7c609e74089a62f9b 100644 (file)
@@ -222,50 +222,50 @@ enum TextClassTags {
 
 namespace {
 
-       LexerKeyword textClassTags[] = {
-               { "addtohtmlpreamble", TC_ADDTOHTMLPREAMBLE },
-               { "addtohtmlstyles",   TC_ADDTOHTMLSTYLES },
-               { "addtopreamble",     TC_ADDTOPREAMBLE },
-               { "citeengine",        TC_CITEENGINE },
-               { "citeenginetype",    TC_CITEENGINETYPE },
-               { "citeformat",        TC_CITEFORMAT },
-               { "classoptions",      TC_CLASSOPTIONS },
-               { "columns",           TC_COLUMNS },
-               { "counter",           TC_COUNTER },
-               { "defaultbiblio",     TC_DEFAULTBIBLIO },
-               { "defaultfont",       TC_DEFAULTFONT },
-               { "defaultmodule",     TC_DEFAULTMODULE },
-               { "defaultstyle",      TC_DEFAULTSTYLE },
-               { "excludesmodule",    TC_EXCLUDESMODULE },
-               { "float",             TC_FLOAT },
-               { "format",            TC_FORMAT },
-               { "fullauthorlist",    TC_FULLAUTHORLIST },
-               { "htmlpreamble",      TC_HTMLPREAMBLE },
-               { "htmlstyles",        TC_HTMLSTYLES },
-               { "htmltocsection",    TC_HTMLTOCSECTION },
-               { "ifcounter",         TC_IFCOUNTER },
-               { "ifstyle",           TC_IFSTYLE },
-               { "input",             TC_INPUT },
-               { "insetlayout",       TC_INSETLAYOUT },
-               { "leftmargin",        TC_LEFTMARGIN },
-               { "nocounter",         TC_NOCOUNTER },
-               { "nofloat",           TC_NOFLOAT },
-               { "nostyle",           TC_NOSTYLE },
-               { "outputformat",      TC_OUTPUTFORMAT },
-               { "outputtype",        TC_OUTPUTTYPE },
-               { "pagestyle",         TC_PAGESTYLE },
-               { "preamble",          TC_PREAMBLE },
-               { "provides",          TC_PROVIDES },
-               { "providesmodule",    TC_PROVIDESMODULE },
-               { "requires",          TC_REQUIRES },
-               { "rightmargin",       TC_RIGHTMARGIN },
-               { "secnumdepth",       TC_SECNUMDEPTH },
-               { "sides",             TC_SIDES },
-               { "style",             TC_STYLE },
-               { "titlelatexname",    TC_TITLELATEXNAME },
-               { "titlelatextype",    TC_TITLELATEXTYPE },
-               { "tocdepth",          TC_TOCDEPTH }
-       };
+LexerKeyword textClassTags[] = {
+       { "addtohtmlpreamble", TC_ADDTOHTMLPREAMBLE },
+       { "addtohtmlstyles",   TC_ADDTOHTMLSTYLES },
+       { "addtopreamble",     TC_ADDTOPREAMBLE },
+       { "citeengine",        TC_CITEENGINE },
+       { "citeenginetype",    TC_CITEENGINETYPE },
+       { "citeformat",        TC_CITEFORMAT },
+       { "classoptions",      TC_CLASSOPTIONS },
+       { "columns",           TC_COLUMNS },
+       { "counter",           TC_COUNTER },
+       { "defaultbiblio",     TC_DEFAULTBIBLIO },
+       { "defaultfont",       TC_DEFAULTFONT },
+       { "defaultmodule",     TC_DEFAULTMODULE },
+       { "defaultstyle",      TC_DEFAULTSTYLE },
+       { "excludesmodule",    TC_EXCLUDESMODULE },
+       { "float",             TC_FLOAT },
+       { "format",            TC_FORMAT },
+       { "fullauthorlist",    TC_FULLAUTHORLIST },
+       { "htmlpreamble",      TC_HTMLPREAMBLE },
+       { "htmlstyles",        TC_HTMLSTYLES },
+       { "htmltocsection",    TC_HTMLTOCSECTION },
+       { "ifcounter",         TC_IFCOUNTER },
+       { "ifstyle",           TC_IFSTYLE },
+       { "input",             TC_INPUT },
+       { "insetlayout",       TC_INSETLAYOUT },
+       { "leftmargin",        TC_LEFTMARGIN },
+       { "nocounter",         TC_NOCOUNTER },
+       { "nofloat",           TC_NOFLOAT },
+       { "nostyle",           TC_NOSTYLE },
+       { "outputformat",      TC_OUTPUTFORMAT },
+       { "outputtype",        TC_OUTPUTTYPE },
+       { "pagestyle",         TC_PAGESTYLE },
+       { "preamble",          TC_PREAMBLE },
+       { "provides",          TC_PROVIDES },
+       { "providesmodule",    TC_PROVIDESMODULE },
+       { "requires",          TC_REQUIRES },
+       { "rightmargin",       TC_RIGHTMARGIN },
+       { "secnumdepth",       TC_SECNUMDEPTH },
+       { "sides",             TC_SIDES },
+       { "style",             TC_STYLE },
+       { "titlelatexname",    TC_TITLELATEXNAME },
+       { "titlelatextype",    TC_TITLELATEXTYPE },
+       { "tocdepth",          TC_TOCDEPTH }
+};
 
 } //namespace anon
 
@@ -1237,6 +1237,7 @@ string const & TextClass::prerequisites(string const & sep) const
        return prerequisites_;
 }
 
+
 bool TextClass::hasLayout(docstring const & n) const
 {
        docstring const name = n.empty() ? defaultLayoutName() : n;
@@ -1531,9 +1532,8 @@ Layout const & DocumentClass::getTOCLayout() const
 
 Layout const & DocumentClass::htmlTOCLayout() const
 {
-       if (html_toc_section_.empty()) {
+       if (html_toc_section_.empty())
                html_toc_section_ = getTOCLayout().name();
-       }
        return operator[](html_toc_section_);
 }
 
index f8e8448979a5f1bad70b5c8db6dfc3a78e69636f..b4655ac27f93e6290fc320ba928c37404c515a45 100644 (file)
@@ -128,9 +128,8 @@ pair<string,string> Thesaurus::Private::getThesaurus(string const & path, docstr
                        break;
                }
        }
-       if (idx.empty()) {
+       if (idx.empty())
                return make_pair(string(), string());
-       }
        for (support::FileNameList::const_iterator it = data_files.begin(); it != data_files.end(); ++it) {
                if (contains(it->onlyFileName(), basename)) {
                        data = it->absFileName();
@@ -150,9 +149,8 @@ pair<string,string> Thesaurus::Private::getThesaurus(docstring const & lang)
        if (thesaurusAvailable(lang))
                return make_pair(string(), string());
 
-       if (!thes_path.empty()) {
+       if (!thes_path.empty())
                result = getThesaurus(thes_path, lang);
-       }
        if (result.first.empty() || result.second.empty()) {
                string const sys_path = external_path(addName(lyx::support::package().system_support().absFileName(),dataDirectory())) ;
                result = getThesaurus(sys_path, lang);
@@ -271,7 +269,8 @@ Thesaurus::Meanings Thesaurus::lookup(WordLangTuple const & wl)
 }
 
 
-Thesaurus::Thesaurus() : d(new Thesaurus::Private)
+Thesaurus::Thesaurus()
+       : d(new Thesaurus::Private)
 {
 }
 
index 719c3c2a1f58241be6f70c50e63cffcdd5632b2e..bd468d86a7326790e7e9c3fe5472b8284fa015c2 100644 (file)
@@ -98,6 +98,7 @@ bool VCS::makeRCSRevision(string const &version, string &revis) const
        return true;
 }
 
+
 bool VCS::checkparentdirs(FileName const & file, std::string const & pathname)
 {
        FileName dirname = file.onlyPath();
index 72315072d61c8b646e47655f54fb0f57931ff8d1..944d016ce33279ffe446768b10c7585e224bd711 100644 (file)
@@ -200,6 +200,7 @@ string VSpace::asHTMLLength() const
        return result;
 }
 
+
 int VSpace::inPixels(BufferView const & bv) const
 {
        // Height of a normal line in pixels (zoom factor considered)
index 5dcbc142348622efb76dd09cdadcf876bdf61b9e..96b7c35ea798c91a7a2726a0d28c1f61a82b694e 100644 (file)
@@ -42,7 +42,8 @@ WordList * theWordList(Language const & lang)
 }
 
 
-void WordList::cleanupWordLists() {
+void WordList::cleanupWordLists()
+{
        map<Language, WordList *>::const_iterator it = theGlobalWordList.begin();
        for (; it != theGlobalWordList.end(); ++it)
                delete it->second;
index 858e53f138de902f1d0823688d070a588f03b9e1..e25a2630490b1598042ec1c890f750d24ed2bae1 100644 (file)
@@ -564,12 +564,15 @@ Inset * readInset(Lexer & lex, Buffer * buf)
                }
                inset->setBuffer(*buf);
        } else { 
-               // FIXME This branch should be made to use inset codes as the preceding 
-               // branch does. Unfortunately, that will take some doing. It requires
-               // converting the representation of the insets in LyX files so that they
-               // use the inset names listed in Inset.cpp. Then, as above, the inset names
-               // can be translated to inset codes using insetCode(). And the insets'
-               // write() routines should use insetName() rather than hardcoding it.
+               // FIXME This branch should be made to use inset codes
+               // as the preceding branch does. Unfortunately, that
+               // will take some doing. It requires converting the
+               // representation of the insets in LyX files so that
+               // they use the inset names listed in Inset.cpp. Then,
+               // as above, the inset names can be translated to
+               // inset codes using insetCode(). And the insets'
+               // write() routines should use insetName() rather than
+               // hardcoding it.
                if (tmptok == "Quotes") {
                        inset.reset(new InsetQuotes(buf));
                } else if (tmptok == "External") {
index a226a7e2e73bad977a8b64ff129bfb68582456cc..217c22b6048c48e393d8ddfe8309c01ec49950d9 100644 (file)
@@ -47,6 +47,7 @@ char const * const unit_name_gui[] = {
        N_("Column Width %"), N_("Page Width %"), N_("Line Width %"),
        N_("Text Height %"), N_("Page Height %"), "" };
 
+
 Length::UNIT unitFromString(string const & data)
 {
        int i = 0;
@@ -208,6 +209,7 @@ LaTeXLength table[] = {
 
 } // namespace anon
 
+
 const char * stringFromUnit(int unit)
 {
        if (unit < 0 || unit > num_units)
index 74b045c4bba0cb2729916a640d5a1d7b2857da63..73700cb4fcef54fc898044fb153f6ff8ff170ede 100644 (file)
@@ -623,6 +623,7 @@ string escape_for_regex(string s, bool match_latex)
        return s;
 }
 
+
 /// Wrapper for lyx::regex_replace with simpler interface
 bool regex_replace(string const & s, string & t, string const & searchstr,
                   string const & replacestr)
@@ -637,6 +638,7 @@ bool regex_replace(string const & s, string & t, string const & searchstr,
        return rv;
 }
 
+
 /** Checks if supplied string segment is well-formed from the standpoint of matching open-closed braces.
  **
  ** Verify that closed braces exactly match open braces. This avoids that, for example,
@@ -678,6 +680,7 @@ bool braces_match(string::const_iterator const & beg,
        return true;
 }
 
+
 /** The class performing a match between a position in the document and the FindAdvOptions.
  **/
 class MatchStringAdv {
@@ -762,7 +765,8 @@ static docstring buffer_to_latex(Buffer & buffer)
 }
 
 
-static docstring stringifySearchBuffer(Buffer & buffer, FindAndReplaceOptions const & opt) {
+static docstring stringifySearchBuffer(Buffer & buffer, FindAndReplaceOptions const & opt)
+{
        docstring str;
        if (!opt.ignoreformat) {
                str = buffer_to_latex(buffer);
@@ -787,7 +791,8 @@ static docstring stringifySearchBuffer(Buffer & buffer, FindAndReplaceOptions co
 
 
 /// Return separation pos between the leading material and the rest
-static size_t identifyLeading(string const & s)  {
+static size_t identifyLeading(string const & s)
+{
        string t = s;
        // @TODO Support \item[text]
        while (regex_replace(t, t, "^\\\\(emph|textbf|subsubsection|subsection|section|subparagraph|paragraph|part)\\*?\\{", "")
@@ -801,7 +806,8 @@ static size_t identifyLeading(string const & s)  {
 
 
 // Remove trailing closure of math, macros and environments, so to catch parts of them.
-static int identifyClosing(string & t) {
+static int identifyClosing(string & t)
+{
        int open_braces = 0;
        do {
                LYXERR(Debug::FIND, "identifyClosing(): t now is '" << t << "'");
@@ -1211,7 +1217,8 @@ int findMostBackwards(DocIterator & cur, MatchStringAdv const & match)
 
 
 /// Finds backwards
-int findBackwardsAdv(DocIterator & cur, MatchStringAdv & match) {
+int findBackwardsAdv(DocIterator & cur, MatchStringAdv & match)
+{
        if (! cur)
                return 0;
        // Backup of original position
@@ -1290,7 +1297,8 @@ namespace {
 
 
 /** Check if 'len' letters following cursor are all non-lowercase */
-static bool allNonLowercase(DocIterator const & cur, int len) {
+static bool allNonLowercase(DocIterator const & cur, int len)
+{
        pos_type end_pos = cur.pos() + len;
        for (pos_type pos = cur.pos(); pos != end_pos; ++pos)
                if (isLowerCase(cur.paragraph().getChar(pos)))
@@ -1300,7 +1308,8 @@ static bool allNonLowercase(DocIterator const & cur, int len) {
 
 
 /** Check if first letter is upper case and second one is lower case */
-static bool firstUppercase(DocIterator const & cur) {
+static bool firstUppercase(DocIterator const & cur)
+{
        char_type ch1, ch2;
        if (cur.pos() >= cur.lastpos() - 1) {
                LYXERR(Debug::FIND, "No upper-case at cur: " << cur);
@@ -1321,13 +1330,15 @@ static bool firstUppercase(DocIterator const & cur) {
  **
  ** \fixme What to do with possible further paragraphs in replace buffer ?
  **/
-static void changeFirstCase(Buffer & buffer, TextCase first_case, TextCase others_case) {
+static void changeFirstCase(Buffer & buffer, TextCase first_case, TextCase others_case)
+{
        ParagraphList::iterator pit = buffer.paragraphs().begin();
        pos_type right = pos_type(1);
        pit->changeCase(buffer.params(), pos_type(0), right, first_case);
        right = pit->size() + 1;
        pit->changeCase(buffer.params(), right, right, others_case);
 }
+
 } // anon namespace
 
 ///
index 432b2e710903c2222ddbefd48b0f45a64591c58e..f8a36d3e43042e3423cd4b7d79692e29ed65c038 100644 (file)
@@ -42,7 +42,7 @@ namespace {
 
 ParagraphList::const_iterator searchParagraph(
        ParagraphList::const_iterator p,
-  ParagraphList::const_iterator const & pend)
+       ParagraphList::const_iterator const & pend)
 {
        for (++p; p != pend && p->layout().latextype == LATEX_PARAGRAPH; ++p)
                ;
@@ -52,8 +52,8 @@ ParagraphList::const_iterator searchParagraph(
 
 
 ParagraphList::const_iterator searchCommand(
-               ParagraphList::const_iterator p,
-               ParagraphList::const_iterator const & pend)
+       ParagraphList::const_iterator p,
+       ParagraphList::const_iterator const & pend)
 {
        Layout const & bstyle = p->layout();
 
@@ -68,8 +68,8 @@ ParagraphList::const_iterator searchCommand(
 
 
 ParagraphList::const_iterator searchEnvironment(
-               ParagraphList::const_iterator p,
-               ParagraphList::const_iterator const & pend)
+       ParagraphList::const_iterator p,
+       ParagraphList::const_iterator const & pend)
 {
        Layout const & bstyle = p->layout();
        size_t const depth = p->params().depth();
@@ -95,12 +95,13 @@ ParagraphList::const_iterator searchEnvironment(
 }
 
 
-ParagraphList::const_iterator makeParagraph(Buffer const & buf,
-                                           odocstream & os,
-                                           OutputParams const & runparams,
-                                           Text const & text,
-                                           ParagraphList::const_iterator const & pbegin,
-                                           ParagraphList::const_iterator const & pend)
+ParagraphList::const_iterator makeParagraph(
+       Buffer const & buf,
+       odocstream & os,
+       OutputParams const & runparams,
+       Text const & text,
+       ParagraphList::const_iterator const & pbegin,
+       ParagraphList::const_iterator const & pend)
 {
        ParagraphList const & paragraphs = text.paragraphs();
        for (ParagraphList::const_iterator par = pbegin; par != pend; ++par) {
@@ -123,12 +124,13 @@ ParagraphList::const_iterator makeParagraph(Buffer const & buf,
 }
 
 
-ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
-                                             odocstream & os,
-                                             OutputParams const & runparams,
-                                             Text const & text,
-                                             ParagraphList::const_iterator const & pbegin,
-                                             ParagraphList::const_iterator const & pend)
+ParagraphList::const_iterator makeEnvironment(
+       Buffer const & buf,
+       odocstream & os,
+       OutputParams const & runparams,
+       Text const & text,
+       ParagraphList::const_iterator const & pbegin,
+       ParagraphList::const_iterator const & pend)
 {
        ParagraphList const & paragraphs = text.paragraphs();
        ParagraphList::const_iterator par = pbegin;
@@ -244,12 +246,13 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
 }
 
 
-ParagraphList::const_iterator makeCommand(Buffer const & buf,
-                                         odocstream & os,
-                                         OutputParams const & runparams,
-                                         Text const & text,
-                                         ParagraphList::const_iterator const & pbegin,
-                                         ParagraphList::const_iterator const & pend)
+ParagraphList::const_iterator makeCommand(
+       Buffer const & buf,
+       odocstream & os,
+       OutputParams const & runparams,
+       Text const & text,
+       ParagraphList::const_iterator const & pbegin,
+       ParagraphList::const_iterator const & pend)
 {
        ParagraphList const & paragraphs = text.paragraphs();
        ParagraphList::const_iterator par = pbegin;
index 92913afb4e92c1cf8f11f34c5d43284bccb0b6f8..585ef8a3ec11f8ab14fea870570c84ab3dd3dd82 100644 (file)
@@ -45,9 +45,9 @@ namespace lyx {
 namespace {
 
 enum OpenEncoding {
-               none,
-               inputenc,
-               CJK
+       none,
+       inputenc,
+       CJK
 };
 
 static int open_encoding_ = none;
index d58c44a7964f42fdc5e75e5cb75451c1e0aa609c..f0a383df4c02591c6afb0851f0cfc8873d1021ff 100644 (file)
@@ -71,6 +71,7 @@ static pair<int, docstring> addDepth(int depth, int ldepth)
        return make_pair(d, docstring(d, ' '));
 }
 
+
 void writePlaintextParagraph(Buffer const & buf,
                    Paragraph const & par,
                    odocstream & os,
index 336f5a88dbcadf0b063e3c0766f35f7e1deb85fb..50ba0f4b0b96774166636d48e4ed5696f6cb73e6 100644 (file)
@@ -71,7 +71,8 @@ docstring escapeChar(char_type c, XHTMLStream::EscapeSettings e)
 
 
 // escape what needs escaping
-docstring htmlize(docstring const & str, XHTMLStream::EscapeSettings e) {
+docstring htmlize(docstring const & str, XHTMLStream::EscapeSettings e)
+{
        odocstringstream d;
        docstring::const_iterator it = str.begin();
        docstring::const_iterator en = str.end();
@@ -109,7 +110,8 @@ string escapeChar(char c, XHTMLStream::EscapeSettings e)
 
 
 // escape what needs escaping
-string htmlize(string const & str, XHTMLStream::EscapeSettings e) {
+string htmlize(string const & str, XHTMLStream::EscapeSettings e)
+{
        ostringstream d;
        string::const_iterator it = str.begin();
        string::const_iterator en = str.end();
@@ -915,10 +917,10 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
 
 
 void makeCommand(Buffer const & buf,
-                                         XHTMLStream & xs,
-                                         OutputParams const & runparams,
-                                         Text const & text,
-                                         ParagraphList::const_iterator const & pbegin)
+                XHTMLStream & xs,
+                OutputParams const & runparams,
+                Text const & text,
+                ParagraphList::const_iterator const & pbegin)
 {
        Layout const & style = pbegin->layout();
        if (!style.counter.empty())
@@ -1020,7 +1022,8 @@ void xhtmlParagraphs(Text const & text,
 }
 
 
-string alignmentToCSS(LyXAlignment align) {
+string alignmentToCSS(LyXAlignment align)
+{
        switch (align) {
        case LYX_ALIGN_BLOCK:
                // we are NOT going to use text-align: justify!!
index 0a902b7ef2544bf3b6cdf022fffb883fd748429b..5810fd66e5c4726ceea15c59fa20bf6094936b98 100644 (file)
@@ -54,6 +54,7 @@ namespace lyx {
 using frontend::Painter;
 using frontend::FontMetrics;
 
+
 RowPainter::RowPainter(PainterInfo & pi,
        Text const & text, pit_type pit, Row const & row, Bidi & bidi, int x, int y)
        : pi_(pi), text_(text),
@@ -693,6 +694,7 @@ void RowPainter::paintTopLevelLabel()
        pi_.pain.text(int(x), yo_ - maxdesc - labeladdon, str, font);
 }
 
+
 /** Check if the current paragraph is the last paragraph in a
     proof environment */
 static int getEndLabel(pit_type p, Text const & text)