http://bugzilla.lyx.org/show_bug.cgi?id=1999

The attached patch works perfectly for me.

What do you think?

Jürgen
Index: src/text.C
===================================================================
--- src/text.C	(Revision 13335)
+++ src/text.C	(Arbeitskopie)
@@ -2264,8 +2264,18 @@ string LyXText::getPossibleLabel(LCursor
 		}
 	}
 
-	string text = layout->latexname().substr(0, 3);
-	if (layout->latexname() == "theorem")
+	string name = layout->latexname();
+
+	// for captions, we want the abbreviation of the float type
+	if (layout->labeltype == LABEL_SENSITIVE) {
+		InsetBase * const in = &cur.inset();
+		if (in && in->lyxCode() == InsetBase::FLOAT_CODE
+		    || in->lyxCode() == InsetBase::WRAP_CODE)
+				name = in->getInsetName();
+	}
+
+	string text = name.substr(0, 3);
+	if (name == "theorem")
 		text = "thm"; // Create a correct prefix for prettyref
 
 	text += ':';

Reply via email to