git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25659 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-07-16 09:43:46 +00:00
parent 145d2419f5
commit 79036bcede
2 changed files with 16 additions and 4 deletions

View File

@ -70,7 +70,9 @@ bool GuiImage::load(FileName const & filename)
return false;
}
if (!original_.load(toqstr(filename.absFilename()))) {
fname_ = toqstr(filename.absFilename());
if (!original_.load(fname_)) {
LYXERR(Debug::GRAPHICS, "Unable to open image");
return false;
}
@ -80,15 +82,22 @@ bool GuiImage::load(FileName const & filename)
bool GuiImage::setPixmap(Params const & params)
{
if (original_.isNull() || !params.display)
if (!params.display)
return false;
if (original_.isNull()) {
if (original_.load(fname_))
return false;
}
is_transformed_ = clip(params);
is_transformed_ |= rotate(params);
is_transformed_ |= scale(params);
if (!is_transformed_)
// Clear it out to save some memory.
// Clear the pixmap to save some memory.
if (is_transformed_)
original_ = QPixmap();
else
transformed_ = QPixmap();
return true;

View File

@ -16,6 +16,7 @@
#include "graphics/GraphicsImage.h"
#include <QPixmap>
#include <QString>
namespace lyx {
namespace graphics {
@ -69,6 +70,8 @@ private:
QPixmap transformed_;
/// Buffer the pixmap itself
bool is_transformed_;
///
QString fname_;
};
} // namespace graphics