From ecf18084ff9c0ed222000f2708c1ed8cb3b1719f Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 30 Nov 2012 09:13:38 +0100 Subject: [PATCH] allow linebreak in argument delimiter string --- lib/doc/Customization.lyx | 100 ++++++++++++++++++++++++++++++++++--- src/Layout.cpp | 8 +++ src/insets/InsetLayout.cpp | 8 +++ 3 files changed, 109 insertions(+), 7 deletions(-) diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx index 52abb0be78..7320540dc5 100644 --- a/lib/doc/Customization.lyx +++ b/lib/doc/Customization.lyx @@ -10583,7 +10583,7 @@ Argument 2 \begin_layout Itemize -\change_inserted -712698321 1353681145 +\change_inserted -712698321 1354263104 \begin_inset Flex Code status collapsed @@ -10638,11 +10638,26 @@ status collapsed \end_inset ). + A line break in the output can be indicated by +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1354263104 +
+\end_layout + +\end_inset + +. +\change_unchanged + \end_layout \begin_layout Itemize -\change_inserted -712698321 1353917319 +\change_inserted -712698321 1354263106 \begin_inset Flex Code status collapsed @@ -10691,6 +10706,21 @@ status collapsed \end_inset ). + A line break in the output can be indicated by +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1354263106 +
+\end_layout + +\end_inset + +. +\change_unchanged + \end_layout \begin_layout Itemize @@ -12642,7 +12672,7 @@ depending upon the LaTeX type. \end_deeper \begin_layout Description -\change_inserted -712698321 1353866861 +\change_inserted -712698321 1354263086 \begin_inset Flex Code status collapsed @@ -12667,6 +12697,21 @@ string \end_inset ] A string that is put at the beginning of the style content. + A line break in the output can be indicated by +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1354263086 +
+\end_layout + +\end_inset + +. +\change_unchanged + \end_layout \begin_layout Description @@ -13671,7 +13716,7 @@ CopyStyle \begin_layout Description -\change_inserted -712698321 1353866881 +\change_inserted -712698321 1354263074 \begin_inset Flex Code status collapsed @@ -13696,6 +13741,21 @@ string \end_inset ] A string that is put at the end of the layout content. + A line break in the output can be indicated by +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1354263069 +
+\change_unchanged + +\end_layout + +\end_inset + +. \end_layout \begin_layout Description @@ -16792,7 +16852,7 @@ depending upon the LaTeX type. \end_deeper \begin_layout Description -\change_inserted -712698321 1353866797 +\change_inserted -712698321 1354263128 \begin_inset Flex Code status collapsed @@ -16819,7 +16879,20 @@ string \end_inset ] A string that is put at the beginning of the layout content. -\change_inserted 155139281 1354130509 + A line break in the output can be indicated by +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1354263128 +
+\end_layout + +\end_inset + +. +\change_unchanged \end_layout @@ -17292,7 +17365,7 @@ status collapsed \begin_layout Description -\change_inserted -712698321 1353866814 +\change_inserted -712698321 1354263134 \begin_inset Flex Code status collapsed @@ -17317,6 +17390,19 @@ string \end_inset ] A string that is put at the end of the layout content. + A line break in the output can be indicated by +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1354263134 +
+\end_layout + +\end_inset + +. \change_unchanged \end_layout diff --git a/src/Layout.cpp b/src/Layout.cpp index 95cb28bdbe..2ff77edafc 100644 --- a/src/Layout.cpp +++ b/src/Layout.cpp @@ -372,10 +372,14 @@ bool Layout::read(Lexer & lex, TextClass const & tclass) case LT_LEFTDELIM: lex >> leftdelim_; + leftdelim_ = support::subst(leftdelim_, from_ascii("
"), + from_ascii("\n")); break; case LT_RIGHTDELIM: lex >> rightdelim_; + rightdelim_ = support::subst(rightdelim_, from_ascii("
"), + from_ascii("\n")); break; case LT_INNERTAG: @@ -902,9 +906,13 @@ void Layout::readArgument(Lexer & lex) } else if (tok == "leftdelim") { lex.next(); arg.ldelim = lex.getDocString(); + arg.ldelim = support::subst(arg.ldelim, from_ascii("
"), + from_ascii("\n")); } else if (tok == "rightdelim") { lex.next(); arg.rdelim = lex.getDocString(); + arg.rdelim = support::subst(arg.rdelim, from_ascii("
"), + from_ascii("\n")); } else if (tok == "tooltip") { lex.next(); arg.tooltip = lex.getDocString(); diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp index aa9672e96d..0d9e88e909 100644 --- a/src/insets/InsetLayout.cpp +++ b/src/insets/InsetLayout.cpp @@ -237,12 +237,16 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass) break; case IL_LEFTDELIM: lex >> leftdelim_; + leftdelim_ = support::subst(leftdelim_, from_ascii("
"), + from_ascii("\n")); break; case IL_FORCE_LOCAL_FONT_SWITCH: lex >> forcelocalfontswitch_; break; case IL_RIGHTDELIM: lex >> rightdelim_; + rightdelim_ = support::subst(rightdelim_, from_ascii("
"), + from_ascii("\n")); break; case IL_LABELFONT: labelfont_ = lyxRead(lex, inherit_font); @@ -522,9 +526,13 @@ void InsetLayout::readArgument(Lexer & lex) } else if (tok == "leftdelim") { lex.next(); arg.ldelim = lex.getDocString(); + arg.ldelim = support::subst(arg.ldelim, + from_ascii("
"), from_ascii("\n")); } else if (tok == "rightdelim") { lex.next(); arg.rdelim = lex.getDocString(); + arg.rdelim = support::subst(arg.rdelim, + from_ascii("
"), from_ascii("\n")); } else if (tok == "tooltip") { lex.next(); arg.tooltip = lex.getDocString(); -- 2.39.5