From 39c7e2faf09a85af8e641549be2694675d133ed6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 23 Aug 2007 19:59:07 +0000 Subject: [PATCH] rename Layout_ptr into LayoutPtr git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19758 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/CutAndPaste.cpp | 2 +- src/LaTeXFeatures.cpp | 2 +- src/Paragraph.cpp | 12 ++++++------ src/Paragraph.h | 10 +++++----- src/ParagraphParameters.cpp | 2 +- src/Text.cpp | 10 +++++----- src/Text2.cpp | 12 ++++++------ src/Text3.cpp | 4 ++-- src/TextClass.cpp | 8 ++++---- src/TextClass.h | 6 +++--- src/TextMetrics.cpp | 8 ++++---- src/buffer_funcs.cpp | 2 +- src/insets/InsetERT.cpp | 2 +- src/insets/InsetEnvironment.cpp | 2 +- src/insets/InsetEnvironment.h | 4 ++-- src/insets/InsetText.cpp | 2 +- src/lyxlayout_ptr_fwd.h | 2 +- src/mathed/InsetMathMBox.cpp | 2 +- src/mathed/InsetMathMBox.h | 2 +- src/output_docbook.cpp | 22 +++++++++++----------- src/output_latex.cpp | 6 +++--- src/paragraph_funcs.cpp | 2 +- src/rowpainter.cpp | 6 +++--- src/sgml.cpp | 4 ++-- src/tex2lyx/Context.cpp | 4 ++-- src/tex2lyx/Context.h | 8 ++++---- src/tex2lyx/tex2lyx.cpp | 4 ++-- src/tex2lyx/tex2lyx.h | 2 +- src/tex2lyx/text.cpp | 14 +++++++------- 29 files changed, 83 insertions(+), 83 deletions(-) diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 485b581e37..d3623c3f47 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -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(); diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index d5163a09d4..06f65e566b 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -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()); diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 80409eafd7..3b44f91193 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -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; } diff --git a/src/Paragraph.h b/src/Paragraph.h index 8fd17c2897..cd43609321 100644 --- a/src/Paragraph.h +++ b/src/Paragraph.h @@ -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. diff --git a/src/ParagraphParameters.cpp b/src/ParagraphParameters.cpp index 12a1783085..905f9f6cdb 100644 --- a/src/ParagraphParameters.cpp +++ b/src/ParagraphParameters.cpp @@ -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'; diff --git a/src/Text.cpp b/src/Text.cpp index ead9fdd187..3b47413b49 100644 --- a/src/Text.cpp +++ b/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; diff --git a/src/Text2.cpp b/src/Text2.cpp index 92eaba739b..4bbd0fda1c 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -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; diff --git a/src/Text3.cpp b/src/Text3.cpp index e730e268a1..d0713fd86b 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -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 diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 2a4d69d0c7..707819d7e2 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -54,12 +54,12 @@ using std::ostream; namespace { -class LayoutNamesEqual : public std::unary_function { +class LayoutNamesEqual : public std::unary_function { 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()); } diff --git a/src/TextClass.h b/src/TextClass.h index d1aeddf860..d2f3490c80 100644 --- a/src/TextClass.h +++ b/src/TextClass.h @@ -53,7 +53,7 @@ typedef std::map InsetLayouts; class TextClass { public: /// The individual styles comprising the document class - typedef std::vector LayoutList; + typedef std::vector 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; /// diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 7aae097c88..925c803977 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -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; diff --git a/src/buffer_funcs.cpp b/src/buffer_funcs.cpp index 87e97376c1..857bbe6a60 100644 --- a/src/buffer_funcs.cpp +++ b/src/buffer_funcs.cpp @@ -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()) { diff --git a/src/insets/InsetERT.cpp b/src/insets/InsetERT.cpp index 3a39b96a74..05c950231f 100644 --- a/src/insets/InsetERT.cpp +++ b/src/insets/InsetERT.cpp @@ -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 diff --git a/src/insets/InsetEnvironment.cpp b/src/insets/InsetEnvironment.cpp index f665e86b34..ed28bc65ff 100644 --- a/src/insets/InsetEnvironment.cpp +++ b/src/insets/InsetEnvironment.cpp @@ -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_; } diff --git a/src/insets/InsetEnvironment.h b/src/insets/InsetEnvironment.h index a666ff439e..55e9bf0a4e 100644 --- a/src/insets/InsetEnvironment.h +++ b/src/insets/InsetEnvironment.h @@ -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 doClone() const; /// the layout - Layout_ptr layout_; + LayoutPtr layout_; /// docstring name_; }; diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 86d92f0e34..f06869814a 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -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()); diff --git a/src/lyxlayout_ptr_fwd.h b/src/lyxlayout_ptr_fwd.h index 69bdfcf348..00a35dee9e 100644 --- a/src/lyxlayout_ptr_fwd.h +++ b/src/lyxlayout_ptr_fwd.h @@ -20,7 +20,7 @@ namespace lyx { class Layout; /// Global typedef -typedef boost::shared_ptr Layout_ptr; +typedef boost::shared_ptr LayoutPtr; } // namespace lyx diff --git a/src/mathed/InsetMathMBox.cpp b/src/mathed/InsetMathMBox.cpp index 82cad33a4e..2b73da1015 100644 --- a/src/mathed/InsetMathMBox.cpp +++ b/src/mathed/InsetMathMBox.cpp @@ -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()); diff --git a/src/mathed/InsetMathMBox.h b/src/mathed/InsetMathMBox.h index 47fd08f982..a64d7d7f4f 100644 --- a/src/mathed/InsetMathMBox.h +++ b/src/mathed/InsetMathMBox.h @@ -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; diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp index 83f2e40295..00cfe1b539 100644 --- a/src/output_docbook.cpp +++ b/src/output_docbook.cpp @@ -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 << "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; diff --git a/src/output_latex.cpp b/src/output_latex.cpp index e3abb52fa5..6f9a040f25 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -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) { diff --git a/src/paragraph_funcs.cpp b/src/paragraph_funcs.cpp index bc2d3257a0..f5dba1d830 100644 --- a/src/paragraph_funcs.cpp +++ b/src/paragraph_funcs.cpp @@ -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) { diff --git a/src/rowpainter.cpp b/src/rowpainter.cpp index ca3a07ef4b..460b373e30 100644 --- a/src/rowpainter.cpp +++ b/src/rowpainter.cpp @@ -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; diff --git a/src/sgml.cpp b/src/sgml.cpp index ff84339a37..68a96a3717 100644 --- a/src/sgml.cpp +++ b/src/sgml.cpp @@ -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()); } diff --git a/src/tex2lyx/Context.cpp b/src/tex2lyx/Context.cpp index 94bb4668fc..558820f00e 100644 --- a/src/tex2lyx/Context.cpp +++ b/src/tex2lyx/Context.cpp @@ -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), diff --git a/src/tex2lyx/Context.h b/src/tex2lyx/Context.h index 4a6c74907c..1af6433023 100644 --- a/src/tex2lyx/Context.h +++ b/src/tex2lyx/Context.h @@ -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 diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp index 69645b23fc..632acc6a7a 100644 --- a/src/tex2lyx/tex2lyx.cpp +++ b/src/tex2lyx/tex2lyx.cpp @@ -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); diff --git a/src/tex2lyx/tex2lyx.h b/src/tex2lyx/tex2lyx.h index 16b84abfe8..913060977c 100644 --- a/src/tex2lyx/tex2lyx.h +++ b/src/tex2lyx/tex2lyx.h @@ -33,7 +33,7 @@ TextClass const parse_preamble(Parser & p, std::ostream & os, std::string const /// used packages with options extern std::map > used_packages; -extern Layout_ptr captionlayout; +extern LayoutPtr captionlayout; /// in text.cpp std::string translate_len(std::string const &); diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 3927dfffd3..b070ccd799 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -433,10 +433,10 @@ void handle_comment(ostream & os, string const & s, Context & context) } -class isLayout : public std::unary_function { +class isLayout : public std::unary_function { 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(); -- 2.39.5