]> git.lyx.org Git - features.git/commitdiff
* Constify Buffer::getLabelList.
authorAngus Leeming <leeming@lyx.org>
Mon, 12 Aug 2002 20:17:41 +0000 (20:17 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 12 Aug 2002 20:17:41 +0000 (20:17 +0000)
* reduce file dependencies of the controllers on the core.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4947 a592a061-630c-0410-9148-cb99ea01b6c8

45 files changed:
src/ChangeLog
src/buffer.C
src/buffer.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/ControlBibitem.C
src/frontends/controllers/ControlBibtex.C
src/frontends/controllers/ControlCharacter.C
src/frontends/controllers/ControlCitation.C
src/frontends/controllers/ControlCommand.C
src/frontends/controllers/ControlCommandBuffer.C
src/frontends/controllers/ControlCommandBuffer.h
src/frontends/controllers/ControlConnections.C
src/frontends/controllers/ControlConnections.h
src/frontends/controllers/ControlDialog.tmpl
src/frontends/controllers/ControlERT.C
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlFloat.C
src/frontends/controllers/ControlFloat.h
src/frontends/controllers/ControlForks.C
src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlGraphics.h
src/frontends/controllers/ControlInclude.C
src/frontends/controllers/ControlInset.tmpl
src/frontends/controllers/ControlLog.C
src/frontends/controllers/ControlMinipage.C
src/frontends/controllers/ControlParagraph.C
src/frontends/controllers/ControlPreamble.C
src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlRef.C
src/frontends/controllers/ControlRef.h
src/frontends/controllers/ControlSearch.C
src/frontends/controllers/ControlSearch.h
src/frontends/controllers/ControlSendto.C
src/frontends/controllers/ControlSpellchecker.C
src/frontends/controllers/ControlTabularCreate.C
src/frontends/controllers/ControlTexinfo.C
src/frontends/controllers/ControlThesaurus.C
src/frontends/controllers/ControlToc.C
src/frontends/controllers/ControlVCLog.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormRef.C

index 436f45e518947099a708bde7d1ed12086af27988..82e5210ac87b18ade52de28496324d906b8801e8 100644 (file)
@@ -1,3 +1,6 @@
+2002-08-12  Angus Leeming  <leeming@lyx.org>
+
+       * buffer.[Ch] (getLabelList): constify.
 
 2002-08-07  André Pönitz <poenitz@gmx.net>
 
index 73616d31c1cb69074a6d3de5f5df94b86409b5eb..323c897849dd067a13b64343339191371c393ea5 100644 (file)
@@ -3691,20 +3691,20 @@ string const Buffer::getIncludeonlyList(char delim)
 }
 
 
-vector<string> const Buffer::getLabelList()
+vector<string> const Buffer::getLabelList() const
 {
        /// if this is a child document and the parent is already loaded
        /// Use the parent's list instead  [ale990407]
        if (!params.parentname.empty()
            && bufferlist.exists(params.parentname)) {
-               Buffer * tmp = bufferlist.getBuffer(params.parentname);
+               Buffer const * tmp = bufferlist.getBuffer(params.parentname);
                if (tmp)
                        return tmp->getLabelList();
        }
 
        vector<string> label_list;
-       for (inset_iterator it = inset_iterator_begin();
-            it != inset_iterator_end(); ++it) {
+       for (inset_iterator it = inset_const_iterator_begin();
+            it != inset_const_iterator_end(); ++it) {
                vector<string> const l = (*it)->getLabelList();
                label_list.insert(label_list.end(), l.begin(), l.end());
        }
index 5f03cab458dd5f2cd2657c9e32564f8bdb7697d7..438593e8091496cff2608d22758f3a53dcc2ba0e 100644 (file)
@@ -278,7 +278,7 @@ public:
        ///
        std::vector<std::pair<string, string> > const getBibkeyList() const;
        ///
-       std::vector<string> const getLabelList();
+       std::vector<string> const getLabelList() const;
 
        /** This will clearly have to change later. Later we can have more
            than one user per buffer. */
index 4837f603b72c8fc3bd79b11fd8e1d9c0d6c7bf0e..3fa784d00e74faef0c16aa88d716ccb655643c4f 100644 (file)
@@ -1,3 +1,12 @@
+2002-08-12  Angus Leeming  <leeming@lyx.org>
+
+       * ControlConnections.[Ch]: (isReadonly): renamed as bufferIsReadonly.
+       (bufferIsAvailable, bufferview, buffer, lyxfunc): new methods. Wrappers
+       for the most commonly accessed core methods, to minimise code
+       dependiencies.
+
+       * many files: use these wrappers and remove associated #includes.
+
 2002-08-12  Angus Leeming  <leeming@lyx.org>
 
        * ControlButtons.[Ch] (bc, view): no longer virtual.
index f7815b97cc0fcfcbc6f23c15350a837f9d79a9fe..c6f1310b9f439cd146292f444f6d9a89e9c86ae4 100644 (file)
@@ -15,9 +15,7 @@
 #endif
 
 #include "ControlAboutlyx.h"
-#include "frontends/LyXView.h"
 #include "Lsstream.h"
-#include "BufferView.h"
 #include "gettext.h"
 #include "support/filetools.h" // FileSearch
 #include "version.h"
index 6a21aa0abbb16b041eb41b151cb04382a87a66a8..df1a3f4273d2d634daeaa00f6209045fe5e92bf5 100644 (file)
@@ -32,16 +32,16 @@ void ControlBibitem::applyParamsToInset()
        // FIXME:
        // confirm, is this only necessary for FormBibTeX ???
        if (params().getContents() != inset()->params().getContents())
-               lv_.view()->ChangeCitationsIfUnique(inset()->params().getContents(),
+               bufferview()->ChangeCitationsIfUnique(inset()->params().getContents(),
                                                    params().getContents());
 
        inset()->setParams(params());
-       lv_.view()->updateInset(inset(), true);
+       bufferview()->updateInset(inset(), true);
 
        // We need to do a redraw because the maximum
        // InsetBibKey width could have changed
 #warning please check you mean repaint() not update(),
 #warning and whether the repaint() is needed at all
-       lv_.view()->repaint();
-       lv_.view()->fitCursor();
+       bufferview()->repaint();
+       bufferview()->fitCursor();
 }
index 832b86a4a1164dc69261ae90754206121c8f7bc9..cd2b96c8caa6d9f8e26c415b024a2f02348a0427 100644 (file)
@@ -20,6 +20,7 @@
 #endif
 
 #include "ControlBibtex.h"
+#include "buffer.h"
 #include "BufferView.h"
 #include "lyxrc.h"
 #include "helper_funcs.h"
@@ -27,7 +28,6 @@
 #include "gettext.h"
 #include "support/lstrings.h"
 
-#include "frontends/LyXView.h"
 
 using std::pair;
 
@@ -41,17 +41,17 @@ ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d)
 void ControlBibtex::applyParamsToInset()
 {
        if (params().getContents() != inset()->params().getContents())
-               lv_.view()->ChangeCitationsIfUnique(inset()->params().getContents(),
+               bufferview()->ChangeCitationsIfUnique(inset()->params().getContents(),
                                                    params().getContents());
 
        inset()->setParams(params());
-       lv_.view()->updateInset(inset(), true);
+       bufferview()->updateInset(inset(), true);
 
        // We need to do a redraw because the maximum
        // InsetBibKey width could have changed
 #warning are you sure you need this repaint() ?
-       lv_.view()->repaint();
-       lv_.view()->fitCursor();
+       bufferview()->repaint();
+       bufferview()->fitCursor();
 }
 
 
@@ -64,7 +64,7 @@ string const ControlBibtex::Browse(string const & in_name,
                                   string const & pattern)
 {
        pair<string, string> dir1(_("Documents|#o#O"), string(lyxrc.document_path));
-       return browseRelFile(&lv_, in_name, lv_.buffer()->filePath(),
+       return browseRelFile(&lv_, in_name, buffer()->filePath(),
                             title, pattern, dir1);
 }
 
index 96de55bac5f77211b25b15bc30fac493fd223395..92cfdb6b7400f0e5bfbc32c8245e0cd03de099b9 100644 (file)
@@ -20,7 +20,6 @@
 #include "bufferview_funcs.h" // ToggleAndShow
 #include "gettext.h"
 #include "language.h"
-#include "BufferView.h"
 
 #include "frontends/LyXView.h"
 
@@ -59,12 +58,12 @@ void ControlCharacter::apply()
                return;
 
        // Apply from the view if it's visible. Otherwise, use the stored values
-       if (lv_.view()->available())
+       if (bufferIsAvailable())
                view().apply();
 
-       toggleAndShow(lv_.view().get(), *(font_.get()), toggleall_);
+       toggleAndShow(bufferview(), *(font_.get()), toggleall_);
        lv_.view_state_changed();
-       lv_.buffer()->markDirty();
+       buffer()->markDirty();
        setMinibuffer(&lv_, _("Character set"));
 }
 
@@ -223,7 +222,7 @@ void ControlCharacter::setLanguage(string const & val)
                font_->setLanguage(ignore_language);
 
        else if (val == "reset")
-               font_->setLanguage(lv_.buffer()->params.language);
+               font_->setLanguage(buffer()->params.language);
 
        else
                font_->setLanguage(languages.getLanguage(val));
index d1069ef90e7ffce3595242eba88524f63474e043..98928b55181b4d260f0c9099ae52c53b702deed8 100644 (file)
@@ -18,6 +18,7 @@
 #endif
 
 #include "ControlCitation.h"
+#include "buffer.h"
 
 using std::vector;
 using std::pair;
@@ -38,7 +39,7 @@ void ControlCitation::clearDaughterParams()
 
 void ControlCitation::setDaughterParams()
 {
-       vector<pair<string,string> > blist = lv_.buffer()->getBibkeyList();
+       vector<pair<string,string> > blist = buffer()->getBibkeyList();
 
        typedef std::map<string, string>::value_type InfoMapValue;
 
@@ -65,7 +66,7 @@ biblio::InfoMap const & ControlCitation::bibkeysInfo() const
 
 bool ControlCitation::usingNatbib() const
 {
-    return lv_.buffer()->params.use_natbib;
+    return buffer()->params.use_natbib;
 }
 
 
@@ -76,7 +77,7 @@ vector<string> const ControlCitation::getCiteStrings(string const & key) const
        vector<biblio::CiteStyle> const cs =
                biblio::getCiteStyles(usingNatbib());
 
-       if (lv_.buffer()->params.use_numerical_citations)
+       if (buffer()->params.use_numerical_citations)
                styles = biblio::getNumericalStrings(key, bibkeysInfo_, cs);
        else
                styles = biblio::getAuthorYearStrings(key, bibkeysInfo_, cs);
index dd57990afc7befab59888f88f8d41cba6dbbd41a..869ad31c07234261ebcee909134651021b53db9e 100644 (file)
@@ -22,7 +22,6 @@
 #include "ControlCommand.h"
 #include "buffer.h"
 #include "Dialogs.h"
-#include "frontends/LyXView.h"
 #include "lyxfunc.h"
 #include "BufferView.h"
 #include "funcrequest.h"
@@ -51,7 +50,7 @@ InsetCommandParams const ControlCommand::getParams(InsetCommand const & inset)
 void ControlCommand::applyParamsToInset()
 {
        inset()->setParams(params());
-       lv_.view()->updateInset(inset(), true);
+       bufferview()->updateInset(inset(), true);
 }
 
 
@@ -59,5 +58,5 @@ void ControlCommand::applyParamsNoInset()
 {
        if (action_ == LFUN_NOACTION)
                return;
-       lv_.getLyXFunc()->dispatch(FuncRequest(action_, params().getAsString()));
+       lyxfunc().dispatch(FuncRequest(action_, params().getAsString()));
 }
index f8fd58f9d5bf5f0d4f7cc6f1ef064aa97fcaf5b8..7dac06fd8ba3d27037efbc1086f3301cdd2b2051 100644 (file)
@@ -8,6 +8,8 @@
  * \author John Levon <levon@movementarian.org>
  */
 
+#include <config.h>
+
 #ifdef __GNUG__
 #pragma implementation
 #endif
index 000786a1c48d9335cade1536c6428ac167607de7..8cd968aa9d969d047d45202c16c4fa24b0dc6f13 100644 (file)
@@ -12,8 +12,6 @@
 #ifndef CONTROLCOMMANDBUFFER_H
 #define CONTROLCOMMANDBUFFER_H
 
-#include <config.h>
 #include "LString.h"
 
 #include <vector>
index 5a5778ad1d60fe7997242e81973bb8aa678787c4..94cb89091d0ae919ea470690e76237b277e2965a 100644 (file)
@@ -21,6 +21,7 @@
 #include "ViewBase.h"
 #include "Dialogs.h"
 #include "buffer.h"
+#include "BufferView.h"
 
 #include "frontends/LyXView.h"
 
@@ -50,7 +51,7 @@ void ControlConnectBase::redraw()
 }
 
 
-bool ControlConnectBase::isReadonly() const
+bool ControlConnectBase::bufferIsReadonly() const
 {
        if (!lv_.buffer())
                return true;
@@ -59,6 +60,51 @@ bool ControlConnectBase::isReadonly() const
 }
 
 
+bool ControlConnectBase::bufferIsAvailable() const
+{
+       if (!lv_.view())
+               return false;
+
+       return lv_.view()->available();
+}
+
+
+BufferView * ControlConnectBase::bufferview()
+{
+       return lv_.view().get();
+}
+
+
+BufferView const * ControlConnectBase::bufferview() const
+{
+       return lv_.view().get();
+}
+
+
+Buffer * ControlConnectBase::buffer()
+{
+       return lv_.buffer();
+}
+
+
+Buffer const * ControlConnectBase::buffer() const
+{
+       return lv_.buffer();
+}
+
+
+LyXFunc & ControlConnectBase::lyxfunc()
+{
+       return *lv_.getLyXFunc();
+}
+
+
+LyXFunc const & ControlConnectBase::lyxfunc() const
+{
+       return *lv_.getLyXFunc();
+}
+
+
 ControlConnectBase::DocTypes ControlConnectBase::docType() const
 {
        if (!lv_.buffer())
index 6f73c28ace4928396d36d467ac4d11d2fdb07a59..6e5dcfbf6bd2f988d0e7411c47e9867e3f56275f 100644 (file)
 
 #include <boost/signals/connection.hpp>
 
+class Buffer;
+class BufferView;
 class Dialogs;
 class LyXView;
+class LyXFunc;
 
 /** Base class to control connection/disconnection of signals with the LyX
     kernel. It is meant to be used solely as the parent class to
@@ -63,7 +66,7 @@ public:
        ///
        ControlConnectBase(LyXView &, Dialogs &);
        /// The View may need to know if the buffer is read-only.
-       bool isReadonly() const;
+       bool bufferIsReadonly() const;
        ///
        DocTypes docType() const;
 
@@ -81,7 +84,23 @@ protected:
        */
        void redraw();
 
-       /// Get at the kernel Dispatch methods we need to apply() parameters.
+       /// a wrapper for BufferView::avaliable()
+       bool bufferIsAvailable() const;
+       /// a wrapper for LyXView::view()
+       BufferView * bufferview();
+       ///
+       BufferView const * bufferview() const;
+       /// a wrapper for LyXView::buffer()
+       Buffer * buffer();
+       ///
+       Buffer const * buffer() const;
+       /// a wrapper for LyXView::getLyXFunc()
+       LyXFunc & lyxfunc();
+       ///
+       LyXFunc const & lyxfunc() const;
+       
+
+       ///
        LyXView & lv_;
        /// Contains the signals we have to connect to.
        Dialogs & d_;
index ff4151d581496da6c9440bd3600974d9db4a0769..8a8ce459cb626e9fd345db34a73ca445b66dfc7a 100644 (file)
  */
 
 #include "ControlDialog.h"
+
 #include "ButtonControllerBase.h"
-#include "ControlConnections.h"
-#include "frontends/LyXView.h"
-#include "BufferView.h"
 #include "ViewBase.h"
-#include "debug.h"
+
 
 template <class Base>
 ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
@@ -27,7 +25,7 @@ ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
 template <class Base>
 void ControlDialog<Base>::show()
 {
-       if (isBufferDependent() && !lv_.view()->available())
+       if (isBufferDependent() && !bufferIsAvailable())
                return;
 
        connect();
@@ -43,14 +41,14 @@ void ControlDialog<Base>::show()
                dialog_built_ = true;
        }
 
-       bc().readOnly(isReadonly());
+       bc().readOnly(bufferIsReadonly());
        view().show();
 }
 
 template <class Base>
 void ControlDialog<Base>::update()
 {
-       if (isBufferDependent() && !lv_.view()->available())
+       if (isBufferDependent() && !bufferIsAvailable())
                return;
 
        setParams();
@@ -59,7 +57,7 @@ void ControlDialog<Base>::update()
                return;
        }
 
-       bc().readOnly(isReadonly());
+       bc().readOnly(bufferIsReadonly());
        view().update();
 }
 
index 76c87ce454f519321778838f23d9bb7cf333ce26..be67e66d435dfdab85852940248f963504b044a8 100644 (file)
@@ -30,7 +30,7 @@ ControlERT::ControlERT(LyXView & lv, Dialogs & d)
 
 void ControlERT::applyParamsToInset()
 {
-       inset()->status(lv_.view().get(), params().status);
+       inset()->status(bufferview(), params().status);
 }
 
 
index 7a5d3c36f9d75cfc785bf1c10a042757211200e6..a2a96eaa47ab69903602149a313997d03c0f5a3e 100644 (file)
@@ -20,6 +20,7 @@
 #endif
 
 #include "ControlExternal.h"
+#include "buffer.h"
 #include "BufferView.h"
 #include "gettext.h"
 #include "helper_funcs.h"
@@ -50,7 +51,7 @@ ControlExternal::getParams(InsetExternal const & inset)
 void ControlExternal::applyParamsToInset()
 {
        inset()->setFromParams(params());
-       lv_.view()->updateInset(inset(), true);
+       bufferview()->updateInset(inset(), true);
 }
 
 void ControlExternal::editExternal()
@@ -62,7 +63,7 @@ void ControlExternal::editExternal()
        // Create a local copy of the inset and initialise it with this
        // params struct.
        boost::scoped_ptr<InsetExternal> ie;
-       ie.reset(static_cast<InsetExternal *>(inset()->clone(*lv_.buffer())));
+       ie.reset(static_cast<InsetExternal *>(inset()->clone(*buffer())));
        ie->setFromParams(params());
 
        ie->editExternal();
@@ -73,7 +74,7 @@ void ControlExternal::viewExternal()
        view().apply();
 
        boost::scoped_ptr<InsetExternal> ie;
-       ie.reset(static_cast<InsetExternal *>(inset()->clone(*lv_.buffer())));
+       ie.reset(static_cast<InsetExternal *>(inset()->clone(*buffer())));
        ie->setFromParams(params());
 
        ie->viewExternal();
@@ -84,7 +85,7 @@ void ControlExternal::updateExternal()
        view().apply();
 
        boost::scoped_ptr<InsetExternal> ie;
-       ie.reset(static_cast<InsetExternal *>(inset()->clone(*lv_.buffer())));
+       ie.reset(static_cast<InsetExternal *>(inset()->clone(*buffer())));
        ie->setFromParams(params());
 
        ie->updateExternal();
@@ -139,7 +140,7 @@ string const ControlExternal::Browse(string const & input) const
 {
        string const title =  _("Select external file");
 
-       string const bufpath = lv_.buffer()->filePath();
+       string const bufpath = buffer()->filePath();
 
        /// Determine the template file extension
        ExternalTemplate const & et = params().templ;
index c78ca8b67151abf7779a0fbebc59d3d44af588f7..2eb6cc47d54545a4a309678838ce56af5f41762d 100644 (file)
@@ -28,7 +28,7 @@ void ControlFloat::applyParamsToInset()
 {
        inset()->placement(params().placement);
        inset()->wide(params().wide);
-       lv_.view()->updateInset(inset(), true);
+       bufferview()->updateInset(inset(), true);
 
 }
 
index 29b810c856da2ba62595bc86b187c7bc8a23647b..73466f81b679eb57573cdda4f0a8d797e7f40d1e 100644 (file)
@@ -22,6 +22,9 @@
 
 #include "ControlInset.h"
 
+// needed to instatiate inset->hideDialog in ControlInset
+#include "insets/insetfloat.h"
+
 class InsetFloat;
 
 ///
index bd31be6cfb61e192dc2725f97973e2048e824120..583a4923b1a69e612398fe32726bee70765c8578 100644 (file)
@@ -15,8 +15,6 @@
 #include "ControlForks.h"
 #include "ViewBase.h"
 
-#include "BufferView.h"
-#include "frontends/LyXView.h"
 #include "lyxfunc.h"
 #include "funcrequest.h"
 
@@ -55,7 +53,7 @@ void ControlForks::kill(pid_t pid)
 
 void ControlForks::apply()
 {
-       if (!lv_.view()->available())
+       if (!bufferIsAvailable())
                return;
 
        view().apply();
@@ -66,7 +64,7 @@ void ControlForks::apply()
 
        for (vector<string>::const_iterator it = pids_.begin();
             it != pids_.end(); ++it) {
-               lv_.getLyXFunc()->dispatch(FuncRequest(LFUN_FORKS_KILL, *it));
+               lyxfunc().dispatch(FuncRequest(LFUN_FORKS_KILL, *it));
        }
 
        pids_.clear();
index c0a93a83a2fbf614c0e73dd29ca8538e847891da..f096f51ea9e633e471c0d419264eb3fc07256ca5 100644 (file)
@@ -26,7 +26,6 @@
 #include "buffer.h"
 #include "BufferView.h"
 #include "Dialogs.h"
-#include "frontends/LyXView.h"
 #include "gettext.h"
 #include "lyxrc.h"
 
@@ -67,11 +66,11 @@ void ControlGraphics::applyParamsToInset()
 {
        // Set the parameters in the inset, it also returns true if the new
        // parameters are different from what was in the inset already.
-       bool changed = inset()->setParams(params(), lv_.buffer()->filePath());
+       bool changed = inset()->setParams(params(), buffer()->filePath());
 
        // Tell LyX we've got a change, and mark the document dirty,
        // if it changed.
-       lv_.view()->updateInset(inset(), changed);
+       bufferview()->updateInset(inset(), changed);
 }
 
 
@@ -97,14 +96,14 @@ string const ControlGraphics::Browse(string const & in_name)
        pair<string, string> dir1(_("Clipart|#C#c"), clipdir);
        pair<string, string> dir2(_("Documents|#o#O"), string(lyxrc.document_path));
        // Show the file browser dialog
-       return browseRelFile(&lv_, in_name, lv_.buffer()->filePath(),
+       return browseRelFile(&lv_, in_name, buffer()->filePath(),
                             title, "*.*", dir1, dir2);
 }
 
 
 string const ControlGraphics::readBB(string const & file)
 {
-       string const abs_file = MakeAbsPath(file, lv_.buffer()->filePath());
+       string const abs_file = MakeAbsPath(file, buffer()->filePath());
 
        // try to get it from the file, if possible. Zipped files are
        // unzipped in the readBB_from_PSFile-Function
@@ -133,7 +132,7 @@ string const ControlGraphics::readBB(string const & file)
 bool ControlGraphics::isFilenameValid(string const & fname) const
 {
        // It may be that the filename is relative.
-       string const name = MakeAbsPath(fname, lv_.buffer()->filePath());
+       string const name = MakeAbsPath(fname, buffer()->filePath());
        return IsFileReadable(name);
 }
 
index 3e5d4663af1113dd9955f4d371e3c9a9294ddb87..013caea13185e80639cd4a141606cfdfae45a836 100644 (file)
 #endif
 
 #include "ControlInset.h"
+
+// needed to instatiate inset->hideDialog in ControlInset
+#include "insets/insetgraphics.h"
+
 #include <utility>
 #include <vector>
 
index 2bac0f5fa2be3460b637b3e313d37c1ef5ba517b..0d16a4c2197d770a0f6be56c41ccaa4b5e996f26 100644 (file)
@@ -38,7 +38,7 @@ ControlInclude::ControlInclude(LyXView & lv, Dialogs & d)
 void ControlInclude::applyParamsToInset()
 {
        inset()->set(params());
-       lv_.view()->updateInset(inset(), true);
+       bufferview()->updateInset(inset(), true);
 }
 
 
@@ -73,7 +73,7 @@ string const ControlInclude::Browse(string const & in_name, Type in_type)
 
 void ControlInclude::load(string const & file)
 {
-       lv_.getLyXFunc()->dispatch(FuncRequest(LFUN_CHILDOPEN, file));
+       lyxfunc().dispatch(FuncRequest(LFUN_CHILDOPEN, file));
 }
 
 
index fe88747c366ad931b4f019034ecc1abbe42d8010..c93476fb6bdd7d4de599a37d5914db237c285c6e 100644 (file)
  */
 
 #include "ControlInset.h"
+
 #include "ButtonControllerBase.h"
 #include "ViewBase.h"
-#include "buffer.h"
-#include "debug.h"
-#include "frontends/LyXView.h"
-#include "insets/insetfloat.h"
-#include "insets/insetgraphics.h"
 #include "support/LAssert.h"
 
 #include <boost/bind.hpp>
@@ -70,7 +66,7 @@ void ControlInset<Inset, Params>::show(Params const & params)
                dialog_built_ = true;
        }
 
-       bc().readOnly(isReadonly());
+       bc().readOnly(bufferIsReadonly());
        view().show();
 }
 
@@ -91,7 +87,7 @@ void ControlInset<Inset, Params>::update()
                return;
        }
 
-       bc().readOnly(isReadonly());
+       bc().readOnly(bufferIsReadonly());
        view().update();
 }
 
@@ -117,7 +113,7 @@ void ControlInset<Inset, Params>::hide()
 template <class Inset, class Params>
 void ControlInset<Inset, Params>::apply()
 {
-       if (lv_.buffer()->isReadonly())
+       if (bufferIsReadonly())
                return;
 
        view().apply();
index bcaa49bb678e9c9d26b406be8f8191205ecc0db8..a271d877682c284da4f34161e35e794e98863c8c 100644 (file)
@@ -19,9 +19,8 @@
 #endif
 
 #include "ControlLog.h"
-#include "BufferView.h"
+#include "buffer.h"
 
-#include "frontends/LyXView.h"
 
 
 ControlLog::ControlLog(LyXView & lv, Dialogs & d)
@@ -31,7 +30,7 @@ ControlLog::ControlLog(LyXView & lv, Dialogs & d)
 
 void ControlLog::setParams()
 {
-       logfile_ = lv_.view()->buffer()->getLogName();
+       logfile_ = buffer()->getLogName();
 }
 
 
index 2ebc759a4c34e2400ca98d1fac77d8a33a15c317..a96cd908c68b793f63950e29bf61e8752e2f7e8f 100644 (file)
@@ -31,7 +31,7 @@ void ControlMinipage::applyParamsToInset()
        inset()->pageWidth(params().pageWidth);
        inset()->pos(params().pos);
 
-       lv_.view()->updateInset(inset(), true);
+       bufferview()->updateInset(inset(), true);
 }
 
 
index c89f56b0ffd2f7ec637144a284839a878f8c93d9..58738aed9549abb35e56c7f667562a86489b7e7b 100644 (file)
@@ -18,7 +18,6 @@
 #include "ViewBase.h"
 #include "ParagraphParameters.h"
 #include "Liason.h"
-#include "LyXView.h"
 #include "BufferView.h"
 #include "gettext.h"
 #include "buffer.h"
@@ -64,13 +63,13 @@ LyXAlignment ControlParagraph::alignPossible() const
 
 void ControlParagraph::apply()
 {
-       if (!lv_.view()->available())
+       if (!bufferIsAvailable())
                return;
 
        view().apply();
 
-       LyXText * text(lv_.view()->getLyXText());
-       text->setParagraph(lv_.view().get(),
+       LyXText * text(bufferview()->getLyXText());
+       text->setParagraph(bufferview(),
                           pp_->lineTop(),
                           pp_->lineBottom(),
                           pp_->pagebreakTop(),
@@ -83,12 +82,12 @@ void ControlParagraph::apply()
                           pp_->noindent());
 
        // Actually apply these settings
-       lv_.view()->update(text,
-                          BufferView::SELECT |
-                          BufferView::FITCUR |
-                          BufferView::CHANGE);
+       bufferview()->update(text,
+                            BufferView::SELECT |
+                            BufferView::FITCUR |
+                            BufferView::CHANGE);
 
-       lv_.buffer()->markDirty();
+       buffer()->markDirty();
 
        setMinibuffer(&lv_, _("Paragraph layout set"));
 }
@@ -100,7 +99,7 @@ void ControlParagraph::setParams()
                pp_.reset(new ParagraphParameters());
 
        /// get paragraph
-       Paragraph const * par_ = lv_.view()->getLyXText()->cursor.par();
+       Paragraph const * par_ = bufferview()->getLyXText()->cursor.par();
 
        /// Set the paragraph parameters
        *pp_ = par_->params();
@@ -123,7 +122,7 @@ void ControlParagraph::setParams()
 void ControlParagraph::changedParagraph()
 {
        /// get paragraph
-       Paragraph const * p = lv_.view()->getLyXText()->cursor.par();
+       Paragraph const * p = bufferview()->getLyXText()->cursor.par();
 
        if (p == 0) // this is wrong as we don't set par_ here! /* || p == par_) */
                return;
index 7f30834f55a9aee1e6ff1c242dcfc9fe929caa2e..b1eb78c120f349d34e814582c1aa028824ca3613 100644 (file)
 
 #include "ControlPreamble.h"
 #include "ViewBase.h"
-#include "frontends/LyXView.h"
 #include "buffer.h"
 #include "Liason.h"
 #include "gettext.h"
-#include "BufferView.h"
-#include "support/LAssert.h"
 
 
 ControlPreamble::ControlPreamble(LyXView & lv, Dialogs & d)
@@ -30,13 +27,13 @@ ControlPreamble::ControlPreamble(LyXView & lv, Dialogs & d)
 
 void ControlPreamble::apply()
 {
-       if (!lv_.view()->available())
+       if (!bufferIsAvailable())
                return;
 
        view().apply();
 
-       lv_.buffer()->params.preamble = params();
-       lv_.buffer()->markDirty();
+       buffer()->params.preamble = params();
+       buffer()->markDirty();
        Liason::setMinibuffer(&lv_, _("LaTeX preamble set"));
 }
 
@@ -51,7 +48,7 @@ string & ControlPreamble::params() const
 void ControlPreamble::setParams()
 {
        delete params_;
-       params_ = new string(lv_.buffer()->params.preamble);
+       params_ = new string(buffer()->params.preamble);
 }
 
 
index 8e5ba18f4f8a63899a957a24e445255fe959e668..0845ec8648b00a951ca2fff0065d82db982a2b95 100644 (file)
 #include "ViewBase.h"
 #include "ButtonControllerBase.h"
 #include "buffer.h"
-#include "frontends/LyXView.h"
 #include "PrinterParams.h"
 #include "Liason.h"
 #include "helper_funcs.h"
 #include "frontends/Alert.h"
 #include "gettext.h"
-#include "BufferView.h"
 #include "support/LAssert.h"
 
 using Liason::printBuffer;
@@ -42,12 +40,12 @@ ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
 
 void ControlPrint::apply()
 {
-       if (!lv_.view()->available())
+       if (!bufferIsAvailable())
                return;
 
        view().apply();
 
-       if (!printBuffer(lv_.buffer(), params())) {
+       if (!printBuffer(buffer(), params())) {
                Alert::alert(_("Error:"),
                           _("Unable to print"),
                           _("Check that your parameters are correct"));
@@ -65,7 +63,7 @@ PrinterParams & ControlPrint::params() const
 void ControlPrint::setParams()
 {
        if (params_) delete params_;
-       params_ = new PrinterParams(getPrinterParams(lv_.buffer()));
+       params_ = new PrinterParams(getPrinterParams(buffer()));
 
        bc().valid(); // so that the user can press Ok
 }
@@ -86,6 +84,6 @@ string const ControlPrint::Browse(string const & in_name)
        string const pattern = "*.ps";
 
        // Show the file browser dialog
-       return browseRelFile(&lv_, in_name, lv_.buffer()->filePath(),
+       return browseRelFile(&lv_, in_name, buffer()->filePath(),
                             title, pattern);
 }
index 3afb56b835fbfc5437bc8c61f9fc3566cd6b7fea..2470e55f0f34e5381e56062f5db46b3982e4bc6e 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "ControlRef.h"
 #include "lyxfunc.h"
+#include "buffer.h"
 #include "bufferlist.h"
 #include "funcrequest.h"
 
@@ -36,29 +37,28 @@ ControlRef::ControlRef(LyXView & lv, Dialogs & d)
 
 vector<string> const ControlRef::getLabelList(string const & name) const
 {
-       Buffer * buffer = bufferlist.getBuffer(MakeAbsPath(name));
-       if (!buffer)
-               buffer = lv_.buffer();
-       return buffer->getLabelList();
+       Buffer const * buf = bufferlist.getBuffer(MakeAbsPath(name));
+       if (!buf)
+               buf = buffer();
+       return buf->getLabelList();
 }
 
 
-void ControlRef::gotoRef(string const & ref) const
+void ControlRef::gotoRef(string const & ref)
 {
-       lv_.getLyXFunc()->dispatch(FuncRequest(LFUN_BOOKMARK_SAVE, "0"), false);
-       lv_.getLyXFunc()->dispatch(FuncRequest(LFUN_REF_GOTO, ref));
+       lyxfunc().dispatch(FuncRequest(LFUN_BOOKMARK_SAVE, "0"), false);
+       lyxfunc().dispatch(FuncRequest(LFUN_REF_GOTO, ref));
 }
 
 
-void ControlRef::gotoBookmark() const
+void ControlRef::gotoBookmark()
 {
-       lv_.getLyXFunc()->dispatch(FuncRequest(LFUN_BOOKMARK_GOTO, "0"), false);
+       lyxfunc().dispatch(FuncRequest(LFUN_BOOKMARK_GOTO, "0"), false);
 }
 
 
 vector<string> const ControlRef::getBufferList() const
 {
-
        vector<string> buffers = bufferlist.getFileNames();
        for (vector<string>::iterator it = buffers.begin();
             it != buffers.end(); ++it) {
@@ -72,7 +72,7 @@ vector<string> const ControlRef::getBufferList() const
 int ControlRef::getBufferNum() const
 {
        vector<string> buffers = bufferlist.getFileNames();
-       string const name = lv_.buffer()->fileName();
+       string const name = buffer()->fileName();
        vector<string>::const_iterator cit =
                find(buffers.begin(), buffers.end(), name);
        if (cit == buffers.end())
index df6c4e9322ecc6cc2576d96a3f1ee9e4508ff537..fdf4a2510855c794477f5200caea6e9a5044b30b 100644 (file)
@@ -31,9 +31,9 @@ public:
        ///
        std::vector<string> const getLabelList(string const &) const;
        ///
-       void gotoRef(string const &) const;
+       void gotoRef(string const &);
        ///
-       void gotoBookmark() const;
+       void gotoBookmark();
        ///
        std::vector<string> const getBufferList() const;
        ///
index 22a012a7bf66c3f3b9147cf67ecbaae6410449b3..0ccfd73f0c156f02bb8129298dafc3315de3505b 100644 (file)
 
 #include "ControlSearch.h"
 #include "Liason.h"
-#include "buffer.h"
 #include "lyxfind.h"
 #include "gettext.h"
-#include "BufferView.h"
 
-#include "frontends/LyXView.h"
 
 #include "support/lstrings.h"
 
@@ -37,9 +34,9 @@ ControlSearch::ControlSearch(LyXView & lv, Dialogs & d)
 
 
 void ControlSearch::find(string const & search,
-                        bool casesensitive, bool matchword, bool forward) const
+                        bool casesensitive, bool matchword, bool forward)
 {
-       bool const found = lyxfind::LyXFind(lv_.view().get(), search,
+       bool const found = lyxfind::LyXFind(bufferview(), search,
                                            forward, casesensitive,
                                            matchword);
 
@@ -49,14 +46,14 @@ void ControlSearch::find(string const & search,
 
 
 void ControlSearch::replace(string const & search, string const & replace,
-                           bool casesensitive, bool matchword, bool all) const
+                           bool casesensitive, bool matchword, bool all)
 {
        // If not replacing all instances of the word, then do not
        // move on to the next instance once the present instance has been
        // changed
        bool const once = !all;
        int const replace_count =
-               lyxfind::LyXReplace(lv_.view().get(),
+               lyxfind::LyXReplace(bufferview(),
                                    search, replace, true, casesensitive,
                                    matchword, all, once);
 
index 8334e3a09458e9318c118e911394ece2975e4797..0b45b09b2671087f3cc3d9ea2975d3a0fdcaea65 100644 (file)
@@ -31,11 +31,11 @@ public:
 
        /// Searches occurence of string
        void find(string const & search,
-                 bool casesensitive, bool matchword, bool forward) const;
+                 bool casesensitive, bool matchword, bool forward);
 
        /// Replaces occurence of string
        void replace(string const & search, string const & replace,
-                    bool casesensitive, bool matchword, bool all) const;
+                    bool casesensitive, bool matchword, bool all);
 
 private:
        /// not needed.
index 4fc80abe1e921cebc58bb3c7cd16143d6a462c52..1daf97a6bf154ab132245a2f907119de9c3ca87a 100644 (file)
@@ -14,8 +14,6 @@
 
 #include "ControlSendto.h"
 #include "ViewBase.h"
-#include "frontends/LyXView.h"
-#include "BufferView.h"
 #include "buffer.h"
 #include "converter.h"
 #include "exporter.h"
@@ -43,13 +41,13 @@ vector<Format const *> const ControlSendto::allFormats() const
        exports.push_back("lyx");
        exports.push_back("text");
 
-       if (lv_.buffer()->isLatex())
+       if (buffer()->isLatex())
                exports.push_back("latex");
-       if (lv_.buffer()->isLinuxDoc())
+       if (buffer()->isLinuxDoc())
                exports.push_back("linuxdoc");
-       if (lv_.buffer()->isDocBook())
+       if (buffer()->isDocBook())
                exports.push_back("docbook");
-       if (lv_.buffer()->isLiterate())
+       if (buffer()->isLiterate())
                exports.push_back("literate");
 
        // Loop over these native formats and ascertain what formats we
@@ -104,7 +102,7 @@ void ControlSendto::setCommand(string const & cmd)
 
 void ControlSendto::apply()
 {
-       if (!lv_.view()->available())
+       if (!bufferIsAvailable())
                return;
 
        view().apply();
@@ -117,15 +115,15 @@ void ControlSendto::apply()
 
        // Output to filename
        if (format_->name() == "lyx") {
-               filename = ChangeExtension(lv_.buffer()->getLatexName(false),
+               filename = ChangeExtension(buffer()->getLatexName(false),
                                           format_->extension());
-               if (!lv_.buffer()->tmppath.empty())
-                       filename = AddName(lv_.buffer()->tmppath, filename);
+               if (!buffer()->tmppath.empty())
+                       filename = AddName(buffer()->tmppath, filename);
 
-               lv_.buffer()->writeFile(filename);
+               buffer()->writeFile(filename);
 
        } else {
-               Exporter::Export(lv_.buffer(), format_->name(), true, filename);
+               Exporter::Export(buffer(), format_->name(), true, filename);
        }
 
        // Substitute $$FName for filename
index 78191572a2cc58087d1a4747df1236462ea26472..488319605af58a811fe7553d7a048f0a88518027 100644 (file)
@@ -24,7 +24,6 @@
 #include "Dialogs.h"
 #include "Liason.h"
 
-#include "frontends/LyXView.h"
 #include "frontends/Alert.h"
 
 #include "support/lstrings.h"
@@ -49,15 +48,15 @@ void ControlSpellchecker::setParams()
 #ifdef USE_PSPELL
                if (lyxrc.use_pspell) {
                        tmp = (lyxrc.isp_use_alt_lang) ?
-                               lyxrc.isp_alt_lang : lv_.buffer()->params.language->code();
+                               lyxrc.isp_alt_lang : buffer()->params.language->code();
 
-                       speller_ = new PSpell(lv_.view()->buffer()->params, tmp);
+                       speller_ = new PSpell(buffer()->params, tmp);
                } else {
 #endif
                        tmp = (lyxrc.isp_use_alt_lang) ?
-                               lyxrc.isp_alt_lang : lv_.buffer()->params.language->lang();
+                               lyxrc.isp_alt_lang : buffer()->params.language->lang();
 
-                       speller_ = new ISpell(lv_.view()->buffer()->params, tmp);
+                       speller_ = new ISpell(buffer()->params, tmp);
 #ifdef USE_PSPELL
                }
 #endif
@@ -67,7 +66,7 @@ void ControlSpellchecker::setParams()
                        if (lang)
                                rtl_ = lang->RightToLeft();
                } else {
-                       rtl_ = lv_.buffer()->params.language->RightToLeft();
+                       rtl_ = buffer()->params.language->RightToLeft();
                }
 
                if (!speller_->error().empty()) {
@@ -86,12 +85,12 @@ void ControlSpellchecker::check()
        stop_ = false;
 
        // clear any old selection
-       LyXText * text = lv_.view()->getLyXText();
-       lv_.view()->toggleSelection(true);
-       lv_.view()->update(text, BufferView::SELECT);
+       LyXText * text = bufferview()->getLyXText();
+       bufferview()->toggleSelection(true);
+       bufferview()->update(text, BufferView::SELECT);
 
        while ((res == SpellBase::OK || res == SpellBase::IGNORE) && !stop_) {
-               word_ = lv_.view()->nextWord(newval_);
+               word_ = bufferview()->nextWord(newval_);
 
                if (word_.word().empty()) {
                        clearParams();
@@ -118,7 +117,7 @@ void ControlSpellchecker::check()
        }
 
        if (!stop_ && !word_.word().empty())
-               lv_.view()->selectLastWord();
+               bufferview()->selectLastWord();
 
        // set suggestions
        if (res != SpellBase::OK && res != SpellBase::IGNORE) {
@@ -129,7 +128,7 @@ void ControlSpellchecker::check()
 
 void ControlSpellchecker::replace(string const & replacement)
 {
-       lv_.view()->replaceWord(replacement);
+       bufferview()->replaceWord(replacement);
        // fix up the count
        --count_;
        check();
@@ -180,7 +179,7 @@ void ControlSpellchecker::ignoreAll()
 void ControlSpellchecker::stop()
 {
        stop_ = true;
-       lv_.view()->endOfSpellCheck();
+       bufferview()->endOfSpellCheck();
 }
 
 
@@ -215,7 +214,7 @@ void ControlSpellchecker::clearParams()
 
        delete speller_;
 
-       lv_.view()->endOfSpellCheck();
+       bufferview()->endOfSpellCheck();
 
        // show closing message if any words were checked.
        if (count_ > 0)
index 58a7198e8997414137cd4ae6bfdcf57f4f73f244..5ed7bebe2f76199aee579d602f6d338029dccd77 100644 (file)
 #include "ControlTabularCreate.h"
 #include "ViewBase.h"
 #include "ButtonControllerBase.h"
-#include "BufferView.h"
 #include "lyxfunc.h"
 #include "funcrequest.h"
 
-#include "frontends/LyXView.h"
 
 #include "support/lstrings.h"
 
@@ -47,11 +45,11 @@ void ControlTabularCreate::setParams()
 
 void ControlTabularCreate::apply()
 {
-       if (!lv_.view()->available())
+       if (!bufferIsAvailable())
                return;
 
        view().apply();
 
        string const val = tostr(params().first) + " " + tostr(params().second);
-       lv_.getLyXFunc()->dispatch(FuncRequest(LFUN_TABULAR_INSERT, val));
+       lyxfunc().dispatch(FuncRequest(LFUN_TABULAR_INSERT, val));
 }
index b3d1d6c7c4dac57b4bd4bbc175d800a2236150a0..ac8faf1d60da36a12e4f27515cc532f3f77f19a2 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "ControlTexinfo.h"
 #include "Dialogs.h"
-#include "BufferView.h"
 #include "gettext.h"
 #include "helper_funcs.h"
 #include "tex_helpers.h"
index 1dc8fc25090a2eafd61c762a252042c9cba7d036..51db250e522f8bf94d0b30f67c1d0912b4da5bbc 100644 (file)
 #include "ControlThesaurus.h"
 #include "Liason.h"
 #include "lyxfind.h"
-#include "buffer.h"
 #include "gettext.h"
-#include "BufferView.h"
 
-#include "frontends/LyXView.h"
 
 using Liason::setMinibuffer;
 
@@ -43,7 +40,7 @@ void ControlThesaurus::replace(string const & newstr)
         * deletion/change !
         */
        int const replace_count =
-               lyxfind::LyXReplace(lv_.view().get(), oldstr_, newstr,
+               lyxfind::LyXReplace(bufferview(), oldstr_, newstr,
                                    true, true, true, false, true);
 
        oldstr_ = newstr;
index 7af987fad6a710079c5803d66405e6ea436e283e..ba57eb8d374b5d30c102fee789cab761ea1619f5 100644 (file)
@@ -19,8 +19,6 @@
 
 #include "ControlToc.h"
 #include "toc.h"
-#include "Dialogs.h"
-#include "BufferView.h"
 
 #include "support/lstrings.h" // tostr
 
@@ -41,7 +39,7 @@ void ControlToc::goTo(toc::TocItem const & item) const
 
 vector<string> const ControlToc::getTypes() const
 {
-       return toc::getTypes(lv_.view()->buffer());
+       return toc::getTypes(buffer());
 }
 
 
@@ -50,11 +48,11 @@ toc::Toc const ControlToc::getContents(string const & type) const
        toc::Toc empty_list;
 
        // This shouldn't be possible...
-       if (!lv_.view()->available()) {
+       if (!bufferIsAvailable()) {
                return empty_list;
        }
 
-       toc::TocList tmp = toc::getTocList(lv_.view()->buffer());
+       toc::TocList tmp = toc::getTocList(buffer());
        toc::TocList::iterator it = tmp.find(type);
        if (it == tmp.end()) {
                return empty_list;
index 2b5f13a2542e7ee85b2eafa2e5db28cdb97a8db4..0e13c4bae3b4b111d20aee7ccb5c61b4b0535254 100644 (file)
 #include "Lsstream.h"
 #include "ButtonControllerBase.h"
 #include "buffer.h"
-#include "BufferView.h"
 #include "lyxrc.h"
 #include "gettext.h"
 
-#include "frontends/LyXView.h"
 
 #include "support/lyxlib.h"
 
@@ -42,13 +40,13 @@ ControlVCLog::ControlVCLog(LyXView & lv, Dialogs & d)
 
 string const ControlVCLog::getBufferFileName() const
 {
-       return lv_.view()->buffer()->fileName();
+       return buffer()->fileName();
 }
 
 
 stringstream & ControlVCLog::getVCLogFile(stringstream & ss) const
 {
-       string const name = lv_.view()->buffer()->lyxvc.getLogFile();
+       string const name = buffer()->lyxvc.getLogFile();
 
        std::ifstream in(name.c_str());
 
index 11afc6e7a90c059b01c559e957866b0cbf6759af..872db30711785987ddd387920496388377f26c48 100644 (file)
@@ -1,3 +1,12 @@
+2002-08-12  Angus Leeming  <leeming@lyx.org>
+
+       * FormCitation.C:
+       * FromRef.C: change due to change of ControlConnections method name,
+       isReadonly() -> bufferIsReadonly().
+
+       * FormIndex.C:
+       * FormPrint.C: no longer #include "frontends/LyXView.h".
+
 2002-08-12  Angus Leeming  <leeming@lyx.org>
 
        * Dialogs.C (c-tor): connect the Tooltips::toggleEnabled method to
index 22ac62b05d238701e5196a2f6e21c09d05575892..8b024de9284ed57f7ab3fce6779e93fb8eb1c6f4 100644 (file)
@@ -307,7 +307,7 @@ ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long)
                        fl_set_browser_topline(dialog_->browser_cite, n+1);
                }
 
-               if (!controller().isReadonly()) {
+               if (!controller().bufferIsReadonly()) {
                        if (cit != citekeys.end()) {
                                setBibButtons(OFF);
                                setCiteButtons(ON);
@@ -322,7 +322,7 @@ ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long)
                if (sel < 1 || sel > citekeys.size())
                        return ButtonPolicy::SMI_NOOP;
 
-               if (!controller().isReadonly()) {
+               if (!controller().bufferIsReadonly()) {
                        setBibButtons(OFF);
                        setCiteButtons(ON);
                }
index 7921e66cadbd1833a30d717796b2d45529a79626..9802e856bebe1b329dbdab561af4620dbd71a473 100644 (file)
@@ -15,7 +15,6 @@
 #include "xformsBC.h"
 #include "ControlIndex.h"
 #include "FormIndex.h"
-#include "frontends/LyXView.h"
 #include "forms/form_index.h"
 #include FORMS_H_LOCATION
 
index 7794204f5a88c5710f99f53889510c331e14f75f..0e3f6367663acb164280ad293b7f343ea61b6cc8 100644 (file)
@@ -18,8 +18,6 @@
 #include "FormPrint.h"
 #include "forms/form_print.h"
 
-#include "frontends/LyXView.h"
-
 #include "PrinterParams.h"
 
 #include "input_validators.h"
index 70640bd4bd56f7e1a154b90dea6fbb07e3ed3e86..ccbe105b290c4d2b9a45c005d7b70b9cc7dd4cc1 100644 (file)
@@ -200,7 +200,7 @@ ButtonPolicy::SMInput FormRef::input(FL_OBJECT * ob, long)
                if (sel < 1 || sel > refs_.size())
                        return ButtonPolicy::SMI_NOOP;
 
-               if (!controller().isReadonly()) {
+               if (!controller().bufferIsReadonly()) {
                        string s = fl_get_browser_line(dialog_->browser_refs, sel);
                        fl_set_input(dialog_->input_ref, s.c_str());
                }