Richard Heck wrote:
Abdelrazak Younes wrote:
Richard Heck wrote:
Abdelrazak Younes wrote:
Richard Heck wrote:
Abdelrazak Younes wrote:
3143       new paragraph doesn't reset text style
Patch for 3143 attached.

Richard



------------------------------------------------------------------------

Index: text3.C
===================================================================
--- text3.C    (revision 17581)
+++ text3.C    (working copy)
@@ -652,6 +652,8 @@
     case LFUN_BREAK_PARAGRAPH:
         cap::replaceSelection(cur);
         breakParagraph(cur, 0);
+        //Reset text style to default
+        setFont(cur, LyXFont(LyXFont::ALL_INHERIT), 0);
I am not very familiar with this but maybe it is better to put the
font setting at the end of breakParagraph(). I am worried about cases
(special layout) where this we should not do that. Is there any?
JMarc, Juergen?
I don't think special layouts will matter: The font will ultimately be
inherited from the layout of the new paragraph.

breakParagraph seems to be called five times: in buffer.C, by
insertStringAsLines; and in text3.C, for LFUN_BREAK_PARAGRAPH,
LFUN_BREAK_PARAGRAPH_KEEP_LAYOUT, LFUN_BREAK_PARAGRAPH_SKIP (which
itself calls LFUN_BREAK_PARAGRAPH if a paragraph will be broken), and
for LFUN_FLOAT_LIST. My sense was that the KEEP_LAYOUT version maybe
shouldn't reset the text style.  That's why I put it where I did. But I
doubt it matters very much, and I had it in breakParagraph myself at one
point.

This makes sense. Could someone more knowledgeable than me please confirm that Richard's fix is correct?

Abdel.

Reply via email to