From 0d6da9afad9d56247b7e4f77ecfe4df49a972bca Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Tue, 18 Jul 2000 10:58:30 +0000 Subject: [PATCH] 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 --- ChangeLog | 8 ++++++++ src/insets/insetfloat.C | 1 + src/text2.C | 18 +++++++++++------- 3 files changed, 20 insertions(+), 7 deletions(-) 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 { -- 2.39.2