2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetert.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-02-25 12:06:15 +00:00
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "insetert.h"
|
2002-08-13 14:40:38 +00:00
|
|
|
|
#include "insettext.h"
|
|
|
|
|
|
2000-03-08 13:52:57 +00:00
|
|
|
|
#include "buffer.h"
|
2001-07-24 15:07:09 +00:00
|
|
|
|
#include "BufferView.h"
|
2001-12-28 13:26:54 +00:00
|
|
|
|
#include "debug.h"
|
2002-08-13 14:40:38 +00:00
|
|
|
|
#include "funcrequest.h"
|
|
|
|
|
#include "gettext.h"
|
|
|
|
|
#include "language.h"
|
|
|
|
|
#include "lyxfont.h"
|
2002-07-21 21:21:06 +00:00
|
|
|
|
#include "lyxlex.h"
|
2002-08-13 14:40:38 +00:00
|
|
|
|
#include "lyxrow.h"
|
|
|
|
|
#include "lyxtext.h"
|
|
|
|
|
#include "WordLangTuple.h"
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
2001-11-26 10:19:58 +00:00
|
|
|
|
#include "frontends/Alert.h"
|
2002-08-13 14:40:38 +00:00
|
|
|
|
#include "frontends/Dialogs.h"
|
|
|
|
|
#include "frontends/LyXView.h"
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
|
|
|
|
#include "support/LOstream.h"
|
2003-02-25 14:51:38 +00:00
|
|
|
|
#include "support/LAssert.h"
|
2003-05-13 14:36:24 +00:00
|
|
|
|
#include "support/tostr.h"
|
2000-02-25 12:06:15 +00:00
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
|
|
2000-04-04 00:19:15 +00:00
|
|
|
|
using std::ostream;
|
2002-02-16 15:59:55 +00:00
|
|
|
|
using std::min;
|
|
|
|
|
using std::endl;
|
|
|
|
|
|
2001-11-27 10:34:16 +00:00
|
|
|
|
using lyx::pos_type;
|
|
|
|
|
|
2000-02-25 12:06:15 +00:00
|
|
|
|
|
2001-07-24 10:13:19 +00:00
|
|
|
|
void InsetERT::init()
|
2000-02-25 12:06:15 +00:00
|
|
|
|
{
|
2001-07-25 19:45:21 +00:00
|
|
|
|
setButtonLabel();
|
2001-07-08 12:52:16 +00:00
|
|
|
|
labelfont = LyXFont(LyXFont::ALL_SANE);
|
|
|
|
|
labelfont.decSize();
|
|
|
|
|
labelfont.decSize();
|
|
|
|
|
labelfont.setColor(LColor::latex);
|
|
|
|
|
setInsetName("ERT");
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-24 15:07:09 +00:00
|
|
|
|
|
2002-03-03 20:25:07 +00:00
|
|
|
|
InsetERT::InsetERT(BufferParams const & bp, bool collapsed)
|
|
|
|
|
: InsetCollapsable(bp, collapsed)
|
2001-07-24 10:13:19 +00:00
|
|
|
|
{
|
2001-08-06 14:55:02 +00:00
|
|
|
|
if (collapsed)
|
|
|
|
|
status_ = Collapsed;
|
|
|
|
|
else
|
|
|
|
|
status_ = Open;
|
2001-07-24 10:13:19 +00:00
|
|
|
|
init();
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-08 12:52:16 +00:00
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
InsetERT::InsetERT(InsetERT const & in)
|
|
|
|
|
: InsetCollapsable(in), status_(in.status_)
|
2001-07-27 12:03:36 +00:00
|
|
|
|
{
|
|
|
|
|
init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-06-16 11:49:38 +00:00
|
|
|
|
InsetBase * InsetERT::clone() const
|
2001-07-27 12:03:36 +00:00
|
|
|
|
{
|
2003-05-28 23:09:16 +00:00
|
|
|
|
return new InsetERT(*this);
|
2001-07-27 12:03:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-03-03 20:25:07 +00:00
|
|
|
|
InsetERT::InsetERT(BufferParams const & bp,
|
|
|
|
|
Language const * l, string const & contents, bool collapsed)
|
|
|
|
|
: InsetCollapsable(bp, collapsed)
|
2001-07-08 12:52:16 +00:00
|
|
|
|
{
|
2001-08-13 09:57:47 +00:00
|
|
|
|
if (collapsed)
|
|
|
|
|
status_ = Collapsed;
|
|
|
|
|
else
|
|
|
|
|
status_ = Open;
|
2002-02-20 14:55:17 +00:00
|
|
|
|
|
|
|
|
|
LyXFont font(LyXFont::ALL_INHERIT, l);
|
|
|
|
|
#ifdef SET_HARD_FONT
|
2001-07-24 15:07:09 +00:00
|
|
|
|
font.setFamily(LyXFont::TYPEWRITER_FAMILY);
|
|
|
|
|
font.setColor(LColor::latex);
|
2002-02-20 14:55:17 +00:00
|
|
|
|
#endif
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-07-08 12:52:16 +00:00
|
|
|
|
string::const_iterator cit = contents.begin();
|
|
|
|
|
string::const_iterator end = contents.end();
|
2001-11-27 10:34:16 +00:00
|
|
|
|
pos_type pos = 0;
|
2001-07-08 12:52:16 +00:00
|
|
|
|
for (; cit != end; ++cit) {
|
2003-04-02 17:11:38 +00:00
|
|
|
|
inset.paragraphs.begin()->insertChar(pos++, *cit, font);
|
2001-07-08 12:52:16 +00:00
|
|
|
|
}
|
2001-07-24 15:07:09 +00:00
|
|
|
|
// the init has to be after the initialization of the paragraph
|
|
|
|
|
// because of the label settings (draw_label for ert insets).
|
|
|
|
|
init();
|
2000-02-25 12:06:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-08-06 14:55:02 +00:00
|
|
|
|
InsetERT::~InsetERT()
|
|
|
|
|
{
|
2003-02-25 14:51:38 +00:00
|
|
|
|
InsetERTMailer mailer(*this);
|
|
|
|
|
mailer.hideDialog();
|
2001-08-06 14:55:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-07-24 22:08:49 +00:00
|
|
|
|
void InsetERT::read(Buffer const * buf, LyXLex & lex)
|
|
|
|
|
{
|
2001-08-06 14:55:02 +00:00
|
|
|
|
bool token_found = false;
|
2001-08-06 19:13:25 +00:00
|
|
|
|
if (lex.isOK()) {
|
2001-08-06 14:55:02 +00:00
|
|
|
|
lex.next();
|
2001-08-06 19:13:25 +00:00
|
|
|
|
string const token = lex.getString();
|
2001-08-06 14:55:02 +00:00
|
|
|
|
if (token == "status") {
|
|
|
|
|
lex.next();
|
2001-08-06 19:13:25 +00:00
|
|
|
|
string const tmp_token = lex.getString();
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-08-06 19:13:25 +00:00
|
|
|
|
if (tmp_token == "Inlined") {
|
2001-08-07 08:05:31 +00:00
|
|
|
|
status(0, Inlined);
|
2001-08-06 19:13:25 +00:00
|
|
|
|
} else if (tmp_token == "Collapsed") {
|
2001-08-07 08:05:31 +00:00
|
|
|
|
status(0, Collapsed);
|
2001-08-06 19:13:25 +00:00
|
|
|
|
} else {
|
|
|
|
|
// leave this as default!
|
2001-08-07 08:05:31 +00:00
|
|
|
|
status(0, Open);
|
2001-08-06 19:13:25 +00:00
|
|
|
|
}
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-08-06 14:55:02 +00:00
|
|
|
|
token_found = true;
|
|
|
|
|
} else {
|
|
|
|
|
lyxerr << "InsetERT::Read: Missing 'status'-tag!"
|
2002-02-16 15:59:55 +00:00
|
|
|
|
<< endl;
|
2001-08-06 14:55:02 +00:00
|
|
|
|
// take countermeasures
|
|
|
|
|
lex.pushToken(token);
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-12-17 13:33:22 +00:00
|
|
|
|
#if 0
|
2001-08-07 08:05:31 +00:00
|
|
|
|
#warning this should be really short lived only for compatibility to
|
|
|
|
|
#warning files written 07/08/2001 so this has to go before 1.2.0! (Jug)
|
|
|
|
|
if (lex.isOK()) {
|
|
|
|
|
lex.next();
|
|
|
|
|
string const token = lex.getString();
|
|
|
|
|
if (token == "collapsed") {
|
|
|
|
|
lex.next();
|
|
|
|
|
collapsed_ = lex.getBool();
|
|
|
|
|
} else {
|
|
|
|
|
// Take countermeasures
|
|
|
|
|
lex.pushToken(token);
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-12-17 13:33:22 +00:00
|
|
|
|
#endif
|
2001-08-07 08:05:31 +00:00
|
|
|
|
inset.read(buf, lex);
|
2001-08-18 15:01:09 +00:00
|
|
|
|
|
2002-02-20 14:55:17 +00:00
|
|
|
|
#ifdef SET_HARD_FONT
|
2001-08-18 15:01:09 +00:00
|
|
|
|
LyXFont font(LyXFont::ALL_INHERIT, latex_language);
|
|
|
|
|
font.setFamily(LyXFont::TYPEWRITER_FAMILY);
|
|
|
|
|
font.setColor(LColor::latex);
|
2003-04-16 04:35:43 +00:00
|
|
|
|
|
|
|
|
|
ParagraphList::iterator pit = inset.paragraphs.begin();
|
|
|
|
|
ParagraphList::iterator pend = inset.paragraphs.end();
|
|
|
|
|
for (; pit != pend; ++pit) {
|
|
|
|
|
pos_type siz = pit->size();
|
2001-11-27 10:34:16 +00:00
|
|
|
|
for (pos_type i = 0; i < siz; ++i) {
|
2003-04-16 04:35:43 +00:00
|
|
|
|
pit->setFont(i, font);
|
2001-08-18 15:01:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2002-02-20 14:55:17 +00:00
|
|
|
|
#endif
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-08-06 14:55:02 +00:00
|
|
|
|
if (!token_found) {
|
2001-08-06 19:13:25 +00:00
|
|
|
|
if (collapsed_) {
|
2001-08-07 08:05:31 +00:00
|
|
|
|
status(0, Collapsed);
|
2001-08-06 19:13:25 +00:00
|
|
|
|
} else {
|
2001-08-07 08:05:31 +00:00
|
|
|
|
status(0, Open);
|
2001-08-06 19:13:25 +00:00
|
|
|
|
}
|
2001-08-06 14:55:02 +00:00
|
|
|
|
}
|
2001-07-25 19:45:21 +00:00
|
|
|
|
setButtonLabel();
|
2001-07-24 22:08:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-03-21 17:09:55 +00:00
|
|
|
|
void InsetERT::write(Buffer const * buf, ostream & os) const
|
2000-06-28 13:35:52 +00:00
|
|
|
|
{
|
2001-08-06 14:55:02 +00:00
|
|
|
|
string st;
|
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
|
switch (status_) {
|
2002-03-21 17:09:55 +00:00
|
|
|
|
case Open:
|
2001-08-06 14:55:02 +00:00
|
|
|
|
st = "Open";
|
|
|
|
|
break;
|
|
|
|
|
case Collapsed:
|
|
|
|
|
st = "Collapsed";
|
|
|
|
|
break;
|
|
|
|
|
case Inlined:
|
|
|
|
|
st = "Inlined";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
os << getInsetName() << "\n"
|
|
|
|
|
<< "status "<< st << "\n";
|
2001-08-07 08:05:31 +00:00
|
|
|
|
|
2001-08-18 15:01:09 +00:00
|
|
|
|
//inset.writeParagraphData(buf, os);
|
2002-07-21 21:21:06 +00:00
|
|
|
|
string const layout(buf->params.getLyXTextClass().defaultLayoutName());
|
2003-04-02 17:11:38 +00:00
|
|
|
|
ParagraphList::iterator par = inset.paragraphs.begin();
|
|
|
|
|
ParagraphList::iterator end = inset.paragraphs.end();
|
|
|
|
|
for (; par != end; ++par) {
|
2001-08-18 15:01:09 +00:00
|
|
|
|
os << "\n\\layout " << layout << "\n";
|
2001-11-27 10:34:16 +00:00
|
|
|
|
pos_type siz = par->size();
|
|
|
|
|
for (pos_type i = 0; i < siz; ++i) {
|
2001-08-18 15:01:09 +00:00
|
|
|
|
Paragraph::value_type c = par->getChar(i);
|
|
|
|
|
switch (c) {
|
|
|
|
|
case Paragraph::META_INSET:
|
2003-03-12 19:16:42 +00:00
|
|
|
|
if (par->getInset(i)->lyxCode() != Inset::NEWLINE_CODE) {
|
|
|
|
|
lyxerr << "Element is not allowed in insertERT"
|
|
|
|
|
<< endl;
|
|
|
|
|
} else {
|
|
|
|
|
par->getInset(i)->write(buf, os);
|
|
|
|
|
}
|
2001-08-18 15:01:09 +00:00
|
|
|
|
break;
|
2003-03-12 19:16:42 +00:00
|
|
|
|
|
2001-08-18 15:01:09 +00:00
|
|
|
|
case '\\':
|
|
|
|
|
os << "\n\\backslash \n";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
os << c;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-06-28 13:35:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-03-21 17:09:55 +00:00
|
|
|
|
string const InsetERT::editMessage() const
|
2000-04-04 00:19:15 +00:00
|
|
|
|
{
|
2001-04-02 14:02:58 +00:00
|
|
|
|
return _("Opened ERT Inset");
|
2000-02-25 12:06:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
|
bool InsetERT::insertInset(BufferView *, Inset *)
|
2001-06-27 14:10:35 +00:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void InsetERT::setFont(BufferView *, LyXFont const &, bool, bool selectall)
|
2000-02-25 12:06:15 +00:00
|
|
|
|
{
|
2003-03-29 10:55:48 +00:00
|
|
|
|
#ifdef WITH_WARNINGS
|
|
|
|
|
#warning FIXME. More UI stupidity...
|
|
|
|
|
#endif
|
2001-05-28 15:11:24 +00:00
|
|
|
|
// if selectall is activated then the fontchange was an outside general
|
|
|
|
|
// fontchange and this messages is not needed
|
|
|
|
|
if (!selectall)
|
2003-03-29 10:55:48 +00:00
|
|
|
|
Alert::error(_("Cannot change font"),
|
|
|
|
|
_("You cannot change font settings inside TeX code."));
|
2000-02-25 12:06:15 +00:00
|
|
|
|
}
|
2000-03-24 13:24:58 +00:00
|
|
|
|
|
2000-07-04 19:16:35 +00:00
|
|
|
|
|
2001-10-31 15:19:49 +00:00
|
|
|
|
void InsetERT::updateStatus(BufferView * bv, bool swap) const
|
2000-03-24 13:24:58 +00:00
|
|
|
|
{
|
2001-08-14 07:37:46 +00:00
|
|
|
|
if (status_ != Inlined) {
|
|
|
|
|
if (collapsed_) {
|
2001-10-31 15:19:49 +00:00
|
|
|
|
status(bv, swap ? Open : Collapsed);
|
2001-08-14 07:37:46 +00:00
|
|
|
|
} else {
|
2001-10-31 15:19:49 +00:00
|
|
|
|
status(bv, swap ? Collapsed : Open);
|
2001-08-14 07:37:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2001-10-31 15:19:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-27 14:10:35 +00:00
|
|
|
|
|
2001-08-06 14:55:02 +00:00
|
|
|
|
Inset::EDITABLE InsetERT::editable() const
|
|
|
|
|
{
|
|
|
|
|
if (status_ == Collapsed)
|
|
|
|
|
return IS_EDITABLE;
|
|
|
|
|
return HIGHLY_EDITABLE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-08-19 10:11:13 +00:00
|
|
|
|
void InsetERT::lfunMousePress(FuncRequest const & cmd)
|
2001-12-04 16:10:19 +00:00
|
|
|
|
{
|
2002-08-19 10:11:13 +00:00
|
|
|
|
if (status_ == Inlined)
|
|
|
|
|
inset.localDispatch(cmd);
|
|
|
|
|
else
|
|
|
|
|
InsetCollapsable::localDispatch(cmd);
|
2001-12-04 16:10:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-08-19 10:11:13 +00:00
|
|
|
|
bool InsetERT::lfunMouseRelease(FuncRequest const & cmd)
|
2001-07-24 22:08:49 +00:00
|
|
|
|
{
|
2002-08-19 10:11:13 +00:00
|
|
|
|
BufferView * bv = cmd.view();
|
|
|
|
|
|
|
|
|
|
if (cmd.button() == mouse_button::button3) {
|
2001-08-06 14:55:02 +00:00
|
|
|
|
showInsetDialog(bv);
|
2001-12-17 13:33:22 +00:00
|
|
|
|
return true;
|
2001-08-06 14:55:02 +00:00
|
|
|
|
}
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2002-08-19 10:11:13 +00:00
|
|
|
|
if (status_ != Inlined && (cmd.x >= 0) && (cmd.x < button_length) &&
|
|
|
|
|
(cmd.y >= button_top_y) && (cmd.y <= button_bottom_y)) {
|
2001-10-31 15:19:49 +00:00
|
|
|
|
updateStatus(bv, true);
|
|
|
|
|
} else {
|
2001-07-31 09:53:40 +00:00
|
|
|
|
LyXFont font(LyXFont::ALL_SANE);
|
2002-08-19 10:11:13 +00:00
|
|
|
|
FuncRequest cmd1 = cmd;
|
|
|
|
|
cmd1.y = ascent(bv, font) + cmd.y - inset.ascent(bv, font);
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
|
|
|
|
// inlined is special - the text appears above
|
2001-10-31 15:19:49 +00:00
|
|
|
|
// button_bottom_y
|
2002-08-19 10:11:13 +00:00
|
|
|
|
if (status_ == Inlined)
|
|
|
|
|
inset.localDispatch(cmd1);
|
|
|
|
|
else if (!collapsed_ && (cmd.y > button_bottom_y)) {
|
2003-05-19 17:03:12 +00:00
|
|
|
|
cmd1.y -= height_collapsed();
|
2002-08-19 10:11:13 +00:00
|
|
|
|
inset.localDispatch(cmd1);
|
2001-10-31 15:19:49 +00:00
|
|
|
|
}
|
2001-07-24 22:08:49 +00:00
|
|
|
|
}
|
2001-12-17 13:33:22 +00:00
|
|
|
|
return false;
|
2001-07-24 22:08:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-08-19 10:11:13 +00:00
|
|
|
|
void InsetERT::lfunMouseMotion(FuncRequest const & cmd)
|
2001-12-04 16:10:19 +00:00
|
|
|
|
{
|
2002-08-19 10:11:13 +00:00
|
|
|
|
if (status_ == Inlined)
|
|
|
|
|
inset.localDispatch(cmd);
|
|
|
|
|
else
|
|
|
|
|
InsetCollapsable::localDispatch(cmd);
|
2001-12-04 16:10:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-23 08:59:47 +00:00
|
|
|
|
int InsetERT::latex(Buffer const *, ostream & os,
|
|
|
|
|
LatexRunParams const &) const
|
2001-06-27 14:10:35 +00:00
|
|
|
|
{
|
2003-04-02 17:11:38 +00:00
|
|
|
|
ParagraphList::iterator par = inset.paragraphs.begin();
|
|
|
|
|
ParagraphList::iterator end = inset.paragraphs.end();
|
|
|
|
|
|
2001-09-28 20:23:49 +00:00
|
|
|
|
int lines = 0;
|
2003-04-02 17:11:38 +00:00
|
|
|
|
while (par != end) {
|
2001-11-27 10:34:16 +00:00
|
|
|
|
pos_type siz = par->size();
|
|
|
|
|
for (pos_type i = 0; i < siz; ++i) {
|
2003-02-08 19:18:01 +00:00
|
|
|
|
// ignore all struck out text
|
2003-02-26 17:04:10 +00:00
|
|
|
|
if (isDeletedText(*par, i))
|
2003-02-08 19:18:01 +00:00
|
|
|
|
continue;
|
2003-03-17 16:25:00 +00:00
|
|
|
|
|
2003-03-12 19:16:42 +00:00
|
|
|
|
if (par->isNewline(i)) {
|
2001-07-16 15:42:57 +00:00
|
|
|
|
os << '\n';
|
2001-09-28 20:23:49 +00:00
|
|
|
|
++lines;
|
2003-03-12 19:16:42 +00:00
|
|
|
|
} else {
|
|
|
|
|
os << par->getChar(i);
|
2001-07-16 15:42:57 +00:00
|
|
|
|
}
|
2001-07-09 23:12:04 +00:00
|
|
|
|
}
|
2003-04-02 17:11:38 +00:00
|
|
|
|
++par;
|
|
|
|
|
if (par != end) {
|
2003-06-07 17:45:43 +00:00
|
|
|
|
os << "\n";
|
|
|
|
|
++lines;
|
2001-09-28 20:23:49 +00:00
|
|
|
|
}
|
2001-06-27 14:10:35 +00:00
|
|
|
|
}
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-09-28 20:23:49 +00:00
|
|
|
|
return lines;
|
2001-06-27 14:10:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-08-19 10:11:13 +00:00
|
|
|
|
int InsetERT::ascii(Buffer const *, ostream &, int /*linelen*/) const
|
2001-06-27 14:10:35 +00:00
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
|
int InsetERT::linuxdoc(Buffer const *, ostream & os) const
|
2001-06-27 14:10:35 +00:00
|
|
|
|
{
|
2003-04-02 17:11:38 +00:00
|
|
|
|
ParagraphList::iterator par = inset.paragraphs.begin();
|
|
|
|
|
ParagraphList::iterator end = inset.paragraphs.end();
|
|
|
|
|
|
2001-10-15 12:21:11 +00:00
|
|
|
|
int lines = 0;
|
2003-04-02 17:11:38 +00:00
|
|
|
|
while (par != end) {
|
2001-11-27 10:34:16 +00:00
|
|
|
|
pos_type siz = par->size();
|
|
|
|
|
for (pos_type i = 0; i < siz; ++i) {
|
2003-03-12 19:16:42 +00:00
|
|
|
|
if (par->isNewline(i)) {
|
2001-10-15 12:21:11 +00:00
|
|
|
|
os << '\n';
|
|
|
|
|
++lines;
|
2003-03-12 19:16:42 +00:00
|
|
|
|
} else {
|
|
|
|
|
os << par->getChar(i);
|
2001-10-15 12:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2003-04-02 17:11:38 +00:00
|
|
|
|
++par;
|
|
|
|
|
if (par != end) {
|
2001-10-15 12:21:11 +00:00
|
|
|
|
os << "\n";
|
|
|
|
|
lines ++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-10-15 12:21:11 +00:00
|
|
|
|
return lines;
|
2001-06-27 14:10:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
|
int InsetERT::docbook(Buffer const *, ostream & os, bool) const
|
2001-06-27 14:10:35 +00:00
|
|
|
|
{
|
2003-04-02 17:11:38 +00:00
|
|
|
|
ParagraphList::iterator par = inset.paragraphs.begin();
|
|
|
|
|
ParagraphList::iterator end = inset.paragraphs.end();
|
|
|
|
|
|
2001-10-15 12:21:11 +00:00
|
|
|
|
int lines = 0;
|
2003-04-02 17:11:38 +00:00
|
|
|
|
while (par != end) {
|
2001-11-27 10:34:16 +00:00
|
|
|
|
pos_type siz = par->size();
|
|
|
|
|
for (pos_type i = 0; i < siz; ++i) {
|
2003-03-12 19:16:42 +00:00
|
|
|
|
if (par->isNewline(i)) {
|
2001-10-15 12:21:11 +00:00
|
|
|
|
os << '\n';
|
|
|
|
|
++lines;
|
2003-03-12 19:16:42 +00:00
|
|
|
|
} else {
|
|
|
|
|
os << par->getChar(i);
|
2001-10-15 12:21:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2003-04-02 17:11:38 +00:00
|
|
|
|
++par;
|
|
|
|
|
if (par != end) {
|
2001-10-15 12:21:11 +00:00
|
|
|
|
os << "\n";
|
|
|
|
|
lines ++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-10-15 12:21:11 +00:00
|
|
|
|
return lines;
|
2000-03-24 13:24:58 +00:00
|
|
|
|
}
|
2001-07-24 15:07:09 +00:00
|
|
|
|
|
|
|
|
|
|
2002-08-19 10:11:13 +00:00
|
|
|
|
Inset::RESULT InsetERT::localDispatch(FuncRequest const & cmd)
|
2001-07-24 15:07:09 +00:00
|
|
|
|
{
|
2003-03-04 14:31:04 +00:00
|
|
|
|
Inset::RESULT result = UNDISPATCHED;
|
2002-08-19 10:11:13 +00:00
|
|
|
|
BufferView * bv = cmd.view();
|
2001-07-31 09:53:40 +00:00
|
|
|
|
|
2003-04-02 17:11:38 +00:00
|
|
|
|
if (inset.paragraphs.begin()->empty()) {
|
2001-07-31 09:53:40 +00:00
|
|
|
|
set_latex_font(bv);
|
|
|
|
|
}
|
|
|
|
|
|
2002-08-19 10:11:13 +00:00
|
|
|
|
switch (cmd.action) {
|
2003-05-16 07:44:00 +00:00
|
|
|
|
|
|
|
|
|
case LFUN_INSET_EDIT:
|
|
|
|
|
if (cmd.button() == mouse_button::button3)
|
|
|
|
|
break;
|
|
|
|
|
if (status_ == Inlined) {
|
|
|
|
|
if (!bv->lockInset(this))
|
|
|
|
|
break;
|
|
|
|
|
result = inset.localDispatch(cmd);
|
|
|
|
|
} else {
|
|
|
|
|
result = InsetCollapsable::localDispatch(cmd);
|
|
|
|
|
}
|
|
|
|
|
set_latex_font(bv);
|
|
|
|
|
updateStatus(bv);
|
|
|
|
|
break;
|
|
|
|
|
|
2003-03-04 14:31:04 +00:00
|
|
|
|
case LFUN_INSET_MODIFY: {
|
2003-02-26 19:28:38 +00:00
|
|
|
|
InsetERT::ERTStatus status_;
|
|
|
|
|
InsetERTMailer::string2params(cmd.argument, status_);
|
2002-08-19 10:11:13 +00:00
|
|
|
|
|
2003-02-26 19:28:38 +00:00
|
|
|
|
status(bv, status_);
|
2003-03-22 17:26:03 +00:00
|
|
|
|
|
|
|
|
|
/* FIXME: I refuse to believe we have to live
|
|
|
|
|
* with ugliness like this ! Note that this
|
|
|
|
|
* rebreak *is* needed. Consider a change from
|
|
|
|
|
* Open (needfullrow) to Inlined (only the space
|
|
|
|
|
* taken by the text).
|
|
|
|
|
*/
|
|
|
|
|
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();
|
|
|
|
|
t->setCursorIntern(t->cursor.par(), t->cursor.pos());
|
|
|
|
|
inset.update(cmd.view(), true);
|
2003-03-19 14:45:22 +00:00
|
|
|
|
bv->updateInset(this);
|
2003-03-04 14:31:04 +00:00
|
|
|
|
result = DISPATCHED;
|
2003-02-26 19:28:38 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2003-03-17 16:25:00 +00:00
|
|
|
|
|
2003-02-26 19:28:38 +00:00
|
|
|
|
case LFUN_MOUSE_PRESS:
|
|
|
|
|
lfunMousePress(cmd);
|
2003-03-04 14:31:04 +00:00
|
|
|
|
result = DISPATCHED;
|
|
|
|
|
break;
|
2003-02-26 19:28:38 +00:00
|
|
|
|
|
|
|
|
|
case LFUN_MOUSE_MOTION:
|
|
|
|
|
lfunMouseMotion(cmd);
|
2003-03-04 14:31:04 +00:00
|
|
|
|
result = DISPATCHED;
|
|
|
|
|
break;
|
2003-02-26 19:28:38 +00:00
|
|
|
|
|
|
|
|
|
case LFUN_MOUSE_RELEASE:
|
|
|
|
|
lfunMouseRelease(cmd);
|
2003-03-04 14:31:04 +00:00
|
|
|
|
result = DISPATCHED;
|
|
|
|
|
break;
|
2003-02-26 19:28:38 +00:00
|
|
|
|
|
|
|
|
|
case LFUN_LAYOUT:
|
2003-04-02 17:11:38 +00:00
|
|
|
|
bv->owner()->setLayout(inset.paragraphs.begin()->layout()->name());
|
2003-03-04 14:31:04 +00:00
|
|
|
|
result = DISPATCHED_NOUPDATE;
|
2003-02-26 19:28:38 +00:00
|
|
|
|
break;
|
2002-08-19 10:11:13 +00:00
|
|
|
|
|
2003-02-26 19:28:38 +00:00
|
|
|
|
default:
|
|
|
|
|
result = InsetCollapsable::localDispatch(cmd);
|
2001-07-24 15:07:09 +00:00
|
|
|
|
}
|
2002-08-19 10:11:13 +00:00
|
|
|
|
|
|
|
|
|
switch (cmd.action) {
|
2001-07-24 15:07:09 +00:00
|
|
|
|
case LFUN_BREAKPARAGRAPH:
|
2001-07-24 22:08:49 +00:00
|
|
|
|
case LFUN_BREAKPARAGRAPHKEEPLAYOUT:
|
2001-08-18 15:01:09 +00:00
|
|
|
|
case LFUN_BACKSPACE:
|
|
|
|
|
case LFUN_BACKSPACE_SKIP:
|
|
|
|
|
case LFUN_DELETE:
|
|
|
|
|
case LFUN_DELETE_SKIP:
|
|
|
|
|
case LFUN_DELETE_LINE_FORWARD:
|
|
|
|
|
case LFUN_CUT:
|
2001-07-31 09:53:40 +00:00
|
|
|
|
set_latex_font(bv);
|
|
|
|
|
break;
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-07-24 15:07:09 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2001-07-24 22:08:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string const InsetERT::get_new_label() const
|
|
|
|
|
{
|
|
|
|
|
string la;
|
2001-11-27 10:34:16 +00:00
|
|
|
|
pos_type const max_length = 15;
|
2003-04-02 17:11:38 +00:00
|
|
|
|
pos_type const p_siz = inset.paragraphs.begin()->size();
|
2002-02-16 15:59:55 +00:00
|
|
|
|
pos_type const n = min(max_length, p_siz);
|
2003-02-25 14:51:38 +00:00
|
|
|
|
pos_type i = 0;
|
|
|
|
|
pos_type j = 0;
|
2001-07-25 19:45:21 +00:00
|
|
|
|
for(; i < n && j < p_siz; ++j) {
|
2003-04-02 17:11:38 +00:00
|
|
|
|
if (inset.paragraphs.begin()->isInset(j))
|
2001-07-24 22:08:49 +00:00
|
|
|
|
continue;
|
2003-04-02 17:11:38 +00:00
|
|
|
|
la += inset.paragraphs.begin()->getChar(j);
|
2001-07-24 22:08:49 +00:00
|
|
|
|
++i;
|
|
|
|
|
}
|
2003-06-18 17:43:49 +00:00
|
|
|
|
if (p_siz > 1 || (i > 0 && j < p_siz)) {
|
2001-07-24 22:08:49 +00:00
|
|
|
|
la += "...";
|
2001-07-25 19:45:21 +00:00
|
|
|
|
}
|
|
|
|
|
if (la.empty()) {
|
2001-07-30 22:14:45 +00:00
|
|
|
|
la = _("ERT");
|
2001-07-25 19:45:21 +00:00
|
|
|
|
}
|
2001-07-24 22:08:49 +00:00
|
|
|
|
return la;
|
|
|
|
|
}
|
2001-07-25 19:45:21 +00:00
|
|
|
|
|
|
|
|
|
|
2001-08-07 15:07:36 +00:00
|
|
|
|
void InsetERT::setButtonLabel() const
|
2001-07-25 19:45:21 +00:00
|
|
|
|
{
|
2001-08-06 14:55:02 +00:00
|
|
|
|
if (status_ == Collapsed) {
|
2001-07-25 19:45:21 +00:00
|
|
|
|
setLabel(get_new_label());
|
|
|
|
|
} else {
|
2001-07-30 22:14:45 +00:00
|
|
|
|
setLabel(_("ERT"));
|
2001-07-25 19:45:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2001-07-27 12:03:36 +00:00
|
|
|
|
|
|
|
|
|
|
2002-02-20 14:55:17 +00:00
|
|
|
|
bool InsetERT::checkInsertChar(LyXFont & /* font */)
|
2001-07-27 12:03:36 +00:00
|
|
|
|
{
|
2002-02-20 14:55:17 +00:00
|
|
|
|
#ifdef SET_HARD_FONT
|
2001-08-11 18:31:14 +00:00
|
|
|
|
LyXFont f(LyXFont::ALL_INHERIT, latex_language);
|
2001-07-27 12:03:36 +00:00
|
|
|
|
font = f;
|
|
|
|
|
font.setFamily(LyXFont::TYPEWRITER_FAMILY);
|
|
|
|
|
font.setColor(LColor::latex);
|
2002-02-20 14:55:17 +00:00
|
|
|
|
#endif
|
2001-07-27 12:03:36 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
2001-07-31 09:53:40 +00:00
|
|
|
|
|
|
|
|
|
|
2003-06-02 10:03:27 +00:00
|
|
|
|
void InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
|
2001-07-31 09:53:40 +00:00
|
|
|
|
{
|
2003-05-21 21:20:50 +00:00
|
|
|
|
if (inlined())
|
2003-06-02 10:03:27 +00:00
|
|
|
|
inset.metrics(mi, dim);
|
2003-05-19 17:03:12 +00:00
|
|
|
|
else
|
2003-06-02 10:03:27 +00:00
|
|
|
|
InsetCollapsable::metrics(mi, dim);
|
2001-08-06 14:55:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-30 06:48:24 +00:00
|
|
|
|
void InsetERT::draw(PainterInfo & pi, int x, int y) const
|
2001-07-31 09:53:40 +00:00
|
|
|
|
{
|
2003-05-30 06:48:24 +00:00
|
|
|
|
InsetCollapsable::draw(pi, x, y, inlined());
|
2001-07-31 09:53:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-02-20 14:55:17 +00:00
|
|
|
|
void InsetERT::set_latex_font(BufferView * /* bv */)
|
2001-07-31 09:53:40 +00:00
|
|
|
|
{
|
2002-02-20 14:55:17 +00:00
|
|
|
|
#ifdef SET_HARD_FONT
|
2001-08-11 18:31:14 +00:00
|
|
|
|
LyXFont font(LyXFont::ALL_INHERIT, latex_language);
|
2001-07-31 09:53:40 +00:00
|
|
|
|
|
|
|
|
|
font.setFamily(LyXFont::TYPEWRITER_FAMILY);
|
|
|
|
|
font.setColor(LColor::latex);
|
2002-02-20 14:55:17 +00:00
|
|
|
|
|
2001-08-06 14:55:02 +00:00
|
|
|
|
inset.getLyXText(bv)->setFont(bv, font, false);
|
2002-02-20 14:55:17 +00:00
|
|
|
|
#endif
|
2001-08-06 14:55:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-03-06 10:17:29 +00:00
|
|
|
|
// attention this function can be called with bv == 0
|
2001-08-07 15:07:36 +00:00
|
|
|
|
void InsetERT::status(BufferView * bv, ERTStatus const st) const
|
2001-08-06 14:55:02 +00:00
|
|
|
|
{
|
|
|
|
|
if (st != status_) {
|
|
|
|
|
status_ = st;
|
2002-02-16 15:59:55 +00:00
|
|
|
|
switch (st) {
|
2001-08-06 14:55:02 +00:00
|
|
|
|
case Inlined:
|
2002-03-06 10:17:29 +00:00
|
|
|
|
if (bv)
|
|
|
|
|
inset.setUpdateStatus(bv, InsetText::INIT);
|
2001-08-06 14:55:02 +00:00
|
|
|
|
break;
|
|
|
|
|
case Open:
|
|
|
|
|
collapsed_ = false;
|
|
|
|
|
setButtonLabel();
|
|
|
|
|
break;
|
|
|
|
|
case Collapsed:
|
|
|
|
|
collapsed_ = true;
|
|
|
|
|
setButtonLabel();
|
2001-08-07 08:05:31 +00:00
|
|
|
|
if (bv)
|
2001-08-07 15:07:36 +00:00
|
|
|
|
bv->unlockInset(const_cast<InsetERT *>(this));
|
2001-08-06 14:55:02 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2003-03-19 14:45:22 +00:00
|
|
|
|
if (bv) {
|
|
|
|
|
bv->updateInset(const_cast<InsetERT *>(this));
|
|
|
|
|
bv->buffer()->markDirty();
|
|
|
|
|
}
|
2001-08-06 14:55:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-10 22:12:07 +00:00
|
|
|
|
bool InsetERT::showInsetDialog(BufferView * bv) const
|
2001-08-06 14:55:02 +00:00
|
|
|
|
{
|
2003-02-25 14:51:38 +00:00
|
|
|
|
InsetERTMailer mailer(const_cast<InsetERT &>(*this));
|
2003-03-10 22:12:07 +00:00
|
|
|
|
mailer.showDialog(bv);
|
2001-08-06 14:55:02 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void InsetERT::open(BufferView * bv)
|
|
|
|
|
{
|
|
|
|
|
if (!collapsed_)
|
|
|
|
|
return;
|
|
|
|
|
status(bv, Open);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-08-07 15:07:36 +00:00
|
|
|
|
void InsetERT::close(BufferView * bv) const
|
2001-08-06 14:55:02 +00:00
|
|
|
|
{
|
2002-03-26 09:51:12 +00:00
|
|
|
|
if (status_ == Collapsed || status_ == Inlined)
|
2001-08-06 14:55:02 +00:00
|
|
|
|
return;
|
2002-03-26 09:51:12 +00:00
|
|
|
|
|
2001-08-06 14:55:02 +00:00
|
|
|
|
status(bv, Collapsed);
|
2001-07-31 09:53:40 +00:00
|
|
|
|
}
|
2001-09-24 14:29:27 +00:00
|
|
|
|
|
|
|
|
|
|
2002-08-13 14:40:38 +00:00
|
|
|
|
WordLangTuple const
|
|
|
|
|
InsetERT::selectNextWordToSpellcheck(BufferView * bv, float &) const
|
2001-09-24 14:29:27 +00:00
|
|
|
|
{
|
2002-02-20 14:55:17 +00:00
|
|
|
|
bv->unlockInset(const_cast<InsetERT *>(this));
|
2002-08-06 22:38:44 +00:00
|
|
|
|
return WordLangTuple();
|
2001-09-24 14:29:27 +00:00
|
|
|
|
}
|
2002-02-20 14:55:17 +00:00
|
|
|
|
|
2002-03-06 14:24:34 +00:00
|
|
|
|
|
2002-02-20 14:55:17 +00:00
|
|
|
|
void InsetERT::getDrawFont(LyXFont & font) const
|
|
|
|
|
{
|
|
|
|
|
LyXFont f(LyXFont::ALL_INHERIT, latex_language);
|
|
|
|
|
font = f;
|
|
|
|
|
font.setFamily(LyXFont::TYPEWRITER_FAMILY);
|
|
|
|
|
font.setColor(LColor::latex);
|
|
|
|
|
}
|
2002-03-05 14:55:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int InsetERT::getMaxWidth(BufferView * bv, UpdatableInset const * in) const
|
|
|
|
|
{
|
2002-03-06 10:17:29 +00:00
|
|
|
|
int w = InsetCollapsable::getMaxWidth(bv, in);
|
2002-03-05 14:55:20 +00:00
|
|
|
|
if (status_ != Inlined || w < 0)
|
|
|
|
|
return w;
|
|
|
|
|
LyXText * text = inset.getLyXText(bv);
|
2003-03-29 23:11:20 +00:00
|
|
|
|
int rw = text->rows().begin()->width();
|
2002-03-06 10:17:29 +00:00
|
|
|
|
if (!rw)
|
|
|
|
|
rw = w;
|
|
|
|
|
rw += 40;
|
2003-03-29 23:11:20 +00:00
|
|
|
|
if (text->rows().size() == 1 && rw < w)
|
2002-03-05 14:55:20 +00:00
|
|
|
|
return -1;
|
|
|
|
|
return w;
|
|
|
|
|
}
|
2002-05-31 12:17:28 +00:00
|
|
|
|
|
|
|
|
|
|
2003-03-20 14:13:49 +00:00
|
|
|
|
void InsetERT::update(BufferView * bv, bool reinit)
|
2002-05-31 12:17:28 +00:00
|
|
|
|
{
|
|
|
|
|
if (inset.need_update & InsetText::INIT ||
|
2003-03-20 14:13:49 +00:00
|
|
|
|
inset.need_update & InsetText::FULL) {
|
2002-05-31 12:17:28 +00:00
|
|
|
|
setButtonLabel();
|
|
|
|
|
}
|
2003-03-20 14:13:49 +00:00
|
|
|
|
|
|
|
|
|
InsetCollapsable::update(bv, reinit);
|
2002-05-31 12:17:28 +00:00
|
|
|
|
}
|
2003-02-25 14:51:38 +00:00
|
|
|
|
|
|
|
|
|
|
2003-03-07 14:08:10 +00:00
|
|
|
|
string const InsetERTMailer::name_("ert");
|
|
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
|
InsetERTMailer::InsetERTMailer(InsetERT & inset)
|
2003-03-07 14:08:10 +00:00
|
|
|
|
: inset_(inset)
|
2003-02-25 14:51:38 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string const InsetERTMailer::inset2string() const
|
|
|
|
|
{
|
2003-03-07 14:08:10 +00:00
|
|
|
|
return params2string(inset_.status());
|
2003-02-25 14:51:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void InsetERTMailer::string2params(string const & in,
|
|
|
|
|
InsetERT::ERTStatus & status)
|
|
|
|
|
{
|
|
|
|
|
status = InsetERT::Collapsed;
|
2003-02-27 13:26:07 +00:00
|
|
|
|
|
|
|
|
|
string name;
|
|
|
|
|
string body = split(in, name, ' ');
|
|
|
|
|
|
|
|
|
|
if (body.empty())
|
2003-02-25 14:51:38 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-02-27 13:26:07 +00:00
|
|
|
|
status = static_cast<InsetERT::ERTStatus>(strToInt(body));
|
2003-02-25 14:51:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string const
|
2003-03-07 14:08:10 +00:00
|
|
|
|
InsetERTMailer::params2string(InsetERT::ERTStatus status)
|
2003-02-25 14:51:38 +00:00
|
|
|
|
{
|
2003-03-07 14:08:10 +00:00
|
|
|
|
return name_ + ' ' + tostr(status);
|
2003-02-25 14:51:38 +00:00
|
|
|
|
}
|