From 3d7ede605978461a6bd67b250925fcc8bf8404c3 Mon Sep 17 00:00:00 2001 From: Guillaume Munch Date: Wed, 28 Sep 2016 23:04:10 +0200 Subject: [PATCH] Clarify that the Dialog::lyxview_ pointer is in fact a reference --- src/frontends/qt4/Dialog.cpp | 28 ++++++++++++++-------------- src/frontends/qt4/Dialog.h | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/frontends/qt4/Dialog.cpp b/src/frontends/qt4/Dialog.cpp index a9c1250b6e..e1fddaaa7e 100644 --- a/src/frontends/qt4/Dialog.cpp +++ b/src/frontends/qt4/Dialog.cpp @@ -45,7 +45,7 @@ namespace lyx { namespace frontend { Dialog::Dialog(GuiView & lv, QString const & name, QString const & title) - : name_(name), title_(title), lyxview_(&lv) + : name_(name), title_(title), lyxview_(lv) {} @@ -75,21 +75,21 @@ void Dialog::updateDialog() const void Dialog::disconnect() const { - lyxview_->disconnectDialog(fromqstr(name_)); + lyxview_.disconnectDialog(fromqstr(name_)); } bool Dialog::isBufferAvailable() const { - return lyxview_->currentBufferView() != 0; + return lyxview_.currentBufferView() != 0; } bool Dialog::isBufferReadonly() const { - if (!lyxview_->documentBufferView()) + if (!lyxview_.documentBufferView()) return true; - return lyxview_->documentBufferView()->buffer().isReadonly(); + return lyxview_.documentBufferView()->buffer().isReadonly(); } @@ -112,21 +112,21 @@ KernelDocType Dialog::docType() const BufferView const * Dialog::bufferview() const { - return lyxview_->currentBufferView(); + return lyxview_.currentBufferView(); } Buffer const & Dialog::buffer() const { - LAPPERR(lyxview_->currentBufferView()); - return lyxview_->currentBufferView()->buffer(); + LAPPERR(lyxview_.currentBufferView()); + return lyxview_.currentBufferView()->buffer(); } Buffer const & Dialog::documentBuffer() const { - LAPPERR(lyxview_->documentBufferView()); - return lyxview_->documentBufferView()->buffer(); + LAPPERR(lyxview_.documentBufferView()); + return lyxview_.documentBufferView()->buffer(); } @@ -193,9 +193,9 @@ void Dialog::showView() if (wantInitialFocus()) w->setFocus(); else { - lyxview_->raise(); - lyxview_->activateWindow(); - lyxview_->setFocus(); + lyxview_.raise(); + lyxview_.activateWindow(); + lyxview_.setFocus(); } } @@ -270,7 +270,7 @@ void Dialog::checkStatus() QString Dialog::sessionKey() const { - return "views/" + QString::number(lyxview_->id()) + return "views/" + QString::number(lyxview_.id()) + "/" + name(); } diff --git a/src/frontends/qt4/Dialog.h b/src/frontends/qt4/Dialog.h index a9769ff4ab..f3f9c1d474 100644 --- a/src/frontends/qt4/Dialog.h +++ b/src/frontends/qt4/Dialog.h @@ -250,7 +250,7 @@ public: * We should aim to reduce/remove these from the interface. */ //@{ - GuiView const & lyxview() const { return *lyxview_; } + GuiView const & lyxview() const { return lyxview_; } /// Current buffer Buffer const & buffer() const; /// Main document buffer @@ -273,7 +273,7 @@ private: /// QString title_; /// - GuiView * lyxview_; + GuiView & lyxview_; /// intentionally unimplemented, therefore uncopiable Dialog(Dialog const &);