Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 24092 → Rev 24093

/branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
27,10 → 27,12
#include "util_color.h"
#include "scgzfile.h"
#include "scpattern.h"
 
#include <QCursor>
#include <QDataStream>
#include <QFileInfo>
#include <QList>
#include <QDataStream>
#include <QScopedPointer>
 
#include "scxmlstreamwriter.h"
 
60,7 → 62,7
if (QFile::exists(tmpFileName))
return false;
 
std::auto_ptr<QIODevice> outputFile;
QScopedPointer<QIODevice> outputFile;
if (fileName.toLower().right(2) == "gz")
outputFile.reset( new ScGzFile(tmpFileName) );
else
71,7 → 73,7
 
ScXmlStreamWriter docu;
docu.setAutoFormatting(true);
docu.setDevice(outputFile.get());
docu.setDevice(outputFile.data());
docu.writeStartDocument();
docu.writeStartElement("SCRIBUSUTF8NEW");
docu.writeAttribute("Version", QString(VERSION));
256,8 → 258,8
docu.writeEndDocument();
bool writeSucceed = false;
const QFile* qFile = dynamic_cast<QFile*>(outputFile.get());
const ScGzFile* gzFile = dynamic_cast<ScGzFile*>(outputFile.get());
const QFile* qFile = dynamic_cast<QFile*>(outputFile.data());
const ScGzFile* gzFile = dynamic_cast<ScGzFile*>(outputFile.data());
if (qFile)
writeSucceed = (qFile->error() == QFile::NoError);
else if (gzFile)
/branches/Version14x/Scribus/scribus/scimage.cpp
22,6 → 22,7
#include <QMessageBox>
#include <QList>
#include <QByteArray>
#include <QScopedPointer>
#include <cassert>
#include <cmath>
#include <cstdlib>
1981,7 → 1982,7
bool ScImage::getAlpha(QString fn, int page, QByteArray& alpha, bool PDF, bool pdf14, int gsRes, int scaleXSize, int scaleYSize)
{
bool gotAlpha = false;
auto_ptr<ScImgDataLoader> pDataLoader;
QScopedPointer<ScImgDataLoader> pDataLoader;
imgInfo.valid = false;
imgInfo.clipPath = "";
imgInfo.PDSpathData.clear();
2005,13 → 2006,13
else if (extensionIndicatesTIFF(ext))
{
pDataLoader.reset( new ScImgDataLoader_TIFF() );
if (pDataLoader.get())
if (pDataLoader.data())
pDataLoader->setRequest(imgInfo.isRequest, imgInfo.RequestProps);
}
else if (extensionIndicatesPSD(ext))
{
pDataLoader.reset( new ScImgDataLoader_PSD() );
if (pDataLoader.get())
if (pDataLoader.data())
pDataLoader->setRequest(imgInfo.isRequest, imgInfo.RequestProps);
}
else if (ext == "pat")
2019,7 → 2020,7
else
pDataLoader.reset( new ScImgDataLoader_QT() );
 
if (pDataLoader.get())
if (pDataLoader.data())
{
bool hasAlpha = false;
bool alphaLoaded = pDataLoader->preloadAlphaChannel(fn, page, gsRes, hasAlpha);
2159,7 → 2160,7
ScColorProfile inputProf = 0;
int cmsFlags = 0;
int cmsProofFlags = 0;
auto_ptr<ScImgDataLoader> pDataLoader;
QScopedPointer<ScImgDataLoader> pDataLoader;
QFileInfo fi = QFileInfo(fn);
if (!fi.exists())
return ret;
/branches/Version14x/Scribus/scribus/sclistboxpixmap.h
32,18 → 32,28
{
public:
ScListBoxPixmap(void);
 
virtual QSize sizeHint (const QStyleOptionViewItem & option, const QModelIndex & index ) const;
virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
 
protected:
#if __cplusplus >= 201103L
static std::unique_ptr<QPixmap> pmap;
#else
static std::auto_ptr<QPixmap> pmap;
#endif
// The drawPixmap function must not modify pixmap size
virtual void redraw(const QVariant&) const = 0;
};
 
#if __cplusplus >= 201103L
template<unsigned int pixWidth, unsigned int pixHeight>
std::unique_ptr<QPixmap> ScListBoxPixmap<pixWidth, pixHeight>::pmap;
#else
template<unsigned int pixWidth, unsigned int pixHeight>
std::auto_ptr<QPixmap> ScListBoxPixmap<pixWidth, pixHeight>::pmap;
#endif
 
 
template<unsigned int pixWidth, unsigned int pixHeight>
ScListBoxPixmap<pixWidth, pixHeight>::ScListBoxPixmap(void) : QAbstractItemDelegate()
{
53,7 → 63,6
}
};
 
 
template<unsigned int pixWidth, unsigned int pixHeight>
QSize ScListBoxPixmap<pixWidth, pixHeight>::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
{
/branches/Version14x/Scribus/scribus/scprintengine_gdi.cpp
17,6 → 17,7
#include <valarray>
#include <windows.h>
#include <QByteArray>
#include <QScopedPointer>
using namespace ::std;
 
#include "scconfig.h"
206,7 → 207,7
bool ScPrintEngine_GDI::printPages( ScribusDoc* doc, PrintOptions& options, HDC printerDC, DEVMODEW* devMode, QString& fileName )
{
int jobId;
auto_ptr<MultiProgressDialog> progress;
QScopedPointer<MultiProgressDialog> progress;
PrintPageFunc printPageFunc = NULL;
bool success = true;
WCHAR docName[512];
258,7 → 259,7
progress.reset( new MultiProgressDialog( QObject::tr("Printing..."), CommonStrings::tr_Cancel, doc->scMW()) );
progress->setOverallTotalSteps( options.pageNumbers.size() );
progress->setOverallProgress(0);
connect(progress.get(), SIGNAL(canceled()), this, SLOT(cancelRequested()));
connect(progress.data(), SIGNAL(canceled()), this, SLOT(cancelRequested()));
progress->show();
}
 
/branches/Version14x/Scribus/scribus/scribusdoc.cpp
35,6 → 35,7
#include <QPainter>
#include <QPixmap>
#include <QProgressBar>
#include <QScopedPointer>
 
#include "canvas.h"
#include "cmserrorhandling.h"
10123,7 → 10124,7
newY = qMax(newY, 1);
}
*/
std::auto_ptr<UndoTransaction> activeTransaction;
QScopedPointer<UndoTransaction> activeTransaction;
if (UndoManager::undoEnabled())
{
QString transacDesc = QString(Um::ResizeFromTo).arg(currItem->oldWidth).arg(currItem->oldHeight).arg(newX).arg(newY);
10181,7 → 10182,7
 
if (currItem->FrameType == 0 || currItem->asLine())
{
if (activeTransaction.get())
if (activeTransaction.data())
{
currItem->checkChanges();
activeTransaction->commit();
10192,7 → 10193,7
currItem->updateClip();
// currItem->updateGradientVectors();
 
if (activeTransaction.get())
if (activeTransaction.data())
{
currItem->checkChanges();
activeTransaction->commit();
10244,7 → 10245,7
}
}
currItem->setCornerRadius(qMin(currItem->cornerRadius(), qMin(currItem->width(),currItem->height())/2));
if (activeTransaction.get())
if (activeTransaction.data())
{
currItem->checkChanges();
activeTransaction->commit();
/branches/Version14x/Scribus/scribus/scslainforeader.cpp
9,6 → 9,7
#include <memory>
 
#include <QFile>
#include <QScopedPointer>
#include <QXmlStreamReader>
#include "scgzfile.h"
 
24,7 → 25,7
bool isScribusDocument = false;
bool readInfoSuccess = false;
bool firstStartElement = true;
std::auto_ptr<QIODevice> file;
QScopedPointer<QIODevice> file;
 
resetFileInfos();
 
33,7 → 34,7
else
file.reset( new QFile(fileName) );
 
if (!file.get() || !file->open(QIODevice::ReadOnly))
if (file.isNull() || !file->open(QIODevice::ReadOnly))
return false;
 
QByteArray bytes = file->read(512);
44,7 → 45,7
}
file->reset();
 
QXmlStreamReader reader(file.get());
QXmlStreamReader reader(file.data());
while (!reader.atEnd() && !reader.hasError())
{
QXmlStreamReader::TokenType ttype = reader.readNext();