* 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
*/
using std::for_each;
using std::vector;
+using namespace lyx::support;
using lyx::pos_type;
using lyx::textclass_type;
} // namespace anon
-vector<string>
+
+std::vector<string>
CutAndPaste::availableSelections(Buffer const & buffer)
{
vector<string> selList;
CutStack::const_iterator cit = cuts.begin();
CutStack::const_iterator end = cuts.end();
for (; cit != end; ++cit) {
- ParagraphList const & pars = cit->first;
- string asciiPar(pars.front().asString(&buffer, false), 0, 25);
- selList.push_back(asciiPar);
+ // 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();
+ for (; pit != pend; ++pit) {
+ asciiSel += pit->asString(&buffer, false);
+ if (asciiSel.size() > 25) {
+ asciiSel.replace(22, string::npos, "...");
+ break;
+ }
+ }
+
+ selList.push_back(asciiSel);
}
return selList;
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;
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;
for (; lit != eit; ++lit) {
switch (lit->inset->lyxCode()) {
- case Inset::INCLUDE_CODE: {
+ case InsetOld::INCLUDE_CODE: {
InsetInclude * ii = static_cast<InsetInclude*>(lit->inset);
InsetInclude::Params ip = ii->params();
ip.masterFilename_ = buffer.fileName();
break;
}
- case Inset::TABULAR_CODE: {
+ case InsetOld::TABULAR_CODE: {
InsetTabular * it = static_cast<InsetTabular*>(lit->inset);
it->buffer(const_cast<Buffer*>(&buffer));
break;
ParagraphList & pars,
ErrorList & errorlist)
{
- lyx::Assert(!pars.empty());
+ Assert(!pars.empty());
int ret = 0;
if (c1 == c2)