On Tue, Oct 29, 2002 at 10:32:40PM +0000, John Levon wrote:

> This does not deal with the opposite case (caption inside minipage
> inside float) which is on bugzilla ?

s/\?//

But this one does.

example of both bugs attached

OK ?

john


Index: insets/insetfloat.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloat.C,v
retrieving revision 1.53
diff -u -r1.53 insetfloat.C
--- insets/insetfloat.C 26 Sep 2002 08:59:34 -0000      1.53
+++ insets/insetfloat.C 29 Oct 2002 22:48:24 -0000
@@ -30,6 +30,7 @@
 #include "frontends/LyXView.h"
 #include "frontends/Dialogs.h"
 #include "lyxlex.h"
+#include "iterators.h"
 
 using std::ostream;
 using std::endl;
@@ -339,11 +340,13 @@
 
 void InsetFloat::addToToc(toc::TocList & toclist, Buffer const * buf) const
 {
-       // Now find the caption in the float...
-       // We now tranverse the paragraphs of
-       // the inset...
-       Paragraph * tmp = inset.paragraph();
-       while (tmp) {
+       ParIterator pit(inset.paragraph());
+       ParIterator end;
+
+       // Find a caption layout in one of the (child inset's) pars
+       while (pit != end) {
+               Paragraph * tmp = *pit;
+ 
                if (tmp->layout()->name() == caplayout) {
                        string const str =
                                tostr(toclist[type()].size() + 1)
@@ -351,6 +354,6 @@
                        toc::TocItem const item(tmp, 0 , str);
                        toclist[type()].push_back(item);
                }
-               tmp = tmp->next();
+               ++pit;
        }
 }
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass article
\language english
\inputencoding auto
\fontscheme default
\graphics default
\float_placement b
\paperfontsize default
\spacing single 
\papersize a4paper
\paperpackage a4
\use_geometry 0
\use_amsmath 1
\use_natbib 1
\use_numerical_citations 0
\paperorientation portrait
\leftmargin 1cm
\topmargin -0.5cm
\rightmargin 1cm
\bottommargin -0.1cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip bigskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Section

csacas
\layout Standard


\begin_inset Minipage
position 1
inner_position 0
height "0pt"
width "100col%"
collapsed false

\layout Standard


\begin_inset Wrap figure
width "50col%"
collapsed false

\layout Caption

blah blah
\end_inset 


\end_inset 


\layout Standard

sacasc
\layout Standard
\added_space_bottom medskip 

\begin_inset Float figure
placement h
wide false
collapsed false

\layout Standard


\begin_inset Minipage
position 1
inner_position 0
height "0pt"
width "60col%"
collapsed false

\layout Caption

A figure title
\end_inset 


\begin_inset Minipage
position 1
inner_position 0
height "0pt"
width "40col%"
collapsed false

\layout Standard
\align center 

\begin_inset Graphics
        filename a_figure.eps
        rotateOrigin center

\end_inset 


\end_inset 


\end_inset 


\the_end

Reply via email to