2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetminipage.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
|
*/
|
2000-06-28 13:35:52 +00:00
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "insetminipage.h"
|
2003-03-07 14:08:10 +00:00
|
|
|
|
#include "insettext.h"
|
|
|
|
|
|
|
|
|
|
#include "BufferView.h"
|
|
|
|
|
#include "debug.h"
|
2003-05-19 17:03:12 +00:00
|
|
|
|
#include "dimension.h"
|
2003-03-07 14:08:10 +00:00
|
|
|
|
#include "funcrequest.h"
|
2000-06-28 13:35:52 +00:00
|
|
|
|
#include "gettext.h"
|
2003-05-19 17:03:12 +00:00
|
|
|
|
#include "Lsstream.h"
|
2000-06-28 13:35:52 +00:00
|
|
|
|
#include "lyxfont.h"
|
2003-03-07 14:08:10 +00:00
|
|
|
|
#include "lyxlex.h"
|
|
|
|
|
#include "lyxtext.h"
|
2003-05-13 09:48:57 +00:00
|
|
|
|
#include "Lsstream.h"
|
2003-03-07 14:08:10 +00:00
|
|
|
|
|
2002-05-23 12:08:47 +00:00
|
|
|
|
#include "frontends/LyXView.h"
|
2001-03-16 15:15:32 +00:00
|
|
|
|
#include "frontends/Dialogs.h"
|
2003-03-07 14:08:10 +00:00
|
|
|
|
|
2000-06-28 13:35:52 +00:00
|
|
|
|
#include "support/LOstream.h"
|
|
|
|
|
|
|
|
|
|
using std::ostream;
|
|
|
|
|
using std::endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Some information about Minipages in LaTeX:
|
|
|
|
|
// A minipage is a complete miniversion of a page and can contain
|
|
|
|
|
// its own footnotes, paragraphs, and array, tabular, and multicols
|
|
|
|
|
// environments. However it cannot contain floats or \marginpar's,
|
|
|
|
|
// but it can appear inside floats.
|
|
|
|
|
//
|
|
|
|
|
// The minipage environment is defined like this:
|
|
|
|
|
//
|
|
|
|
|
// \begin{minipage}[pos][height][inner-pos]{width} <text> \end{minipage}
|
|
|
|
|
//
|
|
|
|
|
// Where:
|
|
|
|
|
// pos [opt] = is the vertical placement of the box with respect
|
|
|
|
|
// to the text baseline, [c], [t] and [b].
|
|
|
|
|
// height [opt] = the height of the box
|
|
|
|
|
// inner-pos [opt] =<3D>the position of the text within the box.
|
|
|
|
|
// It can be t, c, b or s, if unspecified the value
|
|
|
|
|
// of pos is used.
|
|
|
|
|
// width = the width of the box
|
|
|
|
|
//
|
|
|
|
|
// In LyX we should try to support all these parameters, settable in a
|
|
|
|
|
// pop-up dialog.
|
|
|
|
|
// In this pop-up diallog it should also be possible to set all margin
|
|
|
|
|
// values that is usable in the minipage.
|
|
|
|
|
// With regard to different formats (like DocBook) I guess a minipage
|
|
|
|
|
// can be used there also. Perhaps not in the latex way, but we do not
|
|
|
|
|
// have to output "" for minipages.
|
|
|
|
|
// (Lgb)
|
|
|
|
|
|
2002-03-03 20:25:07 +00:00
|
|
|
|
InsetMinipage::InsetMinipage(BufferParams const & bp)
|
2003-03-07 14:08:10 +00:00
|
|
|
|
: InsetCollapsable(bp)
|
2000-06-28 13:35:52 +00:00
|
|
|
|
{
|
|
|
|
|
setLabel(_("minipage"));
|
|
|
|
|
LyXFont font(LyXFont::ALL_SANE);
|
|
|
|
|
font.decSize();
|
|
|
|
|
font.decSize();
|
2001-06-05 17:05:51 +00:00
|
|
|
|
font.setColor(LColor::collapsable);
|
2000-06-28 13:35:52 +00:00
|
|
|
|
setLabelFont(font);
|
2001-07-24 22:08:49 +00:00
|
|
|
|
#if 0
|
2000-06-28 13:35:52 +00:00
|
|
|
|
setAutoCollapse(false);
|
2001-08-06 14:55:02 +00:00
|
|
|
|
#endif
|
2002-03-11 23:03:17 +00:00
|
|
|
|
|
|
|
|
|
#if 0
|
2001-08-06 14:55:02 +00:00
|
|
|
|
#ifdef WITH_WARNINGS
|
|
|
|
|
#warning Remove this color definitions before 1.2.0 final!
|
2001-07-24 22:08:49 +00:00
|
|
|
|
#endif
|
2001-07-24 10:13:19 +00:00
|
|
|
|
// just for experimentation :)
|
2001-08-06 14:55:02 +00:00
|
|
|
|
setBackgroundColor(LColor::green);
|
2002-03-11 23:03:17 +00:00
|
|
|
|
#endif
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-08-06 14:55:02 +00:00
|
|
|
|
inset.setFrameColor(0, LColor::blue);
|
2000-06-28 13:35:52 +00:00
|
|
|
|
setInsetName("Minipage");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
InsetMinipage::InsetMinipage(InsetMinipage const & in)
|
|
|
|
|
: InsetCollapsable(in), params_(in.params_)
|
2001-07-24 15:07:09 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2003-06-03 15:10:14 +00:00
|
|
|
|
Inset * InsetMinipage::clone() const
|
2001-07-24 15:07:09 +00:00
|
|
|
|
{
|
2003-05-28 23:09:16 +00:00
|
|
|
|
return new InsetMinipage(*this);
|
2001-07-24 15:07:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-03-16 15:15:32 +00:00
|
|
|
|
InsetMinipage::~InsetMinipage()
|
|
|
|
|
{
|
2003-03-07 14:08:10 +00:00
|
|
|
|
InsetMinipageMailer mailer(*this);
|
|
|
|
|
mailer.hideDialog();
|
2001-03-16 15:15:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-07 14:08:10 +00:00
|
|
|
|
dispatch_result InsetMinipage::localDispatch(FuncRequest const & cmd)
|
2000-06-28 13:35:52 +00:00
|
|
|
|
{
|
2003-03-07 14:08:10 +00:00
|
|
|
|
switch (cmd.action) {
|
|
|
|
|
case LFUN_INSET_MODIFY: {
|
|
|
|
|
InsetMinipage::Params params;
|
|
|
|
|
InsetMinipageMailer::string2params(cmd.argument, params);
|
|
|
|
|
|
|
|
|
|
params_.pos = params.pos;
|
|
|
|
|
params_.width = params.width;
|
|
|
|
|
|
2003-03-22 17:26:03 +00:00
|
|
|
|
/* FIXME: I refuse to believe we have to live
|
|
|
|
|
* with ugliness like this ... */
|
|
|
|
|
LyXText * t = inset.getLyXText(cmd.view());
|
2003-04-01 00:01:42 +00:00
|
|
|
|
t->need_break_row = t->rows().begin();
|
2003-03-22 17:26:03 +00:00
|
|
|
|
t->fullRebreak();
|
|
|
|
|
inset.update(cmd.view(), true);
|
|
|
|
|
t->setCursorIntern(t->cursor.par(), t->cursor.pos());
|
2003-03-19 14:45:22 +00:00
|
|
|
|
cmd.view()->updateInset(this);
|
2003-05-16 14:48:33 +00:00
|
|
|
|
return DISPATCHED;
|
2003-03-07 14:08:10 +00:00
|
|
|
|
}
|
2003-03-07 15:58:02 +00:00
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
case LFUN_INSET_DIALOG_UPDATE:
|
2003-05-16 14:48:33 +00:00
|
|
|
|
InsetMinipageMailer(*this).updateDialog(cmd.view());
|
|
|
|
|
return DISPATCHED;
|
2003-03-07 15:58:02 +00:00
|
|
|
|
|
2003-03-07 14:08:10 +00:00
|
|
|
|
default:
|
2003-05-16 14:48:33 +00:00
|
|
|
|
return InsetCollapsable::localDispatch(cmd);
|
2003-03-07 14:08:10 +00:00
|
|
|
|
}
|
2000-06-28 13:35:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-07 14:08:10 +00:00
|
|
|
|
void InsetMinipage::Params::write(ostream & os) const
|
|
|
|
|
{
|
|
|
|
|
os << "Minipage" << '\n'
|
|
|
|
|
<< "position " << pos << '\n'
|
|
|
|
|
<< "inner_position " << inner_pos << '\n'
|
|
|
|
|
<< "height \"" << height.asString() << "\"\n"
|
|
|
|
|
<< "width \"" << width.asString() << "\"\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void InsetMinipage::Params::read(LyXLex & lex)
|
2001-03-20 01:22:46 +00:00
|
|
|
|
{
|
2001-08-06 19:13:25 +00:00
|
|
|
|
if (lex.isOK()) {
|
2001-05-28 15:11:24 +00:00
|
|
|
|
lex.next();
|
2001-08-06 19:13:25 +00:00
|
|
|
|
string const token = lex.getString();
|
2001-05-28 15:11:24 +00:00
|
|
|
|
if (token == "position") {
|
|
|
|
|
lex.next();
|
2003-03-07 14:08:10 +00:00
|
|
|
|
pos = static_cast<Position>(lex.getInteger());
|
2001-05-28 15:11:24 +00:00
|
|
|
|
} else {
|
|
|
|
|
lyxerr << "InsetMinipage::Read: Missing 'position'-tag!"
|
|
|
|
|
<< endl;
|
2001-07-25 22:05:53 +00:00
|
|
|
|
// take countermeasures
|
|
|
|
|
lex.pushToken(token);
|
2001-05-28 15:11:24 +00:00
|
|
|
|
}
|
2001-03-22 15:45:15 +00:00
|
|
|
|
}
|
2001-08-06 19:13:25 +00:00
|
|
|
|
if (lex.isOK()) {
|
2001-07-25 22:05:53 +00:00
|
|
|
|
lex.next();
|
2001-08-06 19:13:25 +00:00
|
|
|
|
string const token = lex.getString();
|
2001-05-28 15:11:24 +00:00
|
|
|
|
if (token == "inner_position") {
|
|
|
|
|
lex.next();
|
2003-03-07 14:08:10 +00:00
|
|
|
|
inner_pos = static_cast<InnerPosition>(lex.getInteger());
|
2001-05-28 15:11:24 +00:00
|
|
|
|
} else {
|
|
|
|
|
lyxerr << "InsetMinipage::Read: Missing 'inner_position'-tag!"
|
|
|
|
|
<< endl;
|
2001-07-25 22:05:53 +00:00
|
|
|
|
// take countermeasures
|
|
|
|
|
lex.pushToken(token);
|
2001-05-28 15:11:24 +00:00
|
|
|
|
}
|
2001-03-22 15:45:15 +00:00
|
|
|
|
}
|
2001-08-06 19:13:25 +00:00
|
|
|
|
if (lex.isOK()) {
|
2001-07-25 22:05:53 +00:00
|
|
|
|
lex.next();
|
2001-08-06 19:13:25 +00:00
|
|
|
|
string const token = lex.getString();
|
2001-05-28 15:11:24 +00:00
|
|
|
|
if (token == "height") {
|
|
|
|
|
lex.next();
|
2003-03-07 14:08:10 +00:00
|
|
|
|
height = LyXLength(lex.getString());
|
2001-05-28 15:11:24 +00:00
|
|
|
|
} else {
|
|
|
|
|
lyxerr << "InsetMinipage::Read: Missing 'height'-tag!"
|
|
|
|
|
<< endl;
|
2001-07-25 22:05:53 +00:00
|
|
|
|
// take countermeasures
|
|
|
|
|
lex.pushToken(token);
|
2001-05-28 15:11:24 +00:00
|
|
|
|
}
|
2001-03-22 15:45:15 +00:00
|
|
|
|
}
|
2001-08-06 19:13:25 +00:00
|
|
|
|
if (lex.isOK()) {
|
2001-07-25 22:05:53 +00:00
|
|
|
|
lex.next();
|
2001-08-06 19:13:25 +00:00
|
|
|
|
string const token = lex.getString();
|
2001-05-28 15:11:24 +00:00
|
|
|
|
if (token == "width") {
|
|
|
|
|
lex.next();
|
2003-03-07 14:08:10 +00:00
|
|
|
|
width = LyXLength(lex.getString());
|
2001-05-28 15:11:24 +00:00
|
|
|
|
} else {
|
|
|
|
|
lyxerr << "InsetMinipage::Read: Missing 'width'-tag!"
|
|
|
|
|
<< endl;
|
2001-07-25 22:05:53 +00:00
|
|
|
|
// take countermeasures
|
|
|
|
|
lex.pushToken(token);
|
2001-05-28 15:11:24 +00:00
|
|
|
|
}
|
2001-03-22 15:45:15 +00:00
|
|
|
|
}
|
2003-03-07 14:08:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void InsetMinipage::write(Buffer const * buf, ostream & os) const
|
|
|
|
|
{
|
|
|
|
|
params_.write(os);
|
|
|
|
|
InsetCollapsable::write(buf, os);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
|
|
|
|
|
{
|
|
|
|
|
params_.read(lex);
|
2001-06-28 10:25:20 +00:00
|
|
|
|
InsetCollapsable::read(buf, lex);
|
2001-03-20 01:22:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-06-02 10:03:27 +00:00
|
|
|
|
void InsetMinipage::metrics(MetricsInfo & mi, Dimension & dim) const
|
2001-03-22 19:36:21 +00:00
|
|
|
|
{
|
2001-07-12 14:35:38 +00:00
|
|
|
|
if (collapsed_)
|
2003-05-19 17:03:12 +00:00
|
|
|
|
dimension_collapsed(dim);
|
2001-03-22 19:36:21 +00:00
|
|
|
|
else {
|
2003-05-19 17:03:12 +00:00
|
|
|
|
Dimension d;
|
2003-06-02 10:03:27 +00:00
|
|
|
|
InsetCollapsable::metrics(mi, d);
|
2003-03-07 14:08:10 +00:00
|
|
|
|
switch (params_.pos) {
|
2001-03-22 19:36:21 +00:00
|
|
|
|
case top:
|
2003-05-27 13:55:03 +00:00
|
|
|
|
dim.asc = d.asc;
|
|
|
|
|
dim.des = d.des;
|
2001-03-22 19:36:21 +00:00
|
|
|
|
break;
|
|
|
|
|
case center:
|
2003-05-28 16:36:55 +00:00
|
|
|
|
dim.asc = d.ascent() + d.descent() / 2;
|
2003-05-27 13:55:03 +00:00
|
|
|
|
dim.des = dim.asc;
|
2001-03-22 19:36:21 +00:00
|
|
|
|
break;
|
|
|
|
|
case bottom:
|
2003-05-27 13:55:03 +00:00
|
|
|
|
dim.asc = d.des;
|
|
|
|
|
dim.des = d.asc;
|
2001-03-22 19:36:21 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2003-05-28 16:36:55 +00:00
|
|
|
|
dim.wid = d.wid;
|
2001-03-22 19:36:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
|
string const InsetMinipage::editMessage() const
|
2000-06-28 13:35:52 +00:00
|
|
|
|
{
|
|
|
|
|
return _("Opened Minipage Inset");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-22 22:44:30 +00:00
|
|
|
|
int InsetMinipage::latex(Buffer const * buf, ostream & os,
|
2003-05-23 08:59:47 +00:00
|
|
|
|
LatexRunParams const & runparams) const
|
2000-06-28 13:35:52 +00:00
|
|
|
|
{
|
2001-03-20 01:22:46 +00:00
|
|
|
|
string s_pos;
|
2003-03-07 14:08:10 +00:00
|
|
|
|
switch (params_.pos) {
|
2001-03-20 01:22:46 +00:00
|
|
|
|
case top:
|
2002-11-27 10:30:28 +00:00
|
|
|
|
s_pos += 't';
|
2001-03-20 01:22:46 +00:00
|
|
|
|
break;
|
|
|
|
|
case center:
|
2002-11-27 10:30:28 +00:00
|
|
|
|
s_pos += 'c';
|
2001-03-20 01:22:46 +00:00
|
|
|
|
break;
|
|
|
|
|
case bottom:
|
2002-11-27 10:30:28 +00:00
|
|
|
|
s_pos += 'b';
|
2001-03-20 01:22:46 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2001-03-29 15:00:20 +00:00
|
|
|
|
os << "\\begin{minipage}[" << s_pos << "]{"
|
2003-03-07 14:08:10 +00:00
|
|
|
|
<< params_.width.asLatexString() << "}%\n";
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2003-05-23 08:59:47 +00:00
|
|
|
|
int i = inset.latex(buf, os, runparams);
|
2001-03-29 15:00:20 +00:00
|
|
|
|
|
2000-06-28 13:35:52 +00:00
|
|
|
|
os << "\\end{minipage}%\n";
|
|
|
|
|
return i + 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-07-19 08:52:59 +00:00
|
|
|
|
bool InsetMinipage::insetAllowed(Inset::Code code) const
|
2001-07-12 14:35:38 +00:00
|
|
|
|
{
|
2003-05-27 13:55:03 +00:00
|
|
|
|
if (code == Inset::FLOAT_CODE || code == Inset::MARGIN_CODE)
|
2000-06-28 13:35:52 +00:00
|
|
|
|
return false;
|
2001-07-12 14:35:38 +00:00
|
|
|
|
|
2001-07-19 08:52:59 +00:00
|
|
|
|
return InsetCollapsable::insetAllowed(code);
|
2000-06-28 13:35:52 +00:00
|
|
|
|
}
|
2001-03-14 14:53:55 +00:00
|
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
|
bool InsetMinipage::showInsetDialog(BufferView * bv) const
|
2001-03-26 14:47:34 +00:00
|
|
|
|
{
|
2003-03-07 14:08:10 +00:00
|
|
|
|
if (!inset.showInsetDialog(bv)) {
|
|
|
|
|
InsetMinipage * tmp = const_cast<InsetMinipage *>(this);
|
|
|
|
|
InsetMinipageMailer mailer(*tmp);
|
2003-03-10 22:12:07 +00:00
|
|
|
|
mailer.showDialog(bv);
|
2003-03-07 14:08:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-28 15:11:24 +00:00
|
|
|
|
return true;
|
2001-03-26 14:47:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-03-29 15:00:20 +00:00
|
|
|
|
int InsetMinipage::getMaxWidth(BufferView * bv, UpdatableInset const * inset)
|
2001-05-28 15:11:24 +00:00
|
|
|
|
const
|
2001-03-22 15:45:15 +00:00
|
|
|
|
{
|
2002-01-08 16:07:07 +00:00
|
|
|
|
if (owner() &&
|
2002-01-19 17:05:24 +00:00
|
|
|
|
static_cast<UpdatableInset*>(owner())->getMaxWidth(bv, inset) < 0) {
|
2002-01-08 16:07:07 +00:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
2003-03-07 14:08:10 +00:00
|
|
|
|
if (!params_.width.zero()) {
|
2002-01-19 17:05:24 +00:00
|
|
|
|
int ww1 = latexTextWidth(bv);
|
|
|
|
|
int ww2 = InsetCollapsable::getMaxWidth(bv, inset);
|
|
|
|
|
if (ww2 > 0 && ww2 < ww1) {
|
|
|
|
|
return ww2;
|
2001-08-10 14:00:48 +00:00
|
|
|
|
}
|
2002-01-19 17:05:24 +00:00
|
|
|
|
return ww1;
|
2001-08-02 14:55:06 +00:00
|
|
|
|
}
|
2001-05-28 15:11:24 +00:00
|
|
|
|
// this should not happen!
|
|
|
|
|
return InsetCollapsable::getMaxWidth(bv, inset);
|
2001-03-22 15:45:15 +00:00
|
|
|
|
}
|
2002-01-19 17:05:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int InsetMinipage::latexTextWidth(BufferView * bv) const
|
|
|
|
|
{
|
2003-03-07 14:08:10 +00:00
|
|
|
|
return params_.width.inPixels(InsetCollapsable::latexTextWidth(bv));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InsetMinipage::Params::Params()
|
|
|
|
|
: pos(center),
|
|
|
|
|
inner_pos(inner_center),
|
|
|
|
|
width(100, LyXLength::PCW)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string const InsetMinipageMailer:: name_("minipage");
|
|
|
|
|
|
|
|
|
|
InsetMinipageMailer::InsetMinipageMailer(InsetMinipage & inset)
|
|
|
|
|
: inset_(inset)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string const InsetMinipageMailer::inset2string() const
|
|
|
|
|
{
|
|
|
|
|
return params2string(inset_.params());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void InsetMinipageMailer::string2params(string const & in,
|
|
|
|
|
InsetMinipage::Params & params)
|
|
|
|
|
{
|
|
|
|
|
params = InsetMinipage::Params();
|
|
|
|
|
|
2003-04-24 20:02:49 +00:00
|
|
|
|
if (in.empty())
|
|
|
|
|
return;
|
2003-05-26 09:13:55 +00:00
|
|
|
|
|
2003-05-13 16:24:49 +00:00
|
|
|
|
istringstream data(STRCONV(in));
|
2003-03-07 14:08:10 +00:00
|
|
|
|
LyXLex lex(0,0);
|
|
|
|
|
lex.setStream(data);
|
|
|
|
|
|
|
|
|
|
if (lex.isOK()) {
|
|
|
|
|
lex.next();
|
|
|
|
|
string const token = lex.getString();
|
|
|
|
|
if (token != "minipage")
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This is part of the inset proper that is usually swallowed
|
|
|
|
|
// by Buffer::readInset
|
|
|
|
|
if (lex.isOK()) {
|
|
|
|
|
lex.next();
|
|
|
|
|
string const token = lex.getString();
|
|
|
|
|
if (token != "Minipage")
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-10 03:11:54 +00:00
|
|
|
|
if (lex.isOK()) {
|
|
|
|
|
params.read(lex);
|
|
|
|
|
}
|
2003-03-07 14:08:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string const
|
|
|
|
|
InsetMinipageMailer::params2string(InsetMinipage::Params const & params)
|
|
|
|
|
{
|
|
|
|
|
ostringstream data;
|
|
|
|
|
data << name_ << ' ';
|
|
|
|
|
params.write(data);
|
2003-05-13 16:24:49 +00:00
|
|
|
|
return STRCONV(data.str());
|
2002-01-19 17:05:24 +00:00
|
|
|
|
}
|