]> git.lyx.org Git - features.git/commitdiff
Small change for Lars's float-inset so that the caption-label is correct.
authorJürgen Vigna <jug@sad.it>
Tue, 18 Jul 2000 10:58:30 +0000 (10:58 +0000)
committerJürgen Vigna <jug@sad.it>
Tue, 18 Jul 2000 10:58:30 +0000 (10:58 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@893 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/insets/insetfloat.C
src/text2.C

index 491d8990d63f07bdf90623c84ee6da885225c94a..061a00f32b350a9a6a74aefc8906263b4bbdad71 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * src/mathed/formula.h (ConvertFont): constify
index 55eccaa7bc926254f991808fe2b19cccbea15853..b4792cf16dd737cc7b6fcae86020775f9af4e548 100644 (file)
@@ -92,6 +92,7 @@ InsetFloat::InsetFloat(string const & type)
        setAutoCollapse(false);
        setInsetName("Float");
        floatType = type;
+       setInsetName(type.c_str());
        //floatPlacement = "H";
 }
 
index 45172be79aea4639ddacba70c2245a7ddfd8a1f1..3e5d1479d8fc5924c57c12766dcf856c44179c51 100644 (file)
@@ -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 {