2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
2007-04-25 03:01:35 +00:00
|
|
|
|
* \file InsetMathPar.cpp
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
2002-09-11 09:14:57 +00:00
|
|
|
|
|
2002-08-26 11:27:37 +00:00
|
|
|
|
#include <config.h>
|
2002-07-08 13:35:26 +00:00
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
|
#include "InsetMathPar.h"
|
2007-04-26 16:05:57 +00:00
|
|
|
|
#include "MathData.h"
|
2006-10-22 10:15:23 +00:00
|
|
|
|
#include "MathStream.h"
|
2003-09-05 17:23:11 +00:00
|
|
|
|
#include "support/std_ostream.h"
|
2002-08-23 11:24:55 +00:00
|
|
|
|
|
2002-09-11 09:14:57 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2007-04-26 16:05:57 +00:00
|
|
|
|
InsetMathPar::InsetMathPar(MathData const & ar)
|
2002-08-23 11:24:55 +00:00
|
|
|
|
{
|
|
|
|
|
cells_[0] = ar;
|
|
|
|
|
}
|
2002-07-08 13:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
2006-11-28 15:15:49 +00:00
|
|
|
|
bool InsetMathPar::metrics(MetricsInfo & mi, Dimension & dim) const
|
2002-07-08 13:35:26 +00:00
|
|
|
|
{
|
2006-11-28 15:15:49 +00:00
|
|
|
|
dim = dim_;
|
2003-03-21 14:20:48 +00:00
|
|
|
|
FontSetChanger dummy1(mi.base, "textnormal");
|
2006-09-16 18:11:38 +00:00
|
|
|
|
InsetMathGrid::metrics(mi);
|
2006-11-28 15:15:49 +00:00
|
|
|
|
if (dim_ == dim)
|
|
|
|
|
return false;
|
2003-06-02 10:03:27 +00:00
|
|
|
|
dim = dim_;
|
2006-11-28 15:15:49 +00:00
|
|
|
|
return true;
|
2002-07-08 13:35:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathPar::draw(PainterInfo & pi, int x, int y) const
|
2002-07-08 13:35:26 +00:00
|
|
|
|
{
|
2003-03-21 14:20:48 +00:00
|
|
|
|
FontSetChanger dummy1(pi.base, "textnormal");
|
2006-09-16 18:11:38 +00:00
|
|
|
|
InsetMathGrid::draw(pi, x, y);
|
2002-07-08 13:35:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathPar::write(WriteStream & os) const
|
2002-07-08 13:35:26 +00:00
|
|
|
|
{
|
|
|
|
|
for (idx_type i = 0; i < nargs(); ++i)
|
|
|
|
|
os << cell(i) << "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-22 10:15:23 +00:00
|
|
|
|
void InsetMathPar::infoize(odocstream & os) const
|
2002-07-08 13:35:26 +00:00
|
|
|
|
{
|
|
|
|
|
os << "Type: Paragraph ";
|
|
|
|
|
}
|
2005-02-23 12:01:50 +00:00
|
|
|
|
|
|
|
|
|
|
2007-08-30 18:03:17 +00:00
|
|
|
|
Inset * InsetMathPar::clone() const
|
2005-02-23 12:01:50 +00:00
|
|
|
|
{
|
2007-08-30 18:03:17 +00:00
|
|
|
|
return new InsetMathPar(*this);
|
2005-02-23 12:01:50 +00:00
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|