X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fparagraph.C;h=a38fe6e8c6b6bc507920ba0b0732800e0a56c46f;hb=69cf3b62043861ccad5f8ad7ffb4981fe50b078d;hp=c541fd7ea7dd58f4c798e17b599e8b40d5956085;hpb=ae87b945156585b080ed155919f64b80e48d7a04;p=lyx.git diff --git a/src/paragraph.C b/src/paragraph.C index c541fd7ea7..a38fe6e8c6 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -10,10 +10,6 @@ #include -#ifdef __GNUG__ -#pragma implementation -#endif - #include "paragraph.h" #include "paragraph_pimpl.h" #include "lyxrc.h" @@ -523,9 +519,7 @@ LyXFont const Paragraph::getFont(BufferParams const & bparams, LyXLayout_ptr const & lout = layout(); - pos_type main_body = 0; - if (lout->labeltype == LABEL_MANUAL) - main_body = beginningOfMainBody(); + pos_type const main_body = beginningOfMainBody(); LyXFont layoutfont; if (pos < main_body) @@ -870,6 +864,9 @@ void Paragraph::applyLayout(LyXLayout_ptr const & new_layout) int Paragraph::beginningOfMainBody() const { + if (layout()->labeltype != LABEL_MANUAL) + return 0; + // Unroll the first two cycles of the loop // and remember the previous character to // remove unnecessary GetChar() calls @@ -1360,10 +1357,14 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf, // Maybe we have to create a optional argument. pos_type main_body; - if (style->labeltype != LABEL_MANUAL) + + // FIXME: can we actually skip this check and just call + // beginningOfMainBody() ?? + if (style->labeltype != LABEL_MANUAL) { main_body = 0; - else + } else { main_body = beginningOfMainBody(); + } unsigned int column = 0; @@ -1764,11 +1765,9 @@ bool Paragraph::isMultiLingual(BufferParams const & bparams) // Used for building the table of contents string const Paragraph::asString(Buffer const * buffer, bool label) const { - BufferParams const & bparams = buffer->params; string s; if (label && !params().labelString().empty()) s += params().labelString() + ' '; - string::size_type const len = s.size(); for (pos_type i = 0; i < size(); ++i) { value_type c = getChar(i);