]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsCacheItem.C
Store an InsetBase & in MailInset.
[lyx.git] / src / graphics / GraphicsCacheItem.C
index b599e7c845cea62fc341cbe90645ca2af0bba846..fe38fd16af8856726d452e06de754127e30b3d6c 100644 (file)
@@ -3,19 +3,15 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Baruch Even 
- * \author Herbert Voss 
- * \author Angus Leeming 
+ * \author Baruch Even
+ * \author Herbert Voss
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "GraphicsCacheItem.h"
 #include "GraphicsImage.h"
 #include "GraphicsConverter.h"
@@ -248,7 +244,7 @@ void CacheItem::Impl::setStatus(ImageStatus new_status)
 void CacheItem::Impl::imageConverted(bool success)
 {
        string const text = success ? "succeeded" : "failed";
-       lyxerr[Debug::GRAPHICS] << "Image conversion " << text << "." << endl;
+       lyxerr[Debug::GRAPHICS] << "Image conversion " << text << '.' << endl;
 
        file_to_load_ = converter_.get() ?
                converter_->convertedFile() : string();
@@ -256,9 +252,10 @@ void CacheItem::Impl::imageConverted(bool success)
        cc_.disconnect();
 
        success = !file_to_load_.empty() && IsFileReadable(file_to_load_);
-       lyxerr[Debug::GRAPHICS] << "Unable to find converted file!" << endl;
 
        if (!success) {
+               lyxerr[Debug::GRAPHICS] << "Unable to find converted file!"
+                                       << endl;
                setStatus(ErrorConverting);
 
                if (zipped_)
@@ -290,7 +287,7 @@ void CacheItem::Impl::loadImage()
 void CacheItem::Impl::imageLoaded(bool success)
 {
        string const text = success ? "succeeded" : "failed";
-       lyxerr[Debug::GRAPHICS] << "Image loading " << text << "." << endl;
+       lyxerr[Debug::GRAPHICS] << "Image loading " << text << '.' << endl;
 
        // Clean up after loading.
        if (zipped_)
@@ -325,23 +322,27 @@ string const findTargetFormat(string const & from)
        lyx::Assert(!formats.empty());
 
        // First ascertain if we can load directly with no conversion
-       FormatList::const_iterator it1 = formats.begin();
+       FormatList::const_iterator it  = formats.begin();
        FormatList::const_iterator end = formats.end();
-       for (; it1 != end; ++it1) {
-               if (from == *it1)
-                       return *it1;
+       for (; it != end; ++it) {
+               if (from == *it)
+                       return *it;
        }
 
        // So, we have to convert to a loadable format. Can we?
-       FormatList::const_iterator it2 = formats.begin();
-       for (; it2 != end; ++it2) {
-               if (grfx::Converter::isReachable(from, *it2))
-                       return *it2;
+       it = formats.begin();
+       for (; it != end; ++it) {
+               if (grfx::Converter::isReachable(from, *it))
+                       return *it;
+               else
+                       lyxerr[Debug::GRAPHICS]
+                               << "Unable to convert from " << from
+                               << " to " << *it << std::endl;
        }
 
-       // Failed! so we have to try to convert it to XPM format
+       // Failed! so we have to try to convert it to PPM format
        // with the standard converter
-       return string("xpm");
+       return string("ppm");
 }
 
 } // anon namespace