Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 24735 → Rev 24734

/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.cpp
40,7 → 40,24
#endif
}
 
ScImgDataLoader_PS::ScImgDataLoader_PS()
ScImgDataLoader_PS::ScImgDataLoader_PS() :
m_isDCS1(false),
m_isDCS2(false),
m_isDCS2multi(false),
m_isPhotoshop(false),
m_hasPhotoshopImageData(false),
m_doThumbnail(false),
m_hasThumbnail(false),
m_inTrailer(false),
m_BBoxInTrailer(false),
m_isRotated(false),
m_psXSize(0),
m_psYSize(0),
m_psDepth(0),
m_psMode(0),
m_psChannel(0),
m_psBlock(0),
m_psDataType(0)
{
initSupportedFormatList();
}
451,7 → 468,7
break;
}
}
if (psFound && !isAtend)
if ((psFound) && (!isAtend))
break;
}
}
466,18 → 483,15
double b = 0;
double h = 0;
bool found = false;
 
QFileInfo fi(fn);
QFileInfo fi = QFileInfo(fn);
if (!fi.exists())
return false;
QString ext = fi.suffix().toLower();
if (ext.isEmpty())
ext = getImageType(fn);
 
QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + QString("sc%1.png").arg(qMax(1, page)));
QString tmpFiles = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc%d.png");
QString picFile = QDir::toNativeSeparators(fn);
 
float xres = gsRes;
float yres = gsRes;
 
524,7 → 538,7
m_imageInfoRecord.exifInfo.width = qRound(b);
m_imageInfoRecord.exifInfo.height = qRound(h);
m_image = m_imageInfoRecord.exifInfo.thumbnail;
if (m_isPhotoshop && m_hasPhotoshopImageData)
if ((m_isPhotoshop) && (m_hasPhotoshopImageData))
{
m_imageInfoRecord.exifInfo.width = m_psXSize;
m_imageInfoRecord.exifInfo.height = m_psYSize;
563,7 → 577,7
loadDCS1(fn, gsRes);
else if (m_isDCS2)
loadDCS2(fn, gsRes);
else if (m_isPhotoshop && m_hasPhotoshopImageData)
else if ((m_isPhotoshop) && (m_hasPhotoshopImageData))
loadPhotoshop(fn, gsRes);
else if ((!m_imageInfoRecord.isEmbedded) || ((m_imageInfoRecord.isEmbedded) && (m_profileComponents == 3)))
{
585,7 → 599,7
if (retg == 0)
{
m_image.load(tmpFile);
if ((extensionIndicatesEPS(ext) && m_BBoxInTrailer) || m_isRotated)
if ((extensionIndicatesEPS(ext) && m_BBoxInTrailer) || (m_isRotated))
{
int ex = qRound(x * gsRes / 72.0);
int ey = qRound(m_image.height() - h);
593,7 → 607,7
int eh = qRound(h - y * gsRes / 72.0);
m_image = m_image.copy(ex, ey, ew, eh);
}
if (!ScCore->havePNGAlpha() || m_isRotated)
if ((!ScCore->havePNGAlpha()) || (m_isRotated))
{
int wi = m_image.width();
int hi = m_image.height();
612,7 → 626,7
}
}
 
QStringList files("sc*.png");
QStringList files = QStringList("sc*.png");
files = QDir(ScPaths::tempFileDir()).entryList(files);
for (int i=0; i < files.count(); ++i)
QFile::remove(QDir::toNativeSeparators(ScPaths::tempFileDir() + files[i]));
691,7 → 705,7
f.close();
}
QStringList files("sc*.png");
QStringList files = QStringList("sc*.png");
files = QDir(ScPaths::tempFileDir()).entryList(files);
for (int i=0; i < files.count(); ++i)
QFile::remove(QDir::toNativeSeparators(ScPaths::tempFileDir() + files[i]));
733,7 → 747,7
return;
}
QStringList args;
QFileInfo fi(fn);
QFileInfo fi = QFileInfo(fn);
QString ext = fi.suffix().toLower();
QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc1.png");
int retg;
1433,7 → 1447,7
ts2 >> x >> y >> b >> h;
xres = gsRes;
yres = gsRes;
if (m_isPhotoshop && m_hasPhotoshopImageData)
if ((m_isPhotoshop) && (m_hasPhotoshopImageData))
{
m_image = QImage(m_psXSize, m_psYSize, QImage::Format_ARGB32);
xres = m_psXSize / b * 72.0;
1459,7 → 1473,7
f2.write(imgc.data(), it.value().len);
f2.close();
imgc.resize(0);
if (m_isPhotoshop && m_hasPhotoshopImageData)
if ((m_isPhotoshop) && (m_hasPhotoshopImageData))
{
QImage tmpImg;
loadPhotoshopBinary(tmpFile2, tmpImg);
1488,7 → 1502,7
for (QMap<QString, QString>::Iterator it = m_colorPlates.begin(); it != m_colorPlates.end(); ++it)
{
tmpFile2 = QDir::toNativeSeparators(baseFile+"/"+it.value());
if (m_isPhotoshop && m_hasPhotoshopImageData)
if ((m_isPhotoshop) && (m_hasPhotoshopImageData))
{
QImage tmpImg;
loadPhotoshopBinary(tmpFile2, tmpImg);
1535,7 → 1549,7
{
QStringList args;
double x, y, b, h;
QFileInfo fi(fn);
QFileInfo fi = QFileInfo(fn);
QString ext = fi.suffix().toLower();
QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc1.png");
QString baseFile = fi.absolutePath();
1632,7 → 1646,7
m_pixelFormat = Format_YMCK_8;
}
 
void ScImgDataLoader_PS::blendImages(QImage &source, const ScColor& col)
void ScImgDataLoader_PS::blendImages(QImage &source, ScColor col)
{
int h = source.height();
int w = source.width();
1668,7 → 1682,7
initialize();
 
hasAlpha = false;
QFileInfo fi(fn);
QFileInfo fi = QFileInfo(fn);
if (!fi.exists())
return false;
QString ext = fi.suffix().toLower();
1726,7 → 1740,7
}
}
QStringList files("sc*.png");
QStringList files = QStringList("sc*.png");
files = QDir(ScPaths::tempFileDir()).entryList(files);
for (int i=0; i < files.count(); ++i)
QFile::remove(QDir::toNativeSeparators(ScPaths::tempFileDir() + files[i]));
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_jpeg.cpp
82,7 → 82,7
if (read_jpeg_marker(ICC_MARKER, &cinfo, &EmbedBuffer, &EmbedLen))
{
bool profileIsValid = false;
QByteArray profArray((const char*) EmbedBuffer, EmbedLen);
QByteArray profArray = QByteArray((const char*) EmbedBuffer, EmbedLen);
ScColorProfile prof = ScCore->defaultEngine.openProfileFromMem(profArray);
if (prof)
{
524,7 → 524,7
if (ori != 1)
{
QTransform M;
QTransform flip(-1, 0, 0, 1, 0, 0);
QTransform flip = QTransform(-1, 0, 0, 1, 0, 0);
switch ( ori )
{ // notice intentional fallthroughs
case 2:
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pict.cpp
42,7 → 42,22
#include "util_formats.h"
#include "util_math.h"
 
ScImgDataLoader_PICT::ScImgDataLoader_PICT()
ScImgDataLoader_PICT::ScImgDataLoader_PICT() :
m_baseX(0),
m_baseY(0),
m_docWidth(0),
m_docHeight(0),
m_resX(0.0),
m_resY(0.0),
m_LineW(0.0),
m_patternMode(false),
m_currentTextSize(0),
m_currentFontID(0),
m_currentFontStyle(0),
m_postscriptMode(false),
m_textIsPostScript(false),
m_pctVersion(0),
m_skipOpcode(false)
{
initSupportedFormatList();
}
163,7 → 178,7
m_backColor = Qt::white;
m_foreColor = Qt::black;
m_Coords = QPainterPath();
m_lineW = 1.0;
m_LineW = 1.0;
m_currentPoint = QPoint(0, 0);
m_currentPointT = QPoint(0, 0);
m_ovalSize = QPoint(0, 0);
753,7 → 768,7
redC = qRound((Rc / 65535.0) * 255.0);
greenC = qRound((Gc / 65535.0) * 255.0);
blueC = qRound((Bc / 65535.0) * 255.0);
QColor c(redC, greenC, blueC);
QColor c = QColor(redC, greenC, blueC);
if (back)
m_backColor = c;
else
768,7 → 783,7
redC = qRound((Rc / 65535.0) * 255.0);
greenC = qRound((Gc / 65535.0) * 255.0);
blueC = qRound((Bc / 65535.0) * 255.0);
QColor c(redC, greenC, blueC);
QColor c = QColor(redC, greenC, blueC);
if (back)
m_backColor = c;
else
813,7 → 828,7
m_Coords.lineTo(x, y);
}
if (opCode == 0x0070)
m_imagePainter.strokePath(m_Coords, QPen(m_foreColor, m_lineW));
m_imagePainter.strokePath(m_Coords, QPen(m_foreColor, m_LineW));
else if (opCode == 0x0071)
m_imagePainter.fillPath(m_Coords, fillBrush);
else if (opCode == 0x0072)
838,7 → 853,7
// qDebug() << QString("Handle Rect/Oval 0x%1").arg(opCode, 4, 16, QLatin1Char('0'));
if (opCode == 0x0030)
{
m_imagePainter.setPen(QPen(m_foreColor, m_lineW));
m_imagePainter.setPen(QPen(m_foreColor, m_LineW));
m_imagePainter.setBrush(Qt::NoBrush);
m_imagePainter.drawRect(bounds);
}
862,7 → 877,7
}
else if (opCode == 0x0040)
{
m_imagePainter.setPen(QPen(m_foreColor, m_lineW));
m_imagePainter.setPen(QPen(m_foreColor, m_LineW));
m_imagePainter.setBrush(Qt::NoBrush);
m_imagePainter.drawRoundedRect(bounds, m_ovalSize.x(), m_ovalSize.y());
}
886,7 → 901,7
}
else if (opCode == 0x0050)
{
m_imagePainter.setPen(QPen(m_foreColor, m_lineW));
m_imagePainter.setPen(QPen(m_foreColor, m_LineW));
m_imagePainter.setBrush(Qt::NoBrush);
m_imagePainter.drawEllipse(bounds);
}
927,7 → 942,7
fillBrush = QBrush(m_foreColor);
if (opCode == 0x0038)
{
m_imagePainter.setPen(QPen(m_foreColor, m_lineW));
m_imagePainter.setPen(QPen(m_foreColor, m_LineW));
m_imagePainter.setBrush(Qt::NoBrush);
m_imagePainter.drawRect(bounds);
}
951,7 → 966,7
}
else if (opCode == 0x0048)
{
m_imagePainter.setPen(QPen(m_foreColor, m_lineW));
m_imagePainter.setPen(QPen(m_foreColor, m_LineW));
m_imagePainter.setBrush(Qt::NoBrush);
m_imagePainter.drawRoundedRect(bounds, m_ovalSize.x(), m_ovalSize.y());
}
975,7 → 990,7
}
else if (opCode == 0x0058)
{
m_imagePainter.setPen(QPen(m_foreColor, m_lineW));
m_imagePainter.setPen(QPen(m_foreColor, m_LineW));
m_imagePainter.setBrush(Qt::NoBrush);
m_imagePainter.drawEllipse(bounds);
}
1211,7 → 1226,7
// qDebug() << "Handle Pen Size";
quint16 x, y;
ts >> y >> x;
m_lineW = qMax(x, y);
m_LineW = qMax(x, y);
}
 
void ScImgDataLoader_PICT::handleOvalSize(QDataStream &ts)
1228,7 → 1243,7
qint8 dh, dv;
ts >> y >> x;
ts >> dh >> dv;
m_imagePainter.setPen(QPen(m_foreColor, m_lineW));
m_imagePainter.setPen(QPen(m_foreColor, m_LineW));
m_imagePainter.drawLine(x, y, x + dh, y + dv);
m_currentPoint = QPoint(x+dh, y+dv);
// qDebug() << "Handle Short Line" << x << y << "+" << dh << dv << "->" << currentPoint;
1241,7 → 1256,7
if ((dh == 0) && (dv == 0))
return;
QPoint s = m_currentPoint;
m_imagePainter.setPen(QPen(m_foreColor, m_lineW));
m_imagePainter.setPen(QPen(m_foreColor, m_LineW));
m_imagePainter.drawLine(s.x(), s.y(), s.x() + dh, s.y() + dv);
m_currentPoint = QPoint(s.x()+dh, s.y()+dv);
// qDebug() << "Handle Short Line from" << dh << dv << "->" << currentPoint;
1252,7 → 1267,7
qint16 x1, x2, y1, y2;
ts >> y1 >> x1;
ts >> y2 >> x2;
m_imagePainter.setPen(QPen(m_foreColor, m_lineW));
m_imagePainter.setPen(QPen(m_foreColor, m_LineW));
m_imagePainter.drawLine(x1, y1, x2, y2);
m_currentPoint = QPoint(x2, y2);
// qDebug() << "Handle Line" << x1 << y1 << "->" << currentPoint;
1265,7 → 1280,7
if ((x == 0) && (y == 0))
return;
QPoint s = m_currentPoint;
m_imagePainter.setPen(QPen(m_foreColor, m_lineW));
m_imagePainter.setPen(QPen(m_foreColor, m_LineW));
m_imagePainter.drawLine(s.x(), s.y(), x, y);
m_currentPoint = QPoint(x, y);
// qDebug() << "Handle Line from" << s << "->" << currentPoint;
1684,7 → 1699,7
 
QByteArray ScImgDataLoader_PICT::decodeRLE(QByteArray &in, quint16 bytesPerLine, int multByte)
{
QByteArray ret(bytesPerLine, ' ');
QByteArray ret = QByteArray(bytesPerLine, ' ');
uchar *ptrOut, *ptrIn;
ptrOut = (uchar*)ret.data();
ptrIn = (uchar*)in.data();
1756,7 → 1771,7
 
QBrush ScImgDataLoader_PICT::setFillPattern()
{
QImage image(8, 8, QImage::Format_Mono);
QImage image = QImage(8, 8, QImage::Format_Mono);
QVector<QRgb> colors;
colors.append(m_backColor.rgb());
colors.append(m_foreColor.rgb());
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp
33,6 → 33,7
 
ScImgDataLoader_PSD::ScImgDataLoader_PSD()
{
m_maxChannels = 0;
initSupportedFormatList();
}
 
49,7 → 50,7
 
ScColorProfile prof;
ScColorMgmtEngine engine(ScCore->defaultEngine);
QFileInfo fi(fn);
QFileInfo fi = QFileInfo(fn);
if (!fi.exists())
return;
 
99,7 → 100,7
hasAlpha = false;
m_imageInfoRecord.RequestProps = req;
m_imageInfoRecord.isRequest = valid;
QFileInfo fi(fn);
QFileInfo fi = QFileInfo(fn);
if (!fi.exists())
return false;
 
312,7 → 313,7
cdataStart = s.device()->pos();
if (tmp != 0)
{
if (header.color_mode == CM_DUOTONE)
if ((header.color_mode == CM_DUOTONE))
{
short signature;
short count;
1549,13 → 1550,13
return ret;
}
 
bool ScImgDataLoader_PSD::IsValid( const PSDHeader & header ) const
bool ScImgDataLoader_PSD::IsValid( const PSDHeader & header )
{
return header.signature == 0x38425053;
}
 
// Check that the header is supported.
bool ScImgDataLoader_PSD::IsSupported( const PSDHeader & header ) const
bool ScImgDataLoader_PSD::IsSupported( const PSDHeader & header )
{
if ( header.version != 1 )
return false;
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pict.h
64,17 → 64,15
QByteArray decodeRLE(QByteArray &in, quint16 bytesPerLine, int multByte);
QBrush setFillPattern();
 
int m_baseX { 0 };
int m_baseY { 0 };
int m_docWidth { 0 };
int m_docHeight { 0 };
double m_resX { 0.0 };
double m_resY { 0.0 };
int m_baseX, m_baseY;
int m_docWidth;
int m_docHeight;
double m_resX, m_resY;
 
double m_lineW { 0.0 };
double m_LineW;
QColor m_backColor;
QColor m_foreColor;
bool m_patternMode { false };
bool m_patternMode;
QByteArray m_patternData;
QRect m_currRect;
QBrush m_currPatternBrush;
81,9 → 79,9
QRect m_lastImageRect;
QPoint m_ovalSize;
QMap<int, QString> m_fontMap;
int m_currentTextSize { 0 };
int m_currentFontID { 0 };
int m_currentFontStyle { 0 };
int m_currentTextSize;
int m_currentFontID;
int m_currentFontStyle;
QByteArray m_imageData;
 
QPainterPath m_Coords;
90,10 → 88,10
QPoint m_currentPoint;
QPoint m_currentPointT;
QPainter m_imagePainter;
bool m_postscriptMode { false };
bool m_textIsPostScript { false };
int m_pctVersion { 0 };
bool m_skipOpcode { false };
bool m_postscriptMode;
bool m_textIsPostScript;
int m_pctVersion;
bool m_skipOpcode;
};
 
#endif
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_ps.h
33,7 → 33,7
void loadPhotoshopBinary(const QString& fn, QImage &tmpImg);
void loadDCS1(const QString& fn, int gsRes);
void loadDCS2(const QString& fn, int gsRes);
void blendImages(QImage &source, const ScColor& col);
void blendImages(QImage &source, ScColor col);
struct plateOffsets
{
uint pos;
43,23 → 43,23
QMap<QString, QString> m_colorPlates;
QString m_BBox;
QString m_Creator;
bool m_isDCS1 { false };
bool m_isDCS2 { false };
bool m_isDCS2multi { false };
bool m_isPhotoshop { false };
bool m_hasPhotoshopImageData { false };
bool m_doThumbnail { false };
bool m_hasThumbnail { false };
bool m_inTrailer { false };
bool m_BBoxInTrailer { false };
bool m_isRotated { false };
int m_psXSize { 0 };
int m_psYSize { 0 };
int m_psDepth { 0 };
int m_psMode { 0 };
int m_psChannel { 0 };
int m_psBlock { 0 };
int m_psDataType { 0 };
bool m_isDCS1;
bool m_isDCS2;
bool m_isDCS2multi;
bool m_isPhotoshop;
bool m_hasPhotoshopImageData;
bool m_doThumbnail;
bool m_hasThumbnail;
bool m_inTrailer;
bool m_BBoxInTrailer;
bool m_isRotated;
int m_psXSize;
int m_psYSize;
int m_psDepth;
int m_psMode;
int m_psChannel;
int m_psBlock;
int m_psDataType;
QString m_psCommand;
QMap<QString,ScColor> m_CustColors;
QStringList m_FontListe;
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.h
44,8 → 44,8
 
void initSupportedFormatList();
 
bool IsValid( const PSDHeader & header ) const;
bool IsSupported( const PSDHeader & header ) const;
bool IsValid( const PSDHeader & header );
bool IsSupported( const PSDHeader & header );
 
bool LoadPSD( QDataStream & s, const PSDHeader & header);
bool LoadPSDResources( QDataStream & s, const PSDHeader & header, uint dataOffset );
56,8 → 56,7
bool parseLayer( QDataStream & s, const PSDHeader & header);
QString getLayerString(QDataStream & s);
void putDuotone(uchar *ptr, uchar cbyte);
 
int m_maxChannels { 0 };
int m_maxChannels;
QVector<int> m_curveTable1;
QVector<int> m_curveTable2;
QVector<int> m_curveTable3;
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp
17,9 → 17,14
#include "scimgdataloader_wpg.h"
#include "third_party/wpg/WPGStreamImplementation.h"
 
ScrPainterIm::ScrPainterIm()
ScrPainterIm::ScrPainterIm() :
fillrule(false),
gradientAngle(0.0),
isGradient(false),
fillSet(false),
strokeSet(false),
image(nullptr)
{
 
}
 
void ScrPainterIm::startGraphics(double width, double height)
60,7 → 65,7
Qt::PenJoinStyle lineJoin;
Qt::PenCapStyle lineEnd;
double LineW = 72 * pen.width;
QColor foreColor(pen.foreColor.red, pen.foreColor.green, pen.foreColor.blue, 255 - pen.foreColor.alpha);
QColor foreColor = QColor(pen.foreColor.red, pen.foreColor.green, pen.foreColor.blue, 255 - pen.foreColor.alpha);
if(!pen.solid)
{
for (unsigned i = 0; i < pen.dashArray.count(); i++)
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.h
27,31 → 27,31
public:
ScrPainterIm();
 
void startGraphics(double imageWidth, double imageHeight) override;
void endGraphics() override;
void startLayer(unsigned int id) override;
void endLayer(unsigned int id) override;
void setPen(const libwpg::WPGPen& pen) override;
void setBrush(const libwpg::WPGBrush& brush) override;
void setFillRule(FillRule rule) override;
void drawRectangle(const libwpg::WPGRect& rect, double rx, double ry) override;
void drawEllipse(const libwpg::WPGPoint& center, double rx, double ry) override;
void drawPolygon(const libwpg::WPGPointArray& vertices, bool closed) override;
void drawPath(const libwpg::WPGPath& path) override;
void drawBitmap(const libwpg::WPGBitmap& bitmap, double hres, double vres) override;
void drawImageObject(const libwpg::WPGBinaryData& binaryData) override;
void startGraphics(double imageWidth, double imageHeight);
void endGraphics();
void startLayer(unsigned int id);
void endLayer(unsigned int id);
void setPen(const libwpg::WPGPen& pen);
void setBrush(const libwpg::WPGBrush& brush);
void setFillRule(FillRule rule);
void drawRectangle(const libwpg::WPGRect& rect, double rx, double ry);
void drawEllipse(const libwpg::WPGPoint& center, double rx, double ry);
void drawPolygon(const libwpg::WPGPointArray& vertices, bool closed);
void drawPath(const libwpg::WPGPath& path);
void drawBitmap(const libwpg::WPGBitmap& bitmap, double hres, double vres);
void drawImageObject(const libwpg::WPGBinaryData& binaryData);
 
QPainterPath Coords;
QPainter imagePainter;
QPen currentPen;
QBrush currentBrush;
bool fillrule { false };
double gradientAngle { 0.0 };
bool isGradient { false };
bool fillSet { false };
bool strokeSet { false };
bool fillrule;
double gradientAngle;
bool isGradient;
bool fillSet;
bool strokeSet;
QLinearGradient currentGradient;
QImage* image { nullptr };
QImage *image;
};
 
class ScImgDataLoader_WPG : public ScImgDataLoader
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_kra.cpp
99,7 → 99,7
 
if (png_get_iCCP(pngPtr, pngInfo, &profileName, &compression_type, &profileBuffer, &profileLen))
{
QByteArray profArray((const char*) profileBuffer, profileLen);
QByteArray profArray = QByteArray((const char*) profileBuffer, profileLen);
if ((profArray.size() >= 40) && (profArray[36] == 'a') && (profArray[37] == 'c') && (profArray[38] == 's') && (profArray[39] == 'p'))
profileData = profArray;
}
/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_pdf.cpp
78,11 → 78,9
args.append("-dUseArtBox");
args.append(picFile);
// qDebug() << "scimgdataloader_pdf:" << args;
 
int retg = callGS(args);
if (retg != 0)
return false;
 
if (retg == 0)
{
m_image.load(tmpFile);
QFile::remove(tmpFile);
if (!ScCore->havePNGAlpha())
106,9 → 104,10
m_image.setDotsPerMeterX ((int) (xres / 0.0254));
m_image.setDotsPerMeterY ((int) (yres / 0.0254));
m_pixelFormat = Format_BGRA_8;
 
return true;
}
return false;
}
 
bool ScImgDataLoader_PDF::preloadAlphaChannel(const QString& fn, int page, int gsRes, bool& hasAlpha)
{
118,7 → 117,7
m_imageInfoRecord.actualPageNumber = page;
 
hasAlpha = false;
QFileInfo fi(fn);
QFileInfo fi = QFileInfo(fn);
if (!fi.exists())
return false;
QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.png");
125,10 → 124,12
QString picFile = QDir::toNativeSeparators(fn);
QStringList args;
args.append("-r"+QString::number(gsRes));
// args.append("-sOutputFile=\""+tmpFile + "\"");
args.append("-sOutputFile=" + tmpFile);
args.append("-dFirstPage=" + QString::number(qMax(1, page)));
args.append("-dLastPage=" + QString::number(qMax(1, page)));
args.append("-dUseArtBox");
// args.append("\""+picFile+"\"");
args.append(picFile);
// qDebug() << "scimgdataloader_pdf(alpha):" << args;
int retg = callGS(args);
/trunk/Scribus/scribus/fontlistmodel.h
50,7 → 50,7
It returns the count of fonts. */
int rowCount(const QModelIndex&) const;
//! The same behaviour as the previous one.
int rowCount() const;
int rowCount();
/*! Required inherited method. See Qt4 docs.
It *must* return the count of ColumnTypes items */
int columnCount(const QModelIndex&) const;
76,7 → 76,7
/*! Get the font name for current index.
\note Remember to use the mapToSource() if you're using QSortFilterProxyModel
*/
QString nameForIndex(const QModelIndex & index) const;
QString nameForIndex(const QModelIndex & index);
 
bool isLive() const { return m_embedFlags.count() == 0; }
 
/trunk/Scribus/scribus/pagesize.cpp
36,9 → 36,10
}
 
PageSize::PageSize(const double w, const double h)
: m_width(w),
m_height(h)
{
m_width=w;
m_height=h;
m_pageUnitIndex=-1;
m_pageSizeName = CommonStrings::customPageSize;
m_trPageSizeName = CommonStrings::trCustomPageSize;
}
51,8 → 52,7
 
void PageSize::init(const QString& sizeName)
{
m_width = 0.0;
m_height = 0.0;
m_width=m_height=0.0;
m_pageUnitIndex = -1;
m_pageSizeName.clear();
m_trPageSizeName.clear();
90,8 → 90,7
if (!valuesSet)
{
//qDebug("Non-existent page size selected");
m_width = 0.0;
m_height = 0.0;
m_width=m_height=0.0;
m_pageUnitIndex = -1;
m_pageSizeName = CommonStrings::customPageSize;
m_trPageSizeName = CommonStrings::trCustomPageSize;
101,7 → 100,9
QStringList PageSize::sizeList() const
{
QStringList pageSizes;
for (auto it = m_pageSizeList.begin(); it != m_pageSizeList.end(); ++it)
pageSizes.clear();
PageSizeInfoMap::ConstIterator it;
for (it=m_pageSizeList.begin();it!=m_pageSizeList.end();++it)
pageSizes.append(it.key());
return QStringList(pageSizes);
}
109,7 → 110,9
QStringList PageSize::sizeTRList() const
{
QStringList pageSizes;
for (auto it = m_pageSizeList.begin(); it != m_pageSizeList.end(); ++it)
pageSizes.clear();
PageSizeInfoMap::ConstIterator it;
for (it=m_pageSizeList.begin();it!=m_pageSizeList.end();++it)
pageSizes.append(it.value().trSizeName);
return QStringList(pageSizes);
}
425,14 → 428,10
//Tabloid
}
 
void PageSize::printSizeList() const
void PageSize::printSizeList()
{
for (auto it = m_pageSizeList.begin(); it != m_pageSizeList.end(); ++it)
{
std::cout << it.key().leftJustified(6).toStdString() << ": ";
std::cout << it.value().width << " x " << it.value().height << ", ";
std::cout << it.value().width * unitGetRatioFromIndex(it.value().pageUnitIndex) << " x " << it.value().height * unitGetRatioFromIndex(it.value().pageUnitIndex) << ", ";
std::cout << it.value().trSizeName.toStdString() << std::endl;
PageSizeInfoMap::Iterator it;
for (it=m_pageSizeList.begin();it!=m_pageSizeList.end();++it)
std::cout << it.key().leftJustified(6).toStdString() << ": " << it.value().width << " x " << it.value().height << ", " << it.value().width*unitGetRatioFromIndex(it.value().pageUnitIndex) << " x " << it.value().height*unitGetRatioFromIndex(it.value().pageUnitIndex) << ", " << it.value().trSizeName.toStdString() << std::endl;
}
}
 
/trunk/Scribus/scribus/downloadmanager/scdlthread.cpp
16,6 → 16,10
connect(this, SIGNAL(runSignal()), this, SLOT(runSlot()));
}
 
ScDLThread::~ScDLThread()
{
}
 
void ScDLThread::run()
{
emit runSignal();
/trunk/Scribus/scribus/downloadmanager/scdlthread.h
15,8 → 15,7
Q_OBJECT
public:
ScDLThread(QObject * parent = nullptr);
~ScDLThread() = default;
 
~ScDLThread();
void run();
 
void addURL(const QUrl &url, bool overwrite, const QString& location, const QString& destinationLocation);
/trunk/Scribus/scribus/fontlistmodel.cpp
64,7 → 64,7
return m_font_names.size();
}
 
int FontListModel::rowCount() const
int FontListModel::rowCount()
{
return m_font_names.size();
}
300,7 → 300,7
return true;
}
 
QString FontListModel::nameForIndex(const QModelIndex & idx) const
QString FontListModel::nameForIndex(const QModelIndex & idx)
{
return m_font_names.at(idx.row());
}
/trunk/Scribus/scribus/pagesize.h
56,14 → 56,14
QStringList activeSizeList() const;
QStringList activeSizeTRList() const;
void generateSizeList();
void printSizeList() const;
void printSizeList();
QStringList untransPageSizeList(const QStringList &transList);
 
private:
PageSizeInfoMap m_pageSizeList;
double m_width { 0.0 };
double m_height { 0.0 };
int m_pageUnitIndex { -1 };
double m_width;
double m_height;
int m_pageUnitIndex;
QString m_pageSizeName;
QString m_trPageSizeName;
};