mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-12 16:50:39 +00:00
Make LYX_ALIGN_LAYOUT always be available. (Trunk committed at r19332).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@19810 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
85c58e0337
commit
896b797e05
@ -115,7 +115,7 @@ Layout::Layout ()
|
|||||||
labelbottomsep = 0.0;
|
labelbottomsep = 0.0;
|
||||||
parsep = 0;
|
parsep = 0;
|
||||||
align = LYX_ALIGN_BLOCK;
|
align = LYX_ALIGN_BLOCK;
|
||||||
alignpossible = LYX_ALIGN_BLOCK;
|
alignpossible = LYX_ALIGN_NONE | LYX_ALIGN_LAYOUT;
|
||||||
labeltype = LABEL_NO_LABEL;
|
labeltype = LABEL_NO_LABEL;
|
||||||
endlabeltype = END_LABEL_NO_LABEL;
|
endlabeltype = END_LABEL_NO_LABEL;
|
||||||
// Should or should not. That is the question.
|
// Should or should not. That is the question.
|
||||||
@ -552,7 +552,7 @@ void Layout::readAlignPossible(Lexer & lexrc)
|
|||||||
};
|
};
|
||||||
|
|
||||||
lexrc.pushTable(alignTags, AT_LAYOUT);
|
lexrc.pushTable(alignTags, AT_LAYOUT);
|
||||||
alignpossible = LYX_ALIGN_NONE;
|
alignpossible = LYX_ALIGN_NONE | LYX_ALIGN_LAYOUT;
|
||||||
int lineno = lexrc.getLineNo();
|
int lineno = lexrc.getLineNo();
|
||||||
do {
|
do {
|
||||||
int le = lexrc.lex();
|
int le = lexrc.lex();
|
||||||
|
@ -78,6 +78,13 @@ void operator|=(LyXAlignment & la1, LyXAlignment la2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
inline
|
||||||
|
LyXAlignment operator|(LyXAlignment la1, LyXAlignment la2) {
|
||||||
|
return static_cast<LyXAlignment>(static_cast<int>(la1) | static_cast<int>(la2));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// The different LaTeX-Types
|
/// The different LaTeX-Types
|
||||||
enum LYX_LATEX_TYPES {
|
enum LYX_LATEX_TYPES {
|
||||||
///
|
///
|
||||||
|
@ -1685,10 +1685,8 @@ void Paragraph::applyLayout(Layout_ptr const & new_layout)
|
|||||||
{
|
{
|
||||||
layout(new_layout);
|
layout(new_layout);
|
||||||
LyXAlignment const oldAlign = params().align();
|
LyXAlignment const oldAlign = params().align();
|
||||||
// FIXME The first check is due to the fact that LYX_ALIGN_LAYOUT
|
|
||||||
// is not required to be possible. A fix is on the way.
|
if (!(oldAlign & layout()->alignpossible)) {
|
||||||
if ((oldAlign != LYX_ALIGN_LAYOUT) &&
|
|
||||||
!(oldAlign & layout()->alignpossible)) {
|
|
||||||
frontend::Alert::warning(_("Alignment not permitted"),
|
frontend::Alert::warning(_("Alignment not permitted"),
|
||||||
_("The new layout does not permit the alignment previously used.\nSetting to default."));
|
_("The new layout does not permit the alignment previously used.\nSetting to default."));
|
||||||
params().align(LYX_ALIGN_LAYOUT);
|
params().align(LYX_ALIGN_LAYOUT);
|
||||||
|
@ -253,8 +253,7 @@ void ParagraphParameters::apply(
|
|||||||
{
|
{
|
||||||
spacing(p.spacing());
|
spacing(p.spacing());
|
||||||
// does the layout allow the new alignment?
|
// does the layout allow the new alignment?
|
||||||
if ((p.align() == LYX_ALIGN_LAYOUT) ||
|
if (p.align() & layout.alignpossible)
|
||||||
(p.align() & layout.alignpossible))
|
|
||||||
align(p.align());
|
align(p.align());
|
||||||
labelWidthString(p.labelWidthString());
|
labelWidthString(p.labelWidthString());
|
||||||
noindent(p.noindent());
|
noindent(p.noindent());
|
||||||
|
@ -117,11 +117,7 @@ void QParagraphDialog::checkAlignmentRadioButtons() {
|
|||||||
QPRadioMap::iterator it = radioMap.begin();
|
QPRadioMap::iterator it = radioMap.begin();
|
||||||
for (; it != radioMap.end(); ++it) {
|
for (; it != radioMap.end(); ++it) {
|
||||||
LyXAlignment const align = it->first;
|
LyXAlignment const align = it->first;
|
||||||
//FIXME The reason we need the second check is because
|
it->second->setEnabled(align & alignPossible);
|
||||||
//LYX_ALIGN_LAYOUT isn't required to be possible. It
|
|
||||||
//should be...and will be.
|
|
||||||
it->second->setEnabled((align & alignPossible) ||
|
|
||||||
(align == LYX_ALIGN_LAYOUT));
|
|
||||||
}
|
}
|
||||||
docstring label = labelMap[LYX_ALIGN_LAYOUT];
|
docstring label = labelMap[LYX_ALIGN_LAYOUT];
|
||||||
if (!form_->controller().haveMulitParSelection())
|
if (!form_->controller().haveMulitParSelection())
|
||||||
|
Loading…
Reference in New Issue
Block a user