mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Make layout membership to ParagraphGroup settable (see #6854)
This commit is contained in:
parent
83a9ed4e62
commit
eb748d6330
@ -186,6 +186,9 @@ import os, re, string, sys
|
|||||||
# Incremented to format 56, 20 May 2015 by spitz
|
# Incremented to format 56, 20 May 2015 by spitz
|
||||||
# New Float tags "AllowedPlacement", "AllowsWide", "AllowsSideways"
|
# New Float tags "AllowedPlacement", "AllowsWide", "AllowsSideways"
|
||||||
|
|
||||||
|
# Incremented to format 57, 30 May 2015 by spitz
|
||||||
|
# New Layout tag "ParagraphGroup"
|
||||||
|
|
||||||
# Do not forget to document format change in Customization
|
# Do not forget to document format change in Customization
|
||||||
# Manual (section "Declaring a new text class").
|
# Manual (section "Declaring a new text class").
|
||||||
|
|
||||||
@ -193,7 +196,7 @@ import os, re, string, sys
|
|||||||
# development/tools/updatelayouts.py script to update all
|
# development/tools/updatelayouts.py script to update all
|
||||||
# layout files to the new format.
|
# layout files to the new format.
|
||||||
|
|
||||||
currentFormat = 56
|
currentFormat = 57
|
||||||
|
|
||||||
|
|
||||||
def usage(prog_name):
|
def usage(prog_name):
|
||||||
@ -417,7 +420,7 @@ def convert(lines):
|
|||||||
i += 1
|
i += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if format >= 50 and format <= 55:
|
if format >= 50 and format <= 56:
|
||||||
# nothing to do.
|
# nothing to do.
|
||||||
i += 1
|
i += 1
|
||||||
continue
|
continue
|
||||||
|
@ -75,6 +75,7 @@ enum LayoutTags {
|
|||||||
LT_NEED_PROTECT,
|
LT_NEED_PROTECT,
|
||||||
LT_NEWLINE,
|
LT_NEWLINE,
|
||||||
LT_NEXTNOINDENT,
|
LT_NEXTNOINDENT,
|
||||||
|
LT_PAR_GROUP,
|
||||||
LT_PARINDENT,
|
LT_PARINDENT,
|
||||||
LT_PARSEP,
|
LT_PARSEP,
|
||||||
LT_PARSKIP,
|
LT_PARSKIP,
|
||||||
@ -151,6 +152,7 @@ Layout::Layout()
|
|||||||
forcelocal = 0;
|
forcelocal = 0;
|
||||||
itemcommand_ = "item";
|
itemcommand_ = "item";
|
||||||
toggle_indent = ITOGGLE_DOCUMENT_DEFAULT;
|
toggle_indent = ITOGGLE_DOCUMENT_DEFAULT;
|
||||||
|
par_group_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -231,6 +233,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
|
|||||||
{ "newline", LT_NEWLINE },
|
{ "newline", LT_NEWLINE },
|
||||||
{ "nextnoindent", LT_NEXTNOINDENT },
|
{ "nextnoindent", LT_NEXTNOINDENT },
|
||||||
{ "obsoletedby", LT_OBSOLETEDBY },
|
{ "obsoletedby", LT_OBSOLETEDBY },
|
||||||
|
{ "paragraphgroup", LT_PAR_GROUP },
|
||||||
{ "parbreakisnewline", LT_PARBREAK_IS_NEWLINE },
|
{ "parbreakisnewline", LT_PARBREAK_IS_NEWLINE },
|
||||||
{ "parindent", LT_PARINDENT },
|
{ "parindent", LT_PARINDENT },
|
||||||
{ "parsep", LT_PARSEP },
|
{ "parsep", LT_PARSEP },
|
||||||
@ -542,6 +545,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
|
|||||||
counter = trim(counter);
|
counter = trim(counter);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LT_PAR_GROUP:
|
||||||
|
lex >> par_group_;
|
||||||
|
break;
|
||||||
|
|
||||||
case LT_FREE_SPACING:
|
case LT_FREE_SPACING:
|
||||||
lex >> free_spacing;
|
lex >> free_spacing;
|
||||||
break;
|
break;
|
||||||
@ -875,12 +882,15 @@ void Layout::readLatexType(Lexer & lex)
|
|||||||
return;
|
return;
|
||||||
case LATEX_PARAGRAPH:
|
case LATEX_PARAGRAPH:
|
||||||
case LATEX_COMMAND:
|
case LATEX_COMMAND:
|
||||||
case LATEX_ENVIRONMENT:
|
|
||||||
case LATEX_ITEM_ENVIRONMENT:
|
case LATEX_ITEM_ENVIRONMENT:
|
||||||
case LATEX_BIB_ENVIRONMENT:
|
|
||||||
case LATEX_LIST_ENVIRONMENT:
|
case LATEX_LIST_ENVIRONMENT:
|
||||||
latextype = static_cast<LatexType>(le);
|
latextype = static_cast<LatexType>(le);
|
||||||
break;
|
break;
|
||||||
|
case LATEX_ENVIRONMENT:
|
||||||
|
case LATEX_BIB_ENVIRONMENT:
|
||||||
|
latextype = static_cast<LatexType>(le);
|
||||||
|
par_group_ = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
LYXERR0("Unhandled value " << le);
|
LYXERR0("Unhandled value " << le);
|
||||||
break;
|
break;
|
||||||
@ -1210,6 +1220,7 @@ void Layout::write(ostream & os) const
|
|||||||
os << "\tEndLabelType Static\n";
|
os << "\tEndLabelType Static\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
os << "\tParagraphGroup \"" << par_group_ << "\"\n";
|
||||||
if (!leftmargin.empty())
|
if (!leftmargin.empty())
|
||||||
os << "\tLeftMargin \"" << to_utf8(leftmargin) << "\"\n";
|
os << "\tLeftMargin \"" << to_utf8(leftmargin) << "\"\n";
|
||||||
if (!rightmargin.empty())
|
if (!rightmargin.empty())
|
||||||
|
@ -190,10 +190,7 @@ public:
|
|||||||
}
|
}
|
||||||
/// Is this the kind of layout in which adjacent paragraphs
|
/// Is this the kind of layout in which adjacent paragraphs
|
||||||
/// are handled as one group?
|
/// are handled as one group?
|
||||||
bool isParagraphGroup() const {
|
bool isParagraphGroup() const { return par_group_; }
|
||||||
return latextype == LATEX_ENVIRONMENT
|
|
||||||
|| latextype == LATEX_BIB_ENVIRONMENT;
|
|
||||||
}
|
|
||||||
///
|
///
|
||||||
bool labelIsInline() const {
|
bool labelIsInline() const {
|
||||||
return labeltype == LABEL_STATIC
|
return labeltype == LABEL_STATIC
|
||||||
@ -452,6 +449,8 @@ private:
|
|||||||
docstring langpreamble_;
|
docstring langpreamble_;
|
||||||
/// Language and babel dependent macro definitions needed for this layout
|
/// Language and babel dependent macro definitions needed for this layout
|
||||||
docstring babelpreamble_;
|
docstring babelpreamble_;
|
||||||
|
/// Are adjacent paragraphs handled as one group?
|
||||||
|
bool par_group_;
|
||||||
/// Packages needed for this layout
|
/// Packages needed for this layout
|
||||||
std::set<std::string> requires_;
|
std::set<std::string> requires_;
|
||||||
///
|
///
|
||||||
|
@ -61,7 +61,7 @@ namespace lyx {
|
|||||||
// You should also run the development/tools/updatelayouts.py script,
|
// You should also run the development/tools/updatelayouts.py script,
|
||||||
// to update the format of all of our layout files.
|
// to update the format of all of our layout files.
|
||||||
//
|
//
|
||||||
int const LAYOUT_FORMAT = 56; //spitz: New Float tags AllowedPlacement, AllowsWide, AllowsSideways
|
int const LAYOUT_FORMAT = 57; //spitz: New Layout tag ParagraphGroup
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user