On Fri, Oct 20, 2006 at 05:08:24PM +0200, Abdelrazak Younes wrote:
> Abdelrazak Younes wrote:
> >OK, I've found the bloody source of the tabular crash. I don't know what 
> >this resetPos() method is for but it should be used carefully.
> 
> Here's an alternate patch. Which one do you prefer?
> 
> Martin, can I call this one a "fix"? :-)

This certainly looks more robust. If you're confident that the problem
is indeed about accessing an inset not in the cache...

(I remember there were a lot of such problems around not so long ago...
fixed some myself)

- Martin


> Index: coordcache.h
> ===================================================================
> --- coordcache.h      (revision 15403)
> +++ coordcache.h      (working copy)
> @@ -54,6 +54,11 @@
>               data_.clear();
>       }
>  
> +     bool const empty() const
> +     {
> +             return data_.empty();
> +     }
> +
>       void add(T const * thing, int x, int y)
>       {
>               data_[thing] = Point(x, y);
> Index: insets/insettabular.C
> ===================================================================
> --- insets/insettabular.C     (revision 15403)
> +++ insets/insettabular.C     (working copy)
> @@ -1236,7 +1236,7 @@
>  
>       if (&cur.inset() != this) {
>               scx_ = 0;
> -     } else {
> +     } else if (!bv.coordCache().getInsets().empty()) {
>               int const X1 = 0;
>               int const X2 = maxwidth;
>               int const offset = ADD_TO_TABULAR_WIDTH + 2;

Attachment: pgp57u1hO5ctO.pgp
Description: PGP signature

Reply via email to