diff --git a/src/insets/insetert.C b/src/insets/insetert.C index 9189e5f0bf..f8b3cde8f4 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -408,7 +408,7 @@ void InsetERT::edit(BufferView * bv, bool left) } else { InsetCollapsable::edit(bv, left); } - set_latex_font(bv); + setLatexFont(bv); updateStatus(); } @@ -419,7 +419,7 @@ InsetERT::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos) BufferView * bv = cmd.view(); if (inset.paragraphs.begin()->empty()) - set_latex_font(bv); + setLatexFont(bv); switch (cmd.action) { @@ -455,7 +455,7 @@ InsetERT::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos) case LFUN_DELETE_SKIP: case LFUN_DELETE_LINE_FORWARD: case LFUN_CUT: - set_latex_font(bv); + setLatexFont(bv); return InsetCollapsable::priv_dispatch(cmd, idx, pos); default: @@ -464,7 +464,7 @@ InsetERT::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos) } -string const InsetERT::get_new_label() const +string const InsetERT::getNewLabel() const { string la; pos_type const max_length = 15; @@ -490,7 +490,7 @@ string const InsetERT::get_new_label() const void InsetERT::setButtonLabel() const { - setLabel(status_ == Collapsed ? get_new_label() : _("ERT")); + setLabel(status_ == Collapsed ? getNewLabel() : _("ERT")); } @@ -526,7 +526,7 @@ void InsetERT::draw(PainterInfo & pi, int x, int y) const } -void InsetERT::set_latex_font(BufferView * /*bv*/) +void InsetERT::setLatexFont(BufferView * /*bv*/) { #ifdef SET_HARD_FONT LyXFont font(LyXFont::ALL_INHERIT, latex_language); diff --git a/src/insets/insetert.h b/src/insets/insetert.h index d3e75966f5..4758c627e4 100644 --- a/src/insets/insetert.h +++ b/src/insets/insetert.h @@ -57,7 +57,9 @@ public: /// bool insertInset(BufferView *, InsetOld *); /// - bool insetAllowed(InsetOld::Code code) const { return code == InsetOld::NEWLINE_CODE; } + bool insetAllowed(InsetOld::Code code) const { + return code == InsetOld::NEWLINE_CODE; + } /// void setFont(BufferView *, LyXFont const &, bool toggleall = false, bool selectall = false); @@ -102,9 +104,7 @@ public: /// void getDrawFont(LyXFont &) const; /// - bool forceDefaultParagraphs(InsetOld const *) const { - return true; - } + bool forceDefaultParagraphs(InsetOld const *) const { return true; } protected: /// virtual @@ -124,11 +124,11 @@ private: /// void init(); /// - std::string const get_new_label() const; + std::string const getNewLabel() const; /// void setButtonLabel() const; /// - void set_latex_font(BufferView *); + void setLatexFont(BufferView *); /// update status on button void updateStatus(bool = false) const; /// diff --git a/src/sgml.C b/src/sgml.C index cb6292f1ec..bd17349760 100644 --- a/src/sgml.C +++ b/src/sgml.C @@ -116,16 +116,16 @@ int closeTag(ostream & os, Paragraph::depth_type depth, } -unsigned int closeEnvTags(ostream & ofs, bool mixcont, +unsigned int closeEnvTags(ostream & os, bool mixcont, string const & environment_inner_depth, lyx::depth_type total_depth) { - unsigned int lines; + unsigned int lines = 0; if (environment_inner_depth != "!-- --") { string item_name= "listitem"; - lines += closeTag(ofs, total_depth, mixcont, item_name); + lines += closeTag(os, total_depth, mixcont, item_name); if (environment_inner_depth == "varlistentry") - lines += closeTag(ofs, total_depth, mixcont, + lines += closeTag(os, total_depth, mixcont, environment_inner_depth); } return lines; diff --git a/src/vspace.C b/src/vspace.C index 2c9e4a9074..84bcbc845e 100644 --- a/src/vspace.C +++ b/src/vspace.C @@ -453,9 +453,6 @@ string const VSpace::asLyXCommand() const string const VSpace::asLatexCommand(BufferParams const & params) const { switch (kind_) { - case NONE: - return string(); - case DEFSKIP: return params.getDefSkip().asLatexCommand(params); @@ -474,6 +471,13 @@ string const VSpace::asLatexCommand(BufferParams const & params) const case LENGTH: return keep_ ? "\\vspace*{" + len_.asLatexString() + '}' : "\\vspace{" + len_.asLatexString() + '}'; + + case NONE: + return string(); + + default: + BOOST_ASSERT(false); + return string(); } } @@ -486,10 +490,6 @@ int VSpace::inPixels(BufferView const & bv) const switch (kind_) { - case NONE: - // value for this is already set - return 0; - case DEFSKIP: return bv.buffer()->params().getDefSkip().inPixels(bv); @@ -510,5 +510,12 @@ int VSpace::inPixels(BufferView const & bv) const case LENGTH: return len_.len().inPixels(bv.workWidth()); + + case NONE: + return 0; + + default: + BOOST_ASSERT(false); + return 0; } }