X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCutAndPaste.C;h=36c863428ff1f183dce6c9092f39c18c789aea12;hb=09e01879979643949f1f2c7216023f1f35d5ada2;hp=6d5e2e311690233e5d0e1aaf1affba6a479b4bd1;hpb=9740810c169f1873525bfbbe0f4a0882e5017358;p=lyx.git diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index 6d5e2e3116..36c863428f 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -2,8 +2,9 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Jurgen Vigna + * \author Juergen Vigna * \author Lars Gullik Bjønnes + * \author Alfredo Braunstein * * Full author contact details are available in file CREDITS */ @@ -37,6 +38,7 @@ using std::make_pair; using std::for_each; using std::vector; +using namespace lyx::support; using lyx::pos_type; using lyx::textclass_type; @@ -49,7 +51,8 @@ CutStack cuts(10); } // namespace anon -vector + +std::vector CutAndPaste::availableSelections(Buffer const & buffer) { vector selList; @@ -57,7 +60,9 @@ CutAndPaste::availableSelections(Buffer const & buffer) CutStack::const_iterator cit = cuts.begin(); CutStack::const_iterator end = cuts.end(); for (; cit != end; ++cit) { - ParagraphList const & pars = cit->first; + // we do not use cit-> here because gcc 2.9x does not + // like it (JMarc) + ParagraphList const & pars = (*cit).first; string asciiSel; ParagraphList::const_iterator pit = pars.begin(); ParagraphList::const_iterator pend = pars.end(); @@ -176,11 +181,9 @@ bool CutAndPaste::copySelection(ParagraphList::iterator startpit, ParagraphList::iterator endpit, int start, int end, textclass_type tc) { - lyx::Assert(&*startpit); - lyx::Assert(&*endpit); - lyx::Assert(0 <= start && start <= startpit->size()); - lyx::Assert(0 <= end && end <= endpit->size()); - lyx::Assert(startpit != endpit || start <= end); + Assert(0 <= start && start <= startpit->size()); + Assert(0 <= end && end <= endpit->size()); + Assert(startpit != endpit || start <= end); ParagraphList paragraphs; @@ -225,7 +228,7 @@ CutAndPaste::pasteSelection(Buffer const & buffer, if (!checkPastePossible()) return make_pair(PitPosPair(pit, pos), pit); - lyx::Assert (pos <= pit->size()); + Assert (pos <= pit->size()); // Make a copy of the CaP paragraphs. ParagraphList simple_cut_clone = cuts[cut_index].first; @@ -297,7 +300,7 @@ CutAndPaste::pasteSelection(Buffer const & buffer, for (; lit != eit; ++lit) { switch (lit->inset->lyxCode()) { - case Inset::INCLUDE_CODE: { + case InsetOld::INCLUDE_CODE: { InsetInclude * ii = static_cast(lit->inset); InsetInclude::Params ip = ii->params(); ip.masterFilename_ = buffer.fileName(); @@ -305,7 +308,7 @@ CutAndPaste::pasteSelection(Buffer const & buffer, break; } - case Inset::TABULAR_CODE: { + case InsetOld::TABULAR_CODE: { InsetTabular * it = static_cast(lit->inset); it->buffer(const_cast(&buffer)); break; @@ -380,7 +383,7 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1, ParagraphList & pars, ErrorList & errorlist) { - lyx::Assert(!pars.empty()); + Assert(!pars.empty()); int ret = 0; if (c1 == c2)