]> git.lyx.org Git - features.git/commitdiff
In the case of non-null paragraph separation, replace the hardcoded test for ERT...
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 8 Mar 2011 14:41:01 +0000 (14:41 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 8 Mar 2011 14:41:01 +0000 (14:41 +0000)
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

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37881 a592a061-630c-0410-9148-cb99ea01b6c8

src/TextMetrics.cpp

index 4ca0592e74fa8e7779c2c9561b34d8ba077735f9..7d967f37a2be7e8c31f00786563494ef2028cb1d 100644 (file)
@@ -1050,16 +1050,14 @@ Dimension TextMetrics::rowHeight(pit_type const pit, pos_type const first,
        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())