git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5474 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-10-22 15:15:40 +00:00
parent bb7c6adc28
commit e2778d8628
4 changed files with 10 additions and 7 deletions

View File

@ -935,6 +935,11 @@ bool InsetFormulaBase::display() const
}
string InsetFormulaBase::selectionAsString() const
{
return mathcursor ? mathcursor->grabSelection() : string();
}
/////////////////////////////////////////////////////////////////////

View File

@ -110,6 +110,8 @@ public:
virtual EDITABLE editable() const { return HIGHLY_EDITABLE; }
///
bool display() const;
// return the selection as string
string selectionAsString() const;
private:
/// unimplemented

View File

@ -1339,7 +1339,7 @@ string MathCursor::grabSelection() const
string data;
for (row_type row = r1; row <= r2; ++row) {
if (row > r1)
data += "\\n";
data += "\\\\";
for (col_type col = c1; col <= c2; ++col) {
if (col > c1)
data += "&";

View File

@ -227,6 +227,8 @@ public:
void dump(char const * str) const;
/// moves on
void setSelection(MathIterator const & where, size_type n);
/// grab selection marked by anchor and current cursor
string grabSelection() const;
///
void insert(char c);
///
@ -239,10 +241,6 @@ public:
void markErase();
//void handleExtern(string const & arg);
///
friend class Selection;
private:
/// injects content of a cell into parent
void pullArg();
@ -265,8 +263,6 @@ private:
/// are we in a nucleus of a script inset?
bool inNucleus() const;
/// grab selection marked by anchor and current cursor
string grabSelection() const;
/// erase the selected part and re-sets the cursor
void eraseSelection();
/// guess what