]> git.lyx.org Git - features.git/commitdiff
Bug #6842, part II
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 7 Aug 2010 11:42:27 +0000 (11:42 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 7 Aug 2010 11:42:27 +0000 (11:42 +0000)
Make sure that Package can be initialized several time.s
Make sure that Package is not used before being initialized.

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

src/LyX.cpp
src/main.cpp
src/support/Package.cpp
src/support/lassert.cpp

index 3a03eb31456f430970cbe9ed91cdc56d568168af..548733929326efc918912033ce930af1fb8c4473 100644 (file)
@@ -286,7 +286,7 @@ int LyX::exec(int & argc, char * argv[])
                init_package(os::utf8_argv(0), string(), string(),
                              top_build_dir_is_one_level_up);
        } catch (ExceptionMessage const & message) {}
-       Messages::init();
+       locale_init();
 
        // Here we need to parse the command line. At least
        // we need to parse for "-dbg" and "-help"
index 5e09dd86fb27ac2dba298e16c31ad01ca62c61b2..e9893062df561a564207bd03e3e8ce38e7bce941 100644 (file)
@@ -38,9 +38,6 @@ int main(int argc, char * argv[])
 
        lyx::support::os::init(argc, argv);
 
-       // initialize for internationalized version *EK*
-       lyx::locale_init();
-
        lyx::LyX the_lyx_instance;
 
        return the_lyx_instance.exec(argc, argv);
index d947f9ae80a8996e095a5b5abb77483c4821e321..b65bd1fd235226e023221ade58dae7647b4b7a67 100644 (file)
@@ -18,6 +18,7 @@
 #include "support/ExceptionMessage.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
+#include "support/lassert.h"
 #include "support/lstrings.h"
 #include "support/os.h"
 
@@ -56,10 +57,6 @@ void init_package(string const & command_line_arg0,
                  string const & command_line_user_support_dir,
                  exe_build_dir_to_top_build_dir top_build_dir_location)
 {
-       // Can do so only once.
-       if (initialised_)
-               return;
-
        package_ = Package(command_line_arg0,
                           command_line_system_support_dir,
                           command_line_user_support_dir,
@@ -70,10 +67,7 @@ void init_package(string const & command_line_arg0,
 
 Package const & package()
 {
-       // Commented out because package().locale_dir() can be called
-       // from the message translation code in Messages.cpp before
-       // init_package() is called. Lars is on the case...
-       // LASSERT(initialised_, /**/);
+       LASSERT(initialised_, /**/);
        return package_;
 }
 
index 1e6cd55ecfac9d50a9d6a390a7b8bbb54f551136..b384007f6087027beed63d91915a597e85be068f 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * \file assert.cpp
+ * \file lassert.cpp
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *