+2002-09-10 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * MenuBackend.C (expandToc): fix crash when there is no document
+ open
+
2002-09-10 Dekel Tsur <dekelts@tau.ac.il>
* many files: Add insetwrap.
2002-09-10 Dekel Tsur <dekelts@tau.ac.il>
* many files: Add insetwrap.
void expandToc(Menu & tomenu, Buffer const * buf)
{
void expandToc(Menu & tomenu, Buffer const * buf)
{
+ if (!buf) {
+ tomenu.add(MenuItem(MenuItem::Command,
+ _("No Documents Open!"), LFUN_NOACTION));
+ return;
+ }
+
FloatList const & floats = buf->params.getLyXTextClass().floats();
toc::TocList toc_list = toc::getTocList(buf);
toc::TocList::const_iterator cit = toc_list.begin();
FloatList const & floats = buf->params.getLyXTextClass().floats();
toc::TocList toc_list = toc::getTocList(buf);
toc::TocList::const_iterator cit = toc_list.begin();