From 1776a3d0af0634c927dc0b4aacdad855cfdd1da6 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 20 Aug 2002 11:14:46 +0000 Subject: [PATCH] fix bug 568 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5028 a592a061-630c-0410-9148-cb99ea01b6c8 --- config/ChangeLog | 1 - po/POTFILES.in | 1 + src/ChangeLog | 5 +++++ src/text2.C | 18 ++++++++++++++---- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/config/ChangeLog b/config/ChangeLog index 61dc19f1ef..e15a23cb01 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -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 * configure.in: diff --git a/po/POTFILES.in b/po/POTFILES.in index e662eeb24b..ddad52456e 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -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 diff --git a/src/ChangeLog b/src/ChangeLog index 0e86b7cb0b..42ef0a1d57 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-08-20 Jean-Marc Lasgouttes + + * 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 diff --git a/src/text2.C b/src/text2.C index afd3351592..4b7068dbf1 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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(par->inInset()->owner()); Floating const & fl - = floatList.getType(tmp->type()); + = floatList.getType(static_cast(in)->type()); buf->counters().step(fl.name()); -- 2.39.2