// Start and end is inside same paragraph
if (endpit == pit_type(pars.size()) ||
startpit == endpit) {
- endpos -= pars[startpit].erase(startpos, endpos, false);
+ endpos -= pars[startpit].eraseChars(startpos, endpos, false);
return PitPosPair(endpit, endpos);
}
pos_type const right = ( pit == endpit ? endpos :
pars[pit].size() + 1 );
// Logical erase only:
- pars[pit].erase(left, right, false);
+ pars[pit].eraseChars(left, right, false);
// Separate handling of para break:
if (merge && pit != endpit &&
(pit + 1 != endpit || pars[pit].hasSameLayout(pars[pit + 1]))) {
// Cut out the end of the last paragraph.
Paragraph & back = paragraphs.back();
- back.erase(end, back.size(), false);
+ // do not track deletion here; it is an internal action not visible to the user
+ back.eraseChars(end, back.size(), false);
// Cut out the begin of the first paragraph
Paragraph & front = paragraphs.front();
- front.erase(0, start, false);
+ // again, do not track deletion
+ front.eraseChars(0, start, false);
theCuts.push(make_pair(paragraphs, tc));
}
namespace cap {
-string grabAndEraseSelection(LCursor & cur)
+docstring grabAndEraseSelection(LCursor & cur)
{
if (!cur.selection())
- return string();
- string res = grabSelection(cur);
+ return docstring();
+ docstring res = grabSelection(cur);
eraseSelection(cur);
return res;
}
}
-string grabSelection(LCursor const & cur)
+docstring grabSelection(LCursor const & cur)
{
if (!cur.selection())
- return string();
+ return docstring();
// FIXME: What is wrong with the following?
#if 0
MathArray::const_iterator it = i1.cell().begin();
return asString(MathArray(it + i1.pos(), it + i2.pos()));
} else {
- return "unknown selection 1";
+ return from_ascii("unknown selection 1");
}
}
InsetBase::col_type c1, c2;
region(i1, i2, r1, r2, c1, c2);
- string data;
+ docstring data;
if (i1.inset().asInsetMath()) {
for (InsetBase::row_type row = r1; row <= r2; ++row) {
if (row > r1)
}
}
} else {
- data = "unknown selection 2";
+ data = from_ascii("unknown selection 2");
}
return data;
}