rename LyXLayout into Layout

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18096 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-04-29 18:58:28 +00:00
parent fc6ce7cd08
commit 0bf9ac02a8
38 changed files with 141 additions and 141 deletions

View File

@ -39,7 +39,7 @@
#include "LyX.h"
#include "lyxfind.h"
#include "LyXFunc.h"
#include "LyXLayout.h"
#include "Layout.h"
#include "LyXText.h"
#include "LyXTextClass.h"
#include "LyXRC.h"

View File

@ -145,7 +145,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
// If we are in an inset which returns forceDefaultParagraphs,
// set the paragraphs to default
if (cur.inset().forceDefaultParagraphs(cur.idx())) {
LyXLayout_ptr const layout =
Layout_ptr const layout =
buffer.params().getLyXTextClass().defaultLayout();
ParagraphList::iterator const end = insertion.end();
for (ParagraphList::iterator par = insertion.begin();

View File

@ -129,7 +129,7 @@ void LaTeXFeatures::useLayout(string const & layoutname)
return;
}
LyXLayout_ptr const & lyt = tclass[layoutname];
Layout_ptr const & lyt = tclass[layoutname];
if (!lyt->depends_on().empty()) {
++level;
useLayout(lyt->depends_on());

View File

@ -1,5 +1,5 @@
/**
* \file LyXLayout.cpp
* \file Layout.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
@ -12,7 +12,7 @@
#include <config.h>
#include "LyXLayout.h"
#include "Layout.h"
#include "LyXTextClass.h"
#include "Lexer.h"
#include "debug.h"
@ -29,7 +29,7 @@ using std::endl;
using std::string;
/// Special value of toclevel for layouts that to not belong in a TOC
const int LyXLayout::NOT_IN_TOC = -1000;
const int Layout::NOT_IN_TOC = -1000;
// The order of the LayoutTags enum is no more important. [asierra300396]
// Tags indexes.
@ -95,7 +95,7 @@ enum LayoutTags {
/////////////////////
// Constructor for layout
LyXLayout::LyXLayout ()
Layout::Layout ()
{
margintype = MARGIN_STATIC;
latextype = LATEX_PARAGRAPH;
@ -132,7 +132,7 @@ LyXLayout::LyXLayout ()
// Reads a layout definition from file
bool LyXLayout::read(Lexer & lexrc, LyXTextClass const & tclass)
bool Layout::read(Lexer & lexrc, LyXTextClass const & tclass)
{
// This table is sorted alphabetically [asierra 30March96]
keyword_item layoutTags[] = {
@ -501,7 +501,7 @@ enum AlignTags {
};
void LyXLayout::readAlign(Lexer & lexrc)
void Layout::readAlign(Lexer & lexrc)
{
keyword_item alignTags[] = {
{ "block", AT_BLOCK },
@ -539,7 +539,7 @@ void LyXLayout::readAlign(Lexer & lexrc)
}
void LyXLayout::readAlignPossible(Lexer & lexrc)
void Layout::readAlignPossible(Lexer & lexrc)
{
keyword_item alignTags[] = {
{ "block", AT_BLOCK },
@ -596,7 +596,7 @@ enum LabelTypeTags {
};
void LyXLayout::readLabelType(Lexer & lexrc)
void Layout::readLabelType(Lexer & lexrc)
{
keyword_item labelTypeTags[] = {
{ "bibliography", LA_BIBLIO },
@ -666,7 +666,7 @@ keyword_item endlabelTypeTags[] = {
} // namespace anon
void LyXLayout::readEndLabelType(Lexer & lexrc)
void Layout::readEndLabelType(Lexer & lexrc)
{
PushPopHelper pph(lexrc, endlabelTypeTags,
END_LABEL_ENUM_LAST-END_LABEL_ENUM_FIRST+1);
@ -683,13 +683,13 @@ void LyXLayout::readEndLabelType(Lexer & lexrc)
break;
default:
lyxerr << "Unhandled value " << le
<< " in LyXLayout::readEndLabelType." << endl;
<< " in Layout::readEndLabelType." << endl;
break;
}
}
void LyXLayout::readMargin(Lexer & lexrc)
void Layout::readMargin(Lexer & lexrc)
{
keyword_item marginTags[] = {
{ "dynamic", MARGIN_DYNAMIC },
@ -715,13 +715,13 @@ void LyXLayout::readMargin(Lexer & lexrc)
break;
default:
lyxerr << "Unhandled value " << le
<< " in LyXLayout::readMargin." << endl;
<< " in Layout::readMargin." << endl;
break;
}
}
void LyXLayout::readLatexType(Lexer & lexrc)
void Layout::readLatexType(Lexer & lexrc)
{
keyword_item latexTypeTags[] = {
{ "bib_environment", LATEX_BIB_ENVIRONMENT },
@ -748,7 +748,7 @@ void LyXLayout::readLatexType(Lexer & lexrc)
break;
default:
lyxerr << "Unhandled value " << le
<< " in LyXLayout::readLatexType." << endl;
<< " in Layout::readLatexType." << endl;
break;
}
}
@ -762,7 +762,7 @@ enum SpacingTags {
};
void LyXLayout::readSpacing(Lexer & lexrc)
void Layout::readSpacing(Lexer & lexrc)
{
keyword_item spacingTags[] = {
{"double", ST_SPACING_DOUBLE },
@ -797,25 +797,25 @@ void LyXLayout::readSpacing(Lexer & lexrc)
}
string const & LyXLayout::name() const
string const & Layout::name() const
{
return name_;
}
void LyXLayout::setName(string const & n)
void Layout::setName(string const & n)
{
name_ = n;
}
string const & LyXLayout::obsoleted_by() const
string const & Layout::obsoleted_by() const
{
return obsoleted_by_;
}
string const & LyXLayout::depends_on() const
string const & Layout::depends_on() const
{
return depends_on_;
}

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
/**
* \file LyXLayout.h
* \file Layout.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
@ -28,10 +28,10 @@ class Lexer;
class LyXTextClass;
///
class LyXLayout {
class Layout {
public:
///
LyXLayout();
Layout();
///
bool read(Lexer &, LyXTextClass const &);
///

View File

@ -51,12 +51,12 @@ using std::ostream;
namespace {
class LayoutNamesEqual : public std::unary_function<LyXLayout_ptr, bool> {
class LayoutNamesEqual : public std::unary_function<Layout_ptr, bool> {
public:
LayoutNamesEqual(string const & name)
: name_(name)
{}
bool operator()(LyXLayout_ptr const & c) const
bool operator()(Layout_ptr const & c) const
{
return c->name() == name_;
}
@ -125,7 +125,7 @@ bool LyXTextClass::isTeXClassAvailable() const
}
bool LyXTextClass::do_readStyle(Lexer & lexrc, LyXLayout & lay)
bool LyXTextClass::do_readStyle(Lexer & lexrc, Layout & lay)
{
LYXERR(Debug::TCLASS) << "Reading style " << lay.name() << endl;
if (!lay.read(lexrc, *this)) {
@ -283,17 +283,17 @@ bool LyXTextClass::read(FileName const & filename, bool merge)
string const name = subst(lexrc.getString(),
'_', ' ');
if (hasLayout(name)) {
LyXLayout * lay = operator[](name).get();
Layout * lay = operator[](name).get();
error = do_readStyle(lexrc, *lay);
} else {
LyXLayout lay;
Layout lay;
lay.setName(name);
if (le == TC_ENVIRONMENT)
lay.is_environment = true;
error = do_readStyle(lexrc, lay);
if (!error)
layoutlist_.push_back(
boost::shared_ptr<LyXLayout>(new LyXLayout(lay))
boost::shared_ptr<Layout>(new Layout(lay))
);
if (defaultlayout_.empty()) {
@ -447,14 +447,14 @@ bool LyXTextClass::read(FileName const & filename, bool merge)
error = true;
}
min_toclevel_ = LyXLayout::NOT_IN_TOC;
max_toclevel_ = LyXLayout::NOT_IN_TOC;
min_toclevel_ = Layout::NOT_IN_TOC;
max_toclevel_ = Layout::NOT_IN_TOC;
const_iterator cit = begin();
const_iterator the_end = end();
for ( ; cit != the_end ; ++cit) {
int const toclevel = (*cit)->toclevel;
if (toclevel != LyXLayout::NOT_IN_TOC) {
if (min_toclevel_ == LyXLayout::NOT_IN_TOC)
if (toclevel != Layout::NOT_IN_TOC) {
if (min_toclevel_ == Layout::NOT_IN_TOC)
min_toclevel_ = toclevel;
else
min_toclevel_ = std::min(min_toclevel_,
@ -861,7 +861,7 @@ bool LyXTextClass::hasLayout(string const & n) const
LyXLayout_ptr const & LyXTextClass::operator[](string const & name) const
Layout_ptr const & LyXTextClass::operator[](string const & name) const
{
BOOST_ASSERT(!name.empty());
@ -966,7 +966,7 @@ string const & LyXTextClass::defaultLayoutName() const
}
LyXLayout_ptr const & LyXTextClass::defaultLayout() const
Layout_ptr const & LyXTextClass::defaultLayout() const
{
return operator[](defaultLayoutName());
}
@ -1095,7 +1095,7 @@ int LyXTextClass::max_toclevel() const
bool LyXTextClass::hasTocLevels() const
{
return min_toclevel_ != LyXLayout::NOT_IN_TOC;
return min_toclevel_ != Layout::NOT_IN_TOC;
}

View File

@ -10,7 +10,7 @@
#ifndef LYXTEXTCLASS_H
#define LYXTEXTCLASS_H
#include "LyXLayout.h"
#include "Layout.h"
#include "lyxlayout_ptr_fwd.h"
#include <boost/shared_ptr.hpp>
@ -48,7 +48,7 @@ typedef std::vector<CharStyle> CharStyles;
class LyXTextClass {
public:
/// The individual styles comprising the document class
typedef std::vector<LyXLayout_ptr> LayoutList;
typedef std::vector<Layout_ptr> LayoutList;
/// Enumerate the paragraph styles.
typedef LayoutList::const_iterator const_iterator;
/// Construct a layout with default values. Actual values loaded later.
@ -86,7 +86,7 @@ public:
bool hasLayout(std::string const & name) const;
///
LyXLayout_ptr const & operator[](std::string const & vname) const;
Layout_ptr const & operator[](std::string const & vname) const;
/// Sees to that the textclass structure has been loaded
bool load(std::string const & path = std::string()) const;
@ -106,7 +106,7 @@ public:
///
std::string const & defaultLayoutName() const;
///
LyXLayout_ptr const & defaultLayout() const;
Layout_ptr const & defaultLayout() const;
///
std::string const & name() const;
///
@ -174,7 +174,7 @@ private:
///
bool delete_layout(std::string const &);
///
bool do_readStyle(Lexer &, LyXLayout &);
bool do_readStyle(Lexer &, Layout &);
/// Layout file name
std::string name_;
/// document class name

View File

@ -24,7 +24,7 @@
namespace lyx {
class LyXLayout;
class Layout;
/// Reads the style files
extern bool LyXSetStyle();

View File

@ -177,8 +177,8 @@ lyx_SOURCES = \
LyXFunc.cpp \
LyXFunc.h \
LyX.h \
LyXLayout.cpp \
LyXLayout.h \
Layout.cpp \
Layout.h \
lyxlayout_ptr_fwd.h \
LyXRC.cpp \
LyXRC.h \

View File

@ -76,7 +76,7 @@ using support::rsplit;
/////////////////////////////////////////////////////////////////////
class Encoding;
class LyXLayout;
class Layout;
class Paragraph::Pimpl {
@ -185,7 +185,7 @@ public:
pos_type & i,
unsigned int & column,
Font const & font,
LyXLayout const & style);
Layout const & style);
///
void simpleTeXSpecialChars(Buffer const &, BufferParams const &,
odocstream &,
@ -195,13 +195,13 @@ public:
Font const & outerfont,
bool & open_font,
Change::Type & running_change,
LyXLayout const & style,
Layout const & style,
pos_type & i,
unsigned int & column, value_type const c);
///
void validate(LaTeXFeatures & features,
LyXLayout const & layout) const;
Layout const & layout) const;
///
unsigned int id_;
@ -584,7 +584,7 @@ bool Paragraph::Pimpl::simpleTeXBlanks(Encoding const & encoding,
pos_type & i,
unsigned int & column,
Font const & font,
LyXLayout const & style)
Layout const & style)
{
if (style.pass_thru)
return false;
@ -666,7 +666,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
Font const & outerfont,
bool & open_font,
Change::Type & running_change,
LyXLayout const & style,
Layout const & style,
pos_type & i,
unsigned int & column,
value_type const c)
@ -942,7 +942,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
void Paragraph::Pimpl::validate(LaTeXFeatures & features,
LyXLayout const & layout) const
Layout const & layout) const
{
BufferParams const & bparams = features.bufferParams();
@ -1335,7 +1335,7 @@ Font const Paragraph::getFont(BufferParams const & bparams, pos_type pos,
{
BOOST_ASSERT(pos >= 0);
LyXLayout_ptr const & lout = layout();
Layout_ptr const & lout = layout();
pos_type const body_pos = beginOfBody();
@ -1608,7 +1608,7 @@ docstring const Paragraph::translateIfPossible(docstring const & s,
}
docstring Paragraph::expandLabel(LyXLayout_ptr const & layout,
docstring Paragraph::expandLabel(Layout_ptr const & layout,
BufferParams const & bparams, bool process_appendix) const
{
LyXTextClass const & tclass = bparams.getLyXTextClass();
@ -1637,7 +1637,7 @@ docstring Paragraph::expandLabel(LyXLayout_ptr const & layout,
}
void Paragraph::applyLayout(LyXLayout_ptr const & new_layout)
void Paragraph::applyLayout(Layout_ptr const & new_layout)
{
layout(new_layout);
params().labelWidthString(docstring());
@ -1905,7 +1905,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
bool return_value = false;
LyXLayout_ptr style;
Layout_ptr style;
// well we have to check if we are in an inset with unlimited
// length (all in one row) if that is true then we don't allow
@ -2249,7 +2249,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
{
bool emph_flag = false;
LyXLayout_ptr const & style = layout();
Layout_ptr const & style = layout();
Font font_old =
style->labeltype == LABEL_MANUAL ? style->labelfont : style->font;
@ -2457,13 +2457,13 @@ int Paragraph::id() const
}
LyXLayout_ptr const & Paragraph::layout() const
Layout_ptr const & Paragraph::layout() const
{
return layout_;
}
void Paragraph::layout(LyXLayout_ptr const & new_layout)
void Paragraph::layout(Layout_ptr const & new_layout)
{
layout_ = new_layout;
}

View File

@ -172,9 +172,9 @@ public:
bool empty() const { return text_.empty(); }
///
LyXLayout_ptr const & layout() const;
Layout_ptr const & layout() const;
///
void layout(LyXLayout_ptr const & new_layout);
void layout(Layout_ptr const & new_layout);
/// This is the item depth, only used by enumerate and itemize
signed char itemdepth;
@ -236,7 +236,7 @@ public:
docstring const translateIfPossible(docstring const & label,
BufferParams const & bparams) const;
/// Expand the counters for the labelstring of \c layout
docstring expandLabel(LyXLayout_ptr const &, BufferParams const &,
docstring expandLabel(Layout_ptr const &, BufferParams const &,
bool process_appendix = true) const;
/// Actual paragraph alignment used
char getAlign() const;
@ -245,7 +245,7 @@ public:
/// The maximal possible depth of a paragraph after this one
depth_type getMaxDepthAfter() const;
///
void applyLayout(LyXLayout_ptr const & new_layout);
void applyLayout(Layout_ptr const & new_layout);
/// (logically) erase the char at pos; return true if it was actually erased
bool eraseChar(pos_type pos, bool trackChanges);
@ -370,7 +370,7 @@ public:
private:
///
LyXLayout_ptr layout_;
Layout_ptr layout_;
/**
* Keeping this here instead of in the pimpl makes LyX >10% faster
* for average tasks as buffer loading/switching etc.

View File

@ -18,7 +18,7 @@
#include "Buffer.h"
#include "gettext.h"
#include "LyXLayout.h"
#include "Layout.h"
#include "Lexer.h"
#include "LyXText.h"
#include "Paragraph.h"
@ -276,7 +276,7 @@ void params2string(Paragraph const & par, string & data)
params.labelWidthString(par.getLabelWidthString());
// Alignment
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
if (params.align() == LYX_ALIGN_LAYOUT)
params.align(layout->align);

View File

@ -281,7 +281,7 @@ RowMetrics TextMetrics::computeRowMetrics(pit_type const pit,
result.x = text_->leftMargin(buffer, max_width_, pit, row.pos());
// is there a manual margin with a manual label
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
if (layout->margintype == MARGIN_MANUAL
&& layout->labeltype == LABEL_MANUAL) {
@ -453,7 +453,7 @@ void TextMetrics::rowBreakPoint(int width, pit_type const pit,
return;
}
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
if (layout->margintype == MARGIN_RIGHT_ADDRESS_BOX) {
row.endpos(addressBreakPoint(pos, par));
@ -606,7 +606,7 @@ void TextMetrics::setHeightOfRow(pit_type const pit,
// ok, let us initialize the maxasc and maxdesc value.
// Only the fontsize count. The other properties
// are taken from the layoutfont. Nicer on the screen :)
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
// as max get the first character of this row then it can
// increase but not decrease the height. Just some point to
@ -799,7 +799,7 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit,
pos_type vc = row.pos();
pos_type end = row.endpos();
pos_type c = 0;
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
bool left_side = false;

View File

@ -149,7 +149,7 @@ void TocBackend::updateItem(ParConstIterator const & par_it)
}
int const toclevel = toc_item->par_it_->layout()->toclevel;
if (toclevel != LyXLayout::NOT_IN_TOC
if (toclevel != Layout::NOT_IN_TOC
&& toclevel >= min_toclevel
&& toclevel <= bufparams.tocdepth
&& tocstring.empty())
@ -199,7 +199,7 @@ void TocBackend::update()
/// now the toc entry for the paragraph
int const toclevel = pit->layout()->toclevel;
if (toclevel != LyXLayout::NOT_IN_TOC
if (toclevel != Layout::NOT_IN_TOC
&& toclevel >= min_toclevel
&& toclevel <= bufparams.tocdepth) {
// insert this into the table of contents

View File

@ -424,7 +424,7 @@ void setCaptions(Paragraph & par, LyXTextClass const & textclass)
void setLabel(Buffer const & buf, ParIterator & it, LyXTextClass const & textclass)
{
Paragraph & par = *it;
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
Counters & counters = textclass.counters();
if (it.pit() == 0) {
@ -703,7 +703,7 @@ void updateLabels(Buffer const & buf, bool childonly)
void checkBufferStructure(Buffer & buffer, ParIterator const & par_it)
{
if (par_it->layout()->labeltype == LABEL_COUNTER
&& par_it->layout()->toclevel != LyXLayout::NOT_IN_TOC) {
&& par_it->layout()->toclevel != Layout::NOT_IN_TOC) {
buffer.tocBackend().updateItem(par_it);
buffer.structureChanged();
}

View File

@ -27,7 +27,7 @@
#include "Session.h"
#include "LaTeXFeatures.h"
#include "LyX.h"
#include "LyXLayout.h"
#include "Layout.h"
#include "LyXRC.h"
#include "LyXText.h"
#include "Paragraph.h"

View File

@ -693,7 +693,7 @@ void QDocumentDialog::updateNumbering()
QTreeWidgetItem * item = 0;
for ( ; cit != end ; ++cit) {
int const toclevel = (*cit)->toclevel;
if (toclevel != LyXLayout::NOT_IN_TOC
if (toclevel != Layout::NOT_IN_TOC
&& (*cit)->labeltype == LABEL_COUNTER) {
item = new QTreeWidgetItem(numberingModule->tocTW);
item->setText(0, qt_((*cit)->name()));

View File

@ -224,7 +224,7 @@ void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd)
// FIXME: Change only the pasted paragraphs
BufferParams const & bp = cur.buffer().params();
LyXLayout_ptr const layout =
Layout_ptr const layout =
bp.getLyXTextClass().defaultLayout();
Font font = layout->font;
// ERT contents has always latex_language

View File

@ -91,7 +91,7 @@ int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os,
}
LyXLayout_ptr const & InsetEnvironment::layout() const
Layout_ptr const & InsetEnvironment::layout() const
{
return layout_;
}

View File

@ -41,7 +41,7 @@ public:
///
Inset::EDITABLE editable() const { return HIGHLY_EDITABLE; }
///
LyXLayout_ptr const & layout() const;
Layout_ptr const & layout() const;
/** returns true if, when outputing LaTeX, font changes should
be closed before generating this inset. This is needed for
insets that may contain several paragraphs */
@ -51,7 +51,7 @@ protected:
private:
virtual std::auto_ptr<Inset> doClone() const;
/// the layout
LyXLayout_ptr layout_;
Layout_ptr layout_;
///
docstring name_;
};

View File

@ -16,7 +16,7 @@
#include "gettext.h"
// the following are needed just to get the layout of the enclosing
// paragraph. This seems a bit too much to me (JMarc)
#include "LyXLayout.h"
#include "Layout.h"
#include "OutputParams.h"
#include "Paragraph.h"
#include "paragraph_funcs.h"

View File

@ -119,7 +119,7 @@ void InsetText::clear()
ParagraphList & pars = paragraphs();
// This is a gross hack...
LyXLayout_ptr old_layout = pars.begin()->layout();
Layout_ptr old_layout = pars.begin()->layout();
pars.clear();
pars.push_back(Paragraph());

View File

@ -17,10 +17,10 @@
namespace lyx {
class LyXLayout;
class Layout;
/// Global typedef
typedef boost::shared_ptr<LyXLayout> LyXLayout_ptr;
typedef boost::shared_ptr<Layout> Layout_ptr;
} // namespace lyx

View File

@ -41,7 +41,7 @@ InsetMathMBox::InsetMathMBox()
}
InsetMathMBox::InsetMathMBox(LyXLayout_ptr const & layout)
InsetMathMBox::InsetMathMBox(Layout_ptr const & layout)
{
text_.paragraphs().clear();
text_.paragraphs().push_back(Paragraph());

View File

@ -31,7 +31,7 @@ class InsetMathMBox : public InsetMathDim {
public:
///
explicit InsetMathMBox();
explicit InsetMathMBox(LyXLayout_ptr const & layout);
explicit InsetMathMBox(Layout_ptr const & layout);
/// this stores metrics information in cache_
bool metrics(MetricsInfo & mi, Dimension & dim) const;

View File

@ -61,11 +61,11 @@ ParagraphList::const_iterator searchCommand(
ParagraphList::const_iterator const & par,
ParagraphList::const_iterator const & pend)
{
LyXLayout_ptr const & bstyle = par->layout();
Layout_ptr const & bstyle = par->layout();
ParagraphList::const_iterator p = boost::next(par);
for ( ; p != pend; ++p) {
LyXLayout_ptr const & style = p->layout();
Layout_ptr const & style = p->layout();
if (style->latextype == LATEX_COMMAND
&& style->commanddepth <= bstyle->commanddepth)
return p;
@ -78,10 +78,10 @@ ParagraphList::const_iterator searchEnvironment(
ParagraphList::const_iterator const & par,
ParagraphList::const_iterator const & pend)
{
LyXLayout_ptr const & bstyle = par->layout();
Layout_ptr const & bstyle = par->layout();
ParagraphList::const_iterator p = boost::next(par);
for (; p != pend; ++p) {
LyXLayout_ptr const & style = p->layout();
Layout_ptr const & style = p->layout();
if (style->latextype == LATEX_COMMAND)
return p;
@ -109,7 +109,7 @@ ParagraphList::const_iterator makeParagraph(Buffer const & buf,
ParagraphList::const_iterator const & pbegin,
ParagraphList::const_iterator const & pend)
{
LyXLayout_ptr const & defaultstyle =
Layout_ptr const & defaultstyle =
buf.params().getLyXTextClass().defaultLayout();
for (ParagraphList::const_iterator par = pbegin; par != pend; ++par) {
if (par != pbegin)
@ -134,8 +134,8 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
ParagraphList::const_iterator const & pend) {
ParagraphList::const_iterator par = pbegin;
LyXLayout_ptr const & defaultstyle = buf.params().getLyXTextClass().defaultLayout();
LyXLayout_ptr const & bstyle = par->layout();
Layout_ptr const & defaultstyle = buf.params().getLyXTextClass().defaultLayout();
Layout_ptr const & bstyle = par->layout();
string item_tag;
// Opening outter tag
@ -145,7 +145,7 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
os << "<![CDATA[";
while (par != pend) {
LyXLayout_ptr const & style = par->layout();
Layout_ptr const & style = par->layout();
ParagraphList::const_iterator send;
string id = par->getID(buf, runparams);
string wrapper = "";
@ -247,7 +247,7 @@ ParagraphList::const_iterator makeCommand(Buffer const & buf,
ParagraphList::const_iterator const & pend)
{
ParagraphList::const_iterator par = pbegin;
LyXLayout_ptr const & bstyle = par->layout();
Layout_ptr const & bstyle = par->layout();
//Open outter tag
sgml::openTag(buf, os, runparams, *pbegin);
@ -269,7 +269,7 @@ ParagraphList::const_iterator makeCommand(Buffer const & buf,
++par;
while (par != pend) {
LyXLayout_ptr const & style = par->layout();
Layout_ptr const & style = par->layout();
ParagraphList::const_iterator send;
switch (style->latextype) {
@ -321,7 +321,7 @@ void docbookParagraphs(ParagraphList const & paragraphs,
}
while (par != pend) {
LyXLayout_ptr const & style = par->layout();
Layout_ptr const & style = par->layout();
ParagraphList::const_iterator lastpar = par;
ParagraphList::const_iterator send;

View File

@ -94,7 +94,7 @@ TeXEnvironment(Buffer const & buf,
BufferParams const & bparams = buf.params();
LyXLayout_ptr const & style = pit->layout();
Layout_ptr const & style = pit->layout();
Language const * const par_language = pit->getParLanguage(bparams);
Language const * const doc_language = bparams.language;
@ -243,7 +243,7 @@ TeXOnePar(Buffer const & buf,
LYXERR(Debug::LATEX) << "TeXOnePar... " << &*pit << " '"
<< everypar << "'" << endl;
BufferParams const & bparams = buf.params();
LyXLayout_ptr style;
Layout_ptr style;
// In an inset with unlimited length (all in one row),
// force layout to default
@ -526,7 +526,7 @@ void latexParagraphs(Buffer const & buf,
// any environment other than the default layout of the
// text class to be valid!
if (!par->forceDefaultParagraphs()) {
LyXLayout_ptr const & layout = par->layout();
Layout_ptr const & layout = par->layout();
if (layout->intitle) {
if (already_title) {

View File

@ -258,7 +258,7 @@ int getEndLabel(pit_type p, ParagraphList const & pars)
pit_type pit = p;
depth_type par_depth = pars[p].getDepth();
while (pit != pit_type(pars.size())) {
LyXLayout_ptr const & layout = pars[pit].layout();
Layout_ptr const & layout = pars[pit].layout();
int const endlabeltype = layout->endlabeltype;
if (endlabeltype != END_LABEL_NO_LABEL) {

View File

@ -548,7 +548,7 @@ void RowPainter::paintFirst()
Buffer const & buffer = *bv_.buffer();
LyXLayout_ptr const & layout = par_.layout();
Layout_ptr const & layout = par_.layout();
if (buffer.params().paragraph_separation == BufferParams::PARSEP_SKIP) {
if (pit_ != 0) {
@ -556,7 +556,7 @@ void RowPainter::paintFirst()
&& !par_.getDepth()) {
y_top += buffer.params().getDefSkip().inPixels(bv_);
} else {
LyXLayout_ptr const & playout = pars_[pit_ - 1].layout();
Layout_ptr const & playout = pars_[pit_ - 1].layout();
if (playout->latextype == LATEX_PARAGRAPH
&& !pars_[pit_ - 1].getDepth()) {
// is it right to use defskip here, too? (AS)
@ -724,7 +724,7 @@ void RowPainter::paintText()
body_pos = 0;
}
LyXLayout_ptr const & layout = par_.layout();
Layout_ptr const & layout = par_.layout();
bool running_strikeout = false;
bool is_struckout = false;

View File

@ -205,7 +205,7 @@ void sgml::closeTag(odocstream & os, string const & name)
void sgml::openTag(Buffer const & buf, odocstream & os,
OutputParams const & runparams, Paragraph const & par)
{
LyXLayout_ptr const & style = par.layout();
Layout_ptr const & style = par.layout();
string const & name = style->latexname();
string param = style->latexparam();
Counters & counters = buf.params().getLyXTextClass().counters();
@ -240,7 +240,7 @@ void sgml::openTag(Buffer const & buf, odocstream & os,
void sgml::closeTag(odocstream & os, Paragraph const & par)
{
LyXLayout_ptr const & style = par.layout();
Layout_ptr const & style = par.layout();
closeTag(os, style->latexname());
}

View File

@ -25,7 +25,7 @@ using std::string;
namespace {
void begin_layout(ostream & os, LyXLayout_ptr layout, TeXFont const & font,
void begin_layout(ostream & os, Layout_ptr layout, TeXFont const & font,
TeXFont const & normalfont)
{
os << "\n\\begin_layout " << layout->name() << "\n";
@ -85,7 +85,7 @@ bool Context::empty = true;
Context::Context(bool need_layout_,
LyXTextClass const & textclass_,
LyXLayout_ptr layout_, LyXLayout_ptr parent_layout_,
Layout_ptr layout_, Layout_ptr parent_layout_,
TeXFont font_)
: need_layout(need_layout_),
need_end_layout(false), need_end_deeper(false),

View File

@ -78,8 +78,8 @@ class Context {
public:
Context(bool need_layout_,
LyXTextClass const & textclass_,
LyXLayout_ptr layout_ = LyXLayout_ptr(),
LyXLayout_ptr parent_layout_= LyXLayout_ptr(),
Layout_ptr layout_ = Layout_ptr(),
Layout_ptr parent_layout_= Layout_ptr(),
TeXFont font_ = TeXFont());
~Context();
@ -142,9 +142,9 @@ public:
/// The textclass of the document. Could actually be a global variable
LyXTextClass const & textclass;
/// The layout of the current paragraph
LyXLayout_ptr layout;
Layout_ptr layout;
/// The layout of the outer paragraph (for environment layouts)
LyXLayout_ptr parent_layout;
Layout_ptr parent_layout;
/// font attributes of this context
TeXFont font;
/// font attributes of normal text

View File

@ -26,8 +26,8 @@ LINKED_FILES = \
FloatList.cpp \
Floating.cpp \
Counters.cpp \
LyXLayout.h \
LyXLayout.cpp \
Layout.h \
Layout.cpp \
LyXTextClass.cpp \
LyXTextClass.h \
Lexer.cpp

View File

@ -434,10 +434,10 @@ void handle_comment(ostream & os, string const & s, Context & context)
}
class isLayout : public std::unary_function<LyXLayout_ptr, bool> {
class isLayout : public std::unary_function<Layout_ptr, bool> {
public:
isLayout(string const name) : name_(name) {}
bool operator()(LyXLayout_ptr const & ptr) const {
bool operator()(Layout_ptr const & ptr) const {
return ptr->latexname() == name_;
}
private:
@ -445,7 +445,7 @@ private:
};
LyXLayout_ptr findLayout(LyXTextClass const & textclass,
Layout_ptr findLayout(LyXTextClass const & textclass,
string const & name)
{
LyXTextClass::const_iterator beg = textclass.begin();
@ -454,7 +454,7 @@ LyXLayout_ptr findLayout(LyXTextClass const & textclass,
LyXTextClass::const_iterator
it = std::find_if(beg, end, isLayout(name));
return (it == end) ? LyXLayout_ptr() : *it;
return (it == end) ? Layout_ptr() : *it;
}
@ -463,7 +463,7 @@ void eat_whitespace(Parser &, ostream &, Context &, bool);
void output_command_layout(ostream & os, Parser & p, bool outer,
Context & parent_context,
LyXLayout_ptr newlayout)
Layout_ptr newlayout)
{
parent_context.check_end_layout(os);
Context context(true, parent_context.textclass, newlayout,
@ -717,7 +717,7 @@ void parse_unknown_environment(Parser & p, string const & name, ostream & os,
void parse_environment(Parser & p, ostream & os, bool outer,
Context & parent_context)
{
LyXLayout_ptr newlayout;
Layout_ptr newlayout;
string const name = p.getArg('{', '}');
const bool is_starred = suffixIs(name, '*');
string const unstarred_name = rtrim(name, "*");
@ -1102,7 +1102,7 @@ void parse_noweb(Parser & p, ostream & os, Context & context)
void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
Context & context)
{
LyXLayout_ptr newlayout;
Layout_ptr newlayout;
// Store the latest bibliographystyle (needed for bibtex inset)
string bibliographystyle;
bool const use_natbib = used_packages.find("natbib") != used_packages.end();

View File

@ -139,7 +139,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
par.layout(bp.getLyXTextClass()[layoutname]);
// Test whether the layout is obsolete.
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
if (!layout->obsoleted_by().empty())
par.layout(bp.getLyXTextClass()[layout->obsoleted_by()]);
@ -403,7 +403,7 @@ int LyXText::leftMargin(Buffer const & buffer, int max_width,
BOOST_ASSERT(pos <= par.size());
//lyxerr << "LyXText::leftMargin: pit: " << pit << " pos: " << pos << endl;
LyXTextClass const & tclass = buffer.params().getLyXTextClass();
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
string parindent = layout->parindent;
@ -587,7 +587,7 @@ void LyXText::breakParagraph(Cursor & cur, bool keep_layout)
pit_type cpit = cur.pit();
LyXTextClass const & tclass = cur.buffer().params().getLyXTextClass();
LyXLayout_ptr const & layout = cpar.layout();
Layout_ptr const & layout = cpar.layout();
// this is only allowed, if the current paragraph is not empty
// or caption and if it has not the keepempty flag active
@ -1775,7 +1775,7 @@ docstring LyXText::getPossibleLabel(Cursor & cur) const
{
pit_type pit = cur.pit();
LyXLayout_ptr layout = pars_[pit].layout();
Layout_ptr layout = pars_[pit].layout();
docstring text;
docstring par_text = pars_[pit].asString(cur.buffer(), false);
@ -1799,7 +1799,7 @@ docstring LyXText::getPossibleLabel(Cursor & cur) const
// For section, subsection, etc...
if (layout->latextype == LATEX_PARAGRAPH && pit != 0) {
LyXLayout_ptr const & layout2 = pars_[pit - 1].layout();
Layout_ptr const & layout2 = pars_[pit - 1].layout();
if (layout2->latextype != LATEX_PARAGRAPH) {
--pit;
layout = layout2;

View File

@ -148,7 +148,7 @@ Font LyXText::getFont(Buffer const & buffer, Paragraph const & par,
{
BOOST_ASSERT(pos >= 0);
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
#ifdef WITH_WARNINGS
#warning broken?
#endif
@ -228,7 +228,7 @@ void LyXText::applyOuterFont(Buffer const & buffer, Font & font) const {
Font LyXText::getLayoutFont(Buffer const & buffer, pit_type const pit) const
{
LyXLayout_ptr const & layout = pars_[pit].layout();
Layout_ptr const & layout = pars_[pit].layout();
if (!pars_[pit].getDepth()) {
Font lf = layout->resfont;
@ -249,7 +249,7 @@ Font LyXText::getLayoutFont(Buffer const & buffer, pit_type const pit) const
Font LyXText::getLabelFont(Buffer const & buffer, Paragraph const & par) const
{
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
if (!par.getDepth()) {
Font lf = layout->reslabelfont;
@ -271,7 +271,7 @@ void LyXText::setCharFont(Buffer const & buffer, pit_type pit,
pos_type pos, Font const & fnt)
{
Font font = fnt;
LyXLayout_ptr const & layout = pars_[pit].layout();
Layout_ptr const & layout = pars_[pit].layout();
// Get concrete layout font to reduce against
Font layoutfont;
@ -332,7 +332,7 @@ void LyXText::setLayout(Buffer const & buffer, pit_type start, pit_type end,
BOOST_ASSERT(start != end);
BufferParams const & bufparams = buffer.params();
LyXLayout_ptr const & lyxlayout = bufparams.getLyXTextClass()[layout];
Layout_ptr const & lyxlayout = bufparams.getLyXTextClass()[layout];
for (pit_type pit = start; pit != end; ++pit) {
Paragraph & par = pars_[pit];
@ -351,7 +351,7 @@ void LyXText::setLayout(Cursor & cur, string const & layout)
// special handling of new environment insets
BufferView & bv = cur.bv();
BufferParams const & params = bv.buffer()->params();
LyXLayout_ptr const & lyxlayout = params.getLyXTextClass()[layout];
Layout_ptr const & lyxlayout = params.getLyXTextClass()[layout];
if (lyxlayout->is_environment) {
// move everything in a new environment inset
LYXERR(Debug::DEBUG) << "setting layout " << layout << endl;
@ -606,7 +606,7 @@ void LyXText::setParagraph(Cursor & cur,
params.spacing(spacing);
// does the layout allow the new alignment?
LyXLayout_ptr const & layout = par.layout();
Layout_ptr const & layout = par.layout();
if (align == LYX_ALIGN_LAYOUT)
align = layout->align;

View File

@ -272,7 +272,7 @@ bool doInsertInset(Cursor & cur, LyXText * text,
lyx::dispatch(FuncRequest(LFUN_PASTE, "0"));
// reset first par to default
if (cur.lastpit() != 0 || cur.lastpos() != 0) {
LyXLayout_ptr const layout =
Layout_ptr const layout =
cur.buffer().params().getLyXTextClass().defaultLayout();
cur.text()->paragraphs().begin()->layout(layout);
}
@ -953,7 +953,7 @@ void LyXText::dispatch(Cursor & cur, FuncRequest & cmd)
Paragraph & par = cur.paragraph();
pos_type pos = cur.pos();
BufferParams const & bufparams = bv->buffer()->params();
LyXLayout_ptr const & style = par.layout();
Layout_ptr const & style = par.layout();
if (!style->pass_thru
&& par.getFontSettings(bufparams, pos).language()->lang() != "hebrew") {
// this avoids a double undo

View File

@ -56,7 +56,7 @@ void outline(OutlineOp mode, Cursor & cur)
// Seek the one (on same level) below
for (; finish != end; ++finish) {
toclevel = finish->layout()->toclevel;
if (toclevel != LyXLayout::NOT_IN_TOC
if (toclevel != Layout::NOT_IN_TOC
&& toclevel <= thistoclevel) {
break;
}
@ -70,10 +70,10 @@ void outline(OutlineOp mode, Cursor & cur)
--dest;
toclevel = dest->layout()->toclevel;
} while(dest != bgn
&& (toclevel == LyXLayout::NOT_IN_TOC
&& (toclevel == Layout::NOT_IN_TOC
|| toclevel > thistoclevel));
// Not found; do nothing
if (toclevel == LyXLayout::NOT_IN_TOC
if (toclevel == Layout::NOT_IN_TOC
|| toclevel > thistoclevel)
break;
pit_type const newpit = std::distance(bgn, dest);
@ -93,7 +93,7 @@ void outline(OutlineOp mode, Cursor & cur)
// Find next same-level header:
for (; finish != end; ++finish) {
toclevel = finish->layout()->toclevel;
if (toclevel != LyXLayout::NOT_IN_TOC
if (toclevel != Layout::NOT_IN_TOC
&& toclevel <= thistoclevel) {
break;
}
@ -107,7 +107,7 @@ void outline(OutlineOp mode, Cursor & cur)
// Go further down to find header to insert in front of:
for (; dest != end; ++dest) {
toclevel = dest->layout()->toclevel;
if (toclevel != LyXLayout::NOT_IN_TOC
if (toclevel != Layout::NOT_IN_TOC
&& toclevel <= thistoclevel) {
break;
}