string arg = argument;
if (arg.empty()) {
- arg = bv_->getLyXText()->selectionAsString(buffer_);
+ arg = bv_->getLyXText()->selectionAsString(buffer_,
+ false);
// FIXME
if (arg.size() > 100 || arg.empty()) {
// Get word or selection
bv_->getLyXText()->selectWordWhenUnderCursor(bv_, LyXText::WHOLE_WORD);
- arg = bv_->getLyXText()->selectionAsString(buffer_);
+ arg = bv_->getLyXText()->selectionAsString(buffer_, false);
// FIXME: where is getLyXText()->unselect(bv_) ?
}
}
+2001-09-12 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * text2.C (copySelection):
+ (cutSelection):
+ * lyxfind.C (LyXReplace):
+ * BufferView_pimpl.C (Dispatch): pass the correct flag to
+ LyXText::selectionAsString.
+
+ * paragraph.C (asString): add "label" argument to the second form
+
+ * text2.C (selectionAsString): add "label" argument and pass it to
+ Paragraph::asString.
+
2001-09-10 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lyx_main.C (commandLineHelp): remove version information
string str2;
if (casesens) {
str1 = searchstr;
- str2 = text->selectionAsString(bv->buffer());
+ str2 = text->selectionAsString(bv->buffer(), false);
} else {
str1 = lowercase(searchstr);
- str2 = lowercase(text->selectionAsString(bv->buffer()));
+ str2 = lowercase(text->selectionAsString(bv->buffer(), false));
}
if (str1 != str2) {
if (!LyXFind(bv, searchstr, fw, false, casesens, matchwrd) ||
///
void clearSelection() const;
///
- string const selectionAsString(Buffer const *) const;
+ string const selectionAsString(Buffer const *, bool label) const;
/// select the word we need depending on word_location
void getWord(LyXCursor & from, LyXCursor & to,
+2001-09-12 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * formulabase.C (mathDispatchCreation): pass second argument
+ 'false' (no label) to selectionAsString
+
2001-09-11 André Pönitz <poenitz@gmx.net>
* math_atom.[Ch]: new basic item in the MathArray
// sel = "";
//else
- string sel = bv->getLyXText()->selectionAsString(bv->buffer());
+ string sel = bv->getLyXText()->selectionAsString(bv->buffer(),
+ false);
InsetFormulaBase * f;
if (sel.empty()) {
string const Paragraph::asString(Buffer const * buffer,
- Paragraph::size_type beg,
- Paragraph::size_type end)
+ Paragraph::size_type beg,
+ Paragraph::size_type end,
+ bool label)
{
ostringstream ost;
- if (beg == 0 && !params().labelString().empty())
+ if (beg == 0 && label && !params().labelString().empty())
ost << params().labelString() << ' ';
for (Paragraph::size_type i = beg; i < end; ++i) {
string const asString(Buffer const *, bool label);
///
- string const asString(Buffer const *, size_type beg, size_type end);
+ string const asString(Buffer const *, size_type beg, size_type end,
+ bool label);
///
void writeFile(Buffer const *, std::ostream &, BufferParams const &,
}
-string const LyXText::selectionAsString(Buffer const * buffer) const
+string const LyXText::selectionAsString(Buffer const * buffer,
+ bool label) const
{
if (!selection.set()) return string();
string result;
if (selection.start.par() == selection.end.par()) {
result += selection.start.par()->asString(buffer,
selection.start.pos(),
- selection.end.pos());
+ selection.end.pos(),
+ label);
return result;
}
// First paragraph in selection
result += selection.start.par()->asString(buffer,
selection.start.pos(),
- selection.start.par()->size())
+ selection.start.par()->size(),
+ label)
+ "\n\n";
// The paragraphs in between (if any)
tmpcur.par(tmpcur.par()->next());
while (tmpcur.par() != selection.end.par()) {
result += tmpcur.par()->asString(buffer, 0,
- tmpcur.par()->size()) +"\n\n";
+ tmpcur.par()->size(),
+ label) + "\n\n";
tmpcur.par(tmpcur.par()->next());
}
// Last paragraph in selection
result += selection.end.par()->asString(buffer, 0,
- selection.end.pos());
+ selection.end.pos(), label);
return result;
}
return string();
}
- idxstring = selectionAsString(bview->buffer());
+ idxstring = selectionAsString(bview->buffer(), false);
// Implicit selections are cleared afterwards
//and cursor is set to the original position.
// finished. The solution used currently just works, to make it
// faster we need to be more clever and probably also have more
// calls to stuffClipboard. (Lgb)
- bview->stuffClipboard(selectionAsString(bview->buffer()));
+ bview->stuffClipboard(selectionAsString(bview->buffer(), true));
// This doesn't make sense, if there is no selection
if (!selection.set())
// finished. The solution used currently just works, to make it
// faster we need to be more clever and probably also have more
// calls to stuffClipboard. (Lgb)
- bview->stuffClipboard(selectionAsString(bview->buffer()));
+ bview->stuffClipboard(selectionAsString(bview->buffer(), true));
// this doesnt make sense, if there is no selection
if (!selection.set())