[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-cvs
Subject:    [LyX/master] Fix subfloat inset label (#11757)
From:       Juergen Spitzmueller <spitz () lyx ! org>
Date:       2022-05-27 6:47:17
Message-ID: 20220527064717.187C928065E () lyx ! lyx ! org
[Download RAW message or body]

commit cd3116bbf9ffb5e4853ff7b74a9fdf13a1cbe2dd
Author: Juergen Spitzmueller <spitz@lyx.org>
Date:   Fri May 27 09:26:40 2022 +0200

    Fix subfloat inset label (#11757)
    
    This was broken at 9b7ccbfc/lyxgit
---
 src/insets/InsetFloat.cpp |   11 ++++++++++-
 src/insets/InsetFloat.h   |    2 ++
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp
index 981d611..5404a73 100644
--- a/src/insets/InsetFloat.cpp
+++ b/src/insets/InsetFloat.cpp
@@ -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();
 }
diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h
index 9d20a48..20ee645 100644
--- a/src/insets/InsetFloat.h
+++ b/src/insets/InsetFloat.h
@@ -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); }
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic