2002-09-12 14:58:06 +00:00
|
|
|
|
/**
|
2007-04-26 04:41:58 +00:00
|
|
|
|
* \file paragraph_funcs.cpp
|
2002-09-12 14:58:06 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-08-21 17:35:24 +00:00
|
|
|
|
*
|
2002-09-12 14:58:06 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2002-08-21 17:35:24 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-12 14:58:06 +00:00
|
|
|
|
*/
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "paragraph_funcs.h"
|
2003-09-06 23:36:02 +00:00
|
|
|
|
|
2007-04-26 04:41:58 +00:00
|
|
|
|
#include "BufferParams.h"
|
2006-11-26 13:35:11 +00:00
|
|
|
|
#include "debug.h"
|
2007-04-26 04:41:58 +00:00
|
|
|
|
#include "LyXText.h"
|
|
|
|
|
#include "Paragraph.h"
|
2007-04-24 10:28:45 +00:00
|
|
|
|
#include "ParagraphParameters.h"
|
2003-10-30 08:47:16 +00:00
|
|
|
|
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
2003-05-19 17:03:12 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
using std::string;
|
2006-11-26 13:35:11 +00:00
|
|
|
|
using std::endl;
|
2003-07-31 13:12:21 +00:00
|
|
|
|
|
2005-02-24 13:17:45 +00:00
|
|
|
|
|
2006-11-05 18:39:03 +00:00
|
|
|
|
static bool moveItem(Paragraph & fromPar, pos_type fromPos,
|
|
|
|
|
Paragraph & toPar, pos_type toPos, BufferParams const & params)
|
2003-07-31 13:12:21 +00:00
|
|
|
|
{
|
2006-11-25 23:02:10 +00:00
|
|
|
|
// Note: moveItem() does not honour change tracking!
|
|
|
|
|
// Therefore, it should only be used for breaking and merging paragraphs
|
|
|
|
|
|
2006-11-05 18:39:03 +00:00
|
|
|
|
Paragraph::value_type const tmpChar = fromPar.getChar(fromPos);
|
|
|
|
|
LyXFont const tmpFont = fromPar.getFontSettings(params, fromPos);
|
|
|
|
|
Change const tmpChange = fromPar.lookupChange(fromPos);
|
2003-07-31 13:12:21 +00:00
|
|
|
|
|
2006-11-05 18:39:03 +00:00
|
|
|
|
if (tmpChar == Paragraph::META_INSET) {
|
|
|
|
|
InsetBase * tmpInset = 0;
|
|
|
|
|
if (fromPar.getInset(fromPos)) {
|
2006-11-25 23:02:10 +00:00
|
|
|
|
// the inset is not in the paragraph any more
|
2006-11-05 18:39:03 +00:00
|
|
|
|
tmpInset = fromPar.insetlist.release(fromPos);
|
2003-07-31 13:12:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-11-25 23:02:10 +00:00
|
|
|
|
fromPar.eraseChar(fromPos, false);
|
|
|
|
|
|
2006-11-05 18:39:03 +00:00
|
|
|
|
if (!toPar.insetAllowed(tmpInset->lyxCode())) {
|
|
|
|
|
delete tmpInset;
|
2003-07-31 13:12:21 +00:00
|
|
|
|
return false;
|
2004-03-27 13:24:16 +00:00
|
|
|
|
}
|
2006-11-25 23:02:10 +00:00
|
|
|
|
|
|
|
|
|
toPar.insertInset(toPos, tmpInset, tmpFont, tmpChange);
|
2003-07-31 13:12:21 +00:00
|
|
|
|
} else {
|
2006-11-25 23:02:10 +00:00
|
|
|
|
fromPar.eraseChar(fromPos, false);
|
2006-11-05 18:39:03 +00:00
|
|
|
|
toPar.insertChar(toPos, tmpChar, tmpFont, tmpChange);
|
2003-07-31 13:12:21 +00:00
|
|
|
|
}
|
2006-11-25 23:02:10 +00:00
|
|
|
|
|
2003-07-31 13:12:21 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-06 10:02:40 +00:00
|
|
|
|
void breakParagraph(BufferParams const & bparams,
|
2004-11-24 21:53:46 +00:00
|
|
|
|
ParagraphList & pars, pit_type par_offset, pos_type pos, int flag)
|
2002-08-20 19:41:13 +00:00
|
|
|
|
{
|
2003-03-04 19:52:35 +00:00
|
|
|
|
// create a new paragraph, and insert into the list
|
2004-03-25 09:16:36 +00:00
|
|
|
|
ParagraphList::iterator tmp =
|
2006-03-23 20:11:06 +00:00
|
|
|
|
pars.insert(boost::next(pars.begin(), par_offset + 1),
|
|
|
|
|
Paragraph());
|
2004-08-13 20:26:26 +00:00
|
|
|
|
|
|
|
|
|
Paragraph & par = pars[par_offset];
|
2003-03-04 21:40:36 +00:00
|
|
|
|
|
2002-08-21 15:39:54 +00:00
|
|
|
|
// without doing that we get a crash when typing <Return> at the
|
|
|
|
|
// end of a paragraph
|
|
|
|
|
tmp->layout(bparams.getLyXTextClass().defaultLayout());
|
2002-08-20 19:41:13 +00:00
|
|
|
|
// remember to set the inset_owner
|
2004-08-13 20:26:26 +00:00
|
|
|
|
tmp->setInsetOwner(par.inInset());
|
2002-08-21 17:35:24 +00:00
|
|
|
|
|
2002-08-20 19:41:13 +00:00
|
|
|
|
// layout stays the same with latex-environments
|
|
|
|
|
if (flag) {
|
2004-08-13 20:26:26 +00:00
|
|
|
|
tmp->layout(par.layout());
|
|
|
|
|
tmp->setLabelWidthString(par.params().labelWidthString());
|
2006-04-03 18:28:13 +00:00
|
|
|
|
tmp->params().depth(par.params().depth());
|
2006-09-15 09:38:40 +00:00
|
|
|
|
} else if (par.params().depth() > 0) {
|
|
|
|
|
Paragraph const & hook = pars[outerHook(par_offset, pars)];
|
|
|
|
|
tmp->layout(hook.layout());
|
|
|
|
|
// not sure the line below is useful
|
|
|
|
|
tmp->setLabelWidthString(par.params().labelWidthString());
|
|
|
|
|
tmp->params().depth(hook.params().depth());
|
2002-08-20 19:41:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-08-13 20:26:26 +00:00
|
|
|
|
bool const isempty = (par.allowEmpty() && par.empty());
|
2002-08-21 17:35:24 +00:00
|
|
|
|
|
2004-08-13 20:26:26 +00:00
|
|
|
|
if (!isempty && (par.size() > pos || par.empty() || flag == 2)) {
|
|
|
|
|
tmp->layout(par.layout());
|
|
|
|
|
tmp->params().align(par.params().align());
|
|
|
|
|
tmp->setLabelWidthString(par.params().labelWidthString());
|
2002-08-21 17:35:24 +00:00
|
|
|
|
|
2004-08-13 20:26:26 +00:00
|
|
|
|
tmp->params().depth(par.params().depth());
|
|
|
|
|
tmp->params().noindent(par.params().noindent());
|
2002-08-21 17:35:24 +00:00
|
|
|
|
|
2006-11-26 11:14:16 +00:00
|
|
|
|
// move everything behind the break position
|
2002-08-20 19:41:13 +00:00
|
|
|
|
// to the new paragraph
|
2002-11-07 00:37:09 +00:00
|
|
|
|
|
2004-03-28 19:13:11 +00:00
|
|
|
|
/* Note: if !keepempty, empty() == true, then we reach
|
|
|
|
|
* here with size() == 0. So pos_end becomes - 1. This
|
|
|
|
|
* doesn't cause problems because both loops below
|
|
|
|
|
* enforce pos <= pos_end and 0 <= pos
|
2002-11-07 00:37:09 +00:00
|
|
|
|
*/
|
2004-08-13 20:26:26 +00:00
|
|
|
|
pos_type pos_end = par.size() - 1;
|
2003-02-08 19:18:01 +00:00
|
|
|
|
|
2006-11-25 23:02:10 +00:00
|
|
|
|
for (pos_type i = pos, j = 0; i <= pos_end; ++i) {
|
|
|
|
|
if (moveItem(par, pos, *tmp, j, bparams)) {
|
2002-08-20 19:41:13 +00:00
|
|
|
|
++j;
|
2003-02-08 19:18:01 +00:00
|
|
|
|
}
|
2002-08-20 19:41:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2002-08-21 17:35:24 +00:00
|
|
|
|
|
2006-11-26 11:14:16 +00:00
|
|
|
|
// Move over the end-of-par change information
|
|
|
|
|
tmp->setChange(tmp->size(), par.lookupChange(par.size()));
|
|
|
|
|
par.setChange(par.size(), Change(bparams.trackChanges ?
|
|
|
|
|
Change::INSERTED : Change::UNCHANGED));
|
|
|
|
|
|
2004-08-13 20:26:26 +00:00
|
|
|
|
if (pos) {
|
|
|
|
|
// Make sure that we keep the language when
|
2006-11-25 23:02:10 +00:00
|
|
|
|
// breaking paragraph.
|
2004-08-13 20:26:26 +00:00
|
|
|
|
if (tmp->empty()) {
|
2006-02-05 13:20:16 +00:00
|
|
|
|
LyXFont changed = tmp->getFirstFontSettings(bparams);
|
2004-08-13 20:26:26 +00:00
|
|
|
|
LyXFont old = par.getFontSettings(bparams, par.size());
|
|
|
|
|
changed.setLanguage(old.language());
|
|
|
|
|
tmp->setFont(0, changed);
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-12 14:58:06 +00:00
|
|
|
|
return;
|
2004-08-13 20:26:26 +00:00
|
|
|
|
}
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2006-04-05 23:56:29 +00:00
|
|
|
|
if (!isempty) {
|
|
|
|
|
par.params().clear();
|
|
|
|
|
par.layout(bparams.getLyXTextClass().defaultLayout());
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-12 14:58:06 +00:00
|
|
|
|
// layout stays the same with latex-environments
|
|
|
|
|
if (flag) {
|
2004-08-13 20:26:26 +00:00
|
|
|
|
par.layout(tmp->layout());
|
|
|
|
|
par.setLabelWidthString(tmp->params().labelWidthString());
|
|
|
|
|
par.params().depth(tmp->params().depth());
|
2002-08-20 19:41:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-06 10:02:40 +00:00
|
|
|
|
void breakParagraphConservative(BufferParams const & bparams,
|
2004-11-24 21:53:46 +00:00
|
|
|
|
ParagraphList & pars, pit_type par_offset, pos_type pos)
|
2002-08-20 19:41:13 +00:00
|
|
|
|
{
|
|
|
|
|
// create a new paragraph
|
2006-03-23 20:11:06 +00:00
|
|
|
|
Paragraph & tmp = *pars.insert(boost::next(pars.begin(), par_offset + 1),
|
|
|
|
|
Paragraph());
|
2004-08-13 20:26:26 +00:00
|
|
|
|
Paragraph & par = pars[par_offset];
|
|
|
|
|
|
|
|
|
|
tmp.makeSameLayout(par);
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2006-11-25 23:02:10 +00:00
|
|
|
|
BOOST_ASSERT(pos <= par.size());
|
|
|
|
|
|
|
|
|
|
if (pos < par.size()) {
|
|
|
|
|
// move everything behind the break position to the new paragraph
|
2004-08-13 20:26:26 +00:00
|
|
|
|
pos_type pos_end = par.size() - 1;
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2006-11-25 23:02:10 +00:00
|
|
|
|
for (pos_type i = pos, j = 0; i <= pos_end; ++i) {
|
|
|
|
|
if (moveItem(par, pos, tmp, j, bparams)) {
|
2002-08-20 19:41:13 +00:00
|
|
|
|
++j;
|
2006-11-05 18:39:03 +00:00
|
|
|
|
}
|
2005-02-24 13:17:45 +00:00
|
|
|
|
}
|
2006-11-25 23:02:10 +00:00
|
|
|
|
// Move over the end-of-par change information
|
|
|
|
|
tmp.setChange(tmp.size(), par.lookupChange(par.size()));
|
|
|
|
|
par.setChange(par.size(), Change(bparams.trackChanges ?
|
|
|
|
|
Change::INSERTED : Change::UNCHANGED));
|
2002-08-20 19:41:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-06 10:02:40 +00:00
|
|
|
|
void mergeParagraph(BufferParams const & bparams,
|
2004-11-24 21:53:46 +00:00
|
|
|
|
ParagraphList & pars, pit_type par_offset)
|
2002-08-20 19:41:13 +00:00
|
|
|
|
{
|
2004-08-13 20:26:26 +00:00
|
|
|
|
Paragraph & next = pars[par_offset + 1];
|
|
|
|
|
Paragraph & par = pars[par_offset];
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
pos_type pos_end = next.size() - 1;
|
2004-08-13 20:26:26 +00:00
|
|
|
|
pos_type pos_insert = par.size();
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2006-11-26 13:35:11 +00:00
|
|
|
|
// the imaginary end-of-paragraph character (at par.size()) has to be
|
2006-11-05 19:00:53 +00:00
|
|
|
|
// marked as unmodified. Otherwise, its change is adopted by the first
|
|
|
|
|
// character of the next paragraph.
|
2006-11-26 13:35:11 +00:00
|
|
|
|
if (par.lookupChange(par.size()).type != Change::UNCHANGED) {
|
2007-04-01 10:09:49 +00:00
|
|
|
|
LYXERR(Debug::CHANGES) <<
|
2006-11-26 13:35:11 +00:00
|
|
|
|
"merging par with inserted/deleted end-of-par character" << endl;
|
|
|
|
|
par.setChange(par.size(), Change(Change::UNCHANGED));
|
|
|
|
|
}
|
2006-03-16 06:54:08 +00:00
|
|
|
|
|
2006-11-05 19:00:53 +00:00
|
|
|
|
Change change = next.lookupChange(next.size());
|
2006-11-26 13:35:11 +00:00
|
|
|
|
|
|
|
|
|
// move the content of the second paragraph to the end of the first one
|
2006-11-25 23:02:10 +00:00
|
|
|
|
for (pos_type i = 0, j = pos_insert; i <= pos_end; ++i) {
|
|
|
|
|
if (moveItem(next, 0, par, j, bparams)) {
|
2002-08-20 19:41:13 +00:00
|
|
|
|
++j;
|
2006-11-05 18:39:03 +00:00
|
|
|
|
}
|
2005-02-24 13:17:45 +00:00
|
|
|
|
}
|
2006-11-26 13:35:11 +00:00
|
|
|
|
|
|
|
|
|
// move the change of the end-of-paragraph character
|
2006-11-05 19:00:53 +00:00
|
|
|
|
par.setChange(par.size(), change);
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2006-03-23 20:11:06 +00:00
|
|
|
|
pars.erase(boost::next(pars.begin(), par_offset + 1));
|
2002-08-20 19:41:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
pit_type depthHook(pit_type pit, ParagraphList const & pars, depth_type depth)
|
2002-08-20 19:41:13 +00:00
|
|
|
|
{
|
2004-11-24 21:53:46 +00:00
|
|
|
|
pit_type newpit = pit;
|
2002-08-20 19:41:13 +00:00
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
if (newpit != 0)
|
2003-04-16 08:12:22 +00:00
|
|
|
|
--newpit;
|
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
while (newpit != 0 && pars[newpit].getDepth() > depth)
|
2003-04-16 08:12:22 +00:00
|
|
|
|
--newpit;
|
2003-04-14 18:35:29 +00:00
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
if (pars[newpit].getDepth() > depth)
|
2003-04-16 08:12:22 +00:00
|
|
|
|
return pit;
|
|
|
|
|
|
|
|
|
|
return newpit;
|
2002-08-20 19:41:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-11-24 21:53:46 +00:00
|
|
|
|
pit_type outerHook(pit_type par_offset, ParagraphList const & pars)
|
2002-08-20 19:41:13 +00:00
|
|
|
|
{
|
2004-08-13 20:26:26 +00:00
|
|
|
|
Paragraph const & par = pars[par_offset];
|
|
|
|
|
|
|
|
|
|
if (par.getDepth() == 0)
|
2004-03-25 09:16:36 +00:00
|
|
|
|
return pars.size();
|
2006-10-21 00:16:43 +00:00
|
|
|
|
return depthHook(par_offset, pars, depth_type(par.getDepth() - 1));
|
2002-08-20 19:41:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-11-24 21:53:46 +00:00
|
|
|
|
bool isFirstInSequence(pit_type par_offset, ParagraphList const & pars)
|
2002-08-20 19:41:13 +00:00
|
|
|
|
{
|
2004-08-13 20:26:26 +00:00
|
|
|
|
Paragraph const & par = pars[par_offset];
|
|
|
|
|
|
2004-11-24 21:53:46 +00:00
|
|
|
|
pit_type dhook_offset = depthHook(par_offset, pars, par.getDepth());
|
2004-08-13 20:26:26 +00:00
|
|
|
|
|
2007-01-11 18:50:39 +00:00
|
|
|
|
if (dhook_offset == par_offset)
|
|
|
|
|
return true;
|
|
|
|
|
|
2004-08-13 20:26:26 +00:00
|
|
|
|
Paragraph const & dhook = pars[dhook_offset];
|
|
|
|
|
|
2007-01-11 18:50:39 +00:00
|
|
|
|
return dhook.layout() != par.layout()
|
2004-08-13 20:26:26 +00:00
|
|
|
|
|| dhook.getDepth() != par.getDepth();
|
2002-08-20 19:41:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-11-24 21:53:46 +00:00
|
|
|
|
int getEndLabel(pit_type p, ParagraphList const & pars)
|
2002-08-20 19:41:13 +00:00
|
|
|
|
{
|
2004-11-24 21:53:46 +00:00
|
|
|
|
pit_type pit = p;
|
2006-10-21 00:16:43 +00:00
|
|
|
|
depth_type par_depth = pars[p].getDepth();
|
2004-11-24 21:53:46 +00:00
|
|
|
|
while (pit != pit_type(pars.size())) {
|
2004-03-25 09:16:36 +00:00
|
|
|
|
LyXLayout_ptr const & layout = pars[pit].layout();
|
2003-04-14 18:35:29 +00:00
|
|
|
|
int const endlabeltype = layout->endlabeltype;
|
|
|
|
|
|
2002-08-20 19:41:13 +00:00
|
|
|
|
if (endlabeltype != END_LABEL_NO_LABEL) {
|
2004-11-24 21:53:46 +00:00
|
|
|
|
if (p + 1 == pit_type(pars.size()))
|
2002-08-20 19:41:13 +00:00
|
|
|
|
return endlabeltype;
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
depth_type const next_depth =
|
2004-03-25 09:16:36 +00:00
|
|
|
|
pars[p + 1].getDepth();
|
2002-08-20 19:41:13 +00:00
|
|
|
|
if (par_depth > next_depth ||
|
2004-03-25 09:16:36 +00:00
|
|
|
|
(par_depth == next_depth && layout != pars[p + 1].layout()))
|
2002-08-20 19:41:13 +00:00
|
|
|
|
return endlabeltype;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (par_depth == 0)
|
|
|
|
|
break;
|
2004-03-25 09:16:36 +00:00
|
|
|
|
pit = outerHook(pit, pars);
|
2004-11-24 21:53:46 +00:00
|
|
|
|
if (pit != pit_type(pars.size()))
|
2004-03-25 09:16:36 +00:00
|
|
|
|
par_depth = pars[pit].getDepth();
|
2002-08-20 19:41:13 +00:00
|
|
|
|
}
|
|
|
|
|
return END_LABEL_NO_LABEL;
|
|
|
|
|
}
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
|
|
|
|
|
2004-11-24 21:53:46 +00:00
|
|
|
|
LyXFont const outerFont(pit_type par_offset, ParagraphList const & pars)
|
2003-03-12 11:52:23 +00:00
|
|
|
|
{
|
2006-10-21 00:16:43 +00:00
|
|
|
|
depth_type par_depth = pars[par_offset].getDepth();
|
2003-04-15 00:11:03 +00:00
|
|
|
|
LyXFont tmpfont(LyXFont::ALL_INHERIT);
|
2003-04-14 18:35:29 +00:00
|
|
|
|
|
|
|
|
|
// Resolve against environment font information
|
2004-11-24 21:53:46 +00:00
|
|
|
|
while (par_offset != pit_type(pars.size())
|
2004-03-27 01:18:51 +00:00
|
|
|
|
&& par_depth
|
|
|
|
|
&& !tmpfont.resolved()) {
|
2004-08-13 20:26:26 +00:00
|
|
|
|
par_offset = outerHook(par_offset, pars);
|
2004-11-24 21:53:46 +00:00
|
|
|
|
if (par_offset != pit_type(pars.size())) {
|
2004-08-13 20:26:26 +00:00
|
|
|
|
tmpfont.realize(pars[par_offset].layout()->font);
|
|
|
|
|
par_depth = pars[par_offset].getDepth();
|
2003-04-14 18:35:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-04-15 00:11:03 +00:00
|
|
|
|
return tmpfont;
|
|
|
|
|
}
|
2003-08-26 14:50:16 +00:00
|
|
|
|
|
|
|
|
|
|
2004-11-19 16:17:52 +00:00
|
|
|
|
/// return the number of InsetOptArg in a paragraph
|
|
|
|
|
int numberOfOptArgs(Paragraph const & par)
|
|
|
|
|
{
|
|
|
|
|
int num = 0;
|
2004-11-26 14:52:54 +00:00
|
|
|
|
|
2004-11-19 16:17:52 +00:00
|
|
|
|
InsetList::const_iterator it = par.insetlist.begin();
|
|
|
|
|
InsetList::const_iterator end = par.insetlist.end();
|
|
|
|
|
for (; it != end ; ++it) {
|
2004-11-26 14:52:54 +00:00
|
|
|
|
if (it->inset->lyxCode() == InsetBase::OPTARG_CODE)
|
2004-11-19 16:17:52 +00:00
|
|
|
|
++num;
|
|
|
|
|
}
|
|
|
|
|
return num;
|
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|