On Mon, Dec 01, 2003 at 01:18:05PM +0000, Angus Leeming wrote:
> Index: buffer.h
> -       /** The list of paragraphs.
> +       /** The list of paragraphs().
>             This is a linked list of paragraph, this list holds the
>             whole contents of the document.
>          */

Grmpf. As soon as I introduce some verbosity people start to complain...

> Index: text2.C
> -          the beginning of paragraphs. This happens if you have
> +          the beginning of paragraphs(). This happens if you have
> 
> 
> Thought: do you still need to forward-declare BufferView now?
> Index: iterators.h
> @@ -20,6 +20,7 @@
>  class LyXText;
>  class InsetOld;
>  class Cursor;
> +class Buffer;
>  class BufferView;
>  class PosIterator;
> 
> What has happended to this:
> Index: lyxfunc.C
> -       case LFUN_INSET_TOGGLE: {
> -               LyXText * lt = view()->getLyXText();
> -               disable = !(isEditableInset(lt->getInset())
> -                           || (lt->inset_owner
> -                               && lt->inset_owner->owner()
> -                               && lt->inset_owner->owner()->isOpen()));
> -               break;
> -       }
> 
> ... Ahhhhhhhhh. Neat (I see the code in insetcollapsable).

Most of the other  inset->owner() usages are probably removable like
this. That's why my suspicion that InsetOld::owner_ is not needed at
all.

> Thought: Buffer now contains a LyxText variable that contains the 
> entire document, right?

Hm, yes.

> Is 'Buffer" becoming redundant, given that most of its member
> functions could/should be implemented as free functions?

Maybe. Note that a LyXText is 'nestable', a Buffer is not. So the
main text plays two roles. Having them separated in 'Buffer' (read/write
files etc) and 'LyXText' (basic editing) does not sound wrong.

> This makes me feel uneasy, maybe because I never really got to grips 
> with the 'inherit' stuff. Is the change really Ok?
> 
> @@ -82,13 +71,7 @@ void InsetOld::setBackgroundColor(LColor
> 
>  LColor_color InsetOld::backgroundColor() const
>  {
> -       if (background_color_ == LColor::inherit) {
> -               if (owner())
> -                       return owner()->backgroundColor();
> -               else
> -                       return LColor::background;
> -       } else
> -               return LColor::color(background_color_);
> +       return LColor::color(background_color_);
>  }

I've played a bit around and it got e.g. the Note inset right. I was
actually expecting the need to pass the 'active' background color around
using the PainterInfo struct but so far I've not yet seen a case where
this is needed.
 
> Ditto. Really Ok?
> Index: insets/inset.h
> -       /// check if the font of the char we want inserting is correct
> -       /// and modify it if it is not.
> -       virtual bool checkInsertChar(LyXFont &);
> 
> -       /* needed for widths which are % of something
> -          returns the value of \textwidth in this inset. Most of the
> -          time this is the width of the workarea, but if there is a
> -          minipage somewhere, it will be the width of this minipage */
> -       virtual int latexTextWidth(BufferView *) const;

I think so. This pretty much was dead code and the only suspicious case
'minipage' gets it right without this.

> I think that these showInsetDialog member functions could safely be 
> discarded, given tht many insets implement this directly in 
> priv_dispatch:
> 
> Index: insets/insetwrap.h
> -       bool  showInsetDialog(BufferView *) const;
> -       ///
> -       int latexTextWidth(BufferView *) const;
> +       bool showInsetDialog(BufferView *) const;
> 
> Man! You've been busy!

It was the third or fourth attempt on the matter, so it wasn't that
difficult...

Andre'

Reply via email to