Embedding: fix enable() logic

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22619 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2008-01-18 06:46:06 +00:00
parent 0387ea1a3d
commit 82dfa33276

View File

@ -112,9 +112,6 @@ void EmbeddedFile::setEmbed(bool embed)
void EmbeddedFile::enable(bool flag, Buffer const * buf) void EmbeddedFile::enable(bool flag, Buffer const * buf)
{ {
if (enabled() == flag)
return;
if (flag) { if (flag) {
temp_path_ = buf->temppath(); temp_path_ = buf->temppath();
if (!suffixIs(temp_path_, '/')) if (!suffixIs(temp_path_, '/'))
@ -123,7 +120,8 @@ void EmbeddedFile::enable(bool flag, Buffer const * buf)
if (inzip_name_ != calcInzipName(buf->filePath())) if (inzip_name_ != calcInzipName(buf->filePath()))
syncInzipFile(buf->filePath()); syncInzipFile(buf->filePath());
updateFromExternalFile(); updateFromExternalFile();
} } else
extract();
} else { } else {
extract(); extract();
temp_path_ = ""; temp_path_ = "";