]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsCacheItem.cpp
whitespace only
[lyx.git] / src / graphics / GraphicsCacheItem.cpp
index 4d18ce0778e7d5c86fce8bee59631f3aa64908aa..2e8c415f36b6709d849389281d2a084f6e031a64 100644 (file)
@@ -362,7 +362,12 @@ bool CacheItem::Impl::tryDisplayFormat(FileName & filename, string & from)
 
        zipped_ = formats.isZippedFile(filename_);
        if (zipped_) {
-               TempFile tempfile(filename_.toFilesystemEncoding());
+               string tempname = unzippedFileName(filename_.toFilesystemEncoding());
+               string const ext = getExtension(tempname);
+               tempname = changeExtension(tempname, "") + "-XXXXXX";
+               if (!ext.empty())
+                       tempname = addExtension(tempname, ext);
+               TempFile tempfile(tempname);
                tempfile.setAutoRemove(false);
                unzipped_filename_ = tempfile.name();
                if (unzipped_filename_.empty()) {