Angus Leeming wrote:
[EMAIL PROTECTED] wrote:
BufferView::BufferView(Buffer & buf)
- : width_(0), height_(0), buffer_(buf), wh_(0),
- cursor_(*this),
- multiparsel_cache_(false), anchor_ref_(0), offset_ref_(0),
- need_centering_(false), intl_(new Intl), last_inset_(0),
- gui_(0)
-{
- xsel_cache_.set = false;
- intl_->initKeyMapper(lyxrc.use_kbmap);
-
- cursor_.push(buffer_.inset());
- cursor_.resetAnchor();
- cursor_.setCurrentFont();
+ : width_(0), height_(0), buffer_(buf), d(*new
BufferViewPrivate(*this))
Oh, c'mon! Please! If it's a pointer, it's a pointer. Don't make it
something it isn't.
Well, that's just cosmetics IMO. But I'll change that if it hurts your
eyes. This kind of notation is often use in KDE and I copied it from
GuiView private implementation which was done by Peter K. I grant you
that the only advantage is that it's easier to type 'd.' than 'd->' and
well, I happen to like it.
@@ -372,7 +424,33 @@
// restore to the left of the top level inset.
LyX::ref().session().lastFilePos().save(
support::FileName(buffer_.fileName()),
- boost::tie(cursor_.bottom().pit(), cursor_.bottom().pos()) );
+ boost::tie(d.cursor_.bottom().pit(),
d.cursor_.bottom().pos()) );
+
+ delete &d;
I rest my case. If you want reference semantics (and given that this is
private, there's no need for that), then either put 'd' on the stack or
use an accessor.
I won't fight for this one but I rest my case: this is just cosmetics ;-)
Abdel.