Fix two embedding bugs that lead to deadloop when loading a bundled .lyx file without external file

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20095 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-09-06 05:46:11 +00:00
parent c20795773e
commit f808198306

View File

@ -179,7 +179,7 @@ void EmbeddedFiles::registerFile(string const & filename,
EmbeddedFileList::iterator it = file_list_.begin(); EmbeddedFileList::iterator it = file_list_.begin();
EmbeddedFileList::iterator it_end = file_list_.end(); EmbeddedFileList::iterator it_end = file_list_.end();
for (; it != it_end; ++it) for (; it != it_end; ++it)
if (it->absFilename() == abs_filename) if (it->absFilename() == abs_filename || it->embeddedFile(buffer_) == abs_filename)
break; break;
// find this filename // find this filename
if (it != file_list_.end()) { if (it != file_list_.end()) {
@ -316,9 +316,9 @@ string const EmbeddedFiles::getInzipName(string const & abs_filename)
EmbeddedFileList::iterator it; EmbeddedFileList::iterator it;
EmbeddedFileList::iterator it_end = file_list_.end(); EmbeddedFileList::iterator it_end = file_list_.end();
bool unique_name = false; bool unique_name = false;
size_t i = 0;
while (!unique_name) { while (!unique_name) {
unique_name = true; unique_name = true;
size_t i = 0;
if (i > 0) if (i > 0)
inzip_name = convert<string>(i) + "_" + tmp; inzip_name = convert<string>(i) + "_" + tmp;
it = file_list_.begin(); it = file_list_.begin();