fix bug 568

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5028 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-08-20 11:14:46 +00:00
parent 839002cb96
commit 1776a3d0af
4 changed files with 20 additions and 5 deletions

View 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:

View 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

View 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>

View 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());