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
This commit is contained in:
Jürgen Vigna 2000-07-18 10:58:30 +00:00
parent ba96677bdf
commit 0d6da9afad
3 changed files with 20 additions and 7 deletions

View File

@ -1,3 +1,11 @@
2000-07-18 Juergen Vigna <jug@sad.it>
* 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 <larsbj@lyx.org> 2000-07-17 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/mathed/formula.h (ConvertFont): constify * src/mathed/formula.h (ConvertFont): constify

View File

@ -92,6 +92,7 @@ InsetFloat::InsetFloat(string const & type)
setAutoCollapse(false); setAutoCollapse(false);
setInsetName("Float"); setInsetName("Float");
floatType = type; floatType = type;
setInsetName(type.c_str());
//floatPlacement = "H"; //floatPlacement = "H";
} }

View File

@ -1933,20 +1933,24 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const
string s = layout.labelstring(); string s = layout.labelstring();
// the caption hack: // the caption hack:
if (layout.labeltype == LABEL_SENSITIVE) { 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::FIG
|| par->footnotekind == LyXParagraph::WIDE_FIG)) || par->footnotekind == LyXParagraph::WIDE_FIG)))
s = (par->getParLanguage(buf->params)->lang() == "hebrew") s = (par->getParLanguage(buf->params)->lang() == "hebrew")
? ":øåéà" : "Figure:"; ? ":øåéà" : "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::TAB
|| par->footnotekind == LyXParagraph::WIDE_TAB)) || par->footnotekind == LyXParagraph::WIDE_TAB)))
s = (par->getParLanguage(buf->params)->lang() == "hebrew") s = (par->getParLanguage(buf->params)->lang() == "hebrew")
? ":äìáè" : "Table:"; ? ":äìáè" : "Table:";
else if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE else if ((isOK && (par->InInset()->owner()->getInsetName() == "algorithm")) ||
&& par->footnotekind == LyXParagraph::ALGORITHM) (par->footnoteflag != LyXParagraph::NO_FOOTNOTE
&& par->footnotekind == LyXParagraph::ALGORITHM))
s = (par->getParLanguage(buf->params)->lang() == "hebrew") s = (par->getParLanguage(buf->params)->lang() == "hebrew")
? ":íúéøåâìà" : "Algorithm:"; ? ":íúéøåâìà" : "Algorithm:";
else { else {