]> git.lyx.org Git - lyx.git/blobdiff - src/MenuBackend.C
Point fix, earlier forgotten
[lyx.git] / src / MenuBackend.C
index 34207b68fe114a09236e0123404c20cdc4d6bdcf..ef780bbc7aa32a43a7d0de61181733588cb57e58 100644 (file)
@@ -1,13 +1,17 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file MenuBackend.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Asger Alstrup
+ * \author Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
+ * \author André Pönitz
+ * \author Dekel Tsur
+ * \author Martin Vermeer
  *
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS.
+ */
 
 #include <config.h>
 
@@ -436,15 +440,15 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, LyXView const * view)
                action = LFUN_IMPORT;
                break;
        case MenuItem::ViewFormats:
-               formats = Exporter::GetExportableFormats(view->buffer(), true);
+               formats = Exporter::GetExportableFormats(*view->buffer(), true);
                action = LFUN_PREVIEW;
                break;
        case MenuItem::UpdateFormats:
-               formats = Exporter::GetExportableFormats(view->buffer(), true);
+               formats = Exporter::GetExportableFormats(*view->buffer(), true);
                action = LFUN_UPDATE;
                break;
        default:
-               formats = Exporter::GetExportableFormats(view->buffer(), false);
+               formats = Exporter::GetExportableFormats(*view->buffer(), false);
                action = LFUN_EXPORT;
        }
        sort(formats.begin(), formats.end(), compare_format());
@@ -590,7 +594,7 @@ void expandToc(Menu & tomenu, LyXView const * view)
                return;
        }
 
-       lyx::toc::TocList toc_list = lyx::toc::getTocList(view->buffer());
+       lyx::toc::TocList toc_list = lyx::toc::getTocList(*view->buffer());
        lyx::toc::TocList::const_iterator cit = toc_list.begin();
        lyx::toc::TocList::const_iterator end = toc_list.end();
        for (; cit != end; ++cit) {
@@ -628,6 +632,9 @@ void expandToc(Menu & tomenu, LyXView const * view)
 
 void expandPasteRecent(Menu & tomenu, LyXView const * view)
 {
+       if (!view || !view->buffer())
+               return;
+
        vector<string> const selL =
                CutAndPaste::availableSelections(*view->buffer());
 
@@ -644,11 +651,14 @@ void expandPasteRecent(Menu & tomenu, LyXView const * view)
 
 void expandBranches(Menu & tomenu, LyXView const * view)
 {
+       if (!view || !view->buffer())
+               return;
+
        BufferParams const & params = view->buffer()->params;
 
        std::list<Branch>::const_iterator cit = params.branchlist.begin();
        std::list<Branch>::const_iterator end = params.branchlist.end();
-       
+
        for (int ii = 1; cit != end; ++cit, ++ii) {
                string label = cit->getBranch();
                int const action = lyxaction.