From f808198306eea77d7e3ce312f848b9b7c170ae76 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Thu, 6 Sep 2007 05:46:11 +0000 Subject: [PATCH] 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 --- src/EmbeddedFiles.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EmbeddedFiles.cpp b/src/EmbeddedFiles.cpp index 9f25de6f72..89d24f528b 100644 --- a/src/EmbeddedFiles.cpp +++ b/src/EmbeddedFiles.cpp @@ -179,7 +179,7 @@ void EmbeddedFiles::registerFile(string const & filename, EmbeddedFileList::iterator it = file_list_.begin(); EmbeddedFileList::iterator it_end = file_list_.end(); for (; it != it_end; ++it) - if (it->absFilename() == abs_filename) + if (it->absFilename() == abs_filename || it->embeddedFile(buffer_) == abs_filename) break; // find this filename if (it != file_list_.end()) { @@ -316,9 +316,9 @@ string const EmbeddedFiles::getInzipName(string const & abs_filename) EmbeddedFileList::iterator it; EmbeddedFileList::iterator it_end = file_list_.end(); bool unique_name = false; + size_t i = 0; while (!unique_name) { unique_name = true; - size_t i = 0; if (i > 0) inzip_name = convert(i) + "_" + tmp; it = file_list_.begin();