* 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"
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();
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_)
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_)
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