From e2778d8628833c66c2105aa439635b00312456a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 22 Oct 2002 15:15:40 +0000 Subject: [PATCH] \n -> \\ git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5474 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formulabase.C | 5 +++++ src/mathed/formulabase.h | 2 ++ src/mathed/math_cursor.C | 2 +- src/mathed/math_cursor.h | 8 ++------ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 5d6cc0bc19..7fd60d3c34 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -935,6 +935,11 @@ bool InsetFormulaBase::display() const } +string InsetFormulaBase::selectionAsString() const +{ + return mathcursor ? mathcursor->grabSelection() : string(); +} + ///////////////////////////////////////////////////////////////////// diff --git a/src/mathed/formulabase.h b/src/mathed/formulabase.h index c22ebf02d6..0aeef469a6 100644 --- a/src/mathed/formulabase.h +++ b/src/mathed/formulabase.h @@ -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 diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 15c6a5f51d..42a563de38 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -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 += "&"; diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index 9791bdb2ef..3bf90f7415 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -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 -- 2.39.5