mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Cleanup handling of LFUN_LAYOUT_PARAGRAPH in getStatus
The way it works is: * the inset defines allowParagraphCustomization() correctly * Text::getStatus acts on it. Note that, in Text::getStatus, testing for cur.inset().allowParagraphCustomization() does not make much sense, since one should pass the cursor idx as parameter. Actually, for some reason the safest bet is to use the owner of the Text object as inset.
This commit is contained in:
parent
0d21dca360
commit
ccc8ad4744
@ -3145,7 +3145,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
case LFUN_PARAGRAPH_PARAMS:
|
||||
case LFUN_PARAGRAPH_PARAMS_APPLY:
|
||||
case LFUN_PARAGRAPH_UPDATE:
|
||||
enable = cur.inset().allowParagraphCustomization();
|
||||
enable = owner_->allowParagraphCustomization();
|
||||
break;
|
||||
|
||||
// FIXME: why are accent lfuns forbidden with pass_thru layouts?
|
||||
|
@ -263,7 +263,6 @@ bool InsetScript::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
FuncStatus & flag) const
|
||||
{
|
||||
switch (cmd.action()) {
|
||||
case LFUN_LAYOUT_PARAGRAPH:
|
||||
case LFUN_MATH_DISPLAY:
|
||||
case LFUN_BOX_INSERT:
|
||||
case LFUN_BRANCH_INSERT:
|
||||
|
@ -82,6 +82,8 @@ public:
|
||||
///
|
||||
bool forcePlainLayout(idx_type = 0) const { return true; }
|
||||
///
|
||||
bool allowParagraphCustomization(idx_type = 0) const { return false; }
|
||||
///
|
||||
bool neverIndent() const { return true; }
|
||||
///
|
||||
int plaintext(odocstringstream & ods, OutputParams const & op,
|
||||
|
@ -3413,10 +3413,6 @@ bool InsetTableCell::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
{
|
||||
bool enabled = true;
|
||||
switch (cmd.action()) {
|
||||
case LFUN_LAYOUT_PARAGRAPH:
|
||||
enabled = allowParagraphCustomization();
|
||||
break;
|
||||
|
||||
case LFUN_MATH_DISPLAY:
|
||||
if (!hasFixedWidth()) {
|
||||
enabled = false;
|
||||
|
Loading…
Reference in New Issue
Block a user