The only real user was Text::insertStringAsLine, but this got changed
in commit
2c7152ab.
While not other place did read the value, there is a side effect of
setAutobreakRow that merges exiting paragraphs. However, this is used
in two situations
* some constructors, where the inset is empty;
* InsetTabular::toggleFixedWidth, which actually contains itself some
code to merge paragraphs.
Therefore the member and all associated code can be removed safely.
it.paragraph().setId(cloned_it.paragraph().id());
} else
d->inset = new InsetText(this);
- d->inset->setAutoBreakRows(true);
d->inset->getText(0)->setMacrocontextPosition(par_iterator_begin());
}
Text::Text(InsetText * owner, bool use_default_layout)
- : owner_(owner), autoBreakRows_(false)
+ : owner_(owner)
{
pars_.push_back(Paragraph());
Paragraph & par = pars_.back();
Text::Text(InsetText * owner, Text const & text)
- : owner_(owner), autoBreakRows_(text.autoBreakRows_)
+ : owner_(owner)
{
pars_ = text.pars_;
ParagraphList::iterator const end = pars_.end();
InsetText * owner_;
///
ParagraphList pars_;
- ///
- bool autoBreakRows_;
/// position of the text in the buffer.
DocIterator macrocontext_position_;
};
InsetCaption::InsetCaption(Buffer * buf, string const & type)
: InsetText(buf, InsetText::PlainLayout), type_(type)
{
- setAutoBreakRows(true);
setDrawFrame(true);
setFrameColor(Color_collapsableframe);
}
InsetCollapsable::InsetCollapsable(Buffer * buf, InsetText::UsePlain ltype)
: InsetText(buf, ltype), status_(Open), openinlined_(false)
{
- setAutoBreakRows(true);
setDrawFrame(true);
setFrameColor(Color_collapsableframe);
}
: InsetText(buf),
preview_(new RenderPreview(this)), use_preview_(true)
{
- setAutoBreakRows(true);
setDrawFrame(true);
setFrameColor(Color_insetframe);
}
InsetInfo::InsetInfo(Buffer * buf, string const & name)
: InsetCollapsable(buf), type_(UNKNOWN_INFO), name_()
{
- setAutoBreakRows(true);
setInfo(name);
status_ = Collapsed;
}
: InsetText(buf),
preview_(new RenderPreview(this)), use_preview_(true)
{
- setAutoBreakRows(true);
setDrawFrame(true);
setFrameColor(Color_previewframe);
}
*/
void toggleFixedWidth(Cursor & cur, InsetTableCell * inset, bool fixedWidth)
{
- inset->setAutoBreakRows(fixedWidth);
inset->toggleFixedWidth(fixedWidth);
if (fixedWidth)
return;
}
-void InsetText::setAutoBreakRows(bool flag)
-{
- if (flag == text_.autoBreakRows_)
- return;
-
- text_.autoBreakRows_ = flag;
- if (flag)
- return;
-
- // remove previously existing newlines
- ParagraphList::iterator it = paragraphs().begin();
- ParagraphList::iterator end = paragraphs().end();
- for (; it != end; ++it)
- for (int i = 0; i < it->size(); ++i)
- if (it->isNewline(i))
- // do not track the change, because the user
- // is not allowed to revert/reject it
- it->eraseChar(i, false);
-}
-
-
void InsetText::setDrawFrame(bool flag)
{
drawFrame_ = flag;
///
void setText(docstring const &, Font const &, bool trackChanges);
///
- void setAutoBreakRows(bool);
- ///
- bool getAutoBreakRows() const { return text_.autoBreakRows_; }
- ///
void setDrawFrame(bool);
///
ColorCode frameColor() const;