Bug #6842, part II

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
This commit is contained in:
Jean-Marc Lasgouttes 2010-08-07 11:42:27 +00:00
parent a84925bebe
commit 8a9d765739
4 changed files with 4 additions and 13 deletions

View 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"

View 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);

View 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_;
}

View 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.
*