From: Jürgen Vigna Date: Tue, 18 Jul 2000 10:58:30 +0000 (+0000) Subject: Small change for Lars's float-inset so that the caption-label is correct. X-Git-Tag: 1.6.10~22111 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0d6da9afad9d56247b7e4f77ecfe4df49a972bca;p=features.git Small change for Lars's float-inset so that the caption-label is correct. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@893 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index 491d8990d6..061a00f32b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-07-18 Juergen Vigna + + * src/insets/insetfloat.C (InsetFloat): use setInsetName to set the + name of the inset so that it can be requested outside (text2.C). + + * src/text2.C (SetCounter): modified so it sees insetfloat for caption + labels. + 2000-07-17 Lars Gullik Bjønnes * src/mathed/formula.h (ConvertFont): constify diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index 55eccaa7bc..b4792cf16d 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -92,6 +92,7 @@ InsetFloat::InsetFloat(string const & type) setAutoCollapse(false); setInsetName("Float"); floatType = type; + setInsetName(type.c_str()); //floatPlacement = "H"; } diff --git a/src/text2.C b/src/text2.C index 45172be79a..3e5d1479d8 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1933,20 +1933,24 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const string s = layout.labelstring(); // the caption hack: - if (layout.labeltype == LABEL_SENSITIVE) { - if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE + bool isOK = (par->InInset() && par->InInset()->owner() && + (par->InInset()->owner()->LyxCode()==Inset::FLOAT_CODE)); + if ((isOK && (par->InInset()->owner()->getInsetName() == "figure")) || + (par->footnoteflag != LyXParagraph::NO_FOOTNOTE && (par->footnotekind == LyXParagraph::FIG - || par->footnotekind == LyXParagraph::WIDE_FIG)) + || par->footnotekind == LyXParagraph::WIDE_FIG))) s = (par->getParLanguage(buf->params)->lang() == "hebrew") ? ":øåéà" : "Figure:"; - else if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE + else if ((isOK && (par->InInset()->owner()->getInsetName() == "table")) || + (par->footnoteflag != LyXParagraph::NO_FOOTNOTE && (par->footnotekind == LyXParagraph::TAB - || par->footnotekind == LyXParagraph::WIDE_TAB)) + || par->footnotekind == LyXParagraph::WIDE_TAB))) s = (par->getParLanguage(buf->params)->lang() == "hebrew") ? ":äìáè" : "Table:"; - else if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE - && par->footnotekind == LyXParagraph::ALGORITHM) + else if ((isOK && (par->InInset()->owner()->getInsetName() == "algorithm")) || + (par->footnoteflag != LyXParagraph::NO_FOOTNOTE + && par->footnotekind == LyXParagraph::ALGORITHM)) s = (par->getParLanguage(buf->params)->lang() == "hebrew") ? ":íúéøåâìà" : "Algorithm:"; else {