mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
rename Layout_ptr into LayoutPtr
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19758 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
50d78265aa
commit
39c7e2faf0
@ -148,7 +148,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())) {
|
||||
Layout_ptr const layout =
|
||||
LayoutPtr const layout =
|
||||
buffer.params().getTextClass().defaultLayout();
|
||||
ParagraphList::iterator const end = insertion.end();
|
||||
for (ParagraphList::iterator par = insertion.begin();
|
||||
|
@ -277,7 +277,7 @@ void LaTeXFeatures::useLayout(docstring const & layoutname)
|
||||
return;
|
||||
}
|
||||
|
||||
Layout_ptr const & lyt = tclass[layoutname];
|
||||
LayoutPtr const & lyt = tclass[layoutname];
|
||||
if (!lyt->depends_on().empty()) {
|
||||
++level;
|
||||
useLayout(lyt->depends_on());
|
||||
|
@ -1647,7 +1647,7 @@ docstring const Paragraph::translateIfPossible(docstring const & s,
|
||||
}
|
||||
|
||||
|
||||
docstring Paragraph::expandLabel(Layout_ptr const & layout,
|
||||
docstring Paragraph::expandLabel(LayoutPtr const & layout,
|
||||
BufferParams const & bparams, bool process_appendix) const
|
||||
{
|
||||
TextClass const & tclass = bparams.getTextClass();
|
||||
@ -1681,7 +1681,7 @@ docstring Paragraph::expandLabel(Layout_ptr const & layout,
|
||||
}
|
||||
|
||||
|
||||
void Paragraph::applyLayout(Layout_ptr const & new_layout)
|
||||
void Paragraph::applyLayout(LayoutPtr const & new_layout)
|
||||
{
|
||||
layout(new_layout);
|
||||
LyXAlignment const oldAlign = params().align();
|
||||
@ -1958,7 +1958,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
|
||||
|
||||
bool return_value = false;
|
||||
|
||||
Layout_ptr style;
|
||||
LayoutPtr 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
|
||||
@ -2322,7 +2322,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
|
||||
{
|
||||
bool emph_flag = false;
|
||||
|
||||
Layout_ptr const & style = layout();
|
||||
LayoutPtr const & style = layout();
|
||||
Font font_old =
|
||||
style->labeltype == LABEL_MANUAL ? style->labelfont : style->font;
|
||||
|
||||
@ -2529,13 +2529,13 @@ int Paragraph::id() const
|
||||
}
|
||||
|
||||
|
||||
Layout_ptr const & Paragraph::layout() const
|
||||
LayoutPtr const & Paragraph::layout() const
|
||||
{
|
||||
return layout_;
|
||||
}
|
||||
|
||||
|
||||
void Paragraph::layout(Layout_ptr const & new_layout)
|
||||
void Paragraph::layout(LayoutPtr const & new_layout)
|
||||
{
|
||||
layout_ = new_layout;
|
||||
}
|
||||
|
@ -172,9 +172,9 @@ public:
|
||||
bool empty() const { return text_.empty(); }
|
||||
|
||||
///
|
||||
Layout_ptr const & layout() const;
|
||||
LayoutPtr const & layout() const;
|
||||
///
|
||||
void layout(Layout_ptr const & new_layout);
|
||||
void layout(LayoutPtr 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(Layout_ptr const &, BufferParams const &,
|
||||
docstring expandLabel(LayoutPtr 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(Layout_ptr const & new_layout);
|
||||
void applyLayout(LayoutPtr const & new_layout);
|
||||
|
||||
/// (logically) erase the char at pos; return true if it was actually erased
|
||||
bool eraseChar(pos_type pos, bool trackChanges);
|
||||
@ -379,7 +379,7 @@ public:
|
||||
private:
|
||||
|
||||
///
|
||||
Layout_ptr layout_;
|
||||
LayoutPtr layout_;
|
||||
/**
|
||||
* Keeping this here instead of in the pimpl makes LyX >10% faster
|
||||
* for average tasks as buffer loading/switching etc.
|
||||
|
@ -316,7 +316,7 @@ void params2string(Paragraph const & par, string & data)
|
||||
ostringstream os;
|
||||
params.write(os);
|
||||
|
||||
Layout_ptr const & layout = par.layout();
|
||||
LayoutPtr const & layout = par.layout();
|
||||
|
||||
// Is alignment possible
|
||||
os << "\\alignpossible " << layout->alignpossible << '\n';
|
||||
|
10
src/Text.cpp
10
src/Text.cpp
@ -141,7 +141,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
|
||||
par.layout(bp.getTextClass()[layoutname]);
|
||||
|
||||
// Test whether the layout is obsolete.
|
||||
Layout_ptr const & layout = par.layout();
|
||||
LayoutPtr const & layout = par.layout();
|
||||
if (!layout->obsoleted_by().empty())
|
||||
par.layout(bp.getTextClass()[layout->obsoleted_by()]);
|
||||
|
||||
@ -379,7 +379,7 @@ int Text::leftMargin(Buffer const & buffer, int max_width,
|
||||
BOOST_ASSERT(pos <= par.size());
|
||||
//lyxerr << "Text::leftMargin: pit: " << pit << " pos: " << pos << endl;
|
||||
TextClass const & tclass = buffer.params().getTextClass();
|
||||
Layout_ptr const & layout = par.layout();
|
||||
LayoutPtr const & layout = par.layout();
|
||||
|
||||
docstring parindent = layout->parindent;
|
||||
|
||||
@ -545,7 +545,7 @@ void Text::breakParagraph(Cursor & cur, bool keep_layout)
|
||||
pit_type cpit = cur.pit();
|
||||
|
||||
TextClass const & tclass = cur.buffer().params().getTextClass();
|
||||
Layout_ptr const & layout = cpar.layout();
|
||||
LayoutPtr 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
|
||||
@ -1850,7 +1850,7 @@ docstring Text::getPossibleLabel(Cursor & cur) const
|
||||
{
|
||||
pit_type pit = cur.pit();
|
||||
|
||||
Layout_ptr layout = pars_[pit].layout();
|
||||
LayoutPtr layout = pars_[pit].layout();
|
||||
|
||||
docstring text;
|
||||
docstring par_text = pars_[pit].asString(cur.buffer(), false);
|
||||
@ -1874,7 +1874,7 @@ docstring Text::getPossibleLabel(Cursor & cur) const
|
||||
|
||||
// For section, subsection, etc...
|
||||
if (layout->latextype == LATEX_PARAGRAPH && pit != 0) {
|
||||
Layout_ptr const & layout2 = pars_[pit - 1].layout();
|
||||
LayoutPtr const & layout2 = pars_[pit - 1].layout();
|
||||
if (layout2->latextype != LATEX_PARAGRAPH) {
|
||||
--pit;
|
||||
layout = layout2;
|
||||
|
@ -150,7 +150,7 @@ Font Text::getFont(Buffer const & buffer, Paragraph const & par,
|
||||
{
|
||||
BOOST_ASSERT(pos >= 0);
|
||||
|
||||
Layout_ptr const & layout = par.layout();
|
||||
LayoutPtr const & layout = par.layout();
|
||||
// FIXME: broken?
|
||||
BufferParams const & params = buffer.params();
|
||||
pos_type const body_pos = par.beginOfBody();
|
||||
@ -228,7 +228,7 @@ void Text::applyOuterFont(Buffer const & buffer, Font & font) const {
|
||||
|
||||
Font Text::getLayoutFont(Buffer const & buffer, pit_type const pit) const
|
||||
{
|
||||
Layout_ptr const & layout = pars_[pit].layout();
|
||||
LayoutPtr const & layout = pars_[pit].layout();
|
||||
|
||||
if (!pars_[pit].getDepth()) {
|
||||
Font lf = layout->resfont;
|
||||
@ -249,7 +249,7 @@ Font Text::getLayoutFont(Buffer const & buffer, pit_type const pit) const
|
||||
|
||||
Font Text::getLabelFont(Buffer const & buffer, Paragraph const & par) const
|
||||
{
|
||||
Layout_ptr const & layout = par.layout();
|
||||
LayoutPtr const & layout = par.layout();
|
||||
|
||||
if (!par.getDepth()) {
|
||||
Font lf = layout->reslabelfont;
|
||||
@ -271,7 +271,7 @@ void Text::setCharFont(Buffer const & buffer, pit_type pit,
|
||||
pos_type pos, Font const & fnt)
|
||||
{
|
||||
Font font = fnt;
|
||||
Layout_ptr const & layout = pars_[pit].layout();
|
||||
LayoutPtr const & layout = pars_[pit].layout();
|
||||
|
||||
// Get concrete layout font to reduce against
|
||||
Font layoutfont;
|
||||
@ -353,7 +353,7 @@ void Text::setLayout(Buffer const & buffer, pit_type start, pit_type end,
|
||||
BOOST_ASSERT(start != end);
|
||||
|
||||
BufferParams const & bufparams = buffer.params();
|
||||
Layout_ptr const & lyxlayout = bufparams.getTextClass()[layout];
|
||||
LayoutPtr const & lyxlayout = bufparams.getTextClass()[layout];
|
||||
|
||||
for (pit_type pit = start; pit != end; ++pit) {
|
||||
Paragraph & par = pars_[pit];
|
||||
@ -372,7 +372,7 @@ void Text::setLayout(Cursor & cur, docstring const & layout)
|
||||
// special handling of new environment insets
|
||||
BufferView & bv = cur.bv();
|
||||
BufferParams const & params = bv.buffer().params();
|
||||
Layout_ptr const & lyxlayout = params.getTextClass()[layout];
|
||||
LayoutPtr const & lyxlayout = params.getTextClass()[layout];
|
||||
if (lyxlayout->is_environment) {
|
||||
// move everything in a new environment inset
|
||||
LYXERR(Debug::DEBUG) << "setting layout " << to_utf8(layout) << endl;
|
||||
|
@ -265,7 +265,7 @@ bool doInsertInset(Cursor & cur, Text * text,
|
||||
lyx::dispatch(FuncRequest(LFUN_PASTE, "0"));
|
||||
// reset first par to default
|
||||
if (cur.lastpit() != 0 || cur.lastpos() != 0) {
|
||||
Layout_ptr const layout =
|
||||
LayoutPtr const layout =
|
||||
cur.buffer().params().getTextClass().defaultLayout();
|
||||
cur.text()->paragraphs().begin()->layout(layout);
|
||||
}
|
||||
@ -954,7 +954,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
Paragraph & par = cur.paragraph();
|
||||
pos_type pos = cur.pos();
|
||||
BufferParams const & bufparams = bv->buffer().params();
|
||||
Layout_ptr const & style = par.layout();
|
||||
LayoutPtr const & style = par.layout();
|
||||
if (!style->pass_thru
|
||||
&& par.getFontSettings(bufparams, pos).language()->lang() != "hebrew") {
|
||||
// this avoids a double undo
|
||||
|
@ -54,12 +54,12 @@ using std::ostream;
|
||||
|
||||
namespace {
|
||||
|
||||
class LayoutNamesEqual : public std::unary_function<Layout_ptr, bool> {
|
||||
class LayoutNamesEqual : public std::unary_function<LayoutPtr, bool> {
|
||||
public:
|
||||
LayoutNamesEqual(docstring const & name)
|
||||
: name_(name)
|
||||
{}
|
||||
bool operator()(Layout_ptr const & c) const
|
||||
bool operator()(LayoutPtr const & c) const
|
||||
{
|
||||
return c->name() == name_;
|
||||
}
|
||||
@ -926,7 +926,7 @@ bool TextClass::hasLayout(docstring const & n) const
|
||||
|
||||
|
||||
|
||||
Layout_ptr const & TextClass::operator[](docstring const & name) const
|
||||
LayoutPtr const & TextClass::operator[](docstring const & name) const
|
||||
{
|
||||
BOOST_ASSERT(!name.empty());
|
||||
|
||||
@ -1046,7 +1046,7 @@ docstring const & TextClass::defaultLayoutName() const
|
||||
}
|
||||
|
||||
|
||||
Layout_ptr const & TextClass::defaultLayout() const
|
||||
LayoutPtr const & TextClass::defaultLayout() const
|
||||
{
|
||||
return operator[](defaultLayoutName());
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ typedef std::map<docstring, InsetLayout> InsetLayouts;
|
||||
class TextClass {
|
||||
public:
|
||||
/// The individual styles comprising the document class
|
||||
typedef std::vector<Layout_ptr> LayoutList;
|
||||
typedef std::vector<LayoutPtr> LayoutList;
|
||||
/// Enumerate the paragraph styles.
|
||||
typedef LayoutList::const_iterator const_iterator;
|
||||
/// Construct a layout with default values. Actual values loaded later.
|
||||
@ -93,7 +93,7 @@ public:
|
||||
bool hasLayout(docstring const & name) const;
|
||||
|
||||
///
|
||||
Layout_ptr const & operator[](docstring const & vname) const;
|
||||
LayoutPtr const & operator[](docstring const & vname) const;
|
||||
|
||||
/// Sees to that the textclass structure has been loaded
|
||||
bool load(std::string const & path = std::string()) const;
|
||||
@ -115,7 +115,7 @@ public:
|
||||
///
|
||||
docstring const & defaultLayoutName() const;
|
||||
///
|
||||
Layout_ptr const & defaultLayout() const;
|
||||
LayoutPtr const & defaultLayout() const;
|
||||
///
|
||||
std::string const & name() const;
|
||||
///
|
||||
|
@ -287,7 +287,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
|
||||
Layout_ptr const & layout = par.layout();
|
||||
LayoutPtr const & layout = par.layout();
|
||||
|
||||
if (layout->margintype == MARGIN_MANUAL
|
||||
&& layout->labeltype == LABEL_MANUAL) {
|
||||
@ -470,7 +470,7 @@ void TextMetrics::rowBreakPoint(int width, pit_type const pit,
|
||||
return;
|
||||
}
|
||||
|
||||
Layout_ptr const & layout = par.layout();
|
||||
LayoutPtr const & layout = par.layout();
|
||||
|
||||
if (layout->margintype == MARGIN_RIGHT_ADDRESS_BOX) {
|
||||
row.endpos(addressBreakPoint(pos, par));
|
||||
@ -622,7 +622,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 :)
|
||||
Layout_ptr const & layout = par.layout();
|
||||
LayoutPtr 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
|
||||
@ -823,7 +823,7 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit,
|
||||
pos_type vc = row.pos();
|
||||
pos_type end = row.endpos();
|
||||
pos_type c = 0;
|
||||
Layout_ptr const & layout = par.layout();
|
||||
LayoutPtr const & layout = par.layout();
|
||||
|
||||
bool left_side = false;
|
||||
|
||||
|
@ -410,7 +410,7 @@ void setLabel(Buffer const & buf, ParIterator & it)
|
||||
{
|
||||
TextClass const & textclass = buf.params().getTextClass();
|
||||
Paragraph & par = it.paragraph();
|
||||
Layout_ptr const & layout = par.layout();
|
||||
LayoutPtr const & layout = par.layout();
|
||||
Counters & counters = textclass.counters();
|
||||
|
||||
if (par.params().startOfAppendix()) {
|
||||
|
@ -221,7 +221,7 @@ void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
// FIXME: Change only the pasted paragraphs
|
||||
|
||||
BufferParams const & bp = cur.buffer().params();
|
||||
Layout_ptr const layout =
|
||||
LayoutPtr const layout =
|
||||
bp.getTextClass().defaultLayout();
|
||||
Font font = layout->font;
|
||||
// ERT contents has always latex_language
|
||||
|
@ -90,7 +90,7 @@ int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os,
|
||||
}
|
||||
|
||||
|
||||
Layout_ptr const & InsetEnvironment::layout() const
|
||||
LayoutPtr const & InsetEnvironment::layout() const
|
||||
{
|
||||
return layout_;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
///
|
||||
Inset::EDITABLE editable() const { return HIGHLY_EDITABLE; }
|
||||
///
|
||||
Layout_ptr const & layout() const;
|
||||
LayoutPtr 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
|
||||
Layout_ptr layout_;
|
||||
LayoutPtr layout_;
|
||||
///
|
||||
docstring name_;
|
||||
};
|
||||
|
@ -122,7 +122,7 @@ void InsetText::clear()
|
||||
ParagraphList & pars = paragraphs();
|
||||
|
||||
// This is a gross hack...
|
||||
Layout_ptr old_layout = pars.begin()->layout();
|
||||
LayoutPtr old_layout = pars.begin()->layout();
|
||||
|
||||
pars.clear();
|
||||
pars.push_back(Paragraph());
|
||||
|
@ -20,7 +20,7 @@ namespace lyx {
|
||||
class Layout;
|
||||
|
||||
/// Global typedef
|
||||
typedef boost::shared_ptr<Layout> Layout_ptr;
|
||||
typedef boost::shared_ptr<Layout> LayoutPtr;
|
||||
|
||||
|
||||
} // namespace lyx
|
||||
|
@ -41,7 +41,7 @@ InsetMathMBox::InsetMathMBox()
|
||||
}
|
||||
|
||||
|
||||
InsetMathMBox::InsetMathMBox(Layout_ptr const & layout)
|
||||
InsetMathMBox::InsetMathMBox(LayoutPtr const & layout)
|
||||
{
|
||||
text_.paragraphs().clear();
|
||||
text_.paragraphs().push_back(Paragraph());
|
||||
|
@ -31,7 +31,7 @@ class InsetMathMBox : public InsetMath {
|
||||
public:
|
||||
///
|
||||
explicit InsetMathMBox();
|
||||
explicit InsetMathMBox(Layout_ptr const & layout);
|
||||
explicit InsetMathMBox(LayoutPtr const & layout);
|
||||
|
||||
/// this stores metrics information in cache_
|
||||
bool metrics(MetricsInfo & mi, Dimension & dim) const;
|
||||
|
@ -61,11 +61,11 @@ ParagraphList::const_iterator searchCommand(
|
||||
ParagraphList::const_iterator const & par,
|
||||
ParagraphList::const_iterator const & pend)
|
||||
{
|
||||
Layout_ptr const & bstyle = par->layout();
|
||||
LayoutPtr const & bstyle = par->layout();
|
||||
ParagraphList::const_iterator p = boost::next(par);
|
||||
|
||||
for ( ; p != pend; ++p) {
|
||||
Layout_ptr const & style = p->layout();
|
||||
LayoutPtr 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)
|
||||
{
|
||||
Layout_ptr const & bstyle = par->layout();
|
||||
LayoutPtr const & bstyle = par->layout();
|
||||
ParagraphList::const_iterator p = boost::next(par);
|
||||
for (; p != pend; ++p) {
|
||||
Layout_ptr const & style = p->layout();
|
||||
LayoutPtr 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)
|
||||
{
|
||||
Layout_ptr const & defaultstyle =
|
||||
LayoutPtr const & defaultstyle =
|
||||
buf.params().getTextClass().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;
|
||||
|
||||
Layout_ptr const & defaultstyle = buf.params().getTextClass().defaultLayout();
|
||||
Layout_ptr const & bstyle = par->layout();
|
||||
LayoutPtr const & defaultstyle = buf.params().getTextClass().defaultLayout();
|
||||
LayoutPtr 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) {
|
||||
Layout_ptr const & style = par->layout();
|
||||
LayoutPtr 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;
|
||||
Layout_ptr const & bstyle = par->layout();
|
||||
LayoutPtr 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) {
|
||||
Layout_ptr const & style = par->layout();
|
||||
LayoutPtr const & style = par->layout();
|
||||
ParagraphList::const_iterator send;
|
||||
|
||||
switch (style->latextype) {
|
||||
@ -321,7 +321,7 @@ void docbookParagraphs(ParagraphList const & paragraphs,
|
||||
}
|
||||
|
||||
while (par != pend) {
|
||||
Layout_ptr const & style = par->layout();
|
||||
LayoutPtr const & style = par->layout();
|
||||
ParagraphList::const_iterator lastpar = par;
|
||||
ParagraphList::const_iterator send;
|
||||
|
||||
|
@ -96,7 +96,7 @@ TeXEnvironment(Buffer const & buf,
|
||||
|
||||
BufferParams const & bparams = buf.params();
|
||||
|
||||
Layout_ptr const & style = pit->layout();
|
||||
LayoutPtr const & style = pit->layout();
|
||||
|
||||
Language const * const par_language = pit->getParLanguage(bparams);
|
||||
Language const * const doc_language = bparams.language;
|
||||
@ -247,7 +247,7 @@ TeXOnePar(Buffer const & buf,
|
||||
LYXERR(Debug::LATEX) << "TeXOnePar... " << &*pit << " '"
|
||||
<< everypar << "'" << endl;
|
||||
BufferParams const & bparams = buf.params();
|
||||
Layout_ptr style;
|
||||
LayoutPtr style;
|
||||
|
||||
// In an inset with unlimited length (all in one row),
|
||||
// force layout to default
|
||||
@ -628,7 +628,7 @@ void latexParagraphs(Buffer const & buf,
|
||||
// any environment other than the default layout of the
|
||||
// text class to be valid!
|
||||
if (!par->forceDefaultParagraphs()) {
|
||||
Layout_ptr const & layout = par->layout();
|
||||
LayoutPtr const & layout = par->layout();
|
||||
|
||||
if (layout->intitle) {
|
||||
if (already_title) {
|
||||
|
@ -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())) {
|
||||
Layout_ptr const & layout = pars[pit].layout();
|
||||
LayoutPtr const & layout = pars[pit].layout();
|
||||
int const endlabeltype = layout->endlabeltype;
|
||||
|
||||
if (endlabeltype != END_LABEL_NO_LABEL) {
|
||||
|
@ -565,7 +565,7 @@ void RowPainter::paintFirst()
|
||||
|
||||
Buffer const & buffer = bv_.buffer();
|
||||
|
||||
Layout_ptr const & layout = par_.layout();
|
||||
LayoutPtr const & layout = par_.layout();
|
||||
|
||||
if (buffer.params().paragraph_separation == BufferParams::PARSEP_SKIP) {
|
||||
if (pit_ != 0) {
|
||||
@ -573,7 +573,7 @@ void RowPainter::paintFirst()
|
||||
&& !par_.getDepth()) {
|
||||
y_top += buffer.params().getDefSkip().inPixels(bv_);
|
||||
} else {
|
||||
Layout_ptr const & playout = pars_[pit_ - 1].layout();
|
||||
LayoutPtr const & playout = pars_[pit_ - 1].layout();
|
||||
if (playout->latextype == LATEX_PARAGRAPH
|
||||
&& !pars_[pit_ - 1].getDepth()) {
|
||||
// is it right to use defskip here, too? (AS)
|
||||
@ -745,7 +745,7 @@ void RowPainter::paintText()
|
||||
body_pos = 0;
|
||||
}
|
||||
|
||||
Layout_ptr const & layout = par_.layout();
|
||||
LayoutPtr const & layout = par_.layout();
|
||||
|
||||
bool running_strikeout = false;
|
||||
bool is_struckout = false;
|
||||
|
@ -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)
|
||||
{
|
||||
Layout_ptr const & style = par.layout();
|
||||
LayoutPtr const & style = par.layout();
|
||||
string const & name = style->latexname();
|
||||
string param = style->latexparam();
|
||||
Counters & counters = buf.params().getTextClass().counters();
|
||||
@ -240,7 +240,7 @@ void sgml::openTag(Buffer const & buf, odocstream & os,
|
||||
|
||||
void sgml::closeTag(odocstream & os, Paragraph const & par)
|
||||
{
|
||||
Layout_ptr const & style = par.layout();
|
||||
LayoutPtr const & style = par.layout();
|
||||
closeTag(os, style->latexname());
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ using std::string;
|
||||
|
||||
namespace {
|
||||
|
||||
void begin_layout(ostream & os, Layout_ptr layout, TeXFont const & font,
|
||||
void begin_layout(ostream & os, LayoutPtr layout, TeXFont const & font,
|
||||
TeXFont const & normalfont)
|
||||
{
|
||||
os << "\n\\begin_layout " << to_utf8(layout->name()) << "\n";
|
||||
@ -85,7 +85,7 @@ bool Context::empty = true;
|
||||
|
||||
Context::Context(bool need_layout_,
|
||||
TextClass const & textclass_,
|
||||
Layout_ptr layout_, Layout_ptr parent_layout_,
|
||||
LayoutPtr layout_, LayoutPtr parent_layout_,
|
||||
TeXFont font_)
|
||||
: need_layout(need_layout_),
|
||||
need_end_layout(false), need_end_deeper(false),
|
||||
|
@ -78,8 +78,8 @@ class Context {
|
||||
public:
|
||||
Context(bool need_layout_,
|
||||
TextClass const & textclass_,
|
||||
Layout_ptr layout_ = Layout_ptr(),
|
||||
Layout_ptr parent_layout_= Layout_ptr(),
|
||||
LayoutPtr layout_ = LayoutPtr(),
|
||||
LayoutPtr parent_layout_= LayoutPtr(),
|
||||
TeXFont font_ = TeXFont());
|
||||
~Context();
|
||||
|
||||
@ -142,9 +142,9 @@ public:
|
||||
/// The textclass of the document. Could actually be a global variable
|
||||
TextClass const & textclass;
|
||||
/// The layout of the current paragraph
|
||||
Layout_ptr layout;
|
||||
LayoutPtr layout;
|
||||
/// The layout of the outer paragraph (for environment layouts)
|
||||
Layout_ptr parent_layout;
|
||||
LayoutPtr parent_layout;
|
||||
/// font attributes of this context
|
||||
TeXFont font;
|
||||
/// font attributes of normal text
|
||||
|
@ -68,7 +68,7 @@ using support::isFileReadable;
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
Layout_ptr captionlayout;
|
||||
LayoutPtr captionlayout;
|
||||
|
||||
// Hacks to allow the thing to link in the lyxlayout stuff
|
||||
LyXErr lyxerr(std::cerr.rdbuf());
|
||||
@ -428,7 +428,7 @@ void tex2lyx(std::istream &is, std::ostream &os)
|
||||
|
||||
stringstream ss;
|
||||
TextClass textclass = parse_preamble(p, ss, documentclass);
|
||||
captionlayout = Layout_ptr(Layout::forCaption());
|
||||
captionlayout = LayoutPtr(Layout::forCaption());
|
||||
|
||||
active_environments.push_back("document");
|
||||
Context context(true, textclass);
|
||||
|
@ -33,7 +33,7 @@ TextClass const parse_preamble(Parser & p, std::ostream & os, std::string const
|
||||
|
||||
/// used packages with options
|
||||
extern std::map<std::string, std::vector<std::string> > used_packages;
|
||||
extern Layout_ptr captionlayout;
|
||||
extern LayoutPtr captionlayout;
|
||||
|
||||
/// in text.cpp
|
||||
std::string translate_len(std::string const &);
|
||||
|
@ -433,10 +433,10 @@ void handle_comment(ostream & os, string const & s, Context & context)
|
||||
}
|
||||
|
||||
|
||||
class isLayout : public std::unary_function<Layout_ptr, bool> {
|
||||
class isLayout : public std::unary_function<LayoutPtr, bool> {
|
||||
public:
|
||||
isLayout(string const name) : name_(name) {}
|
||||
bool operator()(Layout_ptr const & ptr) const {
|
||||
bool operator()(LayoutPtr const & ptr) const {
|
||||
return ptr->latexname() == name_;
|
||||
}
|
||||
private:
|
||||
@ -444,7 +444,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
Layout_ptr findLayout(TextClass const & textclass,
|
||||
LayoutPtr findLayout(TextClass const & textclass,
|
||||
string const & name)
|
||||
{
|
||||
TextClass::const_iterator beg = textclass.begin();
|
||||
@ -453,7 +453,7 @@ Layout_ptr findLayout(TextClass const & textclass,
|
||||
TextClass::const_iterator
|
||||
it = std::find_if(beg, end, isLayout(name));
|
||||
|
||||
return (it == end) ? Layout_ptr() : *it;
|
||||
return (it == end) ? LayoutPtr() : *it;
|
||||
}
|
||||
|
||||
|
||||
@ -462,7 +462,7 @@ void eat_whitespace(Parser &, ostream &, Context &, bool);
|
||||
|
||||
void output_command_layout(ostream & os, Parser & p, bool outer,
|
||||
Context & parent_context,
|
||||
Layout_ptr newlayout)
|
||||
LayoutPtr newlayout)
|
||||
{
|
||||
parent_context.check_end_layout(os);
|
||||
Context context(true, parent_context.textclass, newlayout,
|
||||
@ -718,7 +718,7 @@ void parse_unknown_environment(Parser & p, string const & name, ostream & os,
|
||||
void parse_environment(Parser & p, ostream & os, bool outer,
|
||||
Context & parent_context)
|
||||
{
|
||||
Layout_ptr newlayout;
|
||||
LayoutPtr newlayout;
|
||||
string const name = p.getArg('{', '}');
|
||||
const bool is_starred = suffixIs(name, '*');
|
||||
string const unstarred_name = rtrim(name, "*");
|
||||
@ -1104,7 +1104,7 @@ void parse_noweb(Parser & p, ostream & os, Context & context)
|
||||
void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
||||
Context & context)
|
||||
{
|
||||
Layout_ptr newlayout;
|
||||
LayoutPtr newlayout;
|
||||
// Store the latest bibliographystyle (needed for bibtex inset)
|
||||
string bibliographystyle;
|
||||
bool const use_natbib = used_packages.find("natbib") != used_packages.end();
|
||||
|
Loading…
Reference in New Issue
Block a user