Paragraph::Paragraph()
- : pimpl_(new Paragraph::Pimpl(this))
+ : layout(0), pimpl_(new Paragraph::Pimpl(this))
{
- for (int i = 0; i < 10; ++i) setCounter(i , 0);
+ for (int i = 0; i < 10; ++i)
+ setCounter(i, 0);
next_ = 0;
previous_ = 0;
enumdepth = 0;
}
-// This konstruktor inserts the new paragraph in a list.
+// This constructor inserts the new paragraph in a list.
Paragraph::Paragraph(Paragraph * par)
- : pimpl_(new Paragraph::Pimpl(this))
+ : layout(0), pimpl_(new Paragraph::Pimpl(this))
{
for (int i = 0; i < 10; ++i)
setCounter(i, 0);
Paragraph::Paragraph(Paragraph const & lp, bool same_ids)
- : pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this, same_ids))
+ : layout(0), pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this, same_ids))
{
for (int i = 0; i < 10; ++i)
setCounter(i, 0);
it != insetlist.end(); ++it)
{
it->inset = it->inset->clone(*current_view->buffer(), same_ids);
+ // tell the new inset who is the boss now
+ it->inset->parOwner(this);
}
}
search_elem, Pimpl::matchIT());
if (it != insetlist.end() && it->pos == pos)
it->inset = 0;
+ // the inset is not in a paragraph anymore
+ minibuffer_inset->parOwner(0);
} else {
minibuffer_inset = 0;
minibuffer_char = ' ';
}
-int Paragraph::stripLeadingSpaces(LyXTextClassList::size_type tclass)
+int Paragraph::stripLeadingSpaces(lyx::textclass_type tclass)
{
- if (textclasslist.Style(tclass, getLayout()).free_spacing)
+ if (textclasslist.Style(tclass, getLayout()).free_spacing ||
+ isFreeSpacing())
+ {
return 0;
+ }
int i = 0;
- while (size()
- && (isNewline(0) || isLineSeparator(0))){
+ while (size() && (isNewline(0) || isLineSeparator(0))) {
erase(0);
++i;
}
while (index < insetlist.size()) {
if (insetlist[index].inset && insetlist[index].inset->autoDelete()) {
erase(insetlist[index].pos);
- // Erase() calls to insetlist.erase(&insetlist[index])
+ // erase() calls to insetlist.erase(&insetlist[index])
// so index shouldn't be increased.
++count;
} else
// returns -1 if inset not found
-int Paragraph::getPositionOfInset(Inset * inset) const
+int Paragraph::getPositionOfInset(Inset const * inset) const
{
// Find the entry.
for (InsetList::const_iterator cit = insetlist.begin();
if (style.isEnvironment()) {
os << "\\end{" << style.latexname() << "}\n";
+ texrow.newline();
}
lyxerr[Debug::LATEX] << "TeXEnvironment...done " << par << endl;
{
return pimpl_->getParFromID(id);
}
+
+
+bool Paragraph::isFreeSpacing() const
+{
+ // for now we just need this, later should we need this in some
+ // other way we can always add a function to Inset::() too.
+ if (pimpl_->inset_owner && pimpl_->inset_owner->owner())
+ return (pimpl_->inset_owner->owner()->lyxCode() == Inset::ERT_CODE);
+ return false;
+}