* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Juergen Vigna
+ * \author Jürgen Vigna
* \author Lars Gullik Bjønnes
* \author Alfredo Braunstein
*
#include <config.h>
#include "CutAndPaste.h"
+
#include "buffer.h"
-#include "ParagraphParameters.h"
+#include "bufferparams.h"
+#include "errorlist.h"
+#include "gettext.h"
#include "iterators.h"
#include "lyxtextclasslist.h"
-#include "gettext.h"
+#include "paragraph.h"
#include "paragraph_funcs.h"
-#include "insets/insetinclude.h"
+#include "ParagraphParameters.h"
+
#include "insets/insettabular.h"
-#include "support/LAssert.h"
#include "support/lstrings.h"
-using std::endl;
-using std::pair;
-using std::make_pair;
-using std::for_each;
-using std::vector;
-
-using namespace lyx::support;
using lyx::pos_type;
using lyx::textclass_type;
+using lyx::support::bformat;
+
+using std::for_each;
+using std::make_pair;
+using std::pair;
+using std::vector;
+using std::string;
+
typedef limited_stack<pair<ParagraphList, textclass_type> > CutStack;
} // namespace anon
-std::vector<string>
+std::vector<string> const
CutAndPaste::availableSelections(Buffer const & buffer)
{
vector<string> selList;
ParagraphList::iterator endpit,
int start, int end, textclass_type tc)
{
- Assert(0 <= start && start <= startpit->size());
- Assert(0 <= end && end <= endpit->size());
- Assert(startpit != endpit || start <= end);
+ BOOST_ASSERT(0 <= start && start <= startpit->size());
+ BOOST_ASSERT(0 <= end && end <= endpit->size());
+ BOOST_ASSERT(startpit != endpit || start <= end);
ParagraphList paragraphs;
if (!checkPastePossible())
return make_pair(PitPosPair(pit, pos), pit);
- Assert (pos <= pit->size());
+ BOOST_ASSERT (pos <= pit->size());
// Make a copy of the CaP paragraphs.
ParagraphList simple_cut_clone = cuts[cut_index].first;
tmpbuf->erase(i--);
}
} else {
- LyXFont f1 = tmpbuf->getFont(buffer.params, i, outerFont(pit, pars));
+ LyXFont f1 = tmpbuf->getFont(buffer.params(), i, outerFont(pit, pars));
LyXFont f2 = f1;
if (!pit->checkInsertChar(f1)) {
tmpbuf->erase(i--);
for (; lit != eit; ++lit) {
switch (lit->inset->lyxCode()) {
- case InsetOld::INCLUDE_CODE: {
- InsetInclude * ii = static_cast<InsetInclude*>(lit->inset);
- InsetInclude::Params ip = ii->params();
- ip.masterFilename_ = buffer.fileName();
- ii->set(ip);
- break;
- }
-
case InsetOld::TABULAR_CODE: {
InsetTabular * it = static_cast<InsetTabular*>(lit->inset);
it->buffer(const_cast<Buffer*>(&buffer));
// Open the paragraph for inserting the buf
// if necessary.
if (pit->size() > pos || boost::next(pit) == pars.end()) {
- breakParagraphConservative(buffer.params,
+ breakParagraphConservative(buffer.params(),
pars, pit, pos);
paste_the_end = true;
}
if (boost::next(pit) == last_paste)
last_paste = pit;
- mergeParagraph(buffer.params, pars, pit);
+ mergeParagraph(buffer.params(), pars, pit);
// Store the new cursor position.
pit = last_paste;
pos = last_paste->size();
// Maybe some pasting.
-#warning CHECK! Are we comparing last_paste to the wrong list here? (Lgb)
if (boost::next(last_paste) != pars.end() &&
paste_the_end) {
if (boost::next(last_paste)->hasSameLayout(*last_paste)) {
- mergeParagraph(buffer.params, pars,
+ mergeParagraph(buffer.params(), pars,
last_paste);
} else if (boost::next(last_paste)->empty()) {
boost::next(last_paste)->makeSameLayout(*last_paste);
- mergeParagraph(buffer.params, pars,
+ mergeParagraph(buffer.params(), pars,
last_paste);
} else if (last_paste->empty()) {
last_paste->makeSameLayout(*boost::next(last_paste));
- mergeParagraph(buffer.params, pars,
+ mergeParagraph(buffer.params(), pars,
last_paste);
} else
boost::next(last_paste)->stripLeadingSpaces();
ParagraphList & pars,
ErrorList & errorlist)
{
- Assert(!pars.empty());
+ BOOST_ASSERT(!pars.empty());
int ret = 0;
if (c1 == c2)