static bool moveItem(Paragraph & fromPar, pos_type fromPos,
Paragraph & toPar, pos_type toPos, BufferParams const & params)
{
// Note: moveItem() does not honour change tracking!
// Therefore, it should only be used for breaking and merging paragraphs
static bool moveItem(Paragraph & fromPar, pos_type fromPos,
Paragraph & toPar, pos_type toPos, BufferParams const & params)
{
// Note: moveItem() does not honour change tracking!
// Therefore, it should only be used for breaking and merging paragraphs
Font const tmpFont = fromPar.getFontSettings(params, fromPos);
Change const tmpChange = fromPar.lookupChange(fromPos);
Font const tmpFont = fromPar.getFontSettings(params, fromPos);
Change const tmpChange = fromPar.lookupChange(fromPos);
- ParagraphList & pars, pit_type par_offset, pos_type pos, int flag)
+ ParagraphList & pars, pit_type par_offset, pos_type pos,
+ bool keep_layout)
{
// create a new paragraph, and insert into the list
ParagraphList::iterator tmp =
{
// create a new paragraph, and insert into the list
ParagraphList::iterator tmp =
tmp->layout(par.layout());
tmp->setLabelWidthString(par.params().labelWidthString());
tmp->params().depth(par.params().depth());
tmp->layout(par.layout());
tmp->setLabelWidthString(par.params().labelWidthString());
tmp->params().depth(par.params().depth());
tmp->layout(par.layout());
tmp->params().align(par.params().align());
tmp->setLabelWidthString(par.params().labelWidthString());
tmp->layout(par.layout());
tmp->params().align(par.params().align());
tmp->setLabelWidthString(par.params().labelWidthString());
par.layout(tmp->layout());
par.setLabelWidthString(tmp->params().labelWidthString());
par.params().depth(tmp->params().depth());
par.layout(tmp->layout());
par.setLabelWidthString(tmp->params().labelWidthString());
par.params().depth(tmp->params().depth());
// marked as unmodified. Otherwise, its change is adopted by the first
// character of the next paragraph.
if (par.lookupChange(par.size()).type != Change::UNCHANGED) {
// marked as unmodified. Otherwise, its change is adopted by the first
// character of the next paragraph.
if (par.lookupChange(par.size()).type != Change::UNCHANGED) {
Font const outerFont(pit_type par_offset, ParagraphList const & pars)
{
depth_type par_depth = pars[par_offset].getDepth();
Font const outerFont(pit_type par_offset, ParagraphList const & pars)
{
depth_type par_depth = pars[par_offset].getDepth();
- return tmpfont;
-}
-
-
-/// return the number of InsetOptArg in a paragraph
-int numberOfOptArgs(Paragraph const & par)
-{
- int num = 0;
-
- InsetList::const_iterator it = par.insetlist.begin();
- InsetList::const_iterator end = par.insetlist.end();
- for (; it != end ; ++it) {
- if (it->inset->lyxCode() == Inset::OPTARG_CODE)
- ++num;
- }
- return num;