Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 14762 → Rev 14763

/trunk/Scribus/scribus/ui/customfdialog.cpp
4,6 → 4,7
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
 
/***************************************************************************
customfdialog.cpp - description
-------------------
257,7 → 258,6
}
else if (ext.toUtf8() == "shape")
{
QPixmap pmi;
QByteArray cf;
if (loadRawText(name, cf))
{
265,8 → 265,7
StencilReader *pre = new StencilReader();
QString f2 = pre->createShape(f);
ScPreview *pre2 = new ScPreview();
pmi = pre2->createPreview(f2);
QImage im = pmi.toImage();
QImage im = pre2->createPreview(f2);
im = im.scaled(w - 5, h - 21, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPainter p;
QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
286,7 → 285,6
}
else if (ext.toUtf8() == "sce")
{
QPixmap pmi;
QByteArray cf;
if (loadRawText(name, cf))
{
296,8 → 294,7
else
f = cf.data();
ScPreview *pre = new ScPreview();
pmi = pre->createPreview(f);
QImage im = pmi.toImage();
QImage im = pre->createPreview(f);
im = im.scaled(w - 5, h - 21, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPainter p;
QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
/trunk/Scribus/scribus/ui/scrapbookpalette.cpp
4,12 → 4,7
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
/****************************************************************************
** Form implementation generated from reading ui file 'Bib.ui'
**
** Created: Sun Oct 14 19:47:56 2001
**
****************************************************************************/
 
#include "scrapbookpalette.h"
 
#include <QEvent>
323,7 → 318,7
else
f = cf.data();
ScPreview *pre = new ScPreview();
pm = pre->createPreview(f);
pm = QPixmap::fromImage(pre->createPreview(f));
delete pre;
}
QFileInfo fi3(QDir::cleanPath(QDir::convertSeparators(name + "/" + d[dc])));
388,7 → 383,7
StencilReader *pre = new StencilReader();
QString f2 = pre->createShape(f);
ScPreview *pre2 = new ScPreview();
pm = pre2->createPreview(f2);
pm = QPixmap::fromImage(pre2->createPreview(f2));
delete pre;
delete pre2;
}
536,7 → 531,7
else
f = cf.data();
ScPreview *pre = new ScPreview();
pm = pre->createPreview(f);
pm = QPixmap::fromImage(pre->createPreview(f));
if ((canWrite) && (PrefsManager::instance()->appPrefs.scrapbookPrefs.writePreviews))
pm.save(QDir::cleanPath(QDir::convertSeparators(fi.path()+"/"+fi.baseName()+".png")), "PNG");
delete pre;
602,7 → 597,7
StencilReader *pre = new StencilReader();
QString f2 = pre->createShape(f);
ScPreview *pre2 = new ScPreview();
pm = pre2->createPreview(f2);
pm = QPixmap::fromImage(pre2->createPreview(f2));
if ((canWrite) && (PrefsManager::instance()->appPrefs.scrapbookPrefs.writePreviews))
pm.save(QDir::cleanPath(QDir::convertSeparators(fi.path()+"/"+fi.baseName()+".png")), "PNG");
delete pre;
659,10 → 654,7
QMap<QString,Elem>::Iterator itf;
for (itf = objectMap.begin(); itf != objectMap.end(); ++itf)
{
if (itf.value().Preview.width() > 60)
itf.value().Preview = itf.value().Preview.scaledToWidth(60, Qt::SmoothTransformation);
if (itf.value().Preview.height() > 60)
itf.value().Preview = itf.value().Preview.scaledToHeight(60, Qt::SmoothTransformation);
itf.value().Preview = itf.value().Preview.scaled(60, 60, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPixmap pm(60, 60);
pm.fill(palette().color(QPalette::Base));
QPainter p;
1127,10 → 1119,7
if (fiD.baseName() != nam)
adjustReferences(QDir::convertSeparators(bv->ScFilename + "/" + nam + "." + fi.completeSuffix().toLower()));
}
if (pm.width() > 60)
pm = pm.scaledToWidth(60, Qt::SmoothTransformation);
if (pm.height() > 60)
pm = pm.scaledToHeight(60, Qt::SmoothTransformation);
pm = pm.scaled(60, 60, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPixmap pm2(60, 60);
pm2.fill(palette().color(QPalette::Base));
QPainter p;
1524,14 → 1513,11
QString ff = text;
activeBView->checkAndChange(ff, QDir::cleanPath(QDir::convertSeparators(activeBView->ScFilename + "/" + nam + ".sce")), QDir::cleanPath(QDir::convertSeparators(activeBView->ScFilename)));
ScPreview *pre = new ScPreview();
QPixmap pm = pre->createPreview(ff);
QPixmap pm = QPixmap::fromImage(pre->createPreview(ff));
activeBView->AddObj(nam, QDir::cleanPath(QDir::convertSeparators(activeBView->ScFilename + "/" + nam + ".sce")), pm);
if (PrefsManager::instance()->appPrefs.scrapbookPrefs.writePreviews)
pm.save(QDir::cleanPath(QDir::convertSeparators(activeBView->ScFilename + "/" + nam +".png")), "PNG");
if (pm.width() > 60)
pm = pm.scaledToWidth(60, Qt::SmoothTransformation);
if (pm.height() > 60)
pm = pm.scaledToHeight(60, Qt::SmoothTransformation);
pm = pm.scaled(60, 60, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPixmap pm2(60, 60);
pm2.fill(palette().color(QPalette::Base));
QPainter p;
1595,14 → 1581,11
QString ff = text;
tempBView->checkAndChange(ff, QDir::cleanPath(QDir::convertSeparators(tempBView->ScFilename + "/" + nam + ".sce")), QDir::cleanPath(QDir::convertSeparators(tempBView->ScFilename)));
ScPreview *pre = new ScPreview();
QPixmap pm = pre->createPreview(ff);
QPixmap pm = QPixmap::fromImage(pre->createPreview(ff));
tempBView->AddObj(nam, QDir::cleanPath(QDir::convertSeparators(tempBView->ScFilename + "/" + nam + ".sce")), pm);
if (PrefsManager::instance()->appPrefs.scrapbookPrefs.writePreviews)
pm.save(QDir::cleanPath(QDir::convertSeparators(tempBView->ScFilename + "/" + nam +".png")), "PNG");
if (pm.width() > 60)
pm = pm.scaledToWidth(60, Qt::SmoothTransformation);
if (pm.height() > 60)
pm = pm.scaledToHeight(60, Qt::SmoothTransformation);
pm = pm.scaled(60, 60, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPixmap pm2(60, 60);
pm2.fill(palette().color(QPalette::Base));
QPainter p;