Author: lasgouttes
Date: Tue Mar  8 15:41:01 2011
New Revision: 37881
URL: http://www.lyx.org/trac/changeset/37881

Log:
In the case of non-null paragraph separation, replace the hardcoded test for 
ERT and LISTINGS insets by proper check for newLineIsParBreak.

This fixes the display of sweave Chunks in sweave.lyx example, which uses 
parskip instead of indent.

The rest of the changes are just white space

Modified:
   lyx-devel/trunk/src/TextMetrics.cpp

Modified: lyx-devel/trunk/src/TextMetrics.cpp
==============================================================================
--- lyx-devel/trunk/src/TextMetrics.cpp Tue Mar  8 14:15:26 2011        (r37880)
+++ lyx-devel/trunk/src/TextMetrics.cpp Tue Mar  8 15:41:01 2011        (r37881)
@@ -1050,16 +1050,14 @@
        if (first == 0 && topBottomSpace) {
                BufferParams const & bufparams = buffer.params();
                // some parskips VERY EASY IMPLEMENTATION
-               if (bufparams.paragraph_separation
-                   == BufferParams::ParagraphSkipSeparation
-                       && inset.lyxCode() != ERT_CODE
-                       && inset.lyxCode() != LISTINGS_CODE
-                       && pit > 0
-                       && ((layout.isParagraph() && par.getDepth() == 0)
-                           || (pars[pit - 1].layout().isParagraph()
-                               && pars[pit - 1].getDepth() == 0)))
-               {
-                               maxasc += bufparams.getDefSkip().inPixels(*bv_);
+               if (bufparams.paragraph_separation == 
BufferParams::ParagraphSkipSeparation
+                   && !inset.getLayout().parbreakIsNewline()
+                   && !par.layout().parbreak_is_newline
+                   && pit > 0
+                   && ((layout.isParagraph() && par.getDepth() == 0)
+                       || (pars[pit - 1].layout().isParagraph()
+                           && pars[pit - 1].getDepth() == 0))) {
+                       maxasc += bufparams.getDefSkip().inPixels(*bv_);
                }
 
                if (par.params().startOfAppendix())

Reply via email to