mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 17:20:55 +00:00
* InsetExternal.cpp:
* GuiExternal.cpp: - do not crash if the list of external templates is empty (bug #3974). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@31570 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
41924f48f7
commit
7dc9eab62b
@ -80,6 +80,8 @@ char const * const origin_gui_strs[] = {
|
||||
|
||||
external::Template getTemplate(int i)
|
||||
{
|
||||
if (external::TemplateManager::get().getTemplates().empty())
|
||||
return Template();
|
||||
external::TemplateManager::Templates::const_iterator i1
|
||||
= external::TemplateManager::get().getTemplates().begin();
|
||||
advance(i1, i);
|
||||
|
@ -104,7 +104,8 @@ InsetExternalParams::InsetExternalParams()
|
||||
if (defaultTemplateName.empty()) {
|
||||
external::TemplateManager const & etm =
|
||||
external::TemplateManager::get();
|
||||
templatename_ = etm.getTemplates().begin()->first;
|
||||
if (!etm.getTemplates().empty())
|
||||
templatename_ = etm.getTemplates().begin()->first;
|
||||
} else
|
||||
templatename_ = defaultTemplateName;
|
||||
}
|
||||
|
@ -20,7 +20,9 @@ void doAssert(char const * expr, char const * file, long line)
|
||||
{
|
||||
LYXERR0("ASSERTION " << expr << " VIOLATED IN " << file << ":" << line);
|
||||
// comment this out if not needed
|
||||
#ifdef ENABLE_ASSERTIONS
|
||||
BOOST_ASSERT(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace lyx
|
||||
|
@ -89,6 +89,8 @@ What's new
|
||||
|
||||
- Fix a tex2lyx crash when importing a LaTeX file using an unknown encoding
|
||||
(bug 6142).
|
||||
|
||||
- Fix a crash when no external templates are defined (bug 3974).
|
||||
|
||||
- Add encoding "ansinew" as a synonym of "cp1252" for the benefit of
|
||||
tex2lyx (bug 6142).
|
||||
|
Loading…
Reference in New Issue
Block a user