]> git.lyx.org Git - features.git/commitdiff
Fix crash reported by Bennett. We could try to catch these exceptions
authorRichard Heck <rgheck@comcast.net>
Sat, 17 Apr 2010 22:36:31 +0000 (22:36 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 17 Apr 2010 22:36:31 +0000 (22:36 +0000)
elsewhere, but I actually don't know why I put them here in the first
place.

The tex2lyx stuff allows us not to wrap the calls to
frontend::Alert::warning in "#ifdef TEX2LYX" blocks.

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

src/TextClass.cpp
src/tex2lyx/tex2lyx.cpp
src/tex2lyx/tex2lyx.h

index 030e1601e7b7c9a476ec6e8745d2a0910efb5d0c..3aebbbd6381f0776feaa6d76e85e9379f96fac47 100644 (file)
@@ -1278,8 +1278,7 @@ DocumentClass & DocumentClassBundle::makeDocumentClass(
                                                "this document but has not been found in the list of\n"
                                                "available modules. If you recently installed it, you\n"
                                                "probably need to reconfigure LyX.\n"), from_utf8(modName));
-                       throw ExceptionMessage(WarningException,_("Module not available"),
-                                       msg + _("Some layouts may not be available."));
+                       frontend::Alert::warning(_("Module not available"), msg);
                        continue;
                }
                if (!lm->isAvailable()) {
@@ -1287,13 +1286,13 @@ DocumentClass & DocumentClassBundle::makeDocumentClass(
                                                bformat(_("The module %1$s requires a package that is\n"
                                                "not available in your LaTeX installation. LaTeX output\n"
                                                "may not be possible.\n"), from_utf8(modName));
-                       throw ExceptionMessage(WarningException, _("Package not available"), msg);
+                       frontend::Alert::warning(_("Package not available"), msg);
                }
                FileName layout_file = libFileSearch("layouts", lm->getFilename());
                if (!doc_class.read(layout_file, TextClass::MODULE)) {
                        docstring const msg =
                                                bformat(_("Error reading module %1$s\n"), from_utf8(modName));
-                       throw ExceptionMessage(WarningException, _("Read Error"), msg);
+                       frontend::Alert::warning(_("Read Error"), msg);
                }
        }
        return doc_class;
index b6e8aee5559d00b3e7c8251a7c331a59430ab6fe..bb4578d5bc5404f956aa59dd3d8ec9f00636adea 100644 (file)
@@ -42,6 +42,18 @@ using namespace lyx::support::os;
 
 namespace lyx {
 
+namespace frontend {
+namespace Alert {
+       void warning(docstring const & title, docstring const & message,
+                                bool const &)
+       {
+               LYXERR0(title);
+               LYXERR0(message);
+       }
+}
+}
+
+
 // Dummy translation support
 Messages messages_;
 Messages const & getMessages(std::string const &)
index 3ca64d2193273955d36dd71df5f003ccb6f4211a..52cf2c6ffebd53d388079be26b5e2817612d2215 100644 (file)
@@ -26,6 +26,14 @@ namespace lyx {
 
 namespace support { class FileName; }
 
+/// Simple support for frontend::Alert::warning().
+namespace frontend { 
+namespace Alert {
+       void warning(docstring const & title, docstring const & message,
+                                bool const &);
+}
+}
+
 class Context;
 
 /// A trivial subclass, just to give us a public default constructor