From f27853ad41e62f15793902e163754c4b3db1400a Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 25 Nov 2010 16:53:56 +0000 Subject: [PATCH] Cosmetics, typos and comments. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36492 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.h | 2 +- src/ColorCode.h | 3 +-- src/frontends/qt4/GuiView.h | 3 ++- src/frontends/qt4/TocWidget.cpp | 2 +- src/insets/InsetCommand.cpp | 4 ++-- src/insets/InsetCommand.h | 5 +++++ src/insets/InsetTabular.cpp | 2 +- src/mathed/InsetMathFrac.cpp | 4 ++-- src/tex2lyx/text.cpp | 4 ++-- 9 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/Buffer.h b/src/Buffer.h index cb76fe53ef..b91f36ffe6 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -202,7 +202,7 @@ public: bool readString(std::string const &); /// Reloads the LyX file ReadStatus reload(); -//FIXME: The following two functions should be private +//FIXME: The following function should be private //private: /// read the header, returns number of unknown tokens int readHeader(Lexer & lex); diff --git a/src/ColorCode.h b/src/ColorCode.h index 9e94827f27..7925b6e6f8 100644 --- a/src/ColorCode.h +++ b/src/ColorCode.h @@ -13,8 +13,7 @@ namespace lyx { /// Names of colors, including all logical colors -enum ColorCode -{ +enum ColorCode { /// No particular color---clear or default Color_none, /// The different text colors diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index e0ac1ed2f9..745956091a 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -370,7 +370,8 @@ private: bool renameBuffer(Buffer & b, docstring const & newname); /// bool saveBuffer(Buffer & b); - /// + /// save and rename buffer to fn. If fn is empty, the buffer + /// is just saved as the filename it already has. bool saveBuffer(Buffer & b, support::FileName const & fn); /// closes a workarea, if close_buffer is true the buffer will /// also be released, otherwise the buffer will be hidden. diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp index be4c9c7696..84db8bd88e 100644 --- a/src/frontends/qt4/TocWidget.cpp +++ b/src/frontends/qt4/TocWidget.cpp @@ -495,7 +495,7 @@ void TocWidget::init(QString const & str) new_index = typeCO->findData(decodeType(str)); // If everything else fails, settle on the table of contents which is - // guaranted to exist. + // guaranteed to exist. if (new_index == -1) { current_type_ = "tableofcontents"; new_index = typeCO->findData(current_type_); diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index 9d9408fed5..d632e23e13 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -99,13 +99,13 @@ void InsetCommand::draw(PainterInfo & pi, int x, int y) const } -void InsetCommand::setParam(std::string const & name, docstring const & value) +void InsetCommand::setParam(string const & name, docstring const & value) { p_[name] = value; } -docstring const & InsetCommand::getParam(std::string const & name) const +docstring const & InsetCommand::getParam(string const & name) const { return p_[name]; } diff --git a/src/insets/InsetCommand.h b/src/insets/InsetCommand.h index 653a4a0b10..2d1d678a22 100644 --- a/src/insets/InsetCommand.h +++ b/src/insets/InsetCommand.h @@ -85,6 +85,11 @@ public: bool setMouseHover(BufferView const * bv, bool mouse_hover) const; /// bool clickable(int, int) const { return hasSettings(); } + //@} + +protected: + /// \name Methods relaying to the InsetCommandParams p_ + //@{ /// docstring contextMenu(BufferView const & bv, int x, int y) const; /// diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 311143345a..40d1e8ce45 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3361,7 +3361,7 @@ int InsetTabular::rowFromY(Cursor & cur, int y) const row_type r = 0; for (; r < tabular.nrows() && y > h; ++r) h += tabular.rowAscent(r) + tabular.rowDescent(r) - + tabular.interRowSpace(r); + + tabular.interRowSpace(r); return r - 1; } diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index 74d3f1bb49..752dd54bea 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -167,7 +167,7 @@ void InsetMathFrac::metrics(MetricsInfo & mi, Dimension & dim) const dim.des = dim1.height() - 5; } else { if (kind_ == CFRAC || kind_ == CFRACLEFT - || kind_ == CFRACRIGHT || kind_ == DFRAC) { + || kind_ == CFRACRIGHT || kind_ == DFRAC) { // \cfrac and \dfrac are always in display size StyleChanger dummy2(mi.base, LM_ST_DISPLAY); cell(0).metrics(mi, dim0); @@ -407,7 +407,7 @@ void InsetMathFrac::validate(LaTeXFeatures & features) const if (kind_ == NICEFRAC || kind_ == UNITFRAC || kind_ == UNIT) features.require("units"); if (kind_ == CFRAC || kind_ == CFRACLEFT || kind_ == CFRACRIGHT - || kind_ == DFRAC || kind_ == TFRAC) + || kind_ == DFRAC || kind_ == TFRAC) features.require("amsmath"); if (features.runparams().math_flavor == OutputParams::MathAsHTML) // CSS adapted from eLyXer diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 4f5b60e609..30e396ab08 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -465,7 +465,7 @@ void output_command_layout(ostream & os, Parser & p, bool outer, parse_text_in_inset(p, os, FLAG_BRACK_LAST, outer, context); end_inset(os); eat_whitespace(p, os, context, false); - optargs++; + ++optargs; } #if 0 // This is the code needed to parse required arguments, but @@ -482,7 +482,7 @@ void output_command_layout(ostream & os, Parser & p, bool outer, parse_text_in_inset(p, os, FLAG_BRACE_LAST, outer, context); end_inset(os); eat_whitespace(p, os, context, false); - reqargs++; + ++reqargs; } #endif parse_text(p, os, FLAG_ITEM, outer, context); -- 2.39.5