]> git.lyx.org Git - features.git/commitdiff
fix bug 568
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 20 Aug 2002 11:14:46 +0000 (11:14 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 20 Aug 2002 11:14:46 +0000 (11:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5028 a592a061-630c-0410-9148-cb99ea01b6c8

config/ChangeLog
po/POTFILES.in
src/ChangeLog
src/text2.C

index 61dc19f1eff76d481abd713ceacaddbe5433c9df..e15a23cb019d3505de815e282e62c66a22088b65 100644 (file)
@@ -7,7 +7,6 @@
        make sure that -lXpm is used when linking. Require LYX_PATH_XPM.
        (LYX_USE_XFORMS_IMAGE_LOADER): use XPM_LIB here
 
-
 2002-08-14  John Levon  <levon@movementarian.org>
 
        * configure.in:
index e662eeb24ba9863bbbf4b91f0667d44c549b76cc..ddad52456e7cc4593939c1096ba2b26223f87f46 100644 (file)
@@ -8,6 +8,7 @@ src/converter.C
 src/CutAndPaste.C
 src/debug.C
 src/exporter.C
+src/ext_l10n.h
 src/FloatList.C
 src/frontends/controllers/biblio.C
 src/frontends/controllers/ButtonController.h
index 0e86b7cb0bdab2397805963403ae0787d8f738fb..42ef0a1d57540964e20b04b6617efb4c9ba2b4a2 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-20  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * text2.C (setCounter): when searching for right label for a
+       caption, make sure to recurse to parent insets (so that a caption
+       in a minipage in a figure float works) (bug #568)
 
 2002-08-19  André Pönitz <poenitz@gmx.net>
 
index afd3351592f05201454b1ae4d038d09c060a41b3..4b7068dbf1acb5808ae1ed98a0395e36e2ccd1b5 100644 (file)
@@ -1339,13 +1339,23 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
 
                // the caption hack:
                if (layout->labeltype == LABEL_SENSITIVE) {
-                       bool isOK (par->inInset() && par->inInset()->owner() &&
-                                  (par->inInset()->owner()->lyxCode() == Inset::FLOAT_CODE));
+                       Paragraph * tmppar = par;
+                       Inset * in = 0;
+                       bool isOK = false;
+                       while (tmppar && tmppar->inInset()
+                              // the single '=' is intended below
+                              && (in = tmppar->inInset()->owner())) {
+                               if (in->lyxCode() == Inset::FLOAT_CODE) {
+                                       isOK = true;
+                                       break;
+                               } else {
+                                       tmppar = in->parOwner();
+                               }
+                       }
 
                        if (isOK) {
-                               InsetFloat * tmp = static_cast<InsetFloat*>(par->inInset()->owner());
                                Floating const & fl
-                                       = floatList.getType(tmp->type());
+                                       = floatList.getType(static_cast<InsetFloat*>(in)->type());
 
                                buf->counters().step(fl.name());