#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "paragraph.h"
#include "paragraph_pimpl.h"
#include "lyxrc.h"
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)
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
// 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;
// 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);
}
-Paragraph * Paragraph::getParFromID(int id) const
-{
- return pimpl_->getParFromID(id);
-}
-
-
bool Paragraph::isFreeSpacing() const
{
// for now we just need this, later should we need this in some