Fix subfloat inset label (#11757)

This was broken at 9b7ccbfc/lyxgit
This commit is contained in:
Juergen Spitzmueller 2022-05-27 09:26:40 +02:00
parent 567d0e8fb4
commit cd3116bbf9
2 changed files with 12 additions and 1 deletions

View File

@ -879,12 +879,21 @@ bool InsetFloat::insetAllowed(InsetCode code) const
}
void InsetFloat::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
{
InsetCaptionable::updateBuffer(it, utype);
bool const subflt = (it.innerInsetOfType(FLOAT_CODE)
|| it.innerInsetOfType(WRAP_CODE));
setSubfloat(subflt);
}
void InsetFloat::setWide(bool w, bool update_label)
{
if (!buffer().params().documentClass().floats().allowsWide(params_.type))
params_.wide = false;
else
params_.wide = w;
params_.wide = w;
if (update_label)
setNewLabel();
}

View File

@ -111,6 +111,8 @@ private:
///
bool hasSubCaptions(ParIterator const & it) const override;
///
void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
///
void doDispatch(Cursor & cur, FuncRequest & cmd) override;
///
Inset * clone() const override { return new InsetFloat(*this); }