From 31059d1741933d95403e7f07ed033cae482f778b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 26 Apr 2007 16:05:57 +0000 Subject: [PATCH] rename MathArray into MathData git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18043 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/CommandInset.cpp | 2 +- src/mathed/InsetMath.cpp | 10 +- src/mathed/InsetMath.h | 8 +- src/mathed/InsetMathAMSArray.cpp | 2 +- src/mathed/InsetMathArray.cpp | 2 +- src/mathed/InsetMathBinom.cpp | 2 +- src/mathed/InsetMathBoldSymbol.cpp | 2 +- src/mathed/InsetMathBox.cpp | 2 +- src/mathed/InsetMathBoxed.cpp | 2 +- src/mathed/InsetMathBrace.cpp | 4 +- src/mathed/InsetMathBrace.h | 2 +- src/mathed/InsetMathCases.cpp | 2 +- src/mathed/InsetMathColor.cpp | 2 +- src/mathed/InsetMathComment.cpp | 2 +- src/mathed/InsetMathDFrac.cpp | 2 +- src/mathed/InsetMathDecoration.cpp | 2 +- src/mathed/InsetMathDelim.cpp | 4 +- src/mathed/InsetMathDelim.h | 2 +- src/mathed/InsetMathDiff.cpp | 4 +- src/mathed/InsetMathDiff.h | 2 +- src/mathed/InsetMathEnv.cpp | 2 +- src/mathed/InsetMathExFunc.cpp | 4 +- src/mathed/InsetMathExFunc.h | 2 +- src/mathed/InsetMathExInt.cpp | 2 +- src/mathed/InsetMathFBox.cpp | 2 +- src/mathed/InsetMathFont.cpp | 2 +- src/mathed/InsetMathFontOld.cpp | 2 +- src/mathed/InsetMathFrac.cpp | 2 +- src/mathed/InsetMathFracBase.cpp | 2 +- src/mathed/InsetMathFrameBox.cpp | 2 +- src/mathed/InsetMathGrid.cpp | 14 +- src/mathed/InsetMathHull.cpp | 28 +-- src/mathed/InsetMathLefteqn.cpp | 2 +- src/mathed/InsetMathLim.cpp | 4 +- src/mathed/InsetMathLim.h | 2 +- src/mathed/InsetMathMBox.cpp | 2 +- src/mathed/InsetMathMakebox.cpp | 2 +- src/mathed/InsetMathMatrix.cpp | 2 +- src/mathed/InsetMathNest.cpp | 28 +-- src/mathed/InsetMathNest.h | 10 +- src/mathed/InsetMathOverset.cpp | 2 +- src/mathed/InsetMathPar.cpp | 4 +- src/mathed/InsetMathPar.h | 2 +- src/mathed/InsetMathRef.cpp | 4 +- src/mathed/InsetMathRoot.cpp | 2 +- src/mathed/InsetMathScript.cpp | 22 +- src/mathed/InsetMathScript.h | 12 +- src/mathed/InsetMathSize.cpp | 2 +- src/mathed/InsetMathSpace.cpp | 2 +- src/mathed/InsetMathSplit.cpp | 2 +- src/mathed/InsetMathSqrt.cpp | 2 +- src/mathed/InsetMathStackrel.cpp | 2 +- src/mathed/InsetMathSubstack.cpp | 2 +- src/mathed/InsetMathTFrac.cpp | 2 +- src/mathed/InsetMathTabular.cpp | 2 +- src/mathed/InsetMathUnderset.cpp | 2 +- src/mathed/InsetMathXArrow.cpp | 2 +- src/mathed/InsetMathXYArrow.cpp | 16 +- src/mathed/InsetMathXYArrow.h | 4 +- src/mathed/Makefile.am | 4 +- src/mathed/MathAutoCorrect.cpp | 4 +- src/mathed/{MathArray.cpp => MathData.cpp} | 86 ++++---- src/mathed/{MathArray.h => MathData.h} | 32 +-- src/mathed/MathExtern.cpp | 226 ++++++++++----------- src/mathed/MathExtern.h | 24 +-- src/mathed/MathFactory.cpp | 2 +- src/mathed/MathFactory.h | 4 +- src/mathed/MathMacro.cpp | 12 +- src/mathed/MathMacro.h | 8 +- src/mathed/MathMacroTable.cpp | 2 +- src/mathed/MathMacroTable.h | 4 +- src/mathed/MathMacroTemplate.cpp | 6 +- src/mathed/MathMacroTemplate.h | 6 +- src/mathed/MathParser.cpp | 42 ++-- src/mathed/MathParser.h | 6 +- src/mathed/MathStream.cpp | 16 +- src/mathed/MathStream.h | 18 +- src/mathed/MathSupport.cpp | 6 +- src/mathed/MathSupport.h | 6 +- src/mathed/ReplaceData.h | 6 +- 80 files changed, 392 insertions(+), 392 deletions(-) rename src/mathed/{MathArray.cpp => MathData.cpp} (77%) rename src/mathed/{MathArray.h => MathData.h} (86%) diff --git a/src/mathed/CommandInset.cpp b/src/mathed/CommandInset.cpp index a9529b5f3c..303ca931ca 100644 --- a/src/mathed/CommandInset.cpp +++ b/src/mathed/CommandInset.cpp @@ -11,7 +11,7 @@ #include #include "CommandInset.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "DispatchResult.h" #include "FuncRequest.h" diff --git a/src/mathed/InsetMath.cpp b/src/mathed/InsetMath.cpp index 6e06d34fc8..9be69abbaa 100644 --- a/src/mathed/InsetMath.cpp +++ b/src/mathed/InsetMath.cpp @@ -12,7 +12,7 @@ #include #include "InsetMath.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "gettext.h" #include "debug.h" @@ -28,17 +28,17 @@ namespace lyx { -MathArray & InsetMath::cell(idx_type) +MathData & InsetMath::cell(idx_type) { - static MathArray dummyCell; + static MathData dummyCell; lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl; return dummyCell; } -MathArray const & InsetMath::cell(idx_type) const +MathData const & InsetMath::cell(idx_type) const { - static MathArray dummyCell; + static MathData dummyCell; lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl; return dummyCell; } diff --git a/src/mathed/InsetMath.h b/src/mathed/InsetMath.h index f0c615f448..aeaebb9d9a 100644 --- a/src/mathed/InsetMath.h +++ b/src/mathed/InsetMath.h @@ -13,7 +13,7 @@ #ifndef MATH_INSET_H #define MATH_INSET_H -#include "MathArray.h" +#include "MathData.h" #include "insets/InsetBase.h" @@ -104,9 +104,9 @@ public: virtual void drawT(TextPainter &, int x, int y) const; /// return cell given its number - virtual MathArray & cell(idx_type); + virtual MathData & cell(idx_type); /// return cell given its number - virtual MathArray const & cell(idx_type) const; + virtual MathData const & cell(idx_type) const; /// identifies certain types of insets virtual InsetMathAMSArray * asAMSArrayInset() { return 0; } @@ -161,7 +161,7 @@ public: /// replace things by other things virtual void replace(ReplaceData &) {} /// do we contain a given subsequence? - virtual bool contains(MathArray const &) const { return false; } + virtual bool contains(MathData const &) const { return false; } /// access to the lock (only nest array have one) virtual bool lock() const { return false; } /// access to the lock (only nest array have one) diff --git a/src/mathed/InsetMathAMSArray.cpp b/src/mathed/InsetMathAMSArray.cpp index 7e8bbfce79..4ccd56c2fc 100644 --- a/src/mathed/InsetMathAMSArray.cpp +++ b/src/mathed/InsetMathAMSArray.cpp @@ -12,7 +12,7 @@ #include "LaTeXFeatures.h" #include "InsetMathAMSArray.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathStream.h" #include "MathSupport.h" diff --git a/src/mathed/InsetMathArray.cpp b/src/mathed/InsetMathArray.cpp index da7d3183c3..8732f50c9c 100644 --- a/src/mathed/InsetMathArray.cpp +++ b/src/mathed/InsetMathArray.cpp @@ -12,7 +12,7 @@ #include "LaTeXFeatures.h" #include "InsetMathArray.h" -#include "MathArray.h" +#include "MathData.h" #include "MathParser.h" #include "MathStream.h" diff --git a/src/mathed/InsetMathBinom.cpp b/src/mathed/InsetMathBinom.cpp index 17ec145390..0a08e7bea3 100644 --- a/src/mathed/InsetMathBinom.cpp +++ b/src/mathed/InsetMathBinom.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathBinom.h" -#include "MathArray.h" +#include "MathData.h" #include "MathSupport.h" #include "MathStream.h" diff --git a/src/mathed/InsetMathBoldSymbol.cpp b/src/mathed/InsetMathBoldSymbol.cpp index 3a82b02b10..1d7c6f6760 100644 --- a/src/mathed/InsetMathBoldSymbol.cpp +++ b/src/mathed/InsetMathBoldSymbol.cpp @@ -12,7 +12,7 @@ #include "InsetMathBoldSymbol.h" #include "MathStream.h" -#include "MathArray.h" +#include "MathData.h" #include "LaTeXFeatures.h" #include "support/std_ostream.h" diff --git a/src/mathed/InsetMathBox.cpp b/src/mathed/InsetMathBox.cpp index 8a4e87c550..0447e84467 100644 --- a/src/mathed/InsetMathBox.cpp +++ b/src/mathed/InsetMathBox.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathBox.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathStream.h" #include "support/std_ostream.h" diff --git a/src/mathed/InsetMathBoxed.cpp b/src/mathed/InsetMathBoxed.cpp index 5b9db75c1d..2ff48888f7 100644 --- a/src/mathed/InsetMathBoxed.cpp +++ b/src/mathed/InsetMathBoxed.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathBoxed.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "LaTeXFeatures.h" #include "LColor.h" diff --git a/src/mathed/InsetMathBrace.cpp b/src/mathed/InsetMathBrace.cpp index 6a4f6b61a7..e096c7a3ce 100644 --- a/src/mathed/InsetMathBrace.cpp +++ b/src/mathed/InsetMathBrace.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathBrace.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathSupport.h" #include "LColor.h" @@ -32,7 +32,7 @@ InsetMathBrace::InsetMathBrace() {} -InsetMathBrace::InsetMathBrace(MathArray const & ar) +InsetMathBrace::InsetMathBrace(MathData const & ar) : InsetMathNest(1) { cell(0) = ar; diff --git a/src/mathed/InsetMathBrace.h b/src/mathed/InsetMathBrace.h index 3d581dc023..e22bb7cfc1 100644 --- a/src/mathed/InsetMathBrace.h +++ b/src/mathed/InsetMathBrace.h @@ -24,7 +24,7 @@ public: /// InsetMathBrace(); /// - InsetMathBrace(MathArray const & ar); + InsetMathBrace(MathData const & ar); /// InsetMathBrace const * asBraceInset() const { return this; } /// we write extra braces in any case... diff --git a/src/mathed/InsetMathCases.cpp b/src/mathed/InsetMathCases.cpp index 1f2eb60b4d..7155b723f9 100644 --- a/src/mathed/InsetMathCases.cpp +++ b/src/mathed/InsetMathCases.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathCases.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathSupport.h" #include "FuncStatus.h" diff --git a/src/mathed/InsetMathColor.cpp b/src/mathed/InsetMathColor.cpp index 5e0fed7b77..c3358bfe34 100644 --- a/src/mathed/InsetMathColor.cpp +++ b/src/mathed/InsetMathColor.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathColor.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathSupport.h" #include "LaTeXFeatures.h" diff --git a/src/mathed/InsetMathComment.cpp b/src/mathed/InsetMathComment.cpp index 3faf713433..ca0de54262 100644 --- a/src/mathed/InsetMathComment.cpp +++ b/src/mathed/InsetMathComment.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathComment.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathSupport.h" #include "support/std_ostream.h" diff --git a/src/mathed/InsetMathDFrac.cpp b/src/mathed/InsetMathDFrac.cpp index 20616016ff..5dded132b6 100644 --- a/src/mathed/InsetMathDFrac.cpp +++ b/src/mathed/InsetMathDFrac.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathDFrac.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "LaTeXFeatures.h" #include "LColor.h" diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index f1c8a7c3f7..f7a038bec8 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -12,7 +12,7 @@ #include #include "InsetMathDecoration.h" -#include "MathArray.h" +#include "MathData.h" #include "MathParser.h" #include "MathSupport.h" #include "MathStream.h" diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index 86049818e5..f7c1f24aa5 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -12,7 +12,7 @@ #include #include "InsetMathDelim.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathStream.h" #include "MathSupport.h" @@ -45,7 +45,7 @@ InsetMathDelim::InsetMathDelim(docstring const & l, docstring const & r) InsetMathDelim::InsetMathDelim - (docstring const & l, docstring const & r, MathArray const & ar) + (docstring const & l, docstring const & r, MathData const & ar) : InsetMathNest(1), left_(l), right_(r) { cell(0) = ar; diff --git a/src/mathed/InsetMathDelim.h b/src/mathed/InsetMathDelim.h index ab94d85808..61c230e4e9 100644 --- a/src/mathed/InsetMathDelim.h +++ b/src/mathed/InsetMathDelim.h @@ -26,7 +26,7 @@ public: /// InsetMathDelim(docstring const & left, docstring const & right); /// - InsetMathDelim(docstring const & left, docstring const & right, MathArray const &); + InsetMathDelim(docstring const & left, docstring const & right, MathData const &); /// InsetMathDelim * asDelimInset() { return this; } /// diff --git a/src/mathed/InsetMathDiff.cpp b/src/mathed/InsetMathDiff.cpp index 61b87a36c8..d598746f99 100644 --- a/src/mathed/InsetMathDiff.cpp +++ b/src/mathed/InsetMathDiff.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathDiff.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "debug.h" @@ -33,7 +33,7 @@ auto_ptr InsetMathDiff::doClone() const } -void InsetMathDiff::addDer(MathArray const & der) +void InsetMathDiff::addDer(MathData const & der) { cells_.push_back(der); } diff --git a/src/mathed/InsetMathDiff.h b/src/mathed/InsetMathDiff.h index 02658add64..2a8a5a53cc 100644 --- a/src/mathed/InsetMathDiff.h +++ b/src/mathed/InsetMathDiff.h @@ -26,7 +26,7 @@ public: /// InsetMathDiff(); /// - void addDer(MathArray const & der); + void addDer(MathData const & der); /// bool metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/InsetMathEnv.cpp b/src/mathed/InsetMathEnv.cpp index 15584b6745..110d09b259 100644 --- a/src/mathed/InsetMathEnv.cpp +++ b/src/mathed/InsetMathEnv.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathEnv.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathStream.h" #include "support/std_ostream.h" diff --git a/src/mathed/InsetMathExFunc.cpp b/src/mathed/InsetMathExFunc.cpp index 77530973f8..b716af8b80 100644 --- a/src/mathed/InsetMathExFunc.cpp +++ b/src/mathed/InsetMathExFunc.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathExFunc.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathStream.h" #include "MathSupport.h" @@ -29,7 +29,7 @@ InsetMathExFunc::InsetMathExFunc(docstring const & name) {} -InsetMathExFunc::InsetMathExFunc(docstring const & name, MathArray const & ar) +InsetMathExFunc::InsetMathExFunc(docstring const & name, MathData const & ar) : InsetMathNest(1), name_(name) { cell(0) = ar; diff --git a/src/mathed/InsetMathExFunc.h b/src/mathed/InsetMathExFunc.h index 5f150eeab9..aa44fda798 100644 --- a/src/mathed/InsetMathExFunc.h +++ b/src/mathed/InsetMathExFunc.h @@ -28,7 +28,7 @@ public: /// explicit InsetMathExFunc(docstring const & name); /// - InsetMathExFunc(docstring const & name, MathArray const & ar); + InsetMathExFunc(docstring const & name, MathData const & ar); /// bool metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/InsetMathExInt.cpp b/src/mathed/InsetMathExInt.cpp index 9adfe507ce..23fca486bc 100644 --- a/src/mathed/InsetMathExInt.cpp +++ b/src/mathed/InsetMathExInt.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathExInt.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathStream.h" #include "InsetMathSymbol.h" diff --git a/src/mathed/InsetMathFBox.cpp b/src/mathed/InsetMathFBox.cpp index 135395bccb..4eb91a8b97 100644 --- a/src/mathed/InsetMathFBox.cpp +++ b/src/mathed/InsetMathFBox.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathFBox.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "LColor.h" diff --git a/src/mathed/InsetMathFont.cpp b/src/mathed/InsetMathFont.cpp index 6954cd03af..e079868a1a 100644 --- a/src/mathed/InsetMathFont.cpp +++ b/src/mathed/InsetMathFont.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathFont.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathParser.h" #include "LaTeXFeatures.h" diff --git a/src/mathed/InsetMathFontOld.cpp b/src/mathed/InsetMathFontOld.cpp index e70b7370f5..d061280118 100644 --- a/src/mathed/InsetMathFontOld.cpp +++ b/src/mathed/InsetMathFontOld.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathFontOld.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathParser.h" #include "MathStream.h" diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index 55ccf4bbe3..924cebe79c 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -12,7 +12,7 @@ #include #include "InsetMathFrac.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "TextPainter.h" #include "LaTeXFeatures.h" diff --git a/src/mathed/InsetMathFracBase.cpp b/src/mathed/InsetMathFracBase.cpp index 3e78c5f395..f76986a07c 100644 --- a/src/mathed/InsetMathFracBase.cpp +++ b/src/mathed/InsetMathFracBase.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathFracBase.h" -#include "MathArray.h" +#include "MathData.h" #include "Cursor.h" diff --git a/src/mathed/InsetMathFrameBox.cpp b/src/mathed/InsetMathFrameBox.cpp index 2525898941..e77fe38fc6 100644 --- a/src/mathed/InsetMathFrameBox.cpp +++ b/src/mathed/InsetMathFrameBox.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathFrameBox.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathSupport.h" #include "LColor.h" diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index 85068dea75..afcf0cfa48 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathGrid.h" -#include "MathArray.h" +#include "MathData.h" #include "MathParser.h" #include "MathStream.h" @@ -333,7 +333,7 @@ void InsetMathGrid::metrics(MetricsInfo & mi) const int asc = 0; int desc = 0; for (col_type col = 0; col < ncols(); ++col) { - MathArray const & c = cell(index(row, col)); + MathData const & c = cell(index(row, col)); asc = max(asc, c.ascent()); desc = max(desc, c.descent()); } @@ -519,7 +519,7 @@ void InsetMathGrid::metricsT(TextMetricsInfo const & mi, Dimension & dim) const int asc = 0; int desc = 0; for (col_type col = 0; col < ncols(); ++col) { - MathArray const & c = cell(index(row, col)); + MathData const & c = cell(index(row, col)); asc = max(asc, c.ascent()); desc = max(desc, c.descent()); } @@ -614,7 +614,7 @@ docstring InsetMathGrid::eolString(row_type row, bool emptyline, bool fragile) c // make sure an upcoming '[' does not break anything if (row + 1 < nrows()) { - MathArray const & c = cell(index(row + 1, 0)); + MathData const & c = cell(index(row + 1, 0)); if (c.size() && c.front()->getChar() == '[') //eol += "[0pt]"; eol += "{}"; @@ -640,7 +640,7 @@ void InsetMathGrid::addRow(row_type row) { rowinfo_.insert(rowinfo_.begin() + row + 1, RowInfo()); cells_.insert - (cells_.begin() + (row + 1) * ncols(), ncols(), MathArray()); + (cells_.begin() + (row + 1) * ncols(), ncols(), MathData()); cellinfo_.insert (cellinfo_.begin() + (row + 1) * ncols(), ncols(), CellInfo()); } @@ -649,7 +649,7 @@ void InsetMathGrid::addRow(row_type row) void InsetMathGrid::appendRow() { rowinfo_.push_back(RowInfo()); - //cells_.insert(cells_.end(), ncols(), MathArray()); + //cells_.insert(cells_.end(), ncols(), MathData()); for (col_type col = 0; col < ncols(); ++col) { cells_.push_back(cells_type::value_type()); cellinfo_.push_back(CellInfo()); @@ -1016,7 +1016,7 @@ void InsetMathGrid::splitCell(Cursor & cur) { if (cur.idx() == cur.lastidx()) return; - MathArray ar = cur.cell(); + MathData ar = cur.cell(); ar.erase(0, cur.pos()); cur.cell().erase(cur.pos(), cur.lastpos()); ++cur.idx(); diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 38897e2f44..1b963ac068 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -13,7 +13,7 @@ #include "InsetMathArray.h" #include "InsetMathChar.h" #include "InsetMathColor.h" -#include "MathArray.h" +#include "MathData.h" #include "InsetMathDelim.h" #include "MathExtern.h" #include "MathFactory.h" @@ -98,9 +98,9 @@ namespace { // returns position of first relation operator in the array // used for "intelligent splitting" - size_t firstRelOp(MathArray const & ar) + size_t firstRelOp(MathData const & ar) { - for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it) + for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it) if ((*it)->isRelOp()) return it - ar.begin(); return ar.size(); @@ -680,7 +680,7 @@ docstring InsetMathHull::nicelabel(row_type row) const void InsetMathHull::glueall() { - MathArray ar; + MathData ar; for (idx_type i = 0; i < nargs(); ++i) ar.append(cell(i)); *this = InsetMathHull(hullSimple); @@ -696,7 +696,7 @@ void InsetMathHull::splitTo2Cols() for (row_type row = 0; row < nrows(); ++row) { idx_type const i = 2 * row; pos_type pos = firstRelOp(cell(i)); - cell(i + 1) = MathArray(cell(i).begin() + pos, cell(i).end()); + cell(i + 1) = MathData(cell(i).begin() + pos, cell(i).end()); cell(i).erase(pos, cell(i).size()); } } @@ -711,7 +711,7 @@ void InsetMathHull::splitTo3Cols() for (row_type row = 0; row < nrows(); ++row) { idx_type const i = 3 * row + 1; if (cell(i).size()) { - cell(i + 1) = MathArray(cell(i).begin() + 1, cell(i).end()); + cell(i + 1) = MathData(cell(i).begin() + 1, cell(i).end()); cell(i).erase(1, cell(i).size()); } } @@ -967,7 +967,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func) #ifdef WITH_WARNINGS #warning temporarily disabled //if (cur.selection()) { - // MathArray ar; + // MathData ar; // selGet(cur.ar); // lyxerr << "use selection: " << ar << endl; // insert(pipeThroughExtern(lang, extra, ar)); @@ -975,7 +975,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func) //} #endif - MathArray eq; + MathData eq; eq.push_back(MathAtom(new InsetMathChar('='))); // go to first item in line @@ -984,14 +984,14 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func) if (getType() == hullSimple) { size_type pos = cur.cell().find_last(eq); - MathArray ar; + MathData ar; if (cur.inMathed() && cur.selection()) { asArray(grabAndEraseSelection(cur), ar); } else if (pos == cur.cell().size()) { ar = cur.cell(); lyxerr << "use whole cell: " << ar << endl; } else { - ar = MathArray(cur.cell().begin() + pos + 1, cur.cell().end()); + ar = MathData(cur.cell().begin() + pos + 1, cur.cell().end()); lyxerr << "use partial cell form pos: " << pos << endl; } cur.cell().append(eq); @@ -1003,7 +1003,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func) if (getType() == hullEquation) { lyxerr << "use equation inset" << endl; mutate(hullEqnArray); - MathArray & ar = cur.cell(); + MathData & ar = cur.cell(); lyxerr << "use cell: " << ar << endl; ++cur.idx(); cur.cell() = eq; @@ -1018,7 +1018,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func) lyxerr << "use eqnarray" << endl; cur.idx() += 2 - cur.idx() % ncols(); cur.pos() = 0; - MathArray ar = cur.cell(); + MathData ar = cur.cell(); lyxerr << "use cell: " << ar << endl; #ifdef WITH_WARNINGS #warning temporarily disabled @@ -1385,7 +1385,7 @@ bool InsetMathHull::searchForward(BufferView * bv, string const & str, #endif static InsetMathHull * lastformula = 0; static CursorBase current = DocIterator(ibegin(nucleus())); - static MathArray ar; + static MathData ar; static string laststr; if (lastformula != this || laststr != str) { @@ -1402,7 +1402,7 @@ bool InsetMathHull::searchForward(BufferView * bv, string const & str, for (DocIterator it = current; it != iend(nucleus()); increment(it)) { CursorSlice & top = it.back(); - MathArray const & a = top.asInsetMath()->cell(top.idx_); + MathData const & a = top.asInsetMath()->cell(top.idx_); if (a.matchpart(ar, top.pos_)) { bv->cursor().setSelection(it, ar.size()); current = it; diff --git a/src/mathed/InsetMathLefteqn.cpp b/src/mathed/InsetMathLefteqn.cpp index 6227dbf32c..4122d781f9 100644 --- a/src/mathed/InsetMathLefteqn.cpp +++ b/src/mathed/InsetMathLefteqn.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathLefteqn.h" -#include "MathArray.h" +#include "MathData.h" #include "support/std_ostream.h" diff --git a/src/mathed/InsetMathLim.cpp b/src/mathed/InsetMathLim.cpp index 3fdd3b5e8a..d088d80fa3 100644 --- a/src/mathed/InsetMathLim.cpp +++ b/src/mathed/InsetMathLim.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathLim.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "debug.h" @@ -23,7 +23,7 @@ using std::endl; InsetMathLim::InsetMathLim - (MathArray const & f, MathArray const & x, MathArray const & x0) + (MathData const & f, MathData const & x, MathData const & x0) : InsetMathNest(3) { cell(0) = f; diff --git a/src/mathed/InsetMathLim.h b/src/mathed/InsetMathLim.h index af1480dd0c..2a8f3e390b 100644 --- a/src/mathed/InsetMathLim.h +++ b/src/mathed/InsetMathLim.h @@ -24,7 +24,7 @@ namespace lyx { class InsetMathLim : public InsetMathNest { public: /// - InsetMathLim(MathArray const & f, MathArray const & x, MathArray const & x0); + InsetMathLim(MathData const & f, MathData const & x, MathData const & x0); /// bool metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/InsetMathMBox.cpp b/src/mathed/InsetMathMBox.cpp index 23f5453515..bdc95de8d6 100644 --- a/src/mathed/InsetMathMBox.cpp +++ b/src/mathed/InsetMathMBox.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathMBox.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "BufferView.h" diff --git a/src/mathed/InsetMathMakebox.cpp b/src/mathed/InsetMathMakebox.cpp index 51fce619e6..fb6a0b09a4 100644 --- a/src/mathed/InsetMathMakebox.cpp +++ b/src/mathed/InsetMathMakebox.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathMakebox.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathSupport.h" diff --git a/src/mathed/InsetMathMatrix.cpp b/src/mathed/InsetMathMatrix.cpp index 7b19c38d98..feb56cb3df 100644 --- a/src/mathed/InsetMathMatrix.cpp +++ b/src/mathed/InsetMathMatrix.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathMatrix.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index bf224bb12f..154af01e49 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -18,7 +18,7 @@ #include "InsetMathBrace.h" #include "InsetMathColor.h" #include "InsetMathComment.h" -#include "MathArray.h" +#include "MathData.h" #include "InsetMathDelim.h" #include "MathFactory.h" #include "InsetMathHull.h" @@ -92,13 +92,13 @@ void InsetMathNest::cursorPos(BufferView const & bv, { // FIXME: This is a hack. Ideally, the coord cache should not store // absolute positions, but relative ones. This would mean to call -// setXY() not in MathArray::draw(), but in the parent insets' draw() +// setXY() not in MathData::draw(), but in the parent insets' draw() // with the correctly adjusted x,y values. But this means that we'd have // to touch all (math)inset's draw() methods. Right now, we'll store // absolute value, and make them here relative, only to make them // absolute again when actually drawing the cursor. What a mess. BOOST_ASSERT(ptr_cmp(&sl.inset(), this)); - MathArray const & ar = sl.cell(); + MathData const & ar = sl.cell(); CoordCache const & coord_cache = bv.coordCache(); if (!coord_cache.getArrays().has(&ar)) { // this can (semi-)legally happen if we just created this cell @@ -117,7 +117,7 @@ void InsetMathNest::cursorPos(BufferView const & bv, return; } Point const pt2 = coord_cache.getInsets().xy(this); - //lyxerr << "retrieving position cache for MathArray " + //lyxerr << "retrieving position cache for MathData " // << pt.x_ << ' ' << pt.y_ << std::endl; x = pt.x_ - pt2.x_ + ar.pos2x(sl.pos()); y = pt.y_ - pt2.y_; @@ -240,7 +240,7 @@ void InsetMathNest::drawSelection(PainterInfo & pi, int x, int y) const //lyxerr << "InsetMathNest::drawing selection: " // << " s1: " << s1 << " s2: " << s2 << endl; if (s1.idx() == s2.idx()) { - MathArray const & c = cell(s1.idx()); + MathData const & c = cell(s1.idx()); int x1 = c.xo(bv) + c.pos2x(s1.pos()); int y1 = c.yo(bv) - c.ascent(); int x2 = c.xo(bv) + c.pos2x(s2.pos()); @@ -252,7 +252,7 @@ void InsetMathNest::drawSelection(PainterInfo & pi, int x, int y) const } else { for (idx_type i = 0; i < nargs(); ++i) { if (idxBetween(i, s1.idx(), s2.idx())) { - MathArray const & c = cell(i); + MathData const & c = cell(i); int x1 = c.xo(bv); int y1 = c.yo(bv) - c.ascent(); int x2 = c.xo(bv) + c.width(); @@ -278,7 +278,7 @@ void InsetMathNest::replace(ReplaceData & rep) } -bool InsetMathNest::contains(MathArray const & ar) const +bool InsetMathNest::contains(MathData const & ar) const { for (idx_type i = 0; i < nargs(); ++i) if (cell(i).contains(ar)) @@ -305,9 +305,9 @@ bool InsetMathNest::isActive() const } -MathArray InsetMathNest::glue() const +MathData InsetMathNest::glue() const { - MathArray ar; + MathData ar; for (size_t i = 0; i < nargs(); ++i) ar.append(cell(i)); return ar; @@ -352,12 +352,12 @@ bool InsetMathNest::notifyCursorLeaves(Cursor & /*cur*/) #warning look here #endif #if 0 - MathArray & ar = cur.cell(); + MathData & ar = cur.cell(); // remove base-only "scripts" for (pos_type i = 0; i + 1 < ar.size(); ++i) { InsetMathScript * p = operator[](i).nucleus()->asScriptInset(); if (p && p->nargs() == 1) { - MathArray ar = p->nuc(); + MathData ar = p->nuc(); erase(i); insert(i, ar); cur.adjust(i, ar.size() - 1); @@ -975,7 +975,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) } case LFUN_INSET_INSERT: { - MathArray ar; + MathData ar; if (createInsetMath_fromDialogStr(cmd.argument(), ar)) { recordUndo(cur); cur.insert(ar); @@ -1112,7 +1112,7 @@ InsetBase * InsetMathNest::editXY(Cursor & cur, int x, int y) idx_min = i; } } - MathArray & ar = cell(idx_min); + MathData & ar = cell(idx_min); cur.push(*this); cur.idx() = idx_min; cur.pos() = ar.x2pos(x - ar.xo(cur.bv())); @@ -1144,7 +1144,7 @@ void InsetMathNest::lfunMousePress(Cursor & cur, FuncRequest & cmd) // cur.result().update(): don't overwrite previously set flags. cur.updateFlags(Update::Decoration | Update::FitCursor | cur.result().update()); } else if (cmd.button() == mouse_button::button2) { - MathArray ar; + MathData ar; if (cap::selection()) { // See comment in LyXText::dispatch why we do this cap::copySelectionToStack(); diff --git a/src/mathed/InsetMathNest.h b/src/mathed/InsetMathNest.h index 18ba304c9b..1ae230a284 100644 --- a/src/mathed/InsetMathNest.h +++ b/src/mathed/InsetMathNest.h @@ -77,8 +77,8 @@ public: /// direct access to the cell. /// inlined because shows in profile. //@{ - MathArray & cell(idx_type i) { return cells_[i]; } - MathArray const & cell(idx_type i) const { return cells_[i]; } + MathData & cell(idx_type i) { return cells_[i]; } + MathData const & cell(idx_type i) const { return cells_[i]; } //@} /// can we move into this cell (see macroarg.h) @@ -89,9 +89,9 @@ public: /// replace in all cells void replace(ReplaceData &); /// do we contain a given pattern? - bool contains(MathArray const &) const; + bool contains(MathData const &) const; /// glue everything to a single cell - MathArray glue() const; + MathData glue() const; /// debug helper void dump() const; @@ -141,7 +141,7 @@ private: protected: /// we store the cells in a vector - typedef std::vector cells_type; + typedef std::vector cells_type; /// thusly: cells_type cells_; /// if the inset is locked, it can't be entered with the cursor diff --git a/src/mathed/InsetMathOverset.cpp b/src/mathed/InsetMathOverset.cpp index 9d241723a5..15727f9086 100644 --- a/src/mathed/InsetMathOverset.cpp +++ b/src/mathed/InsetMathOverset.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathOverset.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "Cursor.h" diff --git a/src/mathed/InsetMathPar.cpp b/src/mathed/InsetMathPar.cpp index e0b6345bda..4fef89efe3 100644 --- a/src/mathed/InsetMathPar.cpp +++ b/src/mathed/InsetMathPar.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathPar.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "support/std_ostream.h" @@ -22,7 +22,7 @@ namespace lyx { using std::auto_ptr; -InsetMathPar::InsetMathPar(MathArray const & ar) +InsetMathPar::InsetMathPar(MathData const & ar) { cells_[0] = ar; } diff --git a/src/mathed/InsetMathPar.h b/src/mathed/InsetMathPar.h index 3f980e2fec..29d62b98d4 100644 --- a/src/mathed/InsetMathPar.h +++ b/src/mathed/InsetMathPar.h @@ -23,7 +23,7 @@ public: /// InsetMathPar() {} /// - InsetMathPar(MathArray const & ar); + InsetMathPar(MathData const & ar); /// mode_type currentMode() const { return TEXT_MODE; } /// diff --git a/src/mathed/InsetMathRef.cpp b/src/mathed/InsetMathRef.cpp index e66aa89f2d..9945694a68 100644 --- a/src/mathed/InsetMathRef.cpp +++ b/src/mathed/InsetMathRef.cpp @@ -20,7 +20,7 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "gettext.h" -#include "MathArray.h" +#include "MathData.h" #include "MathFactory.h" #include "MathSupport.h" #include "OutputParams.h" @@ -63,7 +63,7 @@ void RefInset::doDispatch(Cursor & cur, FuncRequest & cmd) switch (cmd.action) { case LFUN_INSET_MODIFY: if (cmd.getArg(0) == "ref") { - MathArray ar; + MathData ar; if (createInsetMath_fromDialogStr(cmd.argument(), ar)) { *this = *ar[0].nucleus()->asRefInset(); break; diff --git a/src/mathed/InsetMathRoot.cpp b/src/mathed/InsetMathRoot.cpp index b927db47e3..324d804f6b 100644 --- a/src/mathed/InsetMathRoot.cpp +++ b/src/mathed/InsetMathRoot.cpp @@ -12,7 +12,7 @@ #include #include "InsetMathRoot.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "Cursor.h" #include "LColor.h" diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp index ee18314316..71aeeff773 100644 --- a/src/mathed/InsetMathScript.cpp +++ b/src/mathed/InsetMathScript.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathScript.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathSupport.h" #include "InsetMathSymbol.h" @@ -86,7 +86,7 @@ bool InsetMathScript::idxLast(Cursor & cur) const } -MathArray const & InsetMathScript::down() const +MathData const & InsetMathScript::down() const { if (nargs() == 3) return cell(2); @@ -95,7 +95,7 @@ MathArray const & InsetMathScript::down() const } -MathArray & InsetMathScript::down() +MathData & InsetMathScript::down() { if (nargs() == 3) return cell(2); @@ -104,14 +104,14 @@ MathArray & InsetMathScript::down() } -MathArray const & InsetMathScript::up() const +MathData const & InsetMathScript::up() const { BOOST_ASSERT(nargs() > 1); return cell(1); } -MathArray & InsetMathScript::up() +MathData & InsetMathScript::up() { BOOST_ASSERT(nargs() > 1); return cell(1); @@ -122,26 +122,26 @@ void InsetMathScript::ensure(bool up) { if (nargs() == 1) { // just nucleus so far - cells_.push_back(MathArray()); + cells_.push_back(MathData()); cell_1_is_up_ = up; } else if (nargs() == 2 && !has(up)) { if (up) { cells_.push_back(cell(1)); cell(1).clear(); } else { - cells_.push_back(MathArray()); + cells_.push_back(MathData()); } } } -MathArray const & InsetMathScript::nuc() const +MathData const & InsetMathScript::nuc() const { return cell(0); } -MathArray & InsetMathScript::nuc() +MathData & InsetMathScript::nuc() { return cell(0); } @@ -157,7 +157,7 @@ bool isAlphaSymbol(MathAtom const & at) return true; if (at->asFontInset()) { - MathArray const & ar = at->asFontInset()->cell(0); + MathData const & ar = at->asFontInset()->cell(0); for (size_t i = 0; i < ar.size(); ++i) { if (!(ar[i]->asCharInset() || (ar[i]->asSymbolInset() && @@ -676,7 +676,7 @@ bool InsetMathScript::notifyCursorLeaves(Cursor & cur) // invoke notifyCursorLeaves again and does not touch // cur (since the top slice will be deleted // afterwards)) - MathArray ar = cell(0); + MathData ar = cell(0); Cursor tmpcur = cur; tmpcur.pop(); tmpcur.cell().erase(tmpcur.pos()); diff --git a/src/mathed/InsetMathScript.h b/src/mathed/InsetMathScript.h index 011b82160b..b13d163289 100644 --- a/src/mathed/InsetMathScript.h +++ b/src/mathed/InsetMathScript.h @@ -75,17 +75,17 @@ public: /// get limits int limits() const { return limits_; } /// returns subscript. Always run 'hasDown' or 'has(false)' before! - MathArray const & down() const; + MathData const & down() const; /// returns subscript. Always run 'hasDown' or 'has(false)' before! - MathArray & down(); + MathData & down(); /// returns superscript. Always run 'hasUp' or 'has(true)' before! - MathArray const & up() const; + MathData const & up() const; /// returns superscript. Always run 'hasUp' or 'has(true)' before! - MathArray & up(); + MathData & up(); /// returns nucleus - MathArray const & nuc() const; + MathData const & nuc() const; /// returns nucleus - MathArray & nuc(); + MathData & nuc(); /// do we have a superscript? bool hasUp() const; /// do we have a subscript? diff --git a/src/mathed/InsetMathSize.cpp b/src/mathed/InsetMathSize.cpp index 91709a9532..23eb69812a 100644 --- a/src/mathed/InsetMathSize.cpp +++ b/src/mathed/InsetMathSize.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathSize.h" -#include "MathArray.h" +#include "MathData.h" #include "MathParser.h" #include "MathStream.h" diff --git a/src/mathed/InsetMathSpace.cpp b/src/mathed/InsetMathSpace.cpp index 41ede3c4d3..8d3df0930b 100644 --- a/src/mathed/InsetMathSpace.cpp +++ b/src/mathed/InsetMathSpace.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathSpace.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "LaTeXFeatures.h" diff --git a/src/mathed/InsetMathSplit.cpp b/src/mathed/InsetMathSplit.cpp index 7cbaf9b342..781c6ec2c8 100644 --- a/src/mathed/InsetMathSplit.cpp +++ b/src/mathed/InsetMathSplit.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathSplit.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathStream.h" diff --git a/src/mathed/InsetMathSqrt.cpp b/src/mathed/InsetMathSqrt.cpp index 57faa1ccc0..55d773c946 100644 --- a/src/mathed/InsetMathSqrt.cpp +++ b/src/mathed/InsetMathSqrt.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathSqrt.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "TextPainter.h" #include "LColor.h" diff --git a/src/mathed/InsetMathStackrel.cpp b/src/mathed/InsetMathStackrel.cpp index 3df8d284bf..9f1a9baba9 100644 --- a/src/mathed/InsetMathStackrel.cpp +++ b/src/mathed/InsetMathStackrel.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathStackrel.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" diff --git a/src/mathed/InsetMathSubstack.cpp b/src/mathed/InsetMathSubstack.cpp index a7817f15f0..c285f0f650 100644 --- a/src/mathed/InsetMathSubstack.cpp +++ b/src/mathed/InsetMathSubstack.cpp @@ -12,7 +12,7 @@ #include "LaTeXFeatures.h" #include "InsetMathSubstack.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "support/std_ostream.h" diff --git a/src/mathed/InsetMathTFrac.cpp b/src/mathed/InsetMathTFrac.cpp index a739904edd..84ed2b8157 100644 --- a/src/mathed/InsetMathTFrac.cpp +++ b/src/mathed/InsetMathTFrac.cpp @@ -12,7 +12,7 @@ #include "InsetMathTFrac.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "LaTeXFeatures.h" diff --git a/src/mathed/InsetMathTabular.cpp b/src/mathed/InsetMathTabular.cpp index ac4381aa46..7445044e3e 100644 --- a/src/mathed/InsetMathTabular.cpp +++ b/src/mathed/InsetMathTabular.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathTabular.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathStream.h" diff --git a/src/mathed/InsetMathUnderset.cpp b/src/mathed/InsetMathUnderset.cpp index bceabfb62c..0f91a963f4 100644 --- a/src/mathed/InsetMathUnderset.cpp +++ b/src/mathed/InsetMathUnderset.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathUnderset.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "Cursor.h" diff --git a/src/mathed/InsetMathXArrow.cpp b/src/mathed/InsetMathXArrow.cpp index 08c234c274..dbd16ac31c 100644 --- a/src/mathed/InsetMathXArrow.cpp +++ b/src/mathed/InsetMathXArrow.cpp @@ -11,7 +11,7 @@ #include #include "InsetMathXArrow.h" -#include "MathArray.h" +#include "MathData.h" #include "MathStream.h" #include "MathStream.h" #include "MathSupport.h" diff --git a/src/mathed/InsetMathXYArrow.cpp b/src/mathed/InsetMathXYArrow.cpp index fb0f30252d..1853c2e4d9 100644 --- a/src/mathed/InsetMathXYArrow.cpp +++ b/src/mathed/InsetMathXYArrow.cpp @@ -40,14 +40,14 @@ InsetMathXYMatrix const * InsetMathXYArrow::targetMatrix() const } -MathArray const & InsetMathXYArrow::targetCell() const +MathData const & InsetMathXYArrow::targetCell() const { #if 0 InsetMathXYMatrix const * p = targetMatrix(); int x = 0; int y = 0; - MathArray const & t = cell(0); - for (MathArray::const_iterator it = t.begin(); it != t.end(); ++it) { + MathData const & t = cell(0); + for (MathData::const_iterator it = t.begin(); it != t.end(); ++it) { switch ((*it)->getChar()) { case 'l': --x; break; case 'r': ++x; break; @@ -64,18 +64,18 @@ MathArray const & InsetMathXYArrow::targetCell() const } return p->cell(n); #else - static MathArray dummy; + static MathData dummy; return dummy; #endif } -MathArray const & InsetMathXYArrow::sourceCell() const +MathData const & InsetMathXYArrow::sourceCell() const { #if 0 return targetMatrix()->cell(mi_.idx); #else - static MathArray dummy; + static MathData dummy; return dummy; #endif } @@ -131,8 +131,8 @@ void InsetMathXYArrow::draw(PainterInfo & pi, int x, int y) const } else { pi.pain.text(x, y, "X"); - MathArray const & s = sourceCell(); - MathArray const & t = targetCell(); + MathData const & s = sourceCell(); + MathData const & t = targetCell(); pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), LColor::math); cell(1).draw(pi, (s.xm() + t.xm())/2, (s.ym() + t.ym())/2); diff --git a/src/mathed/InsetMathXYArrow.h b/src/mathed/InsetMathXYArrow.h index 041bf080a7..447e9604e1 100644 --- a/src/mathed/InsetMathXYArrow.h +++ b/src/mathed/InsetMathXYArrow.h @@ -47,9 +47,9 @@ public: /// InsetMathXYMatrix const * targetMatrix() const; /// - MathArray const & targetCell() const; + MathData const & targetCell() const; /// - MathArray const & sourceCell() const; + MathData const & sourceCell() const; /// bool up_; diff --git a/src/mathed/Makefile.am b/src/mathed/Makefile.am index 062f887895..d856a8cb53 100644 --- a/src/mathed/Makefile.am +++ b/src/mathed/Makefile.am @@ -131,8 +131,8 @@ libmathed_la_SOURCES = \ MathAtom.h \ MathAutoCorrect.cpp \ MathAutoCorrect.h \ - MathArray.cpp \ - MathArray.h \ + MathData.cpp \ + MathData.h \ MathExtern.cpp \ MathExtern.h \ MathFactory.cpp \ diff --git a/src/mathed/MathAutoCorrect.cpp b/src/mathed/MathAutoCorrect.cpp index 2b384d330e..f34765ec4d 100644 --- a/src/mathed/MathAutoCorrect.cpp +++ b/src/mathed/MathAutoCorrect.cpp @@ -11,7 +11,7 @@ #include #include "MathAutoCorrect.h" -#include "MathArray.h" +#include "MathData.h" #include "InsetMath.h" #include "MathSupport.h" #include "MathParser.h" @@ -62,7 +62,7 @@ bool Correction::read(idocstream & is) return false; if (s2.size() != 1) return false; - MathArray ar1, ar3; + MathData ar1, ar3; mathed_parse_cell(ar1, s1); mathed_parse_cell(ar3, s3); if (ar1.size() != 1 || ar3.size() != 1) diff --git a/src/mathed/MathArray.cpp b/src/mathed/MathData.cpp similarity index 77% rename from src/mathed/MathArray.cpp rename to src/mathed/MathData.cpp index 20783844b8..a0e9222c82 100644 --- a/src/mathed/MathArray.cpp +++ b/src/mathed/MathData.cpp @@ -1,5 +1,5 @@ /** - * \file MathArray.cpp + * \file MathData.cpp * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -10,7 +10,7 @@ #include -#include "MathArray.h" +#include "MathData.h" #include "InsetMathFont.h" #include "InsetMathScript.h" #include "MathMacro.h" @@ -41,70 +41,70 @@ using std::string; using std::vector; -MathArray::MathArray(const_iterator from, const_iterator to) +MathData::MathData(const_iterator from, const_iterator to) : base_type(from, to) {} -MathAtom & MathArray::operator[](pos_type pos) +MathAtom & MathData::operator[](pos_type pos) { BOOST_ASSERT(pos < size()); return base_type::operator[](pos); } -MathAtom const & MathArray::operator[](pos_type pos) const +MathAtom const & MathData::operator[](pos_type pos) const { BOOST_ASSERT(pos < size()); return base_type::operator[](pos); } -void MathArray::insert(size_type pos, MathAtom const & t) +void MathData::insert(size_type pos, MathAtom const & t) { base_type::insert(begin() + pos, t); } -void MathArray::insert(size_type pos, MathArray const & ar) +void MathData::insert(size_type pos, MathData const & ar) { BOOST_ASSERT(pos <= size()); base_type::insert(begin() + pos, ar.begin(), ar.end()); } -void MathArray::append(MathArray const & ar) +void MathData::append(MathData const & ar) { insert(size(), ar); } -void MathArray::erase(size_type pos) +void MathData::erase(size_type pos) { if (pos < size()) erase(pos, pos + 1); } -void MathArray::erase(iterator pos1, iterator pos2) +void MathData::erase(iterator pos1, iterator pos2) { base_type::erase(pos1, pos2); } -void MathArray::erase(iterator pos) +void MathData::erase(iterator pos) { base_type::erase(pos); } -void MathArray::erase(size_type pos1, size_type pos2) +void MathData::erase(size_type pos1, size_type pos2) { base_type::erase(begin() + pos1, begin() + pos2); } -void MathArray::dump2() const +void MathData::dump2() const { odocstringstream os; NormalStream ns(os); @@ -114,7 +114,7 @@ void MathArray::dump2() const } -void MathArray::dump() const +void MathData::dump() const { odocstringstream os; NormalStream ns(os); @@ -124,20 +124,20 @@ void MathArray::dump() const } -void MathArray::validate(LaTeXFeatures & features) const +void MathData::validate(LaTeXFeatures & features) const { for (const_iterator it = begin(); it != end(); ++it) (*it)->validate(features); } -bool MathArray::match(MathArray const & ar) const +bool MathData::match(MathData const & ar) const { return size() == ar.size() && matchpart(ar, 0); } -bool MathArray::matchpart(MathArray const & ar, pos_type pos) const +bool MathData::matchpart(MathData const & ar, pos_type pos) const { if (size() < ar.size() + pos) return false; @@ -149,7 +149,7 @@ bool MathArray::matchpart(MathArray const & ar, pos_type pos) const } -void MathArray::replace(ReplaceData & rep) +void MathData::replace(ReplaceData & rep) { for (size_type i = 0; i < size(); ++i) { if (find1(rep.from, i)) { @@ -168,7 +168,7 @@ void MathArray::replace(ReplaceData & rep) } -bool MathArray::find1(MathArray const & ar, size_type pos) const +bool MathData::find1(MathData const & ar, size_type pos) const { lyxerr << "finding '" << ar << "' in '" << *this << "'" << endl; for (size_type i = 0, n = ar.size(); i < n; ++i) @@ -178,7 +178,7 @@ bool MathArray::find1(MathArray const & ar, size_type pos) const } -MathArray::size_type MathArray::find(MathArray const & ar) const +MathData::size_type MathData::find(MathData const & ar) const { for (int i = 0, last = size() - ar.size(); i < last; ++i) if (find1(ar, i)) @@ -187,7 +187,7 @@ MathArray::size_type MathArray::find(MathArray const & ar) const } -MathArray::size_type MathArray::find_last(MathArray const & ar) const +MathData::size_type MathData::find_last(MathData const & ar) const { for (int i = size() - ar.size(); i >= 0; --i) if (find1(ar, i)) @@ -196,7 +196,7 @@ MathArray::size_type MathArray::find_last(MathArray const & ar) const } -bool MathArray::contains(MathArray const & ar) const +bool MathData::contains(MathData const & ar) const { if (find(ar) != size()) return true; @@ -207,12 +207,12 @@ bool MathArray::contains(MathArray const & ar) const } -void MathArray::touch() const +void MathData::touch() const { } -bool MathArray::metrics(MetricsInfo & mi, Dimension & dim) const +bool MathData::metrics(MetricsInfo & mi, Dimension & dim) const { dim = dim_; metrics(mi); @@ -225,7 +225,7 @@ bool MathArray::metrics(MetricsInfo & mi, Dimension & dim) const namespace { -bool isInside(DocIterator const & it, MathArray const & ar, +bool isInside(DocIterator const & it, MathData const & ar, pos_type p1, pos_type p2) { for (size_t i = 0; i != it.depth(); ++i) { @@ -240,7 +240,7 @@ bool isInside(DocIterator const & it, MathArray const & ar, -void MathArray::metrics(MetricsInfo & mi) const +void MathData::metrics(MetricsInfo & mi) const { frontend::FontMetrics const & fm = theFontMetrics(mi.base.font); dim_ = fm.dimension('I'); @@ -273,8 +273,8 @@ void MathArray::metrics(MetricsInfo & mi) const lyxerr << "metrics:found macro: " << mac->name() << " numargs: " << numargs << endl; if (!isInside(bv.cursor(), *this, i + 1, i + numargs + 1)) { - MathArray args(begin() + i + 1, begin() + i + numargs + 1); - MathArray exp; + MathData args(begin() + i + 1, begin() + i + numargs + 1); + MathData exp; tmpl.expand(args, exp); mac->setExpansion(exp, args); mac->metricsExpanded(mi, d); @@ -292,9 +292,9 @@ void MathArray::metrics(MetricsInfo & mi) const } -void MathArray::draw(PainterInfo & pi, int x, int y) const +void MathData::draw(PainterInfo & pi, int x, int y) const { - //lyxerr << "MathArray::draw: x: " << x << " y: " << y << endl; + //lyxerr << "MathData::draw: x: " << x << " y: " << y << endl; BufferView & bv = *pi.base.bv; setXY(bv, x, y); @@ -337,7 +337,7 @@ void MathArray::draw(PainterInfo & pi, int x, int y) const } -void MathArray::metricsT(TextMetricsInfo const & mi, Dimension & dim) const +void MathData::metricsT(TextMetricsInfo const & mi, Dimension & dim) const { dim.clear(); Dimension d; @@ -348,7 +348,7 @@ void MathArray::metricsT(TextMetricsInfo const & mi, Dimension & dim) const } -void MathArray::drawT(TextPainter & pain, int x, int y) const +void MathData::drawT(TextPainter & pain, int x, int y) const { //lyxerr << "x: " << x << " y: " << y << ' ' << pain.workAreaHeight() << endl; @@ -363,13 +363,13 @@ void MathArray::drawT(TextPainter & pain, int x, int y) const } -int MathArray::pos2x(size_type pos) const +int MathData::pos2x(size_type pos) const { return pos2x(pos, 0); } -int MathArray::pos2x(size_type pos, int glue) const +int MathData::pos2x(size_type pos, int glue) const { int x = 0; size_type target = min(pos, size()); @@ -385,13 +385,13 @@ int MathArray::pos2x(size_type pos, int glue) const } -MathArray::size_type MathArray::x2pos(int targetx) const +MathData::size_type MathData::x2pos(int targetx) const { return x2pos(targetx, 0); } -MathArray::size_type MathArray::x2pos(int targetx, int glue) const +MathData::size_type MathData::x2pos(int targetx, int glue) const { const_iterator it = begin(); int lastx = 0; @@ -424,7 +424,7 @@ MathArray::size_type MathArray::x2pos(int targetx, int glue) const } -int MathArray::dist(BufferView const & bv, int x, int y) const +int MathData::dist(BufferView const & bv, int x, int y) const { int xx = 0; int yy = 0; @@ -446,26 +446,26 @@ int MathArray::dist(BufferView const & bv, int x, int y) const } -void MathArray::setXY(BufferView & bv, int x, int y) const +void MathData::setXY(BufferView & bv, int x, int y) const { - //lyxerr << "setting position cache for MathArray " << this << std::endl; + //lyxerr << "setting position cache for MathData " << this << std::endl; bv.coordCache().arrays().add(this, x, y); } -int MathArray::xo(BufferView const & bv) const +int MathData::xo(BufferView const & bv) const { return bv.coordCache().getArrays().x(this); } -int MathArray::yo(BufferView const & bv) const +int MathData::yo(BufferView const & bv) const { return bv.coordCache().getArrays().y(this); } -std::ostream & operator<<(std::ostream & os, MathArray const & ar) +std::ostream & operator<<(std::ostream & os, MathData const & ar) { odocstringstream oss; NormalStream ns(oss); @@ -474,7 +474,7 @@ std::ostream & operator<<(std::ostream & os, MathArray const & ar) } -odocstream & operator<<(odocstream & os, MathArray const & ar) +odocstream & operator<<(odocstream & os, MathData const & ar) { NormalStream ns(os); ns << ar; diff --git a/src/mathed/MathArray.h b/src/mathed/MathData.h similarity index 86% rename from src/mathed/MathArray.h rename to src/mathed/MathData.h index 2001ec90d9..f2cde1223f 100644 --- a/src/mathed/MathArray.h +++ b/src/mathed/MathData.h @@ -1,6 +1,6 @@ // -*- C++ -*- /** - * \file MathArray.h + * \file MathData.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -33,7 +33,7 @@ class TextMetricsInfo; class TextPainter; -class MathArray : private std::vector { +class MathData : private std::vector { public: /// re-use inhertited stuff typedef std::vector base_type; @@ -56,16 +56,16 @@ public: public: /// - MathArray() {} + MathData() {} /// - MathArray(const_iterator from, const_iterator to); + MathData(const_iterator from, const_iterator to); /// - void append(MathArray const & ar); + void append(MathData const & ar); /// inserts single atom at position pos void insert(size_type pos, MathAtom const & at); /// inserts multiple atoms at position pos - void insert(size_type pos, MathArray const & ar); + void insert(size_type pos, MathData const & ar); /// erase range from pos1 to pos2 void erase(iterator pos1, iterator pos2); @@ -83,18 +83,18 @@ public: /// void replace(ReplaceData &); /// - void substitute(MathArray const & m); + void substitute(MathData const & m); /// looks for exact match - bool match(MathArray const & ar) const; + bool match(MathData const & ar) const; /// looks for inclusion match starting at pos - bool matchpart(MathArray const & ar, pos_type pos) const; + bool matchpart(MathData const & ar, pos_type pos) const; /// looks for containment, return == size mean not found - size_type find(MathArray const & ar) const; + size_type find(MathData const & ar) const; /// looks for containment, return == size mean not found - size_type find_last(MathArray const & ar) const; + size_type find_last(MathData const & ar) const; /// - bool contains(MathArray const & ar) const; + bool contains(MathData const & ar) const; /// void validate(LaTeXFeatures &) const; @@ -160,7 +160,7 @@ public: /// superscript kerning int kerning() const { return kerning_; } /// - void swap(MathArray & ar) { base_type::swap(ar); } + void swap(MathData & ar) { base_type::swap(ar); } protected: /// cached dimensions of cell @@ -174,13 +174,13 @@ protected: private: /// is this an exact match at this position? - bool find1(MathArray const & ar, size_type pos) const; + bool find1(MathData const & ar, size_type pos) const; }; /// -std::ostream & operator<<(std::ostream & os, MathArray const & ar); +std::ostream & operator<<(std::ostream & os, MathData const & ar); /// -odocstream & operator<<(odocstream & os, MathArray const & ar); +odocstream & operator<<(odocstream & os, MathData const & ar); } // namespace lyx diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index a0ba5e33dc..260ab5138f 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -10,7 +10,7 @@ // This file contains most of the magic that extracts "context // information" from the unstructered layout-oriented stuff in an -// MathArray. +// MathData. #include @@ -18,7 +18,7 @@ #include "InsetMathArray.h" #include "InsetMathChar.h" #include "InsetMathDelim.h" -#include "MathArray.h" +#include "MathData.h" #include "InsetMathDiff.h" #include "InsetMathExFunc.h" #include "InsetMathExInt.h" @@ -72,14 +72,14 @@ static size_t const npos = lyx::docstring::npos; typedef bool TestItemFunc(MathAtom const &); // define a function for replacing subexpressions -typedef MathAtom ReplaceArgumentFunc(const MathArray & ar); +typedef MathAtom ReplaceArgumentFunc(const MathData & ar); // try to extract a super/subscript // modify iterator position to point behind the thing -bool extractScript(MathArray & ar, - MathArray::iterator & pos, MathArray::iterator last, bool superscript) +bool extractScript(MathData & ar, + MathData::iterator & pos, MathData::iterator last, bool superscript) { // nothing to get here if (pos == last) @@ -102,8 +102,8 @@ bool extractScript(MathArray & ar, // try to extract an "argument" to some function. // returns position behind the argument -MathArray::iterator extractArgument(MathArray & ar, - MathArray::iterator pos, MathArray::iterator last, bool function = false) +MathData::iterator extractArgument(MathData & ar, + MathData::iterator pos, MathData::iterator last, bool function = false) { // nothing to get here if (pos == last) @@ -113,9 +113,9 @@ MathArray::iterator extractArgument(MathArray & ar, if ((*pos)->asDelimInset()) { // leave out delimiters if this is a function argument if (function) { - MathArray const & arg = (*pos)->asDelimInset()->cell(0); - MathArray::const_iterator cur = arg.begin(); - MathArray::const_iterator end = arg.end(); + MathData const & arg = (*pos)->asDelimInset()->cell(0); + MathData::const_iterator cur = arg.begin(); + MathData::const_iterator end = arg.end(); while (cur != end) ar.push_back(*cur++); } else @@ -146,7 +146,7 @@ MathArray::iterator extractArgument(MathArray & ar, // but it might be more than that. // FIXME: not implemented - //for (MathArray::iterator it = pos + 1; it != last; ++it) { + //for (MathData::iterator it = pos + 1; it != last; ++it) { // // always take the first thing, no matter // if (it == pos) { // ar.push_back(*it); @@ -160,7 +160,7 @@ MathArray::iterator extractArgument(MathArray & ar, // returns sequence of char with same code starting at it up to end // it might be less, though... docstring charSequence - (MathArray::const_iterator it, MathArray::const_iterator end) + (MathData::const_iterator it, MathData::const_iterator end) { docstring s; for (; it != end && (*it)->asCharInset(); ++it) @@ -169,7 +169,7 @@ docstring charSequence } -void extractStrings(MathArray & ar) +void extractStrings(MathData & ar) { //lyxerr << "\nStrings from: " << ar << endl; for (size_t i = 0; i < ar.size(); ++i) { @@ -183,14 +183,14 @@ void extractStrings(MathArray & ar) } -void extractMatrices(MathArray & ar) +void extractMatrices(MathData & ar) { //lyxerr << "\nMatrices from: " << ar << endl; // first pass for explicitly delimited stuff for (size_t i = 0; i < ar.size(); ++i) { if (!ar[i]->asDelimInset()) continue; - MathArray const & arr = ar[i]->asDelimInset()->cell(0); + MathData const & arr = ar[i]->asDelimInset()->cell(0); if (arr.size() != 1) continue; if (!arr.front()->asGridInset()) @@ -246,7 +246,7 @@ bool extractFunctionName(MathAtom const & at, docstring & str) } if (at->asFontInset() && at->name() == "mathrm") { // assume it is well known... - MathArray const & ar = at->asFontInset()->cell(0); + MathData const & ar = at->asFontInset()->cell(0); str = charSequence(ar.begin(), ar.end()); return ar.size() == str.size(); } @@ -255,7 +255,7 @@ bool extractFunctionName(MathAtom const & at, docstring & str) // convert this inset somehow to a number -bool extractNumber(MathArray const & ar, int & i) +bool extractNumber(MathData const & ar, int & i) { idocstringstream is(charSequence(ar.begin(), ar.end())); is >> i; @@ -263,7 +263,7 @@ bool extractNumber(MathArray const & ar, int & i) } -bool extractNumber(MathArray const & ar, double & d) +bool extractNumber(MathData const & ar, double & d) { idocstringstream is(charSequence(ar.begin(), ar.end())); is >> d; @@ -284,9 +284,9 @@ bool testString(MathAtom const & at, char const * const str) } // search end of nested sequence -MathArray::iterator endNestSearch( - MathArray::iterator it, - MathArray::iterator last, +MathData::iterator endNestSearch( + MathData::iterator it, + MathData::iterator last, TestItemFunc testOpen, TestItemFunc testClose ) @@ -305,7 +305,7 @@ MathArray::iterator endNestSearch( // replace nested sequences by a real Insets void replaceNested( - MathArray & ar, + MathData & ar, TestItemFunc testOpen, TestItemFunc testClose, ReplaceArgumentFunc replaceArg @@ -319,13 +319,13 @@ void replaceNested( continue; // search end of sequence - MathArray::iterator it = ar.begin() + i; - MathArray::iterator jt = endNestSearch(it, ar.end(), testOpen, testClose); + MathData::iterator it = ar.begin() + i; + MathData::iterator jt = endNestSearch(it, ar.end(), testOpen, testClose); if (jt == ar.end()) continue; // replace the original stuff by the new inset - ar[i] = replaceArg(MathArray(it + 1, jt)); + ar[i] = replaceArg(MathData(it + 1, jt)); ar.erase(it + 1, jt + 1); } } @@ -337,7 +337,7 @@ void replaceNested( // front of super... // -void splitScripts(MathArray & ar) +void splitScripts(MathData & ar) { //lyxerr << "\nScripts from: " << ar << endl; for (size_t i = 0; i < ar.size(); ++i) { @@ -367,9 +367,9 @@ void splitScripts(MathArray & ar) // if we don't have a subscript, get rid of the ScriptInset if (!script->hasDown()) { - MathArray arg(p->nuc()); - MathArray::const_iterator it = arg.begin(); - MathArray::const_iterator et = arg.end(); + MathData arg(p->nuc()); + MathData::const_iterator it = arg.begin(); + MathData::const_iterator et = arg.end(); ar.erase(i); while (it != et) ar.insert(i++, *it++); @@ -387,7 +387,7 @@ void splitScripts(MathArray & ar) // extract exp(...) // -void extractExps(MathArray & ar) +void extractExps(MathData & ar) { //lyxerr << "\nExps from: " << ar << endl; for (size_t i = 0; i + 1 < ar.size(); ++i) { @@ -411,10 +411,10 @@ void extractExps(MathArray & ar) // // extract det(...) from |matrix| // -void extractDets(MathArray & ar) +void extractDets(MathData & ar) { //lyxerr << "\ndet from: " << ar << endl; - for (MathArray::iterator it = ar.begin(); it != ar.end(); ++it) { + for (MathData::iterator it = ar.begin(); it != ar.end(); ++it) { InsetMathDelim const * del = (*it)->asDelimInset(); if (!del) continue; @@ -438,7 +438,7 @@ bool isDigitOrSimilar(char_type c) // returns sequence of digits docstring digitSequence - (MathArray::const_iterator it, MathArray::const_iterator end) + (MathData::const_iterator it, MathData::const_iterator end) { docstring s; for (; it != end && (*it)->asCharInset(); ++it) { @@ -450,7 +450,7 @@ docstring digitSequence } -void extractNumbers(MathArray & ar) +void extractNumbers(MathData & ar) { //lyxerr << "\nNumbers from: " << ar << endl; for (size_t i = 0; i < ar.size(); ++i) { @@ -485,7 +485,7 @@ bool testCloseParen(MathAtom const & at) } -MathAtom replaceParenDelims(const MathArray & ar) +MathAtom replaceParenDelims(const MathData & ar) { return MathAtom(new InsetMathDelim(from_ascii("("), from_ascii(")"), ar)); } @@ -503,14 +503,14 @@ bool testCloseBracket(MathAtom const & at) } -MathAtom replaceBracketDelims(const MathArray & ar) +MathAtom replaceBracketDelims(const MathData & ar) { return MathAtom(new InsetMathDelim(from_ascii("["), from_ascii("]"), ar)); } // replace '('...')' and '['...']' sequences by a real InsetMathDelim -void extractDelims(MathArray & ar) +void extractDelims(MathData & ar) { //lyxerr << "\nDelims from: " << ar << endl; replaceNested(ar, testOpenParen, testCloseParen, replaceParenDelims); @@ -527,7 +527,7 @@ void extractDelims(MathArray & ar) // replace 'f' '(...)' and 'f' '^n' '(...)' sequences by a real InsetMathExFunc // assume 'extractDelims' ran before -void extractFunctions(MathArray & ar) +void extractFunctions(MathData & ar) { // we need at least two items... if (ar.size() < 2) @@ -535,8 +535,8 @@ void extractFunctions(MathArray & ar) //lyxerr << "\nFunctions from: " << ar << endl; for (size_t i = 0; i + 1 < ar.size(); ++i) { - MathArray::iterator it = ar.begin() + i; - MathArray::iterator jt = it + 1; + MathData::iterator it = ar.begin() + i; + MathData::iterator jt = it + 1; docstring name; // is it a function? @@ -559,14 +559,14 @@ void extractFunctions(MathArray & ar) // do we have an exponent like in // 'sin' '^2' 'x' -> 'sin(x)' '^2' - MathArray exp; + MathData exp; extractScript(exp, jt, ar.end(), true); // create a proper inset as replacement auto_ptr p(new InsetMathExFunc(name)); // jt points to the "argument". Get hold of this. - MathArray::iterator st = extractArgument(p->cell(0), jt, ar.end(), true); + MathData::iterator st = extractArgument(p->cell(0), jt, ar.end(), true); // replace the function name by a real function inset *it = MathAtom(p.release()); @@ -622,7 +622,7 @@ bool testIntDiff(MathAtom const & at) // replace '\int' ['_^'] x 'd''x'(...)' sequences by a real InsetMathExInt // assume 'extractDelims' ran before -void extractIntegrals(MathArray & ar) +void extractIntegrals(MathData & ar) { // we need at least three items... if (ar.size() < 3) @@ -630,10 +630,10 @@ void extractIntegrals(MathArray & ar) //lyxerr << "\nIntegrals from: " << ar << endl; for (size_t i = 0; i + 1 < ar.size(); ++i) { - MathArray::iterator it = ar.begin() + i; + MathData::iterator it = ar.begin() + i; // search 'd' - MathArray::iterator jt = + MathData::iterator jt = endNestSearch(it, ar.end(), testIntegral, testIntDiff); // something sensible found? @@ -652,10 +652,10 @@ void extractIntegrals(MathArray & ar) p->cell(2) = (*it)->asScriptInset()->down(); p->cell(3) = (*it)->asScriptInset()->up(); } - p->cell(0) = MathArray(it + 1, jt); + p->cell(0) = MathData(it + 1, jt); // use the "thing" behind the 'd' as differential - MathArray::iterator tt = extractArgument(p->cell(1), jt + 1, ar.end()); + MathData::iterator tt = extractArgument(p->cell(1), jt + 1, ar.end()); // remove used parts ar.erase(it + 1, tt); @@ -673,8 +673,8 @@ bool testTermDelimiter(MathAtom const & at) // try to extract a "term", i.e., something delimited by '+' or '-'. // returns position behind the term -MathArray::iterator extractTerm(MathArray & ar, - MathArray::iterator pos, MathArray::iterator last) +MathData::iterator extractTerm(MathData & ar, + MathData::iterator pos, MathData::iterator last) { while (pos != last && !testTermDelimiter(*pos)) { ar.push_back(*pos); @@ -713,7 +713,7 @@ bool testSum(MathAtom const & at) // replace '\sum' ['_^'] f(x) sequences by a real InsetMathExInt // assume 'extractDelims' ran before -void extractSums(MathArray & ar) +void extractSums(MathData & ar) { // we need at least two items... if (ar.size() < 2) @@ -721,7 +721,7 @@ void extractSums(MathArray & ar) //lyxerr << "\nSums from: " << ar << endl; for (size_t i = 0; i + 1 < ar.size(); ++i) { - MathArray::iterator it = ar.begin() + i; + MathData::iterator it = ar.begin() + i; // is this a sum name? if (!testSum(ar[i])) @@ -734,14 +734,14 @@ void extractSums(MathArray & ar) InsetMathScript const * sub = ar[i]->asScriptInset(); if (sub && sub->hasDown()) { // try to figure out the summation index from the subscript - MathArray const & ar = sub->down(); - MathArray::const_iterator xt = + MathData const & ar = sub->down(); + MathData::const_iterator xt = find_if(ar.begin(), ar.end(), &testEqualSign); if (xt != ar.end()) { // we found a '=', use everything in front of that as index, // and everything behind as lower index - p->cell(1) = MathArray(ar.begin(), xt); - p->cell(2) = MathArray(xt + 1, ar.end()); + p->cell(1) = MathData(ar.begin(), xt); + p->cell(2) = MathData(xt + 1, ar.end()); } else { // use everything as summation index, don't use scripts. p->cell(1) = ar; @@ -753,7 +753,7 @@ void extractSums(MathArray & ar) p->cell(3) = sub->up(); // use something behind the script as core - MathArray::iterator tt = extractTerm(p->cell(0), it + 1, ar.end()); + MathData::iterator tt = extractTerm(p->cell(0), it + 1, ar.end()); // cleanup ar.erase(it + 1, tt); @@ -783,7 +783,7 @@ bool testDiffItem(MathAtom const & at) } -bool testDiffArray(MathArray const & ar) +bool testDiffArray(MathData const & ar) { return ar.size() && testDiffItem(ar.front()); } @@ -798,11 +798,11 @@ bool testDiffFrac(MathAtom const & at) } -void extractDiff(MathArray & ar) +void extractDiff(MathData & ar) { //lyxerr << "\nDiffs from: " << ar << endl; for (size_t i = 0; i < ar.size(); ++i) { - MathArray::iterator it = ar.begin() + i; + MathData::iterator it = ar.begin() + i; // is this a "differential fraction"? if (!testDiffFrac(*it)) @@ -818,36 +818,36 @@ void extractDiff(MathArray & ar) auto_ptr diff(new InsetMathDiff); // collect function, let jt point behind last used item - MathArray::iterator jt = it + 1; + MathData::iterator jt = it + 1; //int n = 1; - MathArray numer(f->cell(0)); + MathData numer(f->cell(0)); splitScripts(numer); if (numer.size() > 1 && numer[1]->asScriptInset()) { // this is something like d^n f(x) / d... or d^n / d... // FIXME //n = 1; if (numer.size() > 2) - diff->cell(0) = MathArray(numer.begin() + 2, numer.end()); + diff->cell(0) = MathData(numer.begin() + 2, numer.end()); else jt = extractTerm(diff->cell(0), jt, ar.end()); } else { // simply d f(x) / d... or d/d... if (numer.size() > 1) - diff->cell(0) = MathArray(numer.begin() + 1, numer.end()); + diff->cell(0) = MathData(numer.begin() + 1, numer.end()); else jt = extractTerm(diff->cell(0), jt, ar.end()); } // collect denominator parts - MathArray denom(f->cell(1)); + MathData denom(f->cell(1)); splitScripts(denom); - for (MathArray::iterator dt = denom.begin(); dt != denom.end();) { + for (MathData::iterator dt = denom.begin(); dt != denom.end();) { // find the next 'd' - MathArray::iterator et + MathData::iterator et = find_if(dt + 1, denom.end(), &testDiffItem); // point before this - MathArray::iterator st = et - 1; + MathData::iterator st = et - 1; InsetMathScript const * script = (*st)->asScriptInset(); if (script && script->hasUp()) { // things like d.../dx^n @@ -855,11 +855,11 @@ void extractDiff(MathArray & ar) if (extractNumber(script->up(), mult)) { //lyxerr << "mult: " << mult << endl; for (int i = 0; i < mult; ++i) - diff->addDer(MathArray(dt + 1, st)); + diff->addDer(MathData(dt + 1, st)); } } else { // just d.../dx - diff->addDer(MathArray(dt + 1, et)); + diff->addDer(MathData(dt + 1, et)); } dt = et; } @@ -886,11 +886,11 @@ bool testRightArrow(MathAtom const & at) // replace '\lim_{x->x0} f(x)' sequences by a real InsetMathLim // assume 'extractDelims' ran before -void extractLims(MathArray & ar) +void extractLims(MathData & ar) { //lyxerr << "\nLimits from: " << ar << endl; for (size_t i = 0; i < ar.size(); ++i) { - MathArray::iterator it = ar.begin() + i; + MathData::iterator it = ar.begin() + i; // must be a script inset with a subscript (without superscript) InsetMathScript const * sub = (*it)->asScriptInset(); @@ -902,18 +902,18 @@ void extractLims(MathArray & ar) continue; // subscript must contain a -> symbol - MathArray const & s = sub->down(); - MathArray::const_iterator st = find_if(s.begin(), s.end(), &testRightArrow); + MathData const & s = sub->down(); + MathData::const_iterator st = find_if(s.begin(), s.end(), &testRightArrow); if (st == s.end()) continue; // the -> splits the subscript int x and x0 - MathArray x = MathArray(s.begin(), st); - MathArray x0 = MathArray(st + 1, s.end()); + MathData x = MathData(s.begin(), st); + MathData x0 = MathData(st + 1, s.end()); // use something behind the script as core - MathArray f; - MathArray::iterator tt = extractTerm(f, it + 1, ar.end()); + MathData f; + MathData::iterator tt = extractTerm(f, it + 1, ar.end()); // cleanup ar.erase(it + 1, tt); @@ -929,7 +929,7 @@ void extractLims(MathArray & ar) // combine searches // -void extractStructure(MathArray & ar) +void extractStructure(MathData & ar) { //lyxerr << "\nStructure from: " << ar << endl; splitScripts(ar); @@ -948,64 +948,64 @@ void extractStructure(MathArray & ar) } -void write(MathArray const & dat, WriteStream & wi) +void write(MathData const & dat, WriteStream & wi) { - MathArray ar = dat; + MathData ar = dat; extractStrings(ar); wi.firstitem() = true; - for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it) { + for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it) { (*it)->write(wi); wi.firstitem() = false; } } -void normalize(MathArray const & ar, NormalStream & os) +void normalize(MathData const & ar, NormalStream & os) { - for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it) + for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it) (*it)->normalize(os); } -void octave(MathArray const & dat, OctaveStream & os) +void octave(MathData const & dat, OctaveStream & os) { - MathArray ar = dat; + MathData ar = dat; extractStructure(ar); - for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it) + for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it) (*it)->octave(os); } -void maple(MathArray const & dat, MapleStream & os) +void maple(MathData const & dat, MapleStream & os) { - MathArray ar = dat; + MathData ar = dat; extractStructure(ar); - for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it) + for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it) (*it)->maple(os); } -void maxima(MathArray const & dat, MaximaStream & os) +void maxima(MathData const & dat, MaximaStream & os) { - MathArray ar = dat; + MathData ar = dat; extractStructure(ar); - for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it) + for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it) (*it)->maxima(os); } -void mathematica(MathArray const & dat, MathematicaStream & os) +void mathematica(MathData const & dat, MathematicaStream & os) { - MathArray ar = dat; + MathData ar = dat; extractStructure(ar); - for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it) + for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it) (*it)->mathematica(os); } -void mathmlize(MathArray const & dat, MathStream & os) +void mathmlize(MathData const & dat, MathStream & os) { - MathArray ar = dat; + MathData ar = dat; extractStructure(ar); if (ar.size() == 0) os << ""; @@ -1013,7 +1013,7 @@ void mathmlize(MathArray const & dat, MathStream & os) os << ar.front(); else { os << MTag("mrow"); - for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it) + for (MathData::const_iterator it = ar.begin(); it != ar.end(); ++it) (*it)->mathmlize(os); os << ETag("mrow"); } @@ -1081,7 +1081,7 @@ namespace { return npos; } - MathArray pipeThroughMaxima(docstring const &, MathArray const & ar) + MathData pipeThroughMaxima(docstring const &, MathData const & ar) { odocstringstream os; MaximaStream ms(os); @@ -1131,7 +1131,7 @@ namespace { vector tmp = getVectorFromString(out, "$$"); if (tmp.size() < 2) - return MathArray(); + return MathData(); out = subst(tmp[1], "\\>", std::string()); lyxerr << "output: '" << out << "'" << endl; @@ -1170,13 +1170,13 @@ namespace { //lyxerr << "output: " << out << endl; i = out.find("\\over", i + 4); } - MathArray res; + MathData res; mathed_parse_cell(res, from_utf8(out)); return res; } - MathArray pipeThroughMaple(docstring const & extra, MathArray const & ar) + MathData pipeThroughMaple(docstring const & extra, MathData const & ar) { std::string header = "readlib(latex):\n"; @@ -1248,13 +1248,13 @@ namespace { // change \_ into _ // - MathArray res; + MathData res; mathed_parse_cell(res, from_utf8(out)); return res; } - MathArray pipeThroughOctave(docstring const &, MathArray const & ar) + MathData pipeThroughOctave(docstring const &, MathData const & ar) { odocstringstream os; OctaveStream vs(os); @@ -1307,13 +1307,13 @@ namespace { // ansi control sequence before, such as '\033[?1034hans = ' size_t i = out.find("ans = "); if (i == string::npos) - return MathArray(); + return MathData(); out = out.substr(i + 6); // parse output as matrix or single number MathAtom at(new InsetMathArray(from_ascii("array"), from_utf8(out))); InsetMathArray const * mat = at->asArrayInset(); - MathArray res; + MathData res; if (mat->ncols() == 1 && mat->nrows() == 1) res.append(mat->cell(0)); else { @@ -1372,7 +1372,7 @@ namespace { } - MathArray pipeThroughMathematica(docstring const &, MathArray const & ar) + MathData pipeThroughMathematica(docstring const &, MathData const & ar) { odocstringstream os; MathematicaStream ms(os); @@ -1391,7 +1391,7 @@ namespace { size_t pos2 = out.find("In[2]:="); if (pos1 == string::npos || pos2 == string::npos) - return MathArray(); + return MathData(); // get everything from pos1+17 to pos2 out = out.substr(pos1 + 17, pos2 - pos1 - 17); @@ -1402,7 +1402,7 @@ namespace { prettifyMathematicaOutput(out, "Muserfunction", true, false); prettifyMathematicaOutput(out, "Mvariable", false, false); - MathArray res; + MathData res; mathed_parse_cell(res, from_utf8(out)); return res; } @@ -1410,8 +1410,8 @@ namespace { } -MathArray pipeThroughExtern(string const & lang, docstring const & extra, - MathArray const & ar) +MathData pipeThroughExtern(string const & lang, docstring const & extra, + MathData const & ar) { if (lang == "octave") return pipeThroughOctave(extra, ar); @@ -1438,12 +1438,12 @@ MathArray pipeThroughExtern(string const & lang, docstring const & extra, support::FileName const file = libFileSearch("mathed", "extern_" + lang); if (file.empty()) { lyxerr << "converter to '" << lang << "' not found" << endl; - return MathArray(); + return MathData(); } // run external sript string out = captureOutput(file.absFilename(), data); - MathArray res; + MathData res; mathed_parse_cell(res, from_utf8(out)); return res; } diff --git a/src/mathed/MathExtern.h b/src/mathed/MathExtern.h index 20fe9849eb..82b053195f 100644 --- a/src/mathed/MathExtern.h +++ b/src/mathed/MathExtern.h @@ -24,21 +24,21 @@ class MathematicaStream; class MathStream; class OctaveStream; class WriteStream; -class MathArray; +class MathData; -void write(MathArray const &, WriteStream &); -void normalize(MathArray const &, NormalStream &); -void maple(MathArray const &, MapleStream &); -void maxima(MathArray const &, MaximaStream &); -void mathematica(MathArray const &, MathematicaStream &); -void mathmlize(MathArray const &, MathStream &); -void octave(MathArray const &, OctaveStream &); +void write(MathData const &, WriteStream &); +void normalize(MathData const &, NormalStream &); +void maple(MathData const &, MapleStream &); +void maxima(MathData const &, MaximaStream &); +void mathematica(MathData const &, MathematicaStream &); +void mathmlize(MathData const &, MathStream &); +void octave(MathData const &, OctaveStream &); -bool extractNumber(MathArray const & ar, int & i); -bool extractNumber(MathArray const & ar, double & i); +bool extractNumber(MathData const & ar, int & i); +bool extractNumber(MathData const & ar, double & i); -MathArray pipeThroughExtern(std::string const & language, - docstring const & extra, MathArray const & ar); +MathData pipeThroughExtern(std::string const & language, + docstring const & extra, MathData const & ar); } // namespace lyx diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp index 5f5cb02192..ad7b86d31c 100644 --- a/src/mathed/MathFactory.cpp +++ b/src/mathed/MathFactory.cpp @@ -404,7 +404,7 @@ MathAtom createInsetMath(docstring const & s) } -bool createInsetMath_fromDialogStr(docstring const & str, MathArray & ar) +bool createInsetMath_fromDialogStr(docstring const & str, MathData & ar) { // An example str: // "ref LatexCommand ref\nreference \"sec:Title\"\n\\end_inset\n\n"; diff --git a/src/mathed/MathFactory.h b/src/mathed/MathFactory.h index 89e17e9f8c..2b9cbd0149 100644 --- a/src/mathed/MathFactory.h +++ b/src/mathed/MathFactory.h @@ -18,7 +18,7 @@ namespace lyx { class MathAtom; -class MathArray; +class MathData; MathAtom createInsetMath(docstring const &); @@ -28,7 +28,7 @@ MathAtom createInsetMath(char const * const); * str is created by the frontend dialog's and returned to the LyX core. * The function returns true if successful. */ -bool createInsetMath_fromDialogStr(docstring const &, MathArray &); +bool createInsetMath_fromDialogStr(docstring const &, MathData &); } // namespace lyx diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index 1ce383b555..f12c14e490 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -38,7 +38,7 @@ using std::vector; class MathMacroArgumentValue : public InsetMathDim { public: /// - MathMacroArgumentValue(MathArray const * value, docstring const & macroName) + MathMacroArgumentValue(MathData const * value, docstring const & macroName) : value_(value), macroName_(macroName) {} /// bool metrics(MetricsInfo & mi, Dimension & dim) const; @@ -47,7 +47,7 @@ public: private: std::auto_ptr doClone() const; - MathArray const * value_; + MathData const * value_; docstring macroName_; }; @@ -115,7 +115,7 @@ bool MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const MacroData const & macro = MacroTable::globalMacros().get(name()); if (macro.locked()) { mathed_string_dim(mi.base.font, "Self reference: " + name(), dim); - expanded_ = MathArray(); + expanded_ = MathData(); } else if (editing(mi.base.bv)) { // FIXME UNICODE asArray(macro.def(), tmpl_); @@ -127,7 +127,7 @@ bool MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const // FIXME UNICODE int ww = mathed_string_width(font, from_ascii("#1: ")); for (idx_type i = 0; i < nargs(); ++i) { - MathArray const & c = cell(i); + MathData const & c = cell(i); c.metrics(mi); dim.wid = max(dim.wid, c.width() + ww); dim.des += c.height() + 10; @@ -135,7 +135,7 @@ bool MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const } else { // create MathMacroArgumentValue object pointing to the cells of the macro MacroData const & macro = MacroTable::globalMacros().get(name()); - vector values(nargs()); + vector values(nargs()); for (size_t i = 0; i != nargs(); ++i) values[i].insert(0, MathAtom(new MathMacroArgumentValue(&cells_[i], name()))); macro.expand(values, expanded_); @@ -175,7 +175,7 @@ void MathMacro::draw(PainterInfo & pi, int x, int y) const docstring t = from_ascii("#1: "); mathed_string_dim(font, t, ldim); for (idx_type i = 0; i < nargs(); ++i) { - MathArray const & c = cell(i); + MathData const & c = cell(i); h += max(c.ascent(), ldim.asc) + 5; c.draw(pi, x + ldim.wid, h); char_type str[] = { '#', '1', ':', '\0' }; diff --git a/src/mathed/MathMacro.h b/src/mathed/MathMacro.h index 72453cd8eb..2c455e44c0 100644 --- a/src/mathed/MathMacro.h +++ b/src/mathed/MathMacro.h @@ -14,7 +14,7 @@ #define MATH_MACRO_H #include "InsetMathNest.h" -#include "MathArray.h" +#include "MathData.h" #include "InsetMathNest.h" #include "MathMacroTable.h" @@ -52,7 +52,7 @@ public: /// docstring name() const; /// - void setExpansion(MathArray const & exp, MathArray const & args) const; + void setExpansion(MathData const & exp, MathData const & args) const; /// void validate(LaTeXFeatures &) const; @@ -78,9 +78,9 @@ private: /// name of macro docstring name_; /// the unexpanded macro defintition - mutable MathArray tmpl_; + mutable MathData tmpl_; /// the macro substituted with our args - mutable MathArray expanded_; + mutable MathData expanded_; }; diff --git a/src/mathed/MathMacroTable.cpp b/src/mathed/MathMacroTable.cpp index 2cc7c8fcd8..0a60ee44a2 100644 --- a/src/mathed/MathMacroTable.cpp +++ b/src/mathed/MathMacroTable.cpp @@ -45,7 +45,7 @@ MacroData::MacroData(docstring const & def, int numargs, docstring const & disp, {} -void MacroData::expand(vector const & args, MathArray & to) const +void MacroData::expand(vector const & args, MathData & to) const { InsetMathSqrt inset; // Hack. Any inset with a cell would do. // FIXME UNICODE diff --git a/src/mathed/MathMacroTable.h b/src/mathed/MathMacroTable.h index bf4a17522a..5525beed1c 100644 --- a/src/mathed/MathMacroTable.h +++ b/src/mathed/MathMacroTable.h @@ -21,7 +21,7 @@ namespace lyx { -class MathArray; +class MathData; /// class MacroData { @@ -37,7 +37,7 @@ public: /// int numargs() const { return numargs_; } /// replace #1,#2,... by given MathAtom 0,1,.. - void expand(std::vector const & from, MathArray & to) const; + void expand(std::vector const & from, MathData & to) const; /// std::string requires() const { return requires_; } /// diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index 8106a639d4..024c5d4f12 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -44,7 +44,7 @@ MathMacroTemplate::MathMacroTemplate() MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs, - docstring const & type, MathArray const & ar1, MathArray const & ar2) + docstring const & type, MathData const & ar1, MathData const & ar2) : InsetMathNest(2), numargs_(numargs), name_(name), type_(type) { initMath(); @@ -62,7 +62,7 @@ MathMacroTemplate::MathMacroTemplate(docstring const & str) { initMath(); - MathArray ar; + MathData ar; mathed_parse_cell(ar, str); if (ar.size() != 1 || !ar[0]->asMacroTemplate()) { lyxerr << "Cannot read macro from '" << ar << "'" << endl; @@ -187,7 +187,7 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const void MathMacroTemplate::read(Buffer const &, Lexer & lex) { - MathArray ar; + MathData ar; mathed_parse_cell(ar, lex.getStream()); if (ar.size() != 1 || !ar[0]->asMacroTemplate()) { lyxerr << "Cannot read macro from '" << ar << "'" << endl; diff --git a/src/mathed/MathMacroTemplate.h b/src/mathed/MathMacroTemplate.h index cdf5073544..2ed8e87bf5 100644 --- a/src/mathed/MathMacroTemplate.h +++ b/src/mathed/MathMacroTemplate.h @@ -13,7 +13,7 @@ #ifndef MATH_MACROTEMPLATE_H #define MATH_MACROTEMPLATE_H -#include "MathArray.h" +#include "MathData.h" #include "MathMacroTable.h" #include "InsetMathNest.h" @@ -30,8 +30,8 @@ public: /// MathMacroTemplate(docstring const & name, int nargs, docstring const & type, - MathArray const & = MathArray(), - MathArray const & = MathArray()); + MathData const & = MathData(), + MathData const & = MathData()); /// explicit MathMacroTemplate(const docstring & str); /// diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index 3a5fa9902e..2a63b824b3 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -324,12 +324,12 @@ public: /// bool parse(MathAtom & at); /// - void parse(MathArray & array, unsigned flags, mode_type mode); + void parse(MathData & array, unsigned flags, mode_type mode); /// void parse1(InsetMathGrid & grid, unsigned flags, mode_type mode, bool numbered); /// - MathArray parse(unsigned flags, mode_type mode); + MathData parse(unsigned flags, mode_type mode); /// int lineno() const { return lineno_; } /// @@ -613,7 +613,7 @@ void Parser::error(string const & msg) bool Parser::parse(MathAtom & at) { skipSpaces(); - MathArray ar; + MathData ar; parse(ar, false, InsetMath::UNDECIDED_MODE); if (ar.size() != 1 || ar.front()->getType() == hullNone) { lyxerr << "unusual contents found: " << ar << endl; @@ -666,15 +666,15 @@ docstring Parser::parse_verbatim_item() } -MathArray Parser::parse(unsigned flags, mode_type mode) +MathData Parser::parse(unsigned flags, mode_type mode) { - MathArray ar; + MathData ar; parse(ar, flags, mode); return ar; } -void Parser::parse(MathArray & array, unsigned flags, mode_type mode) +void Parser::parse(MathData & array, unsigned flags, mode_type mode) { InsetMathGrid grid(1, 1); parse1(grid, flags, mode, false); @@ -695,7 +695,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, int limits = 0; InsetMathGrid::row_type cellrow = 0; InsetMathGrid::col_type cellcol = 0; - MathArray * cell = &grid.cell(grid.index(cellrow, cellcol)); + MathData * cell = &grid.cell(grid.index(cellrow, cellcol)); if (grid.asHullInset()) grid.asHullInset()->numbered(cellrow, numbered); @@ -746,7 +746,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, if (flags & FLAG_OPTION) { if (t.cat() == catOther && t.character() == '[') { - MathArray ar; + MathData ar; parse(ar, FLAG_BRACK_LAST, mode); cell->append(ar); } else { @@ -809,7 +809,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, cell->push_back(MathAtom(new InsetMathChar(t.character()))); else if (t.cat() == catBegin) { - MathArray ar; + MathData ar; parse(ar, FLAG_BRACE_LAST, mode); // do not create a BraceInset if they were written by LyX // this helps to keep the annoyance of "a choose b" to a minimum @@ -938,11 +938,11 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, } - MathArray ar1; + MathData ar1; parse(ar1, FLAG_ITEM, InsetMath::UNDECIDED_MODE); // we cannot handle recursive stuff at all - //MathArray test; + //MathData test; //test.push_back(createInsetMath(name)); //if (ar1.contains(test)) { // error("we cannot handle recursive macros at all."); @@ -951,7 +951,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, // is a version for display attached? skipSpaces(); - MathArray ar2; + MathData ar2; if (nextToken().cat() == catBegin) parse(ar2, FLAG_ITEM, InsetMath::MATH_MODE); @@ -1036,7 +1036,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, #if 0 else if (t.cs() == "multicolumn") { // extract column count and insert dummy cells - MathArray count; + MathData count; parse(count, FLAG_ITEM, mode); int cols = 1; if (!extractNumber(count, cols)) { @@ -1056,7 +1056,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, grid.cellinfo(grid.index(cellrow, cellcol)).dummy_ = false; // read special alignment - MathArray align; + MathData align; parse(align, FLAG_ITEM, mode); //grid.cellinfo(grid.index(cellrow, cellcol)).align_ = extractString(align); @@ -1086,7 +1086,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, } else if (t.cs() == "sqrt") { - MathArray ar; + MathData ar; parse(ar, FLAG_OPTION, mode); if (ar.size()) { cell->push_back(MathAtom(new InsetMathRoot)); @@ -1118,7 +1118,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, // can't handle \| // FIXME: fix this in InsetMathDelim itself! docstring const l = tl.cs() == "|" ? from_ascii("Vert") : tl.asString(); - MathArray ar; + MathData ar; parse(ar, FLAG_RIGHT, mode); if (!good()) break; @@ -1274,7 +1274,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, else if (t.cs() == "label") { // FIXME: This is swallowed in inline formulas docstring label = parse_verbatim_item(); - MathArray ar; + MathData ar; asArray(label, ar); if (grid.asHullInset()) { grid.asHullInset()->label(cellrow, label); @@ -1343,7 +1343,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, #if 0 else if (t.cs() == "infer") { - MathArray ar; + MathData ar; parse(ar, FLAG_OPTION, mode); cell->push_back(createInsetMath(t.cs())); parse2(cell->back(), FLAG_ITEM, mode, false); @@ -1427,7 +1427,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, //lyxerr << "default creation: m2: " << m << endl; InsetMath::idx_type start = 0; // this fails on \bigg[...\bigg] - //MathArray opt; + //MathData opt; //parse(opt, FLAG_OPTION, InsetMath::VERBATIM_MODE); //if (opt.size()) { // start = 1; @@ -1454,13 +1454,13 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, } // anonymous namespace -void mathed_parse_cell(MathArray & ar, docstring const & str) +void mathed_parse_cell(MathData & ar, docstring const & str) { Parser(str).parse(ar, 0, InsetMath::MATH_MODE); } -void mathed_parse_cell(MathArray & ar, istream & is) +void mathed_parse_cell(MathData & ar, istream & is) { Parser(is).parse(ar, 0, InsetMath::MATH_MODE); } diff --git a/src/mathed/MathParser.h b/src/mathed/MathParser.h index bf174f1643..5be3b10275 100644 --- a/src/mathed/MathParser.h +++ b/src/mathed/MathParser.h @@ -23,7 +23,7 @@ namespace lyx { class MathAtom; -class MathArray; +class MathData; class InsetMathGrid; class Lexer; @@ -69,10 +69,10 @@ bool mathed_parse_normal(MathAtom &, Lexer &); void mathed_parse_normal(InsetMathGrid &, docstring const &); /// parse a single cell from a string -void mathed_parse_cell(MathArray & ar, docstring const &); +void mathed_parse_cell(MathData & ar, docstring const &); /// parse a single cell from a stream. Only use this for reading from .lyx /// file format, for the reason see Parser::tokenize(std::istream &). -void mathed_parse_cell(MathArray & ar, std::istream &); +void mathed_parse_cell(MathData & ar, std::istream &); void initParser(); diff --git a/src/mathed/MathStream.cpp b/src/mathed/MathStream.cpp index e6d6f52522..c136573957 100644 --- a/src/mathed/MathStream.cpp +++ b/src/mathed/MathStream.cpp @@ -11,7 +11,7 @@ #include #include "InsetMath.h" -#include "MathArray.h" +#include "MathData.h" #include "MathExtern.h" #include "MathStream.h" @@ -36,7 +36,7 @@ NormalStream & operator<<(NormalStream & ns, MathAtom const & at) } -NormalStream & operator<<(NormalStream & ns, MathArray const & ar) +NormalStream & operator<<(NormalStream & ns, MathData const & ar) { normalize(ar, ns); return ns; @@ -139,7 +139,7 @@ WriteStream & operator<<(WriteStream & ws, MathAtom const & at) } -WriteStream & operator<<(WriteStream & ws, MathArray const & ar) +WriteStream & operator<<(WriteStream & ws, MathData const & ar) { write(ar, ws); return ws; @@ -202,7 +202,7 @@ MathStream & operator<<(MathStream & ms, MathAtom const & at) } -MathStream & operator<<(MathStream & ms, MathArray const & ar) +MathStream & operator<<(MathStream & ms, MathData const & ar) { mathmlize(ar, ms); return ms; @@ -266,7 +266,7 @@ MapleStream & operator<<(MapleStream & ms, MathAtom const & at) } -MapleStream & operator<<(MapleStream & ms, MathArray const & ar) +MapleStream & operator<<(MapleStream & ms, MathData const & ar) { maple(ar, ms); return ms; @@ -318,7 +318,7 @@ MaximaStream & operator<<(MaximaStream & ms, MathAtom const & at) } -MaximaStream & operator<<(MaximaStream & ms, MathArray const & ar) +MaximaStream & operator<<(MaximaStream & ms, MathData const & ar) { maxima(ar, ms); return ms; @@ -370,7 +370,7 @@ MathematicaStream & operator<<(MathematicaStream & ms, MathAtom const & at) } -MathematicaStream & operator<<(MathematicaStream & ms, MathArray const & ar) +MathematicaStream & operator<<(MathematicaStream & ms, MathData const & ar) { mathematica(ar, ms); return ms; @@ -422,7 +422,7 @@ OctaveStream & operator<<(OctaveStream & ns, MathAtom const & at) } -OctaveStream & operator<<(OctaveStream & ns, MathArray const & ar) +OctaveStream & operator<<(OctaveStream & ns, MathData const & ar) { octave(ar, ns); return ns; diff --git a/src/mathed/MathStream.h b/src/mathed/MathStream.h index 2262ad9df8..7787949d01 100644 --- a/src/mathed/MathStream.h +++ b/src/mathed/MathStream.h @@ -24,7 +24,7 @@ namespace lyx { -class MathArray; +class MathData; class InsetMath; class MathAtom; @@ -61,7 +61,7 @@ private: odocstream & os_; /// do we have to write \\protect sometimes bool fragile_; - /// are we at the beginning of an MathArray? + /// are we at the beginning of an MathData? bool firstitem_; /// are we writing to .tex? int latex_; @@ -74,7 +74,7 @@ private: /// WriteStream & operator<<(WriteStream &, MathAtom const &); /// -WriteStream & operator<<(WriteStream &, MathArray const &); +WriteStream & operator<<(WriteStream &, MathData const &); /// WriteStream & operator<<(WriteStream &, docstring const &); /// @@ -140,7 +140,7 @@ private: /// MathStream & operator<<(MathStream &, MathAtom const &); /// -MathStream & operator<<(MathStream &, MathArray const &); +MathStream & operator<<(MathStream &, MathData const &); /// MathStream & operator<<(MathStream &, docstring const &); /// @@ -172,7 +172,7 @@ private: /// NormalStream & operator<<(NormalStream &, MathAtom const &); /// -NormalStream & operator<<(NormalStream &, MathArray const &); +NormalStream & operator<<(NormalStream &, MathData const &); /// NormalStream & operator<<(NormalStream &, docstring const &); /// @@ -203,7 +203,7 @@ private: /// MapleStream & operator<<(MapleStream &, MathAtom const &); /// -MapleStream & operator<<(MapleStream &, MathArray const &); +MapleStream & operator<<(MapleStream &, MathData const &); /// MapleStream & operator<<(MapleStream &, docstring const &); /// @@ -236,7 +236,7 @@ private: /// MaximaStream & operator<<(MaximaStream &, MathAtom const &); /// -MaximaStream & operator<<(MaximaStream &, MathArray const &); +MaximaStream & operator<<(MaximaStream &, MathData const &); /// MaximaStream & operator<<(MaximaStream &, docstring const &); /// @@ -269,7 +269,7 @@ private: /// MathematicaStream & operator<<(MathematicaStream &, MathAtom const &); /// -MathematicaStream & operator<<(MathematicaStream &, MathArray const &); +MathematicaStream & operator<<(MathematicaStream &, MathData const &); /// MathematicaStream & operator<<(MathematicaStream &, docstring const &); /// @@ -299,7 +299,7 @@ private: /// OctaveStream & operator<<(OctaveStream &, MathAtom const &); /// -OctaveStream & operator<<(OctaveStream &, MathArray const &); +OctaveStream & operator<<(OctaveStream &, MathData const &); /// OctaveStream & operator<<(OctaveStream &, docstring const &); /// diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index f828b06d58..a381d66304 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -12,7 +12,7 @@ #include #include "MathSupport.h" -#include "MathArray.h" +#include "MathData.h" #include "InsetMath.h" #include "MathStream.h" #include "MathParser.h" @@ -678,7 +678,7 @@ void augmentFont(LyXFont & font, docstring const & name) } -docstring asString(MathArray const & ar) +docstring asString(MathData const & ar) { odocstringstream os; WriteStream ws(os); @@ -687,7 +687,7 @@ docstring asString(MathArray const & ar) } -void asArray(docstring const & str, MathArray & ar) +void asArray(docstring const & str, MathData & ar) { mathed_parse_cell(ar, str); } diff --git a/src/mathed/MathSupport.h b/src/mathed/MathSupport.h index b37d42bc33..c616c8c721 100644 --- a/src/mathed/MathSupport.h +++ b/src/mathed/MathSupport.h @@ -23,7 +23,7 @@ namespace lyx { class PainterInfo; class LyXFont; class Dimension; -class MathArray; +class MathData; class MathAtom; class InsetMath; @@ -51,12 +51,12 @@ void augmentFont(LyXFont & f, docstring const & cmd); bool isFontName(docstring const & name); // converts single cell to string -docstring asString(MathArray const & ar); +docstring asString(MathData const & ar); // converts single inset to string docstring asString(InsetMath const &); docstring asString(MathAtom const &); // converts string to single cell -void asArray(docstring const & str, MathArray & ar); +void asArray(docstring const & str, MathData & ar); } // namespace lyx diff --git a/src/mathed/ReplaceData.h b/src/mathed/ReplaceData.h index dc8eb6b68f..907005e0b5 100644 --- a/src/mathed/ReplaceData.h +++ b/src/mathed/ReplaceData.h @@ -13,7 +13,7 @@ #define MATH_REPLACE_H -#include "MathArray.h" +#include "MathData.h" namespace lyx { @@ -21,9 +21,9 @@ namespace lyx { class ReplaceData { public: /// - MathArray from; + MathData from; /// - MathArray to; + MathData to; }; -- 2.39.2