]> git.lyx.org Git - features.git/commitdiff
* LyXView: the accessor methods now return a reference to the member
authorAngus Leeming <leeming@lyx.org>
Tue, 13 Aug 2002 14:40:38 +0000 (14:40 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 13 Aug 2002 14:40:38 +0000 (14:40 +0000)
variables, not a pointer.
* WordLangTuple: you can forward-declare a return type you know ;-)
* Qt: get it to compile again, having broken it yesterday.
* Everything else? See above.

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

71 files changed:
src/BufferView.h
src/BufferView2.C
src/BufferView_pimpl.C
src/ChangeLog
src/SpellBase.h
src/WordLangTuple.h
src/buffer.C
src/converter.C
src/frontends/ChangeLog
src/frontends/LyXView.C
src/frontends/LyXView.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlConnections.C
src/frontends/controllers/ControlSpellchecker.h
src/frontends/controllers/ControlTexinfo.C
src/frontends/qt2/ChangeLog
src/frontends/qt2/FileDialog_private.C
src/frontends/qt2/Menubar_pimpl.C
src/frontends/qt2/Qt2Base.h
src/frontends/qt2/QtView.C
src/frontends/qt2/Toolbar_pimpl.C
src/frontends/qt2/lyx_gui.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FileDialog.C
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/Toolbar_pimpl.C
src/frontends/xforms/XFormsView.C
src/frontends/xforms/lyx_gui.C
src/importer.C
src/insets/ChangeLog
src/insets/inset.C
src/insets/inset.h
src/insets/insetbib.C
src/insets/insetcite.C
src/insets/insetcollapsable.C
src/insets/insetcollapsable.h
src/insets/inseterror.C
src/insets/insetert.C
src/insets/insetert.h
src/insets/insetexternal.C
src/insets/insetfloat.C
src/insets/insetfloatlist.C
src/insets/insetgraphics.C
src/insets/insetinclude.C
src/insets/insetindex.C
src/insets/insetminipage.C
src/insets/insetparent.C
src/insets/insetref.C
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/insets/insettoc.C
src/insets/inseturl.C
src/ispell.C
src/lyxfunc.C
src/lyxtext.h
src/lyxvc.C
src/mathed/ChangeLog
src/mathed/formulabase.C
src/mathed/math_inset.C
src/mathed/math_inset.h
src/mathed/ref_inset.C
src/pspell.C
src/text.C
src/toc.C
src/vc-backend.C

index 5f1f8fc25e3cdc42558a0d50c7dc01d33fe17a76..454dab6cf8f18feeca1110752e32339c27d41078 100644 (file)
@@ -18,7 +18,6 @@
 #include "undo.h"
 
 #include "insets/inset.h"
-#include "WordLangTuple.h"
 
 #include <boost/utility.hpp>
 
@@ -30,6 +29,7 @@ class LyXScreen;
 class Language;
 class Painter;
 class UpdatableInset;
+class WordLangTuple;
 
 ///
 class BufferView : boost::noncopyable {
index b32045a32f59a2a490034e937fe5caca2a949ee1..f555045e72ce8a73f656339dc791ea245f858339 100644 (file)
@@ -25,6 +25,7 @@
 #include "debug.h"
 #include "iterators.h"
 #include "lyxlex.h"
+#include "WordLangTuple.h"
 
 #include "frontends/Alert.h"
 #include "frontends/Dialogs.h"
@@ -612,13 +613,13 @@ int BufferView::unlockInset(UpdatableInset * inset)
                // make sure we update the combo !
                owner()->setLayout(getLyXText()->cursor.par()->layout()->name());
                // Tell the paragraph dialog that we changed paragraph
-               owner()->getDialogs()->updateParagraph();
+               owner()->getDialogs().updateParagraph();
                finishUndo();
                return 0;
        } else if (inset && theLockingInset() &&
                   theLockingInset()->unlockInsetInInset(this, inset)) {
                // Tell the paragraph dialog that we changed paragraph
-               owner()->getDialogs()->updateParagraph();
+               owner()->getDialogs().updateParagraph();
                // owner inset has updated the layout combo
                finishUndo();
                return 0;
index d0e77c5d1f12a6a3b70d9b97d9adc6db4711fd9b..866e32c607685dfad40f2930ac6a8e38e86ca19b 100644 (file)
@@ -238,10 +238,10 @@ void BufferView::Pimpl::buffer(Buffer * b)
                // Similarly, buffer-dependent dialogs should be updated or
                // hidden. This should go here because some dialogs (eg ToC)
                // require bv_->text.
-               owner_->getDialogs()->updateBufferDependent(true);
+               owner_->getDialogs().updateBufferDependent(true);
        } else {
                lyxerr[Debug::INFO] << "  No Buffer!" << endl;
-               owner_->getDialogs()->hideBufferDependent();
+               owner_->getDialogs().hideBufferDependent();
 
                // Also remove all remaining text's from the testcache.
                // (there should not be any!) (if there is any it is a
@@ -274,7 +274,7 @@ bool BufferView::Pimpl::fitCursor()
                ret = screen().fitCursor(bv_->text, bv_);
        }
 
-       bv_->owner()->getDialogs()->updateParagraph();
+       bv_->owner()->getDialogs().updateParagraph();
        if (ret)
                updateScrollbar();
        return ret;
@@ -447,7 +447,7 @@ int BufferView::Pimpl::scroll(long time)
 void BufferView::Pimpl::workAreaKeyPress(LyXKeySymPtr key,
                                         key_modifier::state state)
 {
-       bv_->owner()->getLyXFunc()->processKeySym(key, state);
+       bv_->owner()->getLyXFunc().processKeySym(key, state);
 }
 
 
@@ -545,7 +545,7 @@ void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos,
        // we have to check this first
        bool paste_internally = false;
        if (button == mouse_button::button2 && bv_->getLyXText()->selection.set()) {
-               owner_->getLyXFunc()->dispatch(LFUN_COPY);
+               owner_->getLyXFunc().dispatch(LFUN_COPY);
                paste_internally = true;
        }
 
@@ -616,9 +616,9 @@ void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos,
        // insert this
        if (button == mouse_button::button2) {
                if (paste_internally)
-                       owner_->getLyXFunc()->dispatch(LFUN_PASTE);
+                       owner_->getLyXFunc().dispatch(LFUN_PASTE);
                else
-                       owner_->getLyXFunc()->dispatch(FuncRequest(LFUN_PASTESELECTION, "paragraph"));
+                       owner_->getLyXFunc().dispatch(FuncRequest(LFUN_PASTESELECTION, "paragraph"));
                selection_possible = false;
                return;
        }
@@ -1272,11 +1272,11 @@ void BufferView::Pimpl::switchKeyMap()
            && !(bv_->theLockingInset()
                 && bv_->theLockingInset()->lyxCode()== Inset::ERT_CODE))
        {
-               if (owner_->getIntl()->keymap == Intl::PRIMARY)
-                       owner_->getIntl()->KeyMapSec();
+               if (owner_->getIntl().keymap == Intl::PRIMARY)
+                       owner_->getIntl().KeyMapSec();
        } else {
-               if (owner_->getIntl()->keymap == Intl::SECONDARY)
-                       owner_->getIntl()->KeyMapPrim();
+               if (owner_->getIntl().keymap == Intl::SECONDARY)
+                       owner_->getIntl().KeyMapPrim();
        }
 }
 
@@ -1617,7 +1617,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                break;
 
        case LFUN_FREE:
-               owner_->getDialogs()->setUserFreeFont();
+               owner_->getDialogs().setUserFreeFont();
                break;
 
        case LFUN_FILE_INSERT:
@@ -1643,7 +1643,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                // function list/array with information about what
                // functions needs arguments and their type.
                if (ev.argument.empty()) {
-                       owner_->getLyXFunc()->setErrorMessage(
+                       owner_->getLyXFunc().setErrorMessage(
                                _("LyX function 'layout' needs an argument."));
                        break;
                }
@@ -1661,7 +1661,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                }
 
                if (!hasLayout) {
-                       owner_->getLyXFunc()->setErrorMessage(
+                       owner_->getLyXFunc().setErrorMessage(
                                string(N_("Layout ")) + ev.argument +
                                N_(" not known"));
                        break;
@@ -1750,7 +1750,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                break;
 
        case LFUN_FONT_STATE:
-               owner_->getLyXFunc()->setMessage(currentState(bv_));
+               owner_->getLyXFunc().setMessage(currentState(bv_));
                break;
 
        case LFUN_UPCASE_WORD:
@@ -1823,7 +1823,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        case LFUN_REF_INSERT:
                if (ev.argument.empty()) {
                        InsetCommandParams p("ref");
-                       owner_->getDialogs()->createRef(p.getAsString());
+                       owner_->getDialogs().createRef(p.getAsString());
                } else {
                        InsetCommandParams p;
                        p.setFromString(ev.argument);
@@ -1881,7 +1881,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                    && lt->cursor.par()->isInset(lt->cursor.pos())
                    && isHighlyEditableInset(lt->cursor.par()->getInset(lt->cursor.pos()))) {
                        Inset * tmpinset = lt->cursor.par()->getInset(lt->cursor.pos());
-                       owner_->getLyXFunc()->setMessage(tmpinset->editMessage());
+                       owner_->getLyXFunc().setMessage(tmpinset->editMessage());
                        if (is_rtl)
                                tmpinset->edit(bv_, false);
                        else
@@ -1913,7 +1913,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                    lt->cursor.par()->isInset(lt->cursor.pos()) &&
                    isHighlyEditableInset(lt->cursor.par()->getInset(lt->cursor.pos()))) {
                        Inset * tmpinset = lt->cursor.par()->getInset(lt->cursor.pos());
-                       owner_->getLyXFunc()->setMessage(tmpinset->editMessage());
+                       owner_->getLyXFunc().setMessage(tmpinset->editMessage());
                        if (is_rtl)
                                tmpinset->edit(bv_);
                        else
@@ -2357,14 +2357,14 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                        update(lt,
                               BufferView::SELECT
                               | BufferView::FITCUR);
-                       owner_->getLyXFunc()->setMessage(N_("Mark removed"));
+                       owner_->getLyXFunc().setMessage(N_("Mark removed"));
                } else {
                        beforeChange(lt);
                        lt->selection.mark(true);
                        update(lt,
                               BufferView::SELECT
                               | BufferView::FITCUR);
-                       owner_->getLyXFunc()->setMessage(N_("Mark set"));
+                       owner_->getLyXFunc().setMessage(N_("Mark set"));
                }
                lt->selection.cursor = lt->cursor;
        }
@@ -2495,7 +2495,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                beforeChange(lt);
                update(lt, BufferView::SELECT|BufferView::FITCUR);
                lt->selection.cursor = lt->cursor;
-               owner_->getLyXFunc()->setMessage(N_("Mark off"));
+               owner_->getLyXFunc().setMessage(N_("Mark off"));
        }
        break;
 
@@ -2508,7 +2508,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                lt->selection.mark(true);
                update(lt, BufferView::SELECT|BufferView::FITCUR);
                lt->selection.cursor = lt->cursor;
-               owner_->getLyXFunc()->setMessage(N_("Mark on"));
+               owner_->getLyXFunc().setMessage(N_("Mark on"));
        }
        break;
 
@@ -2517,7 +2517,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                LyXText * lt = bv_->getLyXText();
 
                if (!lt->selection.set()) {
-                       if (owner_->getIntl()->getTransManager().backspace()) {
+                       if (owner_->getIntl().getTransManager().backspace()) {
                                lt->backspace(bv_);
                                lt->selection.cursor = lt->cursor;
                                update(lt,
@@ -2720,7 +2720,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                        p.setCmdName("htmlurl");
                else
                        p.setCmdName("url");
-               owner_->getDialogs()->createUrl(p.getAsString());
+               owner_->getDialogs().createUrl(p.getAsString());
        }
        break;
 
@@ -2818,7 +2818,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        case LFUN_TABULAR_INSERT:
        {
                if (ev.argument.empty()) {
-                       owner_->getDialogs()->showTabularCreate();
+                       owner_->getDialogs().showTabularCreate();
                        break;
                }
 
@@ -2840,15 +2840,15 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        {
                pos_type pos = bv_->getLyXText()->cursor.pos();
                if (pos < bv_->getLyXText()->cursor.par()->size())
-                       owner_->getLyXFunc()->setMessage(
+                       owner_->getLyXFunc().setMessage(
                                tostr(bv_->getLyXText()->cursor.par()->getChar(pos)));
                else
-                       owner_->getLyXFunc()->setMessage("EOF");
+                       owner_->getLyXFunc().setMessage("EOF");
        }
        break;
 
        case LFUN_GETXY:
-               owner_->getLyXFunc()->setMessage(tostr(bv_->getLyXText()->cursor.x())
+               owner_->getLyXFunc().setMessage(tostr(bv_->getLyXText()->cursor.x())
                                                 + ' '
                                                 + tostr(bv_->getLyXText()->cursor.y()));
                break;
@@ -2866,18 +2866,18 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        break;
 
        case LFUN_GETLAYOUT:
-               owner_->getLyXFunc()->setMessage(tostr(bv_->getLyXText()->cursor.par()->layout()));
+               owner_->getLyXFunc().setMessage(tostr(bv_->getLyXText()->cursor.par()->layout()));
                break;
 
        case LFUN_GETFONT:
        {
                LyXFont & font = bv_->getLyXText()->current_font;
                if (font.shape() == LyXFont::ITALIC_SHAPE)
-                       owner_->getLyXFunc()->setMessage("E");
+                       owner_->getLyXFunc().setMessage("E");
                else if (font.shape() == LyXFont::SMALLCAPS_SHAPE)
-                       owner_->getLyXFunc()->setMessage("N");
+                       owner_->getLyXFunc().setMessage("N");
                else
-                       owner_->getLyXFunc()->setMessage("0");
+                       owner_->getLyXFunc().setMessage("0");
 
        }
        break;
@@ -2903,10 +2903,10 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        case LFUN_OGONEK:
                if (ev.argument.empty()) {
                        // As always...
-                       owner_->getLyXFunc()->handleKeyFunc(ev.action);
+                       owner_->getLyXFunc().handleKeyFunc(ev.action);
                } else {
-                       owner_->getLyXFunc()->handleKeyFunc(ev.action);
-                       owner_->getIntl()->getTransManager()
+                       owner_->getLyXFunc().handleKeyFunc(ev.action);
+                       owner_->getIntl().getTransManager()
                                .TranslateAndInsert(ev.argument[0], bv_->getLyXText());
                        update(bv_->getLyXText(),
                               BufferView::SELECT
@@ -3022,7 +3022,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                }
 
                if (entry.empty()) {
-                       owner_->getDialogs()->createIndex();
+                       owner_->getDialogs().createIndex();
                        break;
                }
 
@@ -3066,7 +3066,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                        delete inset;
                else {
                        updateInset(inset, true);
-                       bv_->owner()->getDialogs()->showInclude(inset);
+                       bv_->owner()->getDialogs().showInclude(inset);
                }
        }
        break;
@@ -3099,7 +3099,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                        }
                }
 
-               bv_->owner()->getDialogs()->showThesaurus(arg);
+               bv_->owner()->getDialogs().showThesaurus(arg);
        }
                break;
 
@@ -3132,7 +3132,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
                string::const_iterator cit = ev.argument.begin();
                string::const_iterator end = ev.argument.end();
                for (; cit != end; ++cit) {
-                       owner_->getIntl()->getTransManager().
+                       owner_->getIntl().getTransManager().
                                TranslateAndInsert(*cit, lt);
                }
 
@@ -3182,7 +3182,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
        break;
 
        case LFUN_UNKNOWN_ACTION:
-               owner_->getLyXFunc()->setErrorMessage(N_("Unknown function!"));
+               owner_->getLyXFunc().setErrorMessage(N_("Unknown function!"));
                break;
 
        default:
@@ -3265,8 +3265,8 @@ void BufferView::Pimpl::smartQuote()
 
        if (style->pass_thru ||
                (!insertInset(new InsetQuotes(c, bv_->buffer()->params))))
-               bv_->owner()->getLyXFunc()
-                       ->dispatch(FuncRequest(LFUN_SELFINSERT, "\""));
+               bv_->owner()->getLyXFunc().
+                       dispatch(FuncRequest(LFUN_SELFINSERT, "\""));
 }
 
 
@@ -3288,7 +3288,7 @@ void BufferView::Pimpl::insertAndEditInset(Inset * inset)
        if (insertInset(inset)) {
                inset->edit(bv_);
                if (gotsel)
-                       owner_->getLyXFunc()->dispatch(LFUN_PASTESELECTION);
+                       owner_->getLyXFunc().dispatch(LFUN_PASTESELECTION);
        }
        else
                delete inset;
index a27614c5287618721d1ab896fa49835b051954d4..236dbb5cc508f01707c79583468aa08c03a83d93 100644 (file)
@@ -1,3 +1,34 @@
+2002-08-13  Angus Leeming  <leeming@lyx.org>
+
+       * BufferView2.C:
+       * BufferView_pimpl.C:
+       * buffer.C:
+       * converter.C:
+       * importer.C:
+       * lyxfunc.C:
+       * lyxvc.C:
+       * toc.C:
+       * vc-backend.C:
+       changes due to the changed LyXView interface that now returns references
+       to member variables not pointers.
+
+2002-08-13  Angus Leeming  <leeming@lyx.org>
+
+       * WordLangTuple (word, lang_code): return references to strings,
+       not strings.
+
+       * BufferView.h:
+       * SpellBase.h:
+       * lyxtext.h: forward-declare WordLangTuple.
+
+       * BufferView2.C:
+       * ispell.C:
+       * pspell.C:
+       * text.C: #include "WordLangTuple.h".
+
+       * lyxtext.h:
+       * text.C: (selectNextWordToSpellcheck): constify return type.
+
 2002-08-12  Martin Vermeer <martin.vermeer@hut.fi>
 
        * buffer.C:
index 1348c1e24c0eaee599cf2c482d328bc4beb3ee1e..2d5f4ddfaaee97e602527bea3eaf10e4fe41f0d0 100644 (file)
@@ -12,9 +12,8 @@
 
 #include "LString.h" // can't forward declare...
 
-#include "WordLangTuple.h"
 class BufferParams;
+class WordLangTuple;
 
 /**
  * Base class of all spell checker implementations.
index 47343f6a4f616ce624da4b2215e41c2d6f2ad40e..90fd01918f3ad72d65aa69c8dc1a25c5b24d67ad 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef WORD_LANG_TUPLE_H
 #define WORD_LANG_TUPLE_H
  
-#include <config.h>
 #include "LString.h" 
  
 /**
@@ -25,12 +24,12 @@ public:
        {}
  
        /// return the word
-       string const word() const {
+       string const word() const {
                return word_;
        }
 
        /// return its language code
-       string const lang_code() const {
+       string const lang_code() const {
                return code_;
        }
 
index 2167570ce29365c775b9bc9c736ae5203cdb491e..430de7cf63ae6e46bb55a7f841beca964a4668ad 100644 (file)
@@ -241,7 +241,7 @@ void Buffer::setReadonly(bool flag)
        if (read_only != flag) {
                read_only = flag;
                updateTitles();
-               users->owner()->getDialogs()->updateBufferDependent(false);
+               users->owner()->getDialogs().updateBufferDependent(false);
        }
 }
 
index 7b86dd6786988262aac965a94f71baf92f9e3fe3..4b3bf5fe86701abdbc51142e966e4aadc34cac81 100644 (file)
@@ -852,7 +852,7 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
        LaTeX latex(command, name, buffer->filePath());
        TeXErrors terr;
        int result = latex.run(terr,
-                              bv ? bv->owner()->getLyXFunc() : 0);
+                              bv ? &bv->owner()->getLyXFunc() : 0);
 
        if (bv) {
                if ((result & LaTeX::ERRORS)) {
index fb64a27cd080d701ec821728586001ef62cecf03..061adef3224e6db3abf0a1d56eba28b740fad5ef 100644 (file)
@@ -1,3 +1,11 @@
+2002-08-13  Angus Leeming  <leeming@lyx.org>
+
+       * LyXView.[Ch]:
+       (getLyXFunc, getToolbar, getMenubar, getDialogs, getIntl): all now
+       return a reference not a pointer.
+       (controlcommand_, intl_, autosave_timeout_): employ the
+       const scoped_ptr idiom.
+
 2002-08-12  Angus Leeming  <leeming@lyx.org>
 
        * DialogBase.h: no longer derive from boost::signals::trackable.
index 2b34be2980fa8696d20b5cab2386e9c956cb42c6..46b4a0d01b5195ba2e674fcbbf38630b41296ad4 100644 (file)
@@ -45,17 +45,13 @@ string current_layout;
 
 
 LyXView::LyXView()
+       : controlcommand_(new ControlCommandBuffer(getLyXFunc())),
+         intl_(new Intl),
+         autosave_timeout_(new Timeout(5000)),
+         lyxfunc_(new LyXFunc(this)),
+         dialogs_(new Dialogs(this))
 {
        lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl;
-
-       lyxfunc_.reset(new LyXFunc(this));
-       intl_.reset(new Intl);
-
-       // Give the timeout some default sensible value.
-       autosave_timeout_.reset(new Timeout(5000));
-
-       dialogs_.reset(new Dialogs(this));
-       controlcommand_.reset(new ControlCommandBuffer(*getLyXFunc()));
 }
 
 
@@ -92,12 +88,6 @@ boost::shared_ptr<BufferView> const & LyXView::view() const
 }
 
 
-Toolbar * LyXView::getToolbar() const
-{
-       return toolbar_.get();
-}
-
-
 void LyXView::setLayout(string const & layout)
 {
        toolbar_->setLayout(layout);
@@ -110,30 +100,12 @@ void LyXView::updateToolbar()
 }
 
 
-LyXFunc * LyXView::getLyXFunc() const
-{
-       return lyxfunc_.get();
-}
-
-
-Menubar * LyXView::getMenubar() const
-{
-       return menubar_.get();
-}
-
-
 void LyXView::updateMenubar()
 {
        menubar_->update();
 }
 
 
-Intl * LyXView::getIntl() const
-{
-       return intl_.get();
-}
-
-
 void LyXView::autoSave()
 {
        lyxerr[Debug::INFO] << "Running autoSave()" << endl;
index e41c1f02b52db16e9cb2a4bd7e7d762148a6ad46..dff70dad24f4dc4954a1b612d7024036c62997c5 100644 (file)
@@ -77,23 +77,33 @@ public:
         */
        boost::shared_ptr<BufferView> const & view() const;
 
-       /// return the LyX function handler for this view
-       LyXFunc * getLyXFunc() const;
-
        /// return the buffer currently shown in this window
        Buffer * buffer() const;
 
+       /// return the LyX function handler for this view
+       LyXFunc & getLyXFunc() { return *lyxfunc_.get(); }
+       ///
+       LyXFunc const & getLyXFunc() const { return *lyxfunc_.get(); }
+
        /// return the toolbar for this view
-       Toolbar * getToolbar() const;
+       Toolbar & getToolbar() { return *toolbar_.get(); }
+       ///
+       Toolbar const & getToolbar() const { return *toolbar_.get(); }
 
        /// return the menubar for this view
-       Menubar * getMenubar() const;
+       Menubar & getMenubar() { return *menubar_.get(); }
+       ///
+       Menubar const & getMenubar() const { return *menubar_.get(); }
 
        /// get access to the dialogs
-       Dialogs * getDialogs() { return dialogs_.get(); }
+       Dialogs & getDialogs() { return *dialogs_.get(); }
+       ///
+       Dialogs const & getDialogs() const { return *dialogs_.get(); }
 
        /// get this view's keyboard map handler
-       Intl * getIntl() const;
+       Intl & getIntl() { return *intl_.get(); }
+       ///
+       Intl const & getIntl() const { return *intl_.get(); }
 
        //@}
 
@@ -123,7 +133,7 @@ public:
        void resetAutosaveTimer();
 
 protected:
-       /// view of a buffer. FuncRequestually there will be several.
+       /// view of a buffer. Eventtually there will be several.
        boost::shared_ptr<BufferView> bufferview_;
 
        /// view's menubar
@@ -131,16 +141,7 @@ protected:
        /// view's toolbar
        boost::scoped_ptr<Toolbar> toolbar_;
        /// view's command buffer controller
-       boost::scoped_ptr<ControlCommandBuffer> controlcommand_;
-
-       /// keyboard mapping object
-       boost::scoped_ptr<Intl> intl_;
-
-       /// auto-saving of buffers
-       boost::scoped_ptr<Timeout> autosave_timeout_;
-
-       /// called on timeout
-       void autoSave();
+       boost::scoped_ptr<ControlCommandBuffer> const controlcommand_;
 
 private:
        /**
@@ -150,6 +151,13 @@ private:
         */
        virtual void setWindowTitle(string const & t, string const & it) = 0;
 
+       /// called on timeout
+       void autoSave();
+
+       /// keyboard mapping object
+       boost::scoped_ptr<Intl> const intl_;
+       /// auto-saving of buffers
+       boost::scoped_ptr<Timeout> const autosave_timeout_;
        /// our function handler
        boost::scoped_ptr<LyXFunc> lyxfunc_;
        /// dialogs for this view
index 3fa784d00e74faef0c16aa88d716ccb655643c4f..8a84487c38bb583de84dcb9c4153363ed5c60f33 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-13  Angus Leeming  <leeming@lyx.org>
+
+       * ControlConnections.C:
+       * ControlTexinfo.C:
+       changes due to the changed LyXView interface that now returns references
+       to member variables not pointers.
+
 2002-08-12  Angus Leeming  <leeming@lyx.org>
 
        * ControlConnections.[Ch]: (isReadonly): renamed as bufferIsReadonly.
@@ -50,7 +57,7 @@
        * ControlSpellchecker.C: some cleanups
  
        * ControlTabularCreate.C: s/LFUN_INSET_TABULAR/LFUN_TABULAR_INSERT/ 
+ <
 2002-08-02  Edwin Leuven <leuven@fee.uva.nl>
 
        * ControlParagraph.[Ch] (changedParagraph): new method invoked when
@@ -68,7 +75,7 @@
 2002-08-01  John Levon  <levon@movementarian.org>
 
        * ControlSendto.C: writeFile() change
+
 2002-08-01  John Levon  <levon@movementarian.org>
 
        * ControlSpellchecker.h:
index 94cb89091d0ae919ea470690e76237b277e2965a..0f99ed064190cd2ca5b814a3260ed879865bcfa3 100644 (file)
@@ -95,13 +95,13 @@ Buffer const * ControlConnectBase::buffer() const
 
 LyXFunc & ControlConnectBase::lyxfunc()
 {
-       return *lv_.getLyXFunc();
+       return lv_.getLyXFunc();
 }
 
 
 LyXFunc const & ControlConnectBase::lyxfunc() const
 {
-       return *lv_.getLyXFunc();
+       return lv_.getLyXFunc();
 }
 
 
index 65a515f12afe031a205cdeaec7644f0e9c82587b..71fb6bcd62fdd24594a61e06825c0a6cbe0dc782 100644 (file)
@@ -98,7 +98,6 @@ private:
 
        /// The actual spellchecker object
        SpellBase * speller_;
-
 };
 
 #endif // CONTROLSPELLCHECKER_H
index ac8faf1d60da36a12e4f27515cc532f3f77f19a2..46b4c4678966eb131bbe1a376a1e29ff1448e432 100644 (file)
@@ -86,7 +86,7 @@ ControlTexinfo::getContents(texFileSuffix type, bool withFullPath) const
 
 void ControlTexinfo::viewFile(string const filename) const
 {
-       lv_.getDialogs()->showFile(filename);
+       lv_.getDialogs().showFile(filename);
 }
 
 
index 968a020d560c121d15f2070444ad37bd8ad95058..be32813b133b0d1c23c9eed9d214c1f5e28d6273 100644 (file)
@@ -1,3 +1,15 @@
+2002-08-13  Angus Leeming  <leeming@lyx.org>
+
+       * Qt2Base.h: compile fix isReadonly -> bufferIsReadonly.
+
+       * FileDialog_private.C:
+       * Menubar_pimpl.C:
+       * Toolbar_pimpl.C:
+       * QtView.C:
+       * lyx_gui.C:
+       changes due to the changed LyXView interface that now returns references
+       to member variables not pointers.
+
 2002-08-12  Angus Leeming  <leeming@lyx.org>
 
        * Menubar_pimpl.C: no need to #include "Dialogs.h". Remove semi-colon
index 4b97afdee267c1ea18f00945ccd533c957fd3957..03942dfa9e99a8c7e5c7cd794cd4893c7bfbfee2 100644 (file)
@@ -39,7 +39,7 @@ void LyXFileDialog::done(int what)
        }
 
        if (what == QDialog::Accepted)
-               lv_->getLyXFunc()->dispatch(FuncRequest(action_, selectedFile().data()));
+               lv_->getLyXFunc().dispatch(FuncRequest(action_, selectedFile().data()));
 
        delete this;
 }
index 998b0ed9f793bdea4fa6c1aa61047a2cbbc10d23..e62242f2e47ddfe974884e7baa7221d41995fa86 100644 (file)
@@ -123,7 +123,7 @@ void Menubar::Pimpl::updateSubmenu(MenuItemInfo const & i)
        for (; m != end; ++m) {
                if (m->action() > 0) {
                        FuncStatus const status =
-                               owner_->getLyXFunc()->getStatus(m->action());
+                               owner_->getLyXFunc().getStatus(m->action());
                        if (!status.disabled())
                                enable = true;
                }
@@ -146,7 +146,7 @@ void Menubar::Pimpl::updateItem(MenuItemInfo const & i)
        if (i.id_ < 0)
                return;
  
-       FuncStatus const status = owner_->getLyXFunc()->getStatus(i.id_);
+       FuncStatus const status = owner_->getLyXFunc().getStatus(i.id_);
        i.parent_->setItemEnabled(i.id_, !status.disabled());
        i.parent_->setItemChecked(i.id_, status.onoff(true));
 }
index 640a043ced70f68e190772b345517ac027fd2629..3bea0caaefa954a6c4fc882ef4cc4c878bf56719 100644 (file)
@@ -160,7 +160,7 @@ class Qt2CB: public Base
 {
 public:
        bool readOnly() const {
-               return controller().isReadonly();
+               return controller().bufferIsReadonly();
        }
 
 protected:
index 086c775d52adb9b4667ba6b0ada670df651f66c7..0cb50062d939f7138b48c4e426afbde98c51f7a4 100644 (file)
@@ -123,7 +123,7 @@ void QtView::update_view_state()
  
 void QtView::activated(int id)
 {
-       getLyXFunc()->dispatch(id, true);
+       getLyXFunc().dispatch(id, true);
 }
  
  
index 68e8cd5e857dea48731413dd23cad1ee87b57ef6..188590cff5decd48f395ba032f3a089451ecb8d3 100644 (file)
@@ -116,7 +116,7 @@ void Toolbar::Pimpl::update()
                int action = p->second;
  
                FuncStatus const status = 
-                       owner_->getLyXFunc()->getStatus(action);
+                       owner_->getLyXFunc().getStatus(action);
  
                button->setToggleButton(true);
                button->setOn(status.onoff(true));
@@ -124,7 +124,7 @@ void Toolbar::Pimpl::update()
        }
 
        if (combo_)
-               combo_->setEnabled(!owner_->getLyXFunc()->getStatus(LFUN_LAYOUT).disabled());
+               combo_->setEnabled(!owner_->getLyXFunc().getStatus(LFUN_LAYOUT).disabled());
 }
 
 
@@ -137,7 +137,7 @@ void Toolbar::Pimpl::button_selected(QToolButton * button)
                return;
        }
 
-       owner_->getLyXFunc()->dispatch(cit->second, true);
+       owner_->getLyXFunc().dispatch(cit->second, true);
 }
  
 
@@ -150,7 +150,7 @@ void Toolbar::Pimpl::changed_layout(string const & sel)
        for (LyXTextClass::const_iterator cit = tc.begin();
             cit != end; ++cit) {
                if (_((*cit)->name()) == sel) {
-                       owner_->getLyXFunc()->dispatch(FuncRequest(LFUN_LAYOUT, (*cit)->name()));
+                       owner_->getLyXFunc().dispatch(FuncRequest(LFUN_LAYOUT, (*cit)->name()));
                        return;
                }
        }
index acb9e932cbbe76ed5e11d395de0d4bfc3478041b..b0d3b460e322ff50e67551a5d7eda22d873fe9ff 100644 (file)
@@ -89,7 +89,7 @@ void lyx_gui::start(string const & batch, vector<string> files)
 
        // FIXME: some code below needs moving
 
-       lyxserver = new LyXServer(view.getLyXFunc(), lyxrc.lyxpipes);
+       lyxserver = new LyXServer(&view.getLyXFunc(), lyxrc.lyxpipes);
 
        vector<string>::const_iterator cit = files.begin();
        vector<string>::const_iterator end = files.end();
@@ -107,7 +107,7 @@ void lyx_gui::start(string const & batch, vector<string> files)
 
        // handle the batch commands the user asked for
        if (!batch.empty()) {
-               view.getLyXFunc()->dispatch(batch);
+               view.getLyXFunc().dispatch(batch);
        }
 
        qApp->exec();
index f927cc22e83785c4b286cae083b7d855adb9aad3..5f0cc7530de5b391fc77ed594475f285864be142 100644 (file)
@@ -1,3 +1,17 @@
+2002-08-13  Angus Leeming  <leeming@lyx.org>
+
+       * FileDialog.C:
+       * FormMathsDelim.C:
+       * FormMathsMatrix.C:
+       * FormMathsPanel.C:
+       * FormPreferences.C:
+       * Menubar_pimpl.C:
+       * Toolbar_pimpl.C:
+       * XFormsView.C:
+       * lyx_gui.C:
+       changes due to the changed LyXView interface that now returns references
+       to member variables not pointers.
+
 2002-08-13  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * Menubar_pimpl.C (create_submenu): fix code to disable submenu
index 0678fd7472d9c25af05102011bb532973658ef78..56c9c1914b826791d1fac7bde114bf491cd2e365 100644 (file)
@@ -33,7 +33,7 @@ using std::endl;
 FileDialog::FileDialog(LyXView *lv, string const &t, kb_action s, Button b1, Button b2)
        : private_(0), lv_(lv), title_(t), success_(s)
 {
-       private_ = new FileDialog::Private(*lv->getDialogs());
+       private_ = new FileDialog::Private(lv->getDialogs());
 
        private_->SetButton(0, b1.first, b1.second);
        private_->SetButton(1, b2.first, b2.second);
index 99c3873b88af881f10bae5fc2d1f0debd3af9d72..015819245e69f909f5497a221c2a08fa93621603 100644 (file)
@@ -93,7 +93,7 @@ void FormMathsDelim::apply()
        ostringstream ost;
        ost << delim_values[left] << ' ' << delim_values[right];
 
-       lv_->getLyXFunc()->
+       lv_->getLyXFunc().
                dispatch(FuncRequest(LFUN_MATH_DELIM, ost.str().c_str()), false);
 }
 
index 84de53f1a287c90621736a20cbc9553d1c49d5b3..77ebb6a4c740c264adf45918f8071e7d0e013f5b 100644 (file)
@@ -100,7 +100,7 @@ void FormMathsMatrix::apply()
        ostringstream ost;
        ost << nx << ' ' << ny << ' ' << c << ' ' << sh;
 
-       lv_->getLyXFunc()->
+       lv_->getLyXFunc().
                dispatch(FuncRequest(LFUN_INSERT_MATRIX, ost.str().c_str()));
 }
 
index a84805b9d9625bbcd559617fc883f44c170889ff..ba8e925b90fa47e2530777fa32386dacaa627dba 100644 (file)
@@ -320,19 +320,19 @@ bool FormMathsPanel::input(FL_OBJECT *, long data)
                break;
 
        case MM_SUPER:
-               //lv_->getLyXFunc()->dispatch(LFUN_MATH_MODE);
-               lv_->getLyXFunc()->dispatch(LFUN_SUPERSCRIPT);
+               //lv_->getLyXFunc().dispatch(LFUN_MATH_MODE);
+               lv_->getLyXFunc().dispatch(LFUN_SUPERSCRIPT);
                break;
 
        case MM_SUB:
-               //lv_->getLyXFunc()->dispatch(LFUN_MATH_MODE);
-               lv_->getLyXFunc()->dispatch(LFUN_SUBSCRIPT);
+               //lv_->getLyXFunc().dispatch(LFUN_MATH_MODE);
+               lv_->getLyXFunc().dispatch(LFUN_SUBSCRIPT);
                break;
 
        case MM_SUBSUPER:
-               lv_->getLyXFunc()->dispatch(LFUN_SUBSCRIPT);
-               lv_->getLyXFunc()->dispatch(LFUN_LEFT);
-               lv_->getLyXFunc()->dispatch(LFUN_SUPERSCRIPT);
+               lv_->getLyXFunc().dispatch(LFUN_SUBSCRIPT);
+               lv_->getLyXFunc().dispatch(LFUN_LEFT);
+               lv_->getLyXFunc().dispatch(LFUN_SUPERSCRIPT);
                break;
 
        case MM_DELIM:
@@ -382,21 +382,21 @@ bool FormMathsPanel::input(FL_OBJECT *, long data)
 void FormMathsPanel::insertSymbol(string const & sym, bool bs) const
 {
        if (bs)
-               lv_->getLyXFunc()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + sym));
+               lv_->getLyXFunc().dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + sym));
        else
-               lv_->getLyXFunc()->dispatch(FuncRequest(LFUN_INSERT_MATH, sym));
+               lv_->getLyXFunc().dispatch(FuncRequest(LFUN_INSERT_MATH, sym));
 }
 
 
 void FormMathsPanel::dispatchFunc(kb_action action) const
 {
-       lv_->getLyXFunc()->dispatch(action);
+       lv_->getLyXFunc().dispatch(action);
 }
 
 
 void FormMathsPanel::mathDisplay() const
 {
-       lv_->getLyXFunc()->dispatch(LFUN_MATH_DISPLAY);
+       lv_->getLyXFunc().dispatch(LFUN_MATH_DISPLAY);
 }
 
 
index f2d4d8ec8500e08f2d2dbe3a3a0d90612ee36cc3..562ba46ac7309933849c705febe2f331aaace4eb 100644 (file)
@@ -132,7 +132,7 @@ void FormPreferences::ok()
                colors_.modifiedXformsPrefs = !XformsColor::write(filename);
        }
 
-       lv_->getLyXFunc()->dispatch(LFUN_SAVEPREFERENCES);
+       lv_->getLyXFunc().dispatch(LFUN_SAVEPREFERENCES);
 }
 
 
@@ -415,7 +415,7 @@ void FormPreferences::Colors::apply()
                                setCursorColor(GUI_COLOR_CURSOR);
                        }
                }
-               parent_.lv_->getDialogs()->redrawGUI();
+               parent_.lv_->getDialogs().redrawGUI();
        }
 
        // Now do the same for the LyX LColors...
@@ -437,7 +437,7 @@ void FormPreferences::Colors::apply()
 
                        string const s = lcolor.getLyXName(lc) + string(" ") +
                                hexname;
-                       parent_.lv_->getLyXFunc()->dispatch(FuncRequest(LFUN_SET_COLOR, s));
+                       parent_.lv_->getLyXFunc().dispatch(FuncRequest(LFUN_SET_COLOR, s));
                }
        }
 }
@@ -744,7 +744,7 @@ void FormPreferences::Colors::LoadBrowserLyX()
                               << "\". Set to \"black\"!" << endl;
 
                        string const arg = lcolor.getLyXName(lc) + " black";
-                       parent_.lv_->getLyXFunc()->
+                       parent_.lv_->getLyXFunc().
                                dispatch(FuncRequest(LFUN_SET_COLOR, arg));
                        continue;
                }
@@ -2557,7 +2557,7 @@ void FormPreferences::ScreenFonts::apply() const
        if (changed) {
                // Now update the buffers
                // Can anything below here affect the redraw process?
-               parent_.lv_->getLyXFunc()->dispatch(LFUN_SCREEN_FONT_UPDATE);
+               parent_.lv_->getLyXFunc().dispatch(LFUN_SCREEN_FONT_UPDATE);
        }
 }
 
index e4d261a39e8527cb112bc59ea0a5c1b9fa410ed1..f430ecd050d75436e1c40018c99d4404a9ae75d2 100644 (file)
@@ -232,7 +232,7 @@ int Menubar::Pimpl::create_submenu(Window win, XFormsView * view,
                if (i->kind() == MenuItem::Separator)
                        *last = "%l";
                else if (!i->optional() ||
-                        !(view->getLyXFunc()->getStatus(i->action()).disabled()))
+                        !(view->getLyXFunc().getStatus(i->action()).disabled()))
                        last = it;
 
        it = extra_labels.begin();
@@ -258,7 +258,7 @@ int Menubar::Pimpl::create_submenu(Window win, XFormsView * view,
                switch (item.kind()) {
                case MenuItem::Command: {
                        FuncStatus const flag =
-                               view->getLyXFunc()->getStatus(item.action());
+                               view->getLyXFunc().getStatus(item.action());
                        // handle optional entries.
                        if (item.optional()
                            && (flag.disabled())) {
@@ -402,7 +402,7 @@ void Menubar::Pimpl::MenuCallback(FL_OBJECT * ob, long button)
                // If the action value is too low, then it is not a
                // valid action, but something else.
                if (choice >= action_offset + 1) {
-                       view->getLyXFunc()->dispatch(choice - action_offset, true);
+                       view->getLyXFunc().dispatch(choice - action_offset, true);
                } else {
                        lyxerr[Debug::GUI]
                                << "MenuCallback: ignoring bogus action "
index 0e8de0e8285e95874b3c8c966630de0f25ef4705..c6e6847276f487c6b0801d72d4eab55977457676 100644 (file)
@@ -118,7 +118,7 @@ void Toolbar::Pimpl::update()
        ToolbarList::const_iterator end = toollist_.end();
        for (; p != end; ++p) {
                if (p->action == ToolbarDefaults::LAYOUTS && combox_) {
-                       if (owner_->getLyXFunc()->getStatus(LFUN_LAYOUT).disabled())
+                       if (owner_->getLyXFunc().getStatus(LFUN_LAYOUT).disabled())
                                combox_->deactivate();
                        else
                                combox_->activate();
@@ -128,7 +128,7 @@ void Toolbar::Pimpl::update()
                if (!p->icon)
                        continue;
  
-               FuncStatus const status = owner_->getLyXFunc()->getStatus(p->action);
+               FuncStatus const status = owner_->getLyXFunc().getStatus(p->action);
                if (status.onoff(true)) {
                        // I'd like to use a different color
                        // here, but then the problem is to
@@ -170,7 +170,7 @@ void Toolbar::Pimpl::layoutSelected()
        for (LyXTextClass::const_iterator cit = tc.begin();
             cit != end; ++cit) {
                if (_((*cit)->name()) == layoutguiname) {
-                       owner_->getLyXFunc()->dispatch(FuncRequest(LFUN_LAYOUT, (*cit)->name()));
+                       owner_->getLyXFunc().dispatch(FuncRequest(LFUN_LAYOUT, (*cit)->name()));
                        return;
                }
        }
@@ -234,7 +234,7 @@ void ToolbarCB(FL_OBJECT * ob, long ac)
 {
        XFormsView * owner = static_cast<XFormsView *>(ob->u_vdata);
 
-       owner->getLyXFunc()->dispatch(int(ac), true);
+       owner->getLyXFunc().dispatch(int(ac), true);
 }
 
 
index eeb2776c8be932fc429522acd93d34e27914e2b5..00519c2978229756880c26199bf5b2b8246021f8 100644 (file)
@@ -67,7 +67,7 @@ XFormsView::XFormsView(int width, int height)
 
        // Make sure the buttons are disabled if needed.
        updateToolbar();
-       redraw_con = getDialogs()->redrawGUI.connect(boost::bind(&XFormsView::redraw, this));
+       redraw_con = getDialogs().redrawGUI.connect(boost::bind(&XFormsView::redraw, this));
 }
 
 
@@ -198,7 +198,7 @@ void XFormsView::message(string const & str)
 
 void XFormsView::show_view_state()
 {
-       message(getLyXFunc()->view_status_message());
+       message(getLyXFunc().view_status_message());
 }
 
 
index 05b418dc3c7f4850f484b11ece35bf5a7533eee3..ca69abcd727667a6ff29912b89c83181d4c2d49b 100644 (file)
@@ -275,7 +275,7 @@ void lyx_gui::start(string const & batch, vector<string> files)
 
        // FIXME: some code below needs moving
 
-       lyxserver = new LyXServer(view.getLyXFunc(), lyxrc.lyxpipes);
+       lyxserver = new LyXServer(&view.getLyXFunc(), lyxrc.lyxpipes);
 
        vector<string>::const_iterator cit = files.begin();
        vector<string>::const_iterator end = files.end();
@@ -293,7 +293,7 @@ void lyx_gui::start(string const & batch, vector<string> files)
 
        // handle the batch commands the user asked for
        if (!batch.empty()) {
-               view.getLyXFunc()->dispatch(batch);
+               view.getLyXFunc().dispatch(batch);
        }
 
        // enter the event loop
index 749ff9b19c7e85bbfd167e9488366e3ebd250212..0bc17cc27d23a39a60193eb1398ffa3e292a44ba 100644 (file)
@@ -78,7 +78,7 @@ bool Importer::Import(LyXView * lv, string const & filename,
                        : ChangeExtension(filename,
                                          formats.extension(loader_format));
                InsertAsciiFile(lv->view().get(), filename2, as_paragraphs);
-               lv->getLyXFunc()->dispatch(LFUN_MARK_OFF);
+               lv->getLyXFunc().dispatch(LFUN_MARK_OFF);
        }
 
        // we are done
index 9d399cfcb44af351fac8134469eb6da7b691353c..c48be7e51d01ca4b302b487b494d5dcf4642ad8d 100644 (file)
@@ -1,3 +1,40 @@
+2002-08-13  Angus Leeming  <leeming@lyx.org>
+
+       * insetbib.C:
+       * insetcite.C:
+       * inseterror.C:
+       * insetert.C:
+       * insetexternal.C:
+       * insetfloat.C:
+       * insetfloatlist.C:
+       * insetgraphics.C:
+       * insetinclude.C:
+       * insetindex.C:
+       * insetminipage.C:
+       * insetparent.C:
+       * insetref.C:
+       * insettabular.C:
+       * insettext.C:
+       * insettoc.C:
+       * inseturl.C:
+       changes due to the changed LyXView interface that now returns references
+       to member variables not pointers.
+
+2002-08-13  Angus Leeming  <leeming@lyx.org>
+
+       * inset.h:
+       * insetcollapsable.h:
+       * insetert.h:
+       * insettabular.h:
+       * insettext.h: forward-declare WordLangTuple
+       (selectNextWordToSpellcheck) constify return type.
+
+       * inset.C:
+       * insetcollapsable.C:
+       * insetert.C:
+       * insettabular.C:
+       * insettext.C: #include "WordLangTuple.h" and rearrange included files.
+       
 2002-08-12  Angus Leeming  <leeming@lyx.org>
 
        * insetgraphicsParams.C: fix reading of lyxsize_type in 1.2.0 documents.
index 0bc1ecb1861211a9626672376079a39a2dc227b8..cb155122b711d67a8e5998011a573c8f71369441 100644 (file)
 #endif
 
 #include "inset.h"
-#include "debug.h"
+
 #include "BufferView.h"
-#include "support/lstrings.h"
-#include "frontends/Painter.h"
-#include "frontends/mouse_state.h"
+#include "debug.h"
 #include "funcrequest.h"
-#include "support/lstrings.h"
 #include "gettext.h"
-#include "lyxfont.h"
 #include "lyxcursor.h"
+#include "lyxfont.h"
 #include "lyxtext.h"
+#include "WordLangTuple.h"
+
+#include "frontends/Painter.h"
+#include "frontends/mouse_state.h"
+
+#include "support/lstrings.h"
+#include "support/lstrings.h"
 
 using std::endl;
 
@@ -358,8 +362,8 @@ LyXCursor const & Inset::cursor(BufferView * bv) const
 }
 
 
-WordLangTuple UpdatableInset::selectNextWordToSpellcheck(BufferView *bv,
-                                           float & value) const
+WordLangTuple const
+UpdatableInset::selectNextWordToSpellcheck(BufferView *bv, float & value) const
 {
        // we have to unlock ourself in this function by default!
        bv->unlockInset(const_cast<UpdatableInset *>(this));
index c3ff56608b68a985ae3b29e2ea0f90ee5a16cf66..7e437057bf5af54825b352096e8ae379bfe9f03e 100644 (file)
@@ -19,7 +19,6 @@
 #include "LString.h"
 #include "LColor.h"
 #include "frontends/mouse_state.h"
-#include "WordLangTuple.h"
 
 class LyXFont;
 class BufferView;
@@ -30,6 +29,7 @@ class LyXLex;
 class Paragraph;
 class LyXCursor;
 class FuncRequest;
+class WordLangTuple;
 
 struct LaTeXFeatures;
 
@@ -537,7 +537,8 @@ public:
        ///
        virtual bool allowSpellcheck() { return false; }
        ///
-       virtual WordLangTuple selectNextWordToSpellcheck(BufferView *, float & value) const;
+       virtual WordLangTuple const
+       selectNextWordToSpellcheck(BufferView *, float & value) const;
        ///
        virtual void selectSelectedWord(BufferView *) { return; }
        ///
index a12d6984021d53fb2e1c897bbd4d693e973e60c0..fcb8b416fe6d21005ff86b08797c250e05dc5133 100644 (file)
@@ -112,7 +112,7 @@ string const InsetBibKey::getScreenLabel(Buffer const *) const
 
 void InsetBibKey::edit(BufferView * bv, int, int, mouse_button::state)
 {
-       bv->owner()->getDialogs()->showBibitem(this);
+       bv->owner()->getDialogs().showBibitem(this);
 }
 
 
@@ -279,7 +279,7 @@ vector<pair<string, string> > const InsetBibtex::getKeys(Buffer const * buffer)
 
 void InsetBibtex::edit(BufferView * bv, int, int, mouse_button::state)
 {
-       bv->owner()->getDialogs()->showBibtex(this);
+       bv->owner()->getDialogs().showBibtex(this);
 }
 
 
index dffb0abefe91a1af93e49cdcd2487556a50d23a1..7cefcfa783fd5580186610cb497994cf20d34177 100644 (file)
@@ -315,7 +315,7 @@ void InsetCitation::edit(BufferView * bv, int, int, mouse_button::state)
        // Doesn't matter if there is no bv->buffer() entry in the map.
        loading_buffer[bv->buffer()] = false;
 
-       bv->owner()->getDialogs()->showCitation(this);
+       bv->owner()->getDialogs().showCitation(this);
 }
 
 
index 1fe588517ec78b493f18e2cd7f96554ca4cf7e31..de05a312797817fcc808264949154dea2f224967 100644 (file)
 #endif
 
 #include "insetcollapsable.h"
-#include "gettext.h"
-#include "lyxfont.h"
+#include "insettext.h"
+
 #include "BufferView.h"
-#include "frontends/Painter.h"
 #include "debug.h"
-#include "lyxtext.h"
-#include "frontends/font_metrics.h"
+#include "gettext.h"
+#include "lyxfont.h"
 #include "lyxlex.h"
+#include "lyxtext.h"
+#include "WordLangTuple.h"
 
-#include "insets/insettext.h"
+#include "frontends/font_metrics.h"
+#include "frontends/Painter.h"
 
 #include "support/LOstream.h"
 #include "support/lstrings.h"
@@ -672,8 +674,8 @@ bool InsetCollapsable::searchBackward(BufferView * bv, string const & str,
 }
 
 
-WordLangTuple InsetCollapsable::selectNextWordToSpellcheck(BufferView * bv,
-                                             float & value) const
+WordLangTuple const
+InsetCollapsable::selectNextWordToSpellcheck(BufferView * bv, float & value) const
 {
        WordLangTuple word = inset.selectNextWordToSpellcheck(bv, value);
        if (first_after_edit && word.word().empty())
index 140e15ba979ea112e61210a0a747e47d2020bc63..9f1abf4ec2327385e9235500d875ca306d36efa1 100644 (file)
@@ -175,12 +175,14 @@ public:
        void close(BufferView *) const;
        ///
        bool allowSpellcheck() { return inset.allowSpellcheck(); }
-
-       WordLangTuple selectNextWordToSpellcheck(BufferView *, float &) const;
-
+       ///
+       WordLangTuple const
+       selectNextWordToSpellcheck(BufferView *, float &) const;
+       ///
        void selectSelectedWord(BufferView * bv) {
                inset.selectSelectedWord(bv);
        }
+       ///
        void toggleSelection(BufferView * bv, bool kill_selection) {
                inset.toggleSelection(bv, kill_selection);
        }
index dd1a12acd632aef5ae99f405465fd88ae78d2c9a..77bcc09dc59f1e067ccb35253415fc878c8f352c 100644 (file)
@@ -88,7 +88,7 @@ string const InsetError::editMessage() const
 
 void InsetError::edit(BufferView * bv, int, int, mouse_button::state)
 {
-       bv->owner()->getDialogs()->showError(this);
+       bv->owner()->getDialogs().showError(this);
 }
 
 
index 062bb4d0cd76001df130cf72accd82235cf6303d..a2f485c87dee212d5b2767dea9000800acb7f192 100644 (file)
 #endif
 
 #include "insetert.h"
-#include "gettext.h"
-#include "lyxfont.h"
-#include "language.h"
+#include "insettext.h"
+
 #include "buffer.h"
 #include "BufferView.h"
-#include "frontends/LyXView.h"
-#include "lyxtext.h"
-#include "funcrequest.h"
 #include "debug.h"
-#include "lyxrow.h"
+#include "funcrequest.h"
+#include "gettext.h"
+#include "language.h"
+#include "lyxfont.h"
 #include "lyxlex.h"
+#include "lyxrow.h"
+#include "lyxtext.h"
+#include "WordLangTuple.h"
 
-#include "insets/insettext.h"
-
-#include "frontends/Dialogs.h"
 #include "frontends/Alert.h"
+#include "frontends/Dialogs.h"
+#include "frontends/LyXView.h"
 
 #include "support/LOstream.h"
 
@@ -653,7 +654,7 @@ void InsetERT::status(BufferView * bv, ERTStatus const st) const
 
 bool InsetERT::showInsetDialog(BufferView * bv) const
 {
-       bv->owner()->getDialogs()->showERT(const_cast<InsetERT *>(this));
+       bv->owner()->getDialogs().showERT(const_cast<InsetERT *>(this));
        return true;
 }
 
@@ -675,8 +676,8 @@ void InsetERT::close(BufferView * bv) const
 }
 
 
-WordLangTuple InsetERT::selectNextWordToSpellcheck(BufferView * bv,
-                                                 float &) const
+WordLangTuple const
+InsetERT::selectNextWordToSpellcheck(BufferView * bv, float &) const
 {
        bv->unlockInset(const_cast<InsetERT *>(this));
        return WordLangTuple();
index b75f62c7b55269461ef9b33bc59294b52f0e45a4..3ab24e0cdc6b1fc23efe479396cd7afc07e378aa 100644 (file)
@@ -114,7 +114,8 @@ public:
        ///
        bool allowSpellcheck() { return false; }
 
-       WordLangTuple selectNextWordToSpellcheck(BufferView *, float &) const;
+       WordLangTuple const
+       selectNextWordToSpellcheck(BufferView *, float &) const;
        ///
        int ascent(BufferView *, LyXFont const &) const;
        ///
index 8e557f91cdd91a2f82a4658a329760eff77d1931..86a4d9876fb5ee226e684a9fc99b83c380a38392 100644 (file)
@@ -81,7 +81,7 @@ void InsetExternal::edit(BufferView * bv,
                         int /*x*/, int /*y*/, mouse_button::state)
 {
        view_ = bv;
-       view_->owner()->getDialogs()->showExternal(this);
+       view_->owner()->getDialogs().showExternal(this);
 }
 
 
index 837ff845e5890d051ce8e513d3916f236159299e..2bfb0aa9272e4482857adecd9e08919cc6883d2a 100644 (file)
@@ -287,7 +287,7 @@ bool InsetFloat::insetAllowed(Inset::Code code) const
 bool InsetFloat::showInsetDialog(BufferView * bv) const
 {
        if (!inset.showInsetDialog(bv)) {
-               bv->owner()->getDialogs()->showFloat(const_cast<InsetFloat *>(this));
+               bv->owner()->getDialogs().showFloat(const_cast<InsetFloat *>(this));
        }
        return true;
 }
index a64693664f73e630697cad54527c5dbbaf3a16b6..33251b1350b12a70d643ca6606dd2c44a1fe128e 100644 (file)
@@ -81,7 +81,7 @@ void InsetFloatList::read(Buffer const *, LyXLex & lex)
 
 void InsetFloatList::edit(BufferView * bv, int, int, mouse_button::state)
 {
-       bv->owner()->getDialogs()->showTOC(this);
+       bv->owner()->getDialogs().showTOC(this);
 }
 
 
index 681f8c1810380ff7e8e73a073670fbf85bf1d58f..7085b0c5cba9b7b59ad6a1d21ac3e5c6ff9c5347 100644 (file)
@@ -373,7 +373,7 @@ void InsetGraphics::draw(BufferView * bv, LyXFont const & font,
 
 void InsetGraphics::edit(BufferView *bv, int, int, mouse_button::state)
 {
-       bv->owner()->getDialogs()->showGraphics(this);
+       bv->owner()->getDialogs().showGraphics(this);
 }
 
 
index 018da0fb3889ba136a3e577a273ed7962a3aac7c..9f40fd4bd2ff478816d37767a5a5b8f0b54bd459 100644 (file)
@@ -169,7 +169,7 @@ Inset * InsetInclude::clone(Buffer const & buffer, bool) const
 
 void InsetInclude::edit(BufferView * bv, int, int, mouse_button::state)
 {
-       bv->owner()->getDialogs()->showInclude(this);
+       bv->owner()->getDialogs().showInclude(this);
 }
 
 
index 3f66ba35099361f26ca409a3f562f186ed3762bd..eaf92d25543a17ad8f1373e17dcf2bb491dbb130 100644 (file)
@@ -27,7 +27,7 @@ string const InsetIndex::getScreenLabel(Buffer const *) const
 
 void InsetIndex::edit(BufferView * bv, int, int, mouse_button::state)
 {
-       bv->owner()->getDialogs()->showIndex(this);
+       bv->owner()->getDialogs().showIndex(this);
 }
 
 
index 91bef6d40c0c3f221011ddaad911c603ee735bfc..bb1ef5bfb2cd78b5f390952bd153d56857577a85 100644 (file)
@@ -322,7 +322,7 @@ void InsetMinipage::pageWidth(LyXLength const & ll)
 bool InsetMinipage::showInsetDialog(BufferView * bv) const
 {
        if (!inset.showInsetDialog(bv))
-               bv->owner()->getDialogs()->showMinipage(const_cast<InsetMinipage *>(this));
+               bv->owner()->getDialogs().showMinipage(const_cast<InsetMinipage *>(this));
        return true;
 }
 
index 8a5a1972859d318590c4b8bf67d7bdb28f4e7e83..a7c5d8eafd999e669113ca446d573a8bfc1af4e8 100644 (file)
@@ -46,7 +46,7 @@ string const InsetParent::getScreenLabel(Buffer const *) const
 
 void InsetParent::edit(BufferView * bv, int, int, mouse_button::state)
 {    
-       bv->owner()->getLyXFunc()->
+       bv->owner()->getLyXFunc().
                dispatch(FuncRequest(LFUN_CHILDOPEN, getContents()));
 }
 
index a0bbc2857c2c097278e5bbf97a9e9c2c6fb9cbf7..19d3c112112f8b3f0731f370b0d4e2274d5a9fb5 100644 (file)
@@ -27,10 +27,10 @@ void InsetRef::edit(BufferView * bv, int, int, mouse_button::state button)
 {
        // FuncRequestually trigger dialog with button 3 not 1
        if (button == mouse_button::button3)
-               bv->owner()->getLyXFunc()->
+               bv->owner()->getLyXFunc().
                        dispatch(FuncRequest(LFUN_REF_GOTO, getContents()));
        else if (button == mouse_button::button1)
-               bv->owner()->getDialogs()->showRef(this);
+               bv->owner()->getDialogs().showRef(this);
 }
 
 
index 8a4bb1c0b90997967e0c72d22458876560436b75..e5f7ad7ab5baa0dc174c91a3e27254801eb02a64 100644 (file)
 #endif
 
 #include "insettabular.h"
+#include "insettext.h"
 
-#include "lyx_cb.h"
 #include "buffer.h"
+#include "BufferView.h"
 #include "commandtags.h"
-#include "lyxfunc.h"
-#include "debug.h"
-#include "LaTeXFeatures.h"
-#include "frontends/Painter.h"
-#include "frontends/font_metrics.h"
-#include "lyxtext.h"
-#include "frontends/LyXView.h"
-#include "insets/insettext.h"
 #include "debug.h"
+#include "funcrequest.h"
 #include "gettext.h"
 #include "language.h"
-#include "BufferView.h"
-#include "undo_funcs.h"
+#include "LaTeXFeatures.h"
+#include "lyx_cb.h"
+#include "lyxfunc.h"
 #include "lyxlength.h"
-#include "ParagraphParameters.h"
 #include "lyxlex.h"
-#include "funcrequest.h"
+#include "lyxtext.h"
+#include "ParagraphParameters.h"
+#include "undo_funcs.h"
+#include "WordLangTuple.h"
 
-#include "frontends/Dialogs.h"
 #include "frontends/Alert.h"
+#include "frontends/Dialogs.h"
+#include "frontends/font_metrics.h"
+#include "frontends/LyXView.h"
+#include "frontends/Painter.h"
 
 #include "support/LAssert.h"
 #include "support/lstrings.h"
@@ -710,7 +710,7 @@ bool InsetTabular::unlockInsetInInset(BufferView * bv, UpdatableInset * inset,
        if (the_locking_inset->unlockInsetInInset(bv, inset, lr)) {
                if (inset->lyxCode() == TABULAR_CODE &&
                    !the_locking_inset->getFirstLockingInsetOfType(TABULAR_CODE)) {
-                       bv->owner()->getDialogs()->updateTabular(this);
+                       bv->owner()->getDialogs().updateTabular(this);
                        oldcell = actcell;
                }
                return true;
@@ -845,7 +845,7 @@ bool InsetTabular::insetButtonRelease(BufferView * bv,
                ret = the_locking_inset->insetButtonRelease(bv, x - inset_x,
                                                                                                        y - inset_y, button);
        if (button == mouse_button::button3 && !ret) {
-               bv->owner()->getDialogs()->showTabular(this);
+               bv->owner()->getDialogs().showTabular(this);
                return true;
        }
        return ret;
@@ -1117,7 +1117,7 @@ InsetTabular::localDispatch(BufferView * bv, FuncRequest const & ev)
        case LFUN_ENDBUFSEL:
                break;
        case LFUN_LAYOUT_TABULAR:
-               bv->owner()->getDialogs()->showTabular(this);
+               bv->owner()->getDialogs().showTabular(this);
                break;
        case LFUN_TABULAR_FEATURE:
                if (!tabularFeatures(bv, arg))
@@ -1607,7 +1607,7 @@ void InsetTabular::resetPos(BufferView * bv) const
             !the_locking_inset->getFirstLockingInsetOfType(TABULAR_CODE)) &&
            actcell != oldcell) {
                InsetTabular * inset = const_cast<InsetTabular *>(this);
-               bv->owner()->getDialogs()->updateTabular(inset);
+               bv->owner()->getDialogs().updateTabular(inset);
                oldcell = actcell;
        }
        in_reset_pos = 0;
@@ -2283,8 +2283,8 @@ LyXText * InsetTabular::getLyXText(BufferView const * bv,
 bool InsetTabular::showInsetDialog(BufferView * bv) const
 {
        if (!the_locking_inset || !the_locking_inset->showInsetDialog(bv))
-               bv->owner()->getDialogs()
-                       ->showTabular(const_cast<InsetTabular *>(this));
+               bv->owner()->getDialogs().
+                       showTabular(const_cast<InsetTabular *>(this));
        return true;
 }
 
@@ -2299,7 +2299,7 @@ void InsetTabular::openLayoutDialog(BufferView * bv) const
                        return;
                }
        }
-       bv->owner()->getDialogs()->showTabular(
+       bv->owner()->getDialogs().showTabular(
                const_cast<InsetTabular *>(this));
 }
 
@@ -2678,7 +2678,7 @@ Inset * InsetTabular::getInsetFromID(int id_arg) const
 }
 
 
-WordLangTuple
+WordLangTuple const
 InsetTabular::selectNextWordToSpellcheck(BufferView * bv, float & value) const
 {
        nodraw(true);
index 6e653b9aadf971328f28ccd801fe748d39a2dde6..3fec464b5a81ee4370d633ed8969b1a952b875c7 100644 (file)
@@ -215,8 +215,12 @@ public:
        LyXCursor const & cursor(BufferView *) const;
        ///
        bool allowSpellcheck() { return true; }
-       WordLangTuple selectNextWordToSpellcheck(BufferView *, float & value) const;
+       ///
+       WordLangTuple const
+       selectNextWordToSpellcheck(BufferView *, float & value) const;
+       ///
        void selectSelectedWord(BufferView *);
+       ///
        void toggleSelection(BufferView *, bool kill_selection);
        ///
        bool searchForward(BufferView *, string const &,
index 28af9b8631ca91c45c5ce4ebea873794edbab95d..be16b2ad3abeab46d11c8a95005abf14933ed3fb 100644 (file)
 #endif
 
 #include "insettext.h"
-#include "paragraph.h"
-#include "lyxlex.h"
-#include "debug.h"
-#include "lyxfont.h"
+
 #include "buffer.h"
-#include "frontends/LyXView.h"
 #include "BufferView.h"
-#include "LaTeXFeatures.h"
-#include "frontends/Painter.h"
-#include "lyxtext.h"
-#include "lyxcursor.h"
 #include "CutAndPaste.h"
-#include "frontends/font_metrics.h"
+#include "debug.h"
+#include "funcrequest.h"
+#include "gettext.h"
+#include "intl.h"
+#include "LaTeXFeatures.h"
 #include "LColor.h"
+#include "lyxfont.h"
+#include "lyxcursor.h"
+#include "lyxfind.h"
+#include "lyxfunc.h"
+#include "lyxlex.h"
 #include "lyxrow.h"
 #include "lyxrc.h"
-#include "intl.h"
-#include "trans_mgr.h"
-#include "frontends/screen.h"
-#include "gettext.h"
-#include "lyxfunc.h"
+#include "lyxtext.h"
+#include "paragraph.h"
 #include "ParagraphParameters.h"
+#include "trans_mgr.h"
 #include "undo_funcs.h"
-#include "lyxfind.h"
-#include "funcrequest.h"
+#include "WordLangTuple.h"
 
 #include "frontends/Alert.h"
 #include "frontends/Dialogs.h"
+#include "frontends/font_metrics.h"
+#include "frontends/LyXView.h"
+#include "frontends/Painter.h"
+#include "frontends/screen.h"
 
 #include "support/textutils.h"
 #include "support/LAssert.h"
@@ -714,7 +716,7 @@ void InsetText::edit(BufferView * bv, int x, int y, mouse_button::state button)
        showInsetCursor(bv);
 
        // Tell the paragraph dialog that we've entered an insettext.
-       bv->owner()->getDialogs()->updateParagraph();
+       bv->owner()->getDialogs().updateParagraph();
 }
 
 
@@ -1256,7 +1258,7 @@ InsetText::localDispatch(BufferView * bv, FuncRequest const & ev)
                        }
                        lt->clearSelection();
                        for (string::size_type i = 0; i < ev.argument.length(); ++i) {
-                               bv->owner()->getIntl()->getTransManager().
+                               bv->owner()->getIntl().getTransManager().
                                        TranslateAndInsert(ev.argument[i], lt);
                        }
                }
@@ -1451,7 +1453,7 @@ InsetText::localDispatch(BufferView * bv, FuncRequest const & ev)
                        // see if we found the layout number:
                        if (!hasLayout) {
                                FuncRequest lf(LFUN_MESSAGE, N_("Layout ") + ev.argument + N_(" not known"));
-                               bv->owner()->getLyXFunc()->dispatch(lf);
+                               bv->owner()->getLyXFunc().dispatch(lf);
                                break;
                        }
 
@@ -2566,7 +2568,7 @@ Inset * InsetText::getInsetFromID(int id_arg) const
 }
 
 
-WordLangTuple
+WordLangTuple const
 InsetText::selectNextWordToSpellcheck(BufferView * bv,
                                      float & value) const
 {
index 06c320c0d377f7552eb227aaad2ed5c2b6e7b803..20b7ce9072369c3f60514482a05dd4b06e405885 100644 (file)
@@ -231,8 +231,9 @@ public:
        ///
        bool allowSpellcheck() { return true; }
        ///
-       WordLangTuple selectNextWordToSpellcheck(BufferView *,
-                                               float & value) const;
+       WordLangTuple const
+       selectNextWordToSpellcheck(BufferView *, float & value) const;
+       ///
        void selectSelectedWord(BufferView *);
        ///
        void toggleSelection(BufferView *, bool kill_selection);
index b658a3bd8064ed5e52a9792eefb5e6bebd397f92..af6fb2d0ab43b97bd960502ab816c21fea9b7899 100644 (file)
@@ -37,7 +37,7 @@ Inset::Code InsetTOC::lyxCode() const
 
 void InsetTOC::edit(BufferView * bv, int, int, mouse_button::state)
 {
-       bv->owner()->getDialogs()->showTOC(this);
+       bv->owner()->getDialogs().showTOC(this);
 }
 
 
index f214d7c904c8ca0874659397dbd98d5cd0498bbd..731147c73ad0b085202ce4249379749f47ae84a5 100644 (file)
@@ -23,7 +23,7 @@ InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
 
 void InsetUrl::edit(BufferView * bv, int, int, mouse_button::state)
 {
-       bv->owner()->getDialogs()->showUrl(this);
+       bv->owner()->getDialogs().showUrl(this);
 }
 
 
index c8e8721ee063c1e814f279288932d21c78ba6ddb..e531795dbe41c08c0e03369221bd8b3c583a86f4 100644 (file)
@@ -49,6 +49,7 @@
 #include "debug.h"
 #include "encoding.h"
 #include "ispell.h"
+#include "WordLangTuple.h"
 
 #ifndef CXX_GLOBAL_CSTD
 using std::strcpy;
index 7cb094a73f52033df4d9214148bba7e90044d583..4449d5f1b80e8c4b58f5e9e492fa92bfd3cb6b2b 100644 (file)
@@ -166,7 +166,7 @@ void LyXFunc::handleKeyFunc(kb_action action)
                c = 0;
        }
 
-       owner->getIntl()->getTransManager()
+       owner->getIntl().getTransManager()
                .deadkey(c, get_accent(action).accent, TEXT(false));
        // Need to clear, in case the minibuffer calls these
        // actions
@@ -602,7 +602,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
        // A few general toggles
        switch (ev.action) {
        case LFUN_TOOLTIPS_TOGGLE:
-               flag.setOnOff(owner->getDialogs()->tooltipsEnabled());
+               flag.setOnOff(owner->getDialogs().tooltipsEnabled());
                break;
 
        case LFUN_READ_ONLY_TOGGLE:
@@ -883,7 +883,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                        }
                        finishUndo();
                        // Tell the paragraph dialog that we changed paragraph
-                       owner->getDialogs()->updateParagraph();
+                       owner->getDialogs().updateParagraph();
                }
        }
        break;
@@ -1003,12 +1003,12 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                break;
 
        case LFUN_MENUPRINT:
-               owner->getDialogs()->showPrint();
+               owner->getDialogs().showPrint();
                break;
 
        case LFUN_EXPORT:
                if (argument == "custom")
-                       owner->getDialogs()->showSendto();
+                       owner->getDialogs().showSendto();
                else
                        Exporter::Export(owner->buffer(), argument, false);
                break;
@@ -1042,7 +1042,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                else
                        p.setCmdName("listoftables");
 #endif
-               owner->getDialogs()->createTOC(p.getAsString());
+               owner->getDialogs().createTOC(p.getAsString());
                break;
        }
 
@@ -1059,7 +1059,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                break;
 
        case LFUN_MENUSEARCH:
-               owner->getDialogs()->showSearch();
+               owner->getDialogs().showSearch();
                break;
 
        case LFUN_REMOVEERRORS:
@@ -1079,7 +1079,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                break;
 
        case LFUN_FREE:
-               owner->getDialogs()->setUserFreeFont();
+               owner->getDialogs().setUserFreeFont();
                break;
 
        case LFUN_RECONFIGURE:
@@ -1103,11 +1103,11 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
 #endif
 #endif
        case LFUN_HELP_ABOUTLYX:
-               owner->getDialogs()->showAboutlyx();
+               owner->getDialogs().showAboutlyx();
                break;
 
        case LFUN_HELP_TEXINFO:
-               owner->getDialogs()->showTexinfo();
+               owner->getDialogs().showTexinfo();
                break;
 
        case LFUN_HELP_OPEN:
@@ -1172,7 +1172,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
 
        case LFUN_VC_HISTORY:
        {
-               owner->getDialogs()->showVCLogFile();
+               owner->getDialogs().showVCLogFile();
                break;
        }
 
@@ -1196,19 +1196,19 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                break;
 
        case LFUN_LATEX_LOG:
-               owner->getDialogs()->showLogFile();
+               owner->getDialogs().showLogFile();
                break;
 
        case LFUN_LAYOUT_DOCUMENT:
-               owner->getDialogs()->showDocument();
+               owner->getDialogs().showDocument();
                break;
 
        case LFUN_LAYOUT_PARAGRAPH:
-               owner->getDialogs()->showParagraph();
+               owner->getDialogs().showParagraph();
                break;
 
        case LFUN_LAYOUT_CHARACTER:
-               owner->getDialogs()->showCharacter();
+               owner->getDialogs().showCharacter();
                break;
 
        case LFUN_LAYOUT_TABULAR:
@@ -1227,19 +1227,19 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
            break;
 
        case LFUN_LAYOUT_PREAMBLE:
-               owner->getDialogs()->showPreamble();
+               owner->getDialogs().showPreamble();
                break;
 
        case LFUN_DROP_LAYOUTS_CHOICE:
-               owner->getToolbar()->openLayoutList();
+               owner->getToolbar().openLayoutList();
                break;
 
        case LFUN_MENU_OPEN_BY_NAME:
-               owner->getMenubar()->openByName(argument);
+               owner->getMenubar().openByName(argument);
                break; // RVDK_PATCH_5
 
        case LFUN_SPELLCHECK:
-               owner->getDialogs()->showSpellchecker();
+               owner->getDialogs().showSpellchecker();
                break;
 
        // --- lyxserver commands ----------------------------
@@ -1344,7 +1344,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                break;
 
        case LFUN_MATH_PANEL:
-               owner->getDialogs()->showMathPanel();
+               owner->getDialogs().showMathPanel();
                break;
 
        case LFUN_CITATION_CREATE:
@@ -1364,7 +1364,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                        }
                        dispatch(FuncRequest(LFUN_CITATION_INSERT, p.getAsString()));
                } else
-                       owner->getDialogs()->createCitation(p.getAsString());
+                       owner->getDialogs().createCitation(p.getAsString());
        }
        break;
 
@@ -1388,19 +1388,19 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                break;
 
        case LFUN_KMAP_OFF:             // keymap off
-               owner->getIntl()->KeyMapOn(false);
+               owner->getIntl().KeyMapOn(false);
                break;
 
        case LFUN_KMAP_PRIM:    // primary keymap
-               owner->getIntl()->KeyMapPrim();
+               owner->getIntl().KeyMapPrim();
                break;
 
        case LFUN_KMAP_SEC:             // secondary keymap
-               owner->getIntl()->KeyMapSec();
+               owner->getIntl().KeyMapSec();
                break;
 
        case LFUN_KMAP_TOGGLE:  // toggle keymap
-               owner->getIntl()->ToggleKeyMap();
+               owner->getIntl().ToggleKeyMap();
                break;
 
        case LFUN_SEQUENCE:
@@ -1415,7 +1415,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
        break;
 
        case LFUN_DIALOG_PREFERENCES:
-               owner->getDialogs()->showPreferences();
+               owner->getDialogs().showPreferences();
                break;
 
        case LFUN_SAVEPREFERENCES:
@@ -1486,7 +1486,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                break;
 
        case LFUN_FORKS_SHOW:
-               owner->getDialogs()->showForks();
+               owner->getDialogs().showForks();
                break;
 
        case LFUN_FORKS_KILL:
@@ -1501,7 +1501,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
        }
 
        case LFUN_TOOLTIPS_TOGGLE:
-               owner->getDialogs()->toggleTooltips();
+               owner->getDialogs().toggleTooltips();
                break;
 
        default:
@@ -1817,7 +1817,7 @@ void LyXFunc::closeBuffer()
                        // need this otherwise SEGV may occur while trying to
                        // set variables that don't exist
                        // since there's no current buffer
-                       owner->getDialogs()->hideBufferDependent();
+                       owner->getDialogs().hideBufferDependent();
                } else {
                        owner->view()->buffer(bufferlist.first());
                }
index 89edf41d656a6eb63f4d0568e21a1a8550207e1c..ba127439e73537c1636442aea0f00ffff516ffb5 100644 (file)
@@ -21,7 +21,6 @@
 #include "layout.h"
 #include "LColor.h"
 #include "insets/inset.h"
-#include "WordLangTuple.h"
 
 class Buffer;
 class BufferParams;
@@ -32,6 +31,7 @@ class Row;
 class Spacing;
 class UpdatableInset;
 class VSpace;
+class WordLangTuple;
 
 
 /**
@@ -293,7 +293,7 @@ public:
         to the beginning of this word.
         With SelectSelectedWord can this be highlighted really
         */
-       WordLangTuple selectNextWordToSpellcheck(BufferView *, float & value) const;
+       WordLangTuple const selectNextWordToSpellcheck(BufferView *, float & value) const;
        ///
        void selectSelectedWord(BufferView *);
        /// returns true if par was empty and was removed
index 61ecb73d78e0d4df5606fd293823386944b2b080..92670f2a17d8a547bf436eff77847fe8cf86178d 100644 (file)
@@ -113,7 +113,7 @@ void LyXVC::registrer()
                        MakeDisplayPath(filename, 50),
                        _("Save document and proceed?"))) {
                vcs->owner()->getUser()->owner()
-                       ->getLyXFunc()->dispatch(LFUN_MENUWRITE);
+                       ->getLyXFunc().dispatch(LFUN_MENUWRITE);
        }
 
        // Maybe the save fails, or we answered "no". In both cases,
@@ -146,7 +146,7 @@ void LyXVC::checkIn()
                        MakeDisplayPath(vcs->owner()->fileName(), 50),
                        _("Save document and proceed?"))) {
                vcs->owner()->getUser()->owner()
-                       ->getLyXFunc()->dispatch(LFUN_MENUWRITE);
+                       ->getLyXFunc().dispatch(LFUN_MENUWRITE);
        }
 
        // Maybe the save fails, or we answered "no". In both cases,
index bc8c6f6c08788337c9c5bd1c2173e59470a5b19f..4dd2edada23cccb46dba17bdaae8db48f5a2db28 100644 (file)
@@ -1,3 +1,13 @@
+2002-08-13  Angus Leeming  <leeming@lyx.org>
+
+       * formulabase.C:
+       * ref_inset.C:
+       changes due to the changed LyXView interface that now returns references
+       to member variables not pointers.
+
+       * math_inset.[Ch] (getDialogs, getLyXFunc): return a reference, not a
+       pointer, reflecting this change.
+
 2002-08-02  Angus Leeming  <leeming@lyx.org>
 
        * formula.C: pass the BufferView to the PreviewedInset so that it can
index 9476d5990524e009764b022f88f1377b577b8df5..37541fe0475a6efbe7f115d0ad509036dffd1219 100644 (file)
@@ -118,7 +118,7 @@ void InsetFormulaBase::mutateToText()
                view_->owner()->getIntl()->getTransManager().TranslateAndInsert(*cit, lt);
 
        // remove ourselves
-       //view_->owner()->getLyXFunc()->dispatch(LFUN_ESCAPE);
+       //view_->owner()->getLyXFunc().dispatch(LFUN_ESCAPE);
 #endif
 }
 
@@ -303,7 +303,7 @@ bool InsetFormulaBase::insetButtonRelease(BufferView * bv,
                        return true;
 
                // launch math panel for right mouse button
-               bv->owner()->getDialogs()->showMathPanel();
+               bv->owner()->getDialogs().showMathPanel();
                return true;
        }
 
@@ -740,7 +740,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, FuncRequest const & ev)
        case LFUN_REF_INSERT:
                //if (argument.empty()) {
                //      InsetCommandParams p("ref");
-               //      owner_->getDialogs()->createRef(p.getAsString());
+               //      owner_->getDialogs().createRef(p.getAsString());
                //} else {
                //      InsetCommandParams p;
                //      p.setFromString(argument);
@@ -754,7 +754,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, FuncRequest const & ev)
                //
                if (ev.argument.empty()) {
                        InsetCommandParams p("ref");
-                       bv->owner()->getDialogs()->createRef(p.getAsString());
+                       bv->owner()->getDialogs().createRef(p.getAsString());
                } else {
                        //mathcursor->handleNest(new InsetRef2);
                        //mathcursor->insert(arg);
@@ -951,7 +951,7 @@ void mathDispatchCreation(BufferView * bv, string const & arg, bool display)
                bv->getLyXText()->cutSelection(bv);
                openNewInset(bv, f);
        }
-       bv->owner()->getLyXFunc()->setMessage(N_("Math editor mode"));
+       bv->owner()->getLyXFunc().setMessage(N_("Math editor mode"));
 }
 
 
@@ -978,7 +978,7 @@ void mathDispatchMathMacro(BufferView * bv, string const & arg)
        if (!bv->available())
                return;
        if (arg.empty())
-               bv->owner()->getLyXFunc()->setErrorMessage(N_("Missing argument"));
+               bv->owner()->getLyXFunc().setErrorMessage(N_("Missing argument"));
        else {
                string s = arg;
                string const s1 = token(s, ' ', 1);
index f075e4654c53bc689ec2c13e3344ede477e99765..683bf3d99f22580f915cb4c91480df057ec1ddf1 100644 (file)
@@ -301,13 +301,13 @@ MathArray asArray(string const & str)
 }
 
 
-Dialogs * getDialogs()
+Dialogs & getDialogs()
 {
        return mathcursor->formula()->view()->owner()->getDialogs();
 }
 
 
-LyXFunc * getLyXFunc()
+LyXFunc & getLyXFunc()
 {
        return mathcursor->formula()->view()->owner()->getLyXFunc();
 }
index 8a98be797f420c15b91c24cced5d8782d7131e24..8ca244a7542f54060d9519ae7cc4cf71568251d2 100644 (file)
@@ -308,7 +308,7 @@ void initMath();
 class Dialogs;
 class LyXFunc;
 
-Dialogs * getDialogs();
-LyXFunc * getLyXFunc();
+Dialogs & getDialogs();
+LyXFunc & getLyXFunc();
 
 #endif
index 0055d75407b3f2714b73d497fdf80950c56ea888..a7231d78f736313bfa289d9209b87d90235f053a 100644 (file)
@@ -42,7 +42,7 @@ int RefInset::dispatch(FuncRequest const & cmd, idx_type, pos_type)
                case LFUN_MOUSE_RELEASE:
                        if (cmd.extra == 3) {
                                lyxerr << "trying to goto ref" << cell(0) << "\n";
-                               mathcursor->formula()->view()->owner()->getLyXFunc()->
+                               mathcursor->formula()->view()->owner()->getLyXFunc().
                                        dispatch(FuncRequest(LFUN_REF_GOTO, asString(cell(0))));
                                return 1; // dispatched
                        }
index f31605d02a9d1201fd96be1a5fb982f7306f6c6d..b9c113dfbdff41682cadfbca325b396bfc2db481 100644 (file)
@@ -24,6 +24,7 @@ extern "C" {
 }
 
 #include "pspell.h"
+#include "WordLangTuple.h"
 
 using std::endl;
 
index 74349c6dcb0f5d8f1a36b2acdf0272f5ef38dbc3..ec90880c5801eaf1ad6d0d60efc005a8ef7d7c3a 100644 (file)
@@ -28,6 +28,7 @@
 #include "language.h"
 #include "ParagraphParameters.h"
 #include "undo_funcs.h"
+#include "WordLangTuple.h"
 
 #include "insets/insetbib.h"
 #include "insets/insettext.h"
@@ -2393,8 +2394,8 @@ bool LyXText::selectWordWhenUnderCursor(BufferView * bview,
 
 // This function is only used by the spellchecker for NextWord().
 // It doesn't handle LYX_ACCENTs and probably never will.
-WordLangTuple LyXText::selectNextWordToSpellcheck(BufferView * bview,
-                                                float & value) const
+WordLangTuple const
+LyXText::selectNextWordToSpellcheck(BufferView * bview, float & value) const
 {
        if (the_locking_inset) {
                WordLangTuple word = the_locking_inset->selectNextWordToSpellcheck(bview, value);
index 5627acb83c25d08972da387f318769ed483ea952..256da3a31511ddaf41a6eb9d79d001569c537ed1 100644 (file)
--- a/src/toc.C
+++ b/src/toc.C
@@ -46,7 +46,7 @@ string const TocItem::asString() const
 void TocItem::goTo(LyXView & lv_) const
 {
        string const tmp = tostr(par->id());
-       lv_.getLyXFunc()->dispatch(FuncRequest(LFUN_GOTO_PARAGRAPH, tmp));
+       lv_.getLyXFunc().dispatch(FuncRequest(LFUN_GOTO_PARAGRAPH, tmp));
 }
 
 
index 56528c53ae75bc6705d3a5f8c9227ecef12cbcd1..d72d6b34068bcb913815a28f3039a4314463ac46 100644 (file)
@@ -159,7 +159,7 @@ void RCS::registrer(string const & msg)
        cmd += OnlyFilename(owner_->fileName());
        cmd += "\"";
        doVCCommand(cmd, owner_->filePath());
-       owner_->getUser()->owner()->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+       owner_->getUser()->owner()->getLyXFunc().dispatch(LFUN_MENURELOAD);
 }
 
 
@@ -167,7 +167,7 @@ void RCS::checkIn(string const & msg)
 {
        doVCCommand("ci -q -u -m\"" + msg + "\" \""
                    + OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
-       owner_->getUser()->owner()->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+       owner_->getUser()->owner()->getLyXFunc().dispatch(LFUN_MENURELOAD);
 }
 
 
@@ -176,7 +176,7 @@ void RCS::checkOut()
        owner_->markClean();
        doVCCommand("co -q -l \""
                    + OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
-       owner_->getUser()->owner()->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+       owner_->getUser()->owner()->getLyXFunc().dispatch(LFUN_MENURELOAD);
 }
 
 
@@ -187,7 +187,7 @@ void RCS::revert()
        // We ignore changes and just reload!
        owner_->markClean();
        owner_->getUser()->owner()
-               ->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+               ->getLyXFunc().dispatch(LFUN_MENURELOAD);
 }
 
 
@@ -289,7 +289,7 @@ void CVS::registrer(string const & msg)
 {
        doVCCommand("cvs -q add -m \"" + msg + "\" \""
                    + OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
-       owner_->getUser()->owner()->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+       owner_->getUser()->owner()->getLyXFunc().dispatch(LFUN_MENURELOAD);
 }
 
 
@@ -298,7 +298,7 @@ void CVS::checkIn(string const & msg)
        doVCCommand("cvs -q commit -m \"" + msg + "\" \""
                    + OnlyFilename(owner_->fileName()) + "\"",
                    owner_->filePath());
-       owner_->getUser()->owner()->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+       owner_->getUser()->owner()->getLyXFunc().dispatch(LFUN_MENURELOAD);
 }
 
 
@@ -319,7 +319,7 @@ void CVS::revert()
                    owner_->filePath());
        owner_->markClean();
        owner_->getUser()->owner()
-               ->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+               ->getLyXFunc().dispatch(LFUN_MENURELOAD);
 }