mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
make a some members private
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4552 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f68213134c
commit
469946043f
@ -102,7 +102,8 @@ InsetFormula::InsetFormula()
|
||||
|
||||
|
||||
InsetFormula::InsetFormula(InsetFormula const & other)
|
||||
: par_(other.par_),
|
||||
: InsetFormulaBase(other),
|
||||
par_(other.par_),
|
||||
preview_(new PreviewImpl(*this))
|
||||
{}
|
||||
|
||||
|
@ -19,7 +19,7 @@ MathInset * MathDiffInset::clone() const
|
||||
void MathDiffInset::addDer(MathArray const & der)
|
||||
{
|
||||
cells_.push_back(MathXArray());
|
||||
cells_.back().data_ = der;
|
||||
cells_.back().data() = der;
|
||||
}
|
||||
|
||||
|
||||
|
@ -299,7 +299,7 @@ void splitScripts(MathArray & ar)
|
||||
// create extra script inset and move superscript over
|
||||
MathScriptInset * q = new MathScriptInset;
|
||||
q->ensure(true);
|
||||
q->up().data_.swap(p->up().data_);
|
||||
q->up().data().swap(p->up().data());
|
||||
p->removeScript(true);
|
||||
|
||||
// insert new inset behind
|
||||
@ -549,7 +549,7 @@ void extractIntegrals(MathArray & ar)
|
||||
if (st != ar.end())
|
||||
if (MathScriptInset * sub = (*st)->asScriptInset())
|
||||
if (sub->hasDown()) {
|
||||
p->cell(2) = sub->down().data_;
|
||||
p->cell(2) = sub->down().data();
|
||||
++st;
|
||||
}
|
||||
|
||||
@ -557,7 +557,7 @@ void extractIntegrals(MathArray & ar)
|
||||
if (st != ar.end())
|
||||
if (MathScriptInset * sup = (*st)->asScriptInset())
|
||||
if (sup->hasUp()) {
|
||||
p->cell(3) = sup->up().data_;
|
||||
p->cell(3) = sup->up().data();
|
||||
++st;
|
||||
}
|
||||
|
||||
@ -617,7 +617,7 @@ void extractSums(MathArray & ar)
|
||||
if (MathScriptInset * sub = (*st)->asScriptInset())
|
||||
if (sub->hasDown()) {
|
||||
// try to figure out the summation index from the subscript
|
||||
MathArray & ar = sub->down().data_;
|
||||
MathArray & ar = sub->down().data();
|
||||
MathArray::iterator it =
|
||||
find_if(ar.begin(), ar.end(), &testEqualSign);
|
||||
if (it != ar.end()) {
|
||||
@ -636,7 +636,7 @@ void extractSums(MathArray & ar)
|
||||
if (st != ar.end())
|
||||
if (MathScriptInset * sup = (*st)->asScriptInset())
|
||||
if (sup->hasUp()) {
|
||||
p->cell(3) = sup->up().data_;
|
||||
p->cell(3) = sup->up().data();
|
||||
++st;
|
||||
}
|
||||
|
||||
@ -741,7 +741,7 @@ void extractDiff(MathArray & ar)
|
||||
if (script && script->hasUp()) {
|
||||
// things like d.../dx^n
|
||||
int mult = 1;
|
||||
if (extractNumber(script->up().data_, mult)) {
|
||||
if (extractNumber(script->up().data(), mult)) {
|
||||
//lyxerr << "mult: " << mult << endl;
|
||||
for (int i = 0; i < mult; ++i)
|
||||
diff->addDer(MathArray(dt + 1, st));
|
||||
|
@ -87,14 +87,14 @@ MathXArray const & MathInset::xcell(idx_type) const
|
||||
MathArray & MathInset::cell(idx_type)
|
||||
{
|
||||
lyxerr << "I don't have a cell 3\n";
|
||||
return dummyCell.data_;
|
||||
return dummyCell.data();
|
||||
}
|
||||
|
||||
|
||||
MathArray const & MathInset::cell(idx_type) const
|
||||
{
|
||||
lyxerr << "I don't have a cell 4\n";
|
||||
return dummyCell.data_;
|
||||
return dummyCell.data();
|
||||
}
|
||||
|
||||
|
||||
|
@ -107,7 +107,7 @@ void MathMacro::metrics(MathMetricsInfo & mi) const
|
||||
}
|
||||
|
||||
expand();
|
||||
expanded_.data_.substitute(*this);
|
||||
expanded_.data().substitute(*this);
|
||||
expanded_.metrics(mi_);
|
||||
width_ = expanded_.width();
|
||||
ascent_ = expanded_.ascent();
|
||||
@ -199,21 +199,21 @@ void MathMacro::validate(LaTeXFeatures & features) const
|
||||
void MathMacro::maplize(MapleStream & os) const
|
||||
{
|
||||
updateExpansion();
|
||||
::maplize(expanded_.data_, os);
|
||||
::maplize(expanded_.data(), os);
|
||||
}
|
||||
|
||||
|
||||
void MathMacro::mathmlize(MathMLStream & os) const
|
||||
{
|
||||
updateExpansion();
|
||||
::mathmlize(expanded_.data_, os);
|
||||
::mathmlize(expanded_.data(), os);
|
||||
}
|
||||
|
||||
|
||||
void MathMacro::octavize(OctaveStream & os) const
|
||||
{
|
||||
updateExpansion();
|
||||
::octavize(expanded_.data_, os);
|
||||
::octavize(expanded_.data(), os);
|
||||
}
|
||||
|
||||
|
||||
@ -239,5 +239,5 @@ void MathMacro::write(WriteStream & os) const
|
||||
void MathMacro::updateExpansion() const
|
||||
{
|
||||
expand();
|
||||
expanded_.data_.substitute(*this);
|
||||
expanded_.data().substitute(*this);
|
||||
}
|
||||
|
@ -38,13 +38,13 @@ MathXArray const & MathNestInset::xcell(idx_type i) const
|
||||
|
||||
MathArray & MathNestInset::cell(idx_type i)
|
||||
{
|
||||
return cells_[i].data_;
|
||||
return cells_[i].data();
|
||||
}
|
||||
|
||||
|
||||
MathArray const & MathNestInset::cell(idx_type i) const
|
||||
{
|
||||
return cells_[i].data_;
|
||||
return cells_[i].data();
|
||||
}
|
||||
|
||||
|
||||
|
@ -361,11 +361,11 @@ void MathScriptInset::write2(MathInset const * nuc, WriteStream & os) const
|
||||
else
|
||||
os << "{}";
|
||||
|
||||
if (hasDown() && down().data_.size())
|
||||
os << "_{" << down().data_ << '}';
|
||||
if (hasDown() && down().data().size())
|
||||
os << "_{" << down().data() << '}';
|
||||
|
||||
if (hasUp() && up().data_.size())
|
||||
os << "^{" << up().data_ << '}';
|
||||
if (hasUp() && up().data().size())
|
||||
os << "^{" << up().data() << '}';
|
||||
}
|
||||
|
||||
|
||||
@ -378,8 +378,8 @@ void MathScriptInset::normalize(NormalStream & os) const
|
||||
|
||||
void MathScriptInset::normalize2(MathInset const * nuc, NormalStream & os) const
|
||||
{
|
||||
bool d = hasDown() && down().data_.size();
|
||||
bool u = hasUp() && up().data_.size();
|
||||
bool d = hasDown() && down().data().size();
|
||||
bool u = hasUp() && up().data().size();
|
||||
|
||||
if (u)
|
||||
os << "[sup ";
|
||||
@ -392,9 +392,9 @@ void MathScriptInset::normalize2(MathInset const * nuc, NormalStream & os) const
|
||||
os << "[par]";
|
||||
|
||||
if (d)
|
||||
os << down().data_ << ']';
|
||||
os << down().data() << ']';
|
||||
if (u)
|
||||
os << up().data_ << ']';
|
||||
os << up().data() << ']';
|
||||
}
|
||||
|
||||
|
||||
@ -402,17 +402,17 @@ void MathScriptInset::maplize2(MathInset const * nuc, MapleStream & os) const
|
||||
{
|
||||
if (nuc)
|
||||
os << nuc;
|
||||
if (hasDown() && down().data_.size())
|
||||
os << '[' << down().data_ << ']';
|
||||
if (hasUp() && up().data_.size())
|
||||
os << "^(" << up().data_ << ')';
|
||||
if (hasDown() && down().data().size())
|
||||
os << '[' << down().data() << ']';
|
||||
if (hasUp() && up().data().size())
|
||||
os << "^(" << up().data() << ')';
|
||||
}
|
||||
|
||||
|
||||
void MathScriptInset::mathematicize2(MathInset const * nuc, MathematicaStream & os) const
|
||||
{
|
||||
bool d = hasDown() && down().data_.size();
|
||||
bool u = hasUp() && up().data_.size();
|
||||
bool d = hasDown() && down().data().size();
|
||||
bool u = hasUp() && up().data().size();
|
||||
|
||||
if (nuc)
|
||||
if (d) //subscript only if nuc !
|
||||
@ -420,18 +420,18 @@ void MathScriptInset::mathematicize2(MathInset const * nuc, MathematicaStream &
|
||||
else
|
||||
os << nuc;
|
||||
if (u)
|
||||
os << "^(" << up().data_ << ")";
|
||||
os << "^(" << up().data() << ")";
|
||||
|
||||
if (nuc)
|
||||
if (d)
|
||||
os << "," << down().data_ << "]";
|
||||
os << "," << down().data() << "]";
|
||||
}
|
||||
|
||||
|
||||
void MathScriptInset::mathmlize2(MathInset const * nuc, MathMLStream & os) const
|
||||
{
|
||||
bool d = hasDown() && down().data_.size();
|
||||
bool u = hasUp() && up().data_.size();
|
||||
bool d = hasDown() && down().data().size();
|
||||
bool u = hasUp() && up().data().size();
|
||||
|
||||
if (u && d)
|
||||
os << MTag("msubsup");
|
||||
@ -446,11 +446,11 @@ void MathScriptInset::mathmlize2(MathInset const * nuc, MathMLStream & os) const
|
||||
os << "<mrow/>";
|
||||
|
||||
if (u && d)
|
||||
os << down().data_ << up().data_ << ETag("msubsup");
|
||||
os << down().data() << up().data() << ETag("msubsup");
|
||||
else if (u)
|
||||
os << up().data_ << ETag("msup");
|
||||
os << up().data() << ETag("msup");
|
||||
else if (d)
|
||||
os << down().data_ << ETag("msub");
|
||||
os << down().data() << ETag("msub");
|
||||
}
|
||||
|
||||
|
||||
@ -458,10 +458,10 @@ void MathScriptInset::octavize2(MathInset const * nuc, OctaveStream & os) const
|
||||
{
|
||||
if (nuc)
|
||||
os << nuc;
|
||||
if (hasDown() && down().data_.size())
|
||||
os << '[' << down().data_ << ']';
|
||||
if (hasUp() && up().data_.size())
|
||||
os << "^(" << up().data_ << ')';
|
||||
if (hasDown() && down().data().size())
|
||||
os << '[' << down().data() << ']';
|
||||
if (hasUp() && up().data().size())
|
||||
os << "^(" << up().data() << ')';
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,9 +26,9 @@ void MathSizeInset::metrics(MathMetricsInfo & mi) const
|
||||
{
|
||||
//MathStyleChanger dummy(mi.base, MathStyles(key_->id));
|
||||
xcell(0).metrics(mi);
|
||||
ascent_ = xcell(0).ascent_ + 1;
|
||||
descent_ = xcell(0).descent_ + 1;
|
||||
width_ = xcell(0).width_ + 2;
|
||||
ascent_ = xcell(0).ascent() + 1;
|
||||
descent_ = xcell(0).descent() + 1;
|
||||
width_ = xcell(0).width() + 2;
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,13 +30,13 @@ public:
|
||||
/// constructor
|
||||
MathXArray();
|
||||
/// rebuild cached metrics information
|
||||
void metrics(MathMetricsInfo & st) const;
|
||||
void metrics(MathMetricsInfo & mi) const;
|
||||
/// redraw cell using cache metrics information
|
||||
void draw(MathPainterInfo & pain, int x, int y) const;
|
||||
void draw(MathPainterInfo & pi, int x, int y) const;
|
||||
/// rebuild cached metrics information
|
||||
void metricsT(TextMetricsInfo const & st) const;
|
||||
void metricsT(TextMetricsInfo const & mi) const;
|
||||
/// redraw cell using cache metrics information
|
||||
void drawT(TextPainter & pain, int x, int y) const;
|
||||
void drawT(TextPainter & pi, int x, int y) const;
|
||||
/// mark cell for re-drawing
|
||||
void touch() const;
|
||||
|
||||
@ -77,8 +77,12 @@ public:
|
||||
const_iterator begin() const { return data_.begin(); }
|
||||
/// end iterator of the underlying MathArray
|
||||
const_iterator end() const { return data_.end(); }
|
||||
/// access to data
|
||||
MathArray const & data() const { return data_; }
|
||||
/// access to data
|
||||
MathArray & data() { return data_; }
|
||||
|
||||
public:
|
||||
private:
|
||||
/// the underlying MathArray
|
||||
MathArray data_;
|
||||
/// cached width of cell
|
||||
@ -97,6 +101,17 @@ public:
|
||||
mutable bool clean_;
|
||||
/// cached draw status of cell
|
||||
mutable bool drawn_;
|
||||
|
||||
// cached metrics
|
||||
struct Row {
|
||||
///
|
||||
Row();
|
||||
/// y offset relative to yo
|
||||
int yo;
|
||||
/// glue between words
|
||||
int glue;
|
||||
};
|
||||
std::vector<Row> rows_;
|
||||
};
|
||||
|
||||
/// output cell on a stream
|
||||
|
Loading…
Reference in New Issue
Block a user