]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
Fixed cut&paste bugs and added freespacing for ERT Insets.
[lyx.git] / src / paragraph.C
index df3964ccc48e25271d2c59eac235c7a1b5c9bc74..76311c25589cc39b6d4d60a381c2fbcea9f640f6 100644 (file)
@@ -928,8 +928,11 @@ void Paragraph::makeSameLayout(Paragraph const * par)
 
 int Paragraph::stripLeadingSpaces(LyXTextClassList::size_type tclass) 
 {
-       if (textclasslist.Style(tclass, getLayout()).free_spacing)
+       if (textclasslist.Style(tclass, getLayout()).free_spacing ||
+               isFreeSpacing())
+       {
                return 0;
+       }
        
        int i = 0;
        while (size()
@@ -2156,3 +2159,13 @@ Paragraph * Paragraph::getParFromID(int id) const
 {
        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;
+}