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.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-08-19 13:00:56 +00:00
|
|
|
*
|
|
|
|
* 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-11-06 21:45:24 +00:00
|
|
|
|
2007-04-26 16:05:57 +00:00
|
|
|
#include "MathData.h"
|
2006-10-22 10:15:23 +00:00
|
|
|
#include "MathStream.h"
|
2007-11-06 21:45:24 +00:00
|
|
|
|
2008-05-06 10:36:32 +00:00
|
|
|
#include <ostream>
|
2002-09-11 09:14:57 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2009-11-08 11:45:46 +00:00
|
|
|
InsetMathPar::InsetMathPar(Buffer * buf, MathData const & ar)
|
|
|
|
: InsetMathHull(buf)
|
2002-08-23 11:24:55 +00:00
|
|
|
{
|
|
|
|
cells_[0] = ar;
|
|
|
|
}
|
2002-07-08 13:35:26 +00:00
|
|
|
|
|
|
|
|
2007-09-21 20:39:47 +00:00
|
|
|
void InsetMathPar::metrics(MetricsInfo & mi, Dimension & dim) const
|
2002-07-08 13:35:26 +00:00
|
|
|
{
|
2003-03-21 14:20:48 +00:00
|
|
|
FontSetChanger dummy1(mi.base, "textnormal");
|
2007-09-23 22:39:49 +00:00
|
|
|
InsetMathGrid::metrics(mi, dim);
|
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
|