On Fri, Jul 13, 2001 at 02:05:38AM -0300, Garst R. Reese wrote:
> "Kayvan A. Sylvan" wrote:
> > 
> > This is new. I haven't tracked it yet, but I don't think it's due to my
> > Literate patch. Any ideas?
> > 
> I did not check that closely the msgs, but current cvs compiled for me.
> gcc-3.0
> xforms-.89-5
> libc-2.2
> linux PII
> Garst

Okay, that makes no sense.

The error message is:

insetcollapsable.C:431: comparison of distinct pointer types `const InsetText *' and 
`UpdatableInset *' lacks a cast

In insetcollapsible.h, inset is a public member, defined as an InsetText.

In insetcollapsible.C, we have:

        UpdatableInset * InsetCollapsable::getLockingInset() const
        {
                UpdatableInset * in = inset.getLockingInset();
error   ====>   if (&inset == in)
                    return const_cast<InsetCollapsable *>(this);
                return in;
        }

So, this line *should* be flagged as an error.

The following patch fixes the problem.

-- 
Kayvan A. Sylvan          | Proud husband of       | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan  | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)
Index: src/insets/insetcollapsable.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.67
diff -u -r1.67 insetcollapsable.C
--- src/insets/insetcollapsable.C       2001/07/12 14:35:38     1.67
+++ src/insets/insetcollapsable.C       2001/07/13 07:02:46
@@ -427,7 +427,7 @@
 
 UpdatableInset * InsetCollapsable::getLockingInset() const
 {
-       UpdatableInset * in = inset.getLockingInset();
+       InsetText * in = (InsetText *) inset.getLockingInset();
        if (&inset == in)
                return const_cast<InsetCollapsable *>(this);
        return in;
Index: src/insets/insetfloat.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/insets/insetfloat.C,v
retrieving revision 1.27
diff -u -r1.27 insetfloat.C
--- src/insets/insetfloat.C     2001/07/12 14:35:38     1.27
+++ src/insets/insetfloat.C     2001/07/13 07:02:46
@@ -244,7 +244,7 @@
 {
        if (code == Inset::FLOAT_CODE)
                return false;
-       if (inset.getLockingInset() != this)
+       if ((InsetFloat *) inset.getLockingInset() != this)
                return inset.insertInsetAllowed(code);
        if ((code == Inset::FOOT_CODE) || (code == Inset::MARGIN_CODE))
                return false;

Reply via email to