[LyX/master] Amend d2cbeea0113

Juergen Spitzmueller <[email protected]> Sun, 05 Jul 2026 07:42:11 +0000
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit 551f2455fb1572c761685e1a94997b4837e68659
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun Jul 5 09:41:34 2026 +0200

    Amend d2cbeea0113
    
    Check whether arguments are actually given
---
 src/insets/InsetFloat.cpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp
index 015dfd590b..c64c72e0e1 100644
--- a/src/insets/InsetFloat.cpp
+++ b/src/insets/InsetFloat.cpp
@@ -458,13 +458,19 @@ void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const
 	// We only output placement if different from the def_placement.
 	// sidewaysfloats always use their own page,
 	// therefore don't output the p option that is always set
-	InsetLayout const & il = getLayout();
 	bool const have_placement = !placement.empty()
 		&& (!params_.sideways || from_ascii(placement) != "p");
-	if (have_placement || !il.latexargs().empty()) {
+	// If the Float InsetLayout has an argument, we inherit it
+	docstring extargs;
+	if (!getLayout().latexargs().empty()) {
+		otexstringstream oss;
+		getArgs(oss, runparams);
+		extargs = oss.str();
+	}
+	if (have_placement || !extargs.empty()) {
 		os << '[';
-		if (!il.latexargs().empty()) {
-			getArgs(os, runparams);
+		if (!extargs.empty()) {
+			os << extargs;
 			if (have_placement)
 				os << ", ";
 		}
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs