Cosmetics, and simplify updateEmbeddedFile.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24043 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2008-03-29 16:17:30 +00:00
parent b9c79778d7
commit 8555235f68

View File

@ -57,15 +57,15 @@ void InsetBibtex::setBuffer(Buffer & buffer)
// FIXME We ought to have a buffer.
if (buffer_) {
EmbeddedFileList::iterator it = bibfiles_.begin();
EmbeddedFileList::iterator it_end = bibfiles_.end();
for (; it != it_end; ++it) {
EmbeddedFileList::iterator en = bibfiles_.end();
for (; it != en; ++it) {
try {
*it = it->copyTo(&buffer);
} catch (ExceptionMessage const & message) {
Alert::error(message.title_, message.details_);
// failed to embed
it->setEmbed(false);
}
}
}
}
InsetCommand::setBuffer(buffer);
@ -836,8 +836,8 @@ void InsetBibtex::registerEmbeddedFiles(EmbeddedFileList & files) const
createBibFiles();
EmbeddedFileList::const_iterator it = bibfiles_.begin();
EmbeddedFileList::const_iterator it_end = bibfiles_.end();
for (; it != it_end; ++it)
EmbeddedFileList::const_iterator en = bibfiles_.end();
for (; it != en; ++it)
files.registerFile(*it, this, buffer());
}
@ -845,11 +845,11 @@ void InsetBibtex::registerEmbeddedFiles(EmbeddedFileList & files) const
void InsetBibtex::updateEmbeddedFile(EmbeddedFile const & file)
{
// look for the item and update status
for (EmbeddedFileList::iterator it = bibfiles_.begin();
it != bibfiles_.end(); ++it)
if (it->absFilename() == file.absFilename())
*it = file;
string const filename = file.absFilename();
EmbeddedFileList::iterator it = bibfiles_.findFile(filename);
if (it == bibfiles_.end())
return;
*it = file;
updateParam();
}