]> git.lyx.org Git - features.git/commitdiff
More cleanup from Andre.
authorRichard Heck <rgheck@comcast.net>
Sun, 24 Feb 2008 15:44:11 +0000 (15:44 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 24 Feb 2008 15:44:11 +0000 (15:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23194 a592a061-630c-0410-9148-cb99ea01b6c8

13 files changed:
src/BufferParams.cpp
src/CutAndPaste.cpp
src/MenuBackend.cpp
src/Paragraph.cpp
src/ParagraphMetrics.cpp
src/TocBackend.cpp
src/frontends/qt4/Dialog.cpp
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiToolbars.h
src/insets/InsetCollapsable.cpp
src/output_docbook.cpp
src/output_latex.cpp
src/sgml.cpp

index 0c2d1b4bb6c6639507aec8fc57a165e1977c90d8..d037fc67ffb2c6e6d18338aebe3d57d03e44e87c 100644 (file)
@@ -1361,12 +1361,12 @@ bool BufferParams::hasClassDefaults() const
 {
        TextClass const & tclass = textclasslist[baseClass_];
 
-       return (sides == tclass.sides()
+       return sides == tclass.sides()
                && columns == tclass.columns()
                && pagestyle == tclass.pagestyle()
                && options == tclass.options()
                && secnumdepth == tclass.secnumdepth()
-               && tocdepth == tclass.tocdepth());
+               && tocdepth == tclass.tocdepth();
 }
 
 
@@ -1448,13 +1448,15 @@ void BufferParams::makeTextClass()
 }
 
 
-vector<string> const & BufferParams::getModules() const {
+vector<string> const & BufferParams::getModules() const 
+{
        return layoutModules_;
 }
 
 
 
-bool BufferParams::addLayoutModule(string const & modName) {
+bool BufferParams::addLayoutModule(string const & modName) 
+{
        LayoutModuleList::const_iterator it = layoutModules_.begin();
        LayoutModuleList::const_iterator end = layoutModules_.end();
        for (; it != end; it++) {
@@ -1468,7 +1470,8 @@ bool BufferParams::addLayoutModule(string const & modName) {
 }
 
 
-void BufferParams::clearLayoutModules() {
+void BufferParams::clearLayoutModules() 
+{
        layoutModules_.clear();
 }
 
@@ -1516,7 +1519,8 @@ void BufferParams::readLanguage(Lexer & lex)
 
 void BufferParams::readGraphicsDriver(Lexer & lex)
 {
-       if (!lex.next()) return;
+       if (!lex.next()) 
+               return;
 
        string const tmptok = lex.getString();
        // check if tmptok is part of tex_graphics in tex_defs.h
@@ -1540,7 +1544,8 @@ void BufferParams::readGraphicsDriver(Lexer & lex)
 
 void BufferParams::readBullets(Lexer & lex)
 {
-       if (!lex.next()) return;
+       if (!lex.next()) 
+               return;
 
        int const index = lex.getInteger();
        lex.next();
@@ -1559,7 +1564,8 @@ void BufferParams::readBullets(Lexer & lex)
 void BufferParams::readBulletsLaTeX(Lexer & lex)
 {
        // The bullet class should be able to read this.
-       if (!lex.next()) return;
+       if (!lex.next()) 
+               return;
        int const index = lex.getInteger();
        lex.next(true);
        docstring const temp_str = lex.getDocString();
index 96986dd69ff8343f186d4f558379096c214fe0f0..fcf9633520b33a37bc6f296ddd56496ce93bae27 100644 (file)
@@ -702,8 +702,7 @@ void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
                PitPosPair ppp;
 
                boost::tie(ppp, endpit) =
-                       pasteSelectionHelper(cur, parlist,
-                                            textclass, errorList);
+                       pasteSelectionHelper(cur, parlist, textclass, errorList);
                updateLabels(cur.buffer());
                cur.clearSelection();
                text->setCursor(cur, ppp.first, ppp.second);
@@ -765,7 +764,7 @@ void pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs)
 }
 
 
-void pasteClipboardGraphics(Cursor & cur, ErrorList & errorList,
+void pasteClipboardGraphics(Cursor & cur, ErrorList & /* errorList */,
                            Clipboard::GraphicsType preferedType)
 {
        BOOST_ASSERT(theClipboard().hasGraphicsContents(preferedType));
index 05aa0b461de1e5833d62a5567ca3ff43d18f251b..fce89d6c25d5998d8b0230120869f4a74ae34ecf 100644 (file)
@@ -598,8 +598,7 @@ void expandFloatListInsert(Menu & tomenu, Buffer const * buf)
                return;
        }
 
-       FloatList const & floats =
-               buf->params().textClass().floats();
+       FloatList const & floats = buf->params().textClass().floats();
        FloatList::const_iterator cit = floats.begin();
        FloatList::const_iterator end = floats.end();
        for (; cit != end; ++cit) {
@@ -620,8 +619,7 @@ void expandFloatInsert(Menu & tomenu, Buffer const * buf)
                return;
        }
 
-       FloatList const & floats =
-               buf->params().textClass().floats();
+       FloatList const & floats = buf->params().textClass().floats();
        FloatList::const_iterator cit = floats.begin();
        FloatList::const_iterator end = floats.end();
        for (; cit != end; ++cit) {
index ee1a3ba8493ed52a37def7fe67e23f35e53548e2..5d773ee34c48a916da1498ff866273f017253d8c 100644 (file)
@@ -1817,11 +1817,10 @@ bool Paragraph::latex(Buffer const & buf,
        // to be valid!
        bool asdefault = forceEmptyLayout();
 
-       if (asdefault) {
+       if (asdefault)
                style = bparams.textClass().defaultLayout();
-       } else {
+        else
                style = d->layout_;
-       }
 
        // Current base font for all inherited font changes, without any
        // change caused by an individual character, except for the language:
index 77519e7673e94d8c9a25584bf3219690de15f78e..b249f01d9bf0baa1359a891d0355f71bc9a0f2c1 100644 (file)
@@ -62,9 +62,9 @@ using namespace lyx::support;
 namespace lyx {
 
 
-ParagraphMetrics::ParagraphMetrics(Paragraph const & par): position_(-1), par_(&par)
-{
-}
+ParagraphMetrics::ParagraphMetrics(Paragraph const & par) :
+       position_(-1), par_(&par)
+{}
 
 
 ParagraphMetrics & ParagraphMetrics::operator=(
index 4c5bdb00f363610aa42a7e845bbdd00b3582d9d1..10a1a931c0ba66915db924727ab01a57a6042408 100644 (file)
@@ -133,8 +133,7 @@ void TocBackend::updateItem(ParConstIterator const & par_it)
        }
 
        int const toclevel = toc_item->par_it_->layout()->toclevel;
-       if (toclevel != Layout::NOT_IN_TOC
-           && toclevel >= min_toclevel
+       if (toclevel != Layout::NOT_IN_TOC && toclevel >= min_toclevel
                && tocstring.empty())
                        tocstring = toc_item->par_it_->asString(*buffer_, true);
 
index de358a63c0aece40b91637c0433e9310810c0201..2be31a4ffc4aff2343b140fab629afdfb53798f0 100644 (file)
@@ -25,6 +25,8 @@
 #include <QSettings>
 #include <QString>
 
+#include <boost/assert.hpp>
+
 #include <string>
 
 using namespace std;
index 6adc1f52e9a7ce7c5c568410b03b9c4294a6b7f9..163d591f3e168bdd42e4bce81f435617243bec50 100644 (file)
@@ -1230,8 +1230,8 @@ void GuiDocument::classChanged()
 
 
 namespace {
-       //This is an insanely complicated attempt to make this sort of thing
-       //work with RTL languages.
+       // This is an insanely complicated attempt to make this sort of thing
+       // work with RTL languages.
        docstring formatStrVec(vector<string> const & v, docstring const & s) 
        {
                //this mess formats the list as "v[0], v[1], ..., [s] v[n]"
index d7015c8eb94f6244944c314d4f1db2b319948018..0b9d23cb3ad7aa8de3bf590996f021b102e95320 100644 (file)
@@ -93,4 +93,4 @@ private:
 } // namespace frontend
 } // namespace lyx
 
-#endif // NOT GUI_TOOLBARS_H
+#endif // GUI_TOOLBARS_H
index cb68250b29bba68ff2d4c06cfab6054daa43cc18..60b864f32c19221203219f481792dc4037a44e66 100644 (file)
@@ -110,7 +110,7 @@ docstring InsetCollapsable::toolTip(BufferView const & bv, int x, int y) const
        Dimension dim = dimensionCollapsed();
        if (geometry() == NoButton)
                return layout_->labelstring();
-       else if (x > xo(bv) + dim.wid || y > yo(bv) + dim.des)
+       if (x > xo(bv) + dim.wid || y > yo(bv) + dim.des)
                return docstring();
 
        switch (status_) {
@@ -188,7 +188,7 @@ void InsetCollapsable::read(Buffer const & buf, Lexer & lex)
                        lex.pushToken(token);
                }
        }
-       //this must be set before we enter InsetText::read()
+       // this must be set before we enter InsetText::read()
        setLayout(buf.params());
 
        InsetText::read(buf, lex);
@@ -254,8 +254,7 @@ void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
        case LeftButton:
        case ButtonOnly:
                dim = dimensionCollapsed();
-               if (geometry() == TopButton
-                || geometry() == LeftButton) {
+               if (geometry() == TopButton || geometry() == LeftButton) {
                        Dimension textdim;
                        InsetText::metrics(mi, textdim);
                        openinlined_ = (textdim.wid + dim.wid) < mi.base.textwidth;
@@ -749,11 +748,11 @@ bool InsetCollapsable::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_TABULAR_INSERT:
        case LFUN_TOC_INSERT:
        case LFUN_WRAP_INSERT:
-       if (layout_->isPassThru()) {
-               flag.enabled(false);
-               return true;
-       } else
-               return InsetText::getStatus(cur, cmd, flag);
+               if (layout_->isPassThru()) {
+                       flag.enabled(false);
+                       return true;
+               } else
+                       return InsetText::getStatus(cur, cmd, flag);
 
        case LFUN_INSET_TOGGLE:
                if (cmd.argument() == "open" || cmd.argument() == "close" ||
index d024ab13164acb0b9f9dea771779340d331280b2..fb52f221d86f0d81dbb3b1aa2fb7961326a24540 100644 (file)
@@ -102,16 +102,17 @@ ParagraphList::const_iterator makeParagraph(Buffer const & buf,
                                            ParagraphList::const_iterator const & pbegin,
                                            ParagraphList::const_iterator const & pend)
 {
-       LayoutPtr const & defaultstyle =
-               buf.params().textClass().defaultLayout();
+       LayoutPtr const & defaultstyle = buf.params().textClass().defaultLayout();
        for (ParagraphList::const_iterator par = pbegin; par != pend; ++par) {
                if (par != pbegin)
                        os << '\n';
                if (par->layout() == defaultstyle && par->emptyTag()) {
-                       par->simpleDocBookOnePar(buf, os, runparams, outerFont(distance(paragraphs.begin(), par), paragraphs));
+                       par->simpleDocBookOnePar(buf, os, runparams, 
+                                       outerFont(distance(paragraphs.begin(), par), paragraphs));
                } else {
                        sgml::openTag(buf, os, runparams, *par);
-                       par->simpleDocBookOnePar(buf, os, runparams, outerFont(distance(paragraphs.begin(), par), paragraphs));
+                       par->simpleDocBookOnePar(buf, os, runparams, 
+                                       outerFont(distance(paragraphs.begin(), par), paragraphs));
                        sgml::closeTag(os, *par);
                }
        }
index ac906835ed7537055843e34e089c00f0bc65b98f..cdf8a5bb21b21c21f59c0ed2a8a1141fa056132c 100644 (file)
@@ -109,8 +109,7 @@ TeXEnvironment(Buffer const & buf,
        BufferParams const & bparams = buf.params();
 
        LayoutPtr const & style = pit->forceEmptyLayout() ?
-                       bparams.textClass().emptyLayout() :
-                       pit->layout();
+                       bparams.textClass().emptyLayout() : pit->layout();
 
        ParagraphList const & paragraphs = text.paragraphs();
 
@@ -310,8 +309,7 @@ TeXOnePar(Buffer const & buf,
        // In an inset with unlimited length (all in one row),
        // force layout to default
        LayoutPtr const style = pit->forceEmptyLayout() ?
-               bparams.textClass().emptyLayout() :
-               pit->layout();
+               bparams.textClass().emptyLayout() : pit->layout();
 
        OutputParams runparams = runparams_in;
        runparams.moving_arg |= style->needprotect;
index fcaffdd56a266e803366dcb20abf189e1cfb9c07..68d922e76e782a473807183d293c095fc78dec66 100644 (file)
@@ -123,7 +123,7 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams,
        // to disable this mangling.
        TextClass const & tclass = buf.params().textClass();
        docstring const allowed = from_ascii(
-               runparams.flavor == OutputParams::XML? ".-_:":tclass.options());
+               runparams.flavor == OutputParams::XML ? ".-_:" : tclass.options());
 
        if (allowed.empty())
                return orig;
@@ -139,7 +139,7 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams,
 
        MangledMap::const_iterator const known = mangledNames.find(orig);
        if (known != mangledNames.end())
-               return (*known).second;
+               return known->second;
 
        // make sure it starts with a letter
        if (!isAlphaASCII(*it) && allowed.find(*it) >= allowed.size())