Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 18203 → Rev 18202

/trunk/Scribus/scribus/scribus.cpp
4482,14 → 4482,11
currItem->IRender = doc->cmsSettings().DefaultIntentImages;
qApp->setOverrideCursor( QCursor(Qt::WaitCursor) );
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
currItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX.png");
currItem->tempImageFile->open();
QString fileName = getLongPathName(currItem->tempImageFile->fileName());
currItem->tempImageFile->close();
currItem->isInlineImage = true;
currItem->isTempFile = true;
currItem->Pfile = fileName;
img.save(fileName, "PNG");
doc->loadPict(fileName, currItem, false, true);
/trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
1010,13 → 1010,11
image = image.convertToFormat(QImage::Format_ARGB32);
int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, baseX, baseY, image.width() * resX, image.height() * resY, 0, m_Doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
PageItem *ite = m_Doc->Items->at(z);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
image.save(fileName, "PNG");
ite->moveBy(m_Doc->currentPage()->xOffset(), m_Doc->currentPage()->yOffset());
ite->moveBy(offsetX, offsetY);
1023,7 → 1021,6
finishItem(ite);
m_Doc->loadPict(fileName, ite);
ite->setImageScalingMode(false, false);
delete tempFile;
}
// qDebug() << "End of Pict";
return;
1849,14 → 1846,11
image.invertPixels();
int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, baseX + dstRect.left() * resX, baseY + dstRect.top() * resY, imgCols * resY, imgRows * resY, 0, m_Doc->itemToolPrefs().imageFillColor, m_Doc->itemToolPrefs().imageStrokeColor, true);
PageItem *ite = m_Doc->Items->at(z);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
image.save(fileName, "PNG");
ite->moveBy(baseX, baseY);
ite->moveBy(offsetX, offsetY);
2190,14 → 2184,11
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
newItem->tempImageFile->open();
QString fileName = getLongPathName(newItem->tempImageFile->fileName());
newItem->tempImageFile->close();
newItem->isInlineImage = true;
newItem->isTempFile = true;
image.setDotsPerMeterY(2834);
image.setDotsPerMeterX(2834);
image.save(fileName, "PNG");
/trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
2279,17 → 2279,15
imgExt = "psd";
else if (imageType.contains("TIFF", Qt::CaseInsensitive))
imgExt = "tif";
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_idml_XXXXXX." + imgExt);
tempFile->setAutoRemove(false);
if (tempFile->open())
item->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_idml_XXXXXX." + imgExt);
if (item->tempImageFile->open())
{
QString fileName = getLongPathName(tempFile->fileName());
QString fileName = getLongPathName(item->tempImageFile->fileName());
if (!fileName.isEmpty())
{
tempFile->write(imageData);
tempFile->close();
item->tempImageFile->write(imageData);
item->tempImageFile->close();
item->isInlineImage = true;
item->isTempFile = true;
item->ScaleType = true;
item->AspectRatio = true;
m_Doc->loadPict(fileName, item);
2298,7 → 2296,6
item->setImageRotation(-roti);
}
}
delete tempFile;
}
else
{
/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
1445,16 → 1445,13
ite->setWidthHeight(wh.x(),wh.y());
ite->setTextFlowMode(PageItem::TextFlowDisabled);
m_Doc->AdjustItemSize(ite);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_ai_XXXXXX.pdf");
tempFile->setAutoRemove(false);
tempFile->open();
tempFile->write(fData);
QString imgName = getLongPathName(tempFile->fileName());
tempFile->close();
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_ai_XXXXXX.pdf");
ite->tempImageFile->open();
ite->tempImageFile->write(fData);
QString imgName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
m_Doc->loadPict(imgName, ite);
delete tempFile;
if (ite->PictureIsAvailable)
ite->setImageXYScale(ite->width() / ite->pixm.width(), ite->height() / ite->pixm.height());
ite->setImageFlippedV(true);
3051,14 → 3048,11
uchar *p;
uint yCount = 0;
quint16 eTag = EXTRASAMPLE_UNASSALPHA;
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_ai_XXXXXX.tif");
tempFile->setAutoRemove(false);
tempFile->open();
QString imgName = getLongPathName(tempFile->fileName());
tempFile->close();
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_ai_XXXXXX.tif");
ite->tempImageFile->open();
QString imgName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
delete tempFile;
TIFF* tif = TIFFOpen(imgName.toLocal8Bit().data(), "w");
if (tif)
{
/trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
1834,13 → 1834,10
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
newItem->isTempFile = true;
newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
newItem->tempImageFile->open();
QString fileName = getLongPathName(newItem->tempImageFile->fileName());
newItem->tempImageFile->close();
newItem->isInlineImage = true;
image.setDotsPerMeterY(2834);
image.setDotsPerMeterX(2834);
2600,13 → 2597,10
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
newItem->isTempFile = true;
newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
newItem->tempImageFile->open();
QString fileName = getLongPathName(newItem->tempImageFile->fileName());
newItem->tempImageFile->close();
newItem->isInlineImage = true;
image.setDotsPerMeterY(2834);
image.setDotsPerMeterX(2834);
2690,13 → 2684,10
QString imgNam = m_Doc->docPatterns[patternRef[bref]].items.at(0)->externalFile();
QImage image;
image.load(imgNam);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
ite->isTempFile = true;
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
ite->isInlineImage = true;
image.save(fileName, "PNG");
m_Doc->loadPict(fileName, ite);
2757,13 → 2748,10
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
newItem->isTempFile = true;
newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
newItem->tempImageFile->open();
QString fileName = getLongPathName(newItem->tempImageFile->fileName());
newItem->tempImageFile->close();
newItem->isInlineImage = true;
image.setDotsPerMeterY(2834);
image.setDotsPerMeterX(2834);
/trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
904,16 → 904,13
{
if (currentItem != NULL)
{
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_drw_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
currentItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_drw_XXXXXX.png");
currentItem->tempImageFile->open();
QString fileName = getLongPathName(currentItem->tempImageFile->fileName());
currentItem->tempImageFile->close();
currentItem->isInlineImage = true;
currentItem->isTempFile = true;
tmpImage.save(fileName, "PNG");
m_Doc->loadPict(fileName, currentItem);
delete tempFile;
currentItem->setImageScalingMode(false, false);
}
imageValid = false;
968,7 → 965,7
{
if (currentItem->asImageFrame())
{
QString fileName = currentItem->Pfile;
QString fileName = getLongPathName(currentItem->tempImageFile->fileName());
if (!fileName.isEmpty())
{
QVector<QRgb> colors;
1876,14 → 1873,11
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_drw_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_drw_XXXXXX.png");
newItem->tempImageFile->open();
QString fileName = getLongPathName(newItem->tempImageFile->fileName());
newItem->tempImageFile->close();
newItem->isInlineImage = true;
newItem->isTempFile = true;
image.setDotsPerMeterY(2834);
image.setDotsPerMeterX(2834);
image.save(fileName, "PNG");
/trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
395,13 → 395,10
double h = (bitmap.rect.y2 - bitmap.rect.y1) * 72.0;
int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, bitmap.rect.x1 * 72 + baseX, bitmap.rect.y1 * 72 + baseY, w, h, 1, m_Doc->itemToolPrefs().imageFillColor, m_Doc->itemToolPrefs().imageStrokeColor, true);
PageItem *ite = m_Doc->Items->at(z);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_wpg_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
ite->isTempFile = true;
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_wpg_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
ite->isInlineImage = true;
image.setDotsPerMeterX ((int) (hres / 0.0254));
image.setDotsPerMeterY ((int) (vres / 0.0254));
/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
1530,13 → 1530,10
ba.append(fname);
if (dataType.contains("base64"))
ba = QByteArray::fromBase64(ba);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_svg_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
ite->isTempFile = true;
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_svg_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
ite->isInlineImage = true;
QImage img;
img.loadFromData(ba);
/trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
1562,18 → 1562,15
istr.skipRawData(1);
}
}
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_cgm_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_cgm_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
image.save(fileName, "PNG");
if ((image.width() < 20) || image.height() < 20)
ite->pixm.imgInfo.lowResType = 0;
m_Doc->loadPict(fileName, ite);
delete tempFile;
ite->setImageFlippedH(flipX);
ite->setImageFlippedV(flipY);
ite->setImageScalingMode(false, false);
2395,16 → 2392,14
m_Doc->AdjustItemSize(ite);
ite->OldB2 = ite->width();
ite->OldH2 = ite->height();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_cgm_XXXXXX.png");
tempFile->setAutoRemove(false);
if (tempFile->open())
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_cgm_XXXXXX.png");
if (ite->tempImageFile->open())
{
QString fileName = getLongPathName(tempFile->fileName());
QString fileName = getLongPathName(ite->tempImageFile->fileName());
if (!fileName.isEmpty())
{
tempFile->close();
ite->tempImageFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
tmpImg.save(fileName, "PNG");
m_Doc->loadPict(fileName, ite);
ite->setImageScalingMode(false, true);
2435,7 → 2430,6
m_Doc->Items->removeAll(ite);
delete ite;
}
delete tempFile;
colorPrecision = t_colorPrecision;
// qDebug() << "PATTERN TABLE" << "Index" << index << "NX" << nx << "NY" << ny;
}
/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
2412,16 → 2412,14
ite->setFillShade(100);
ite->setLineShade(100);
ite->setFillEvenOdd(false);
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
tempFile->setAutoRemove(false);
if (tempFile->open())
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
if (ite->tempImageFile->open())
{
QString fileName = getLongPathName(tempFile->fileName());
QString fileName = getLongPathName(ite->tempImageFile->fileName());
if (!fileName.isEmpty())
{
tempFile->close();
ite->tempImageFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
res.save(fileName, "PNG");
m_doc->loadPict(fileName, ite);
ite->setImageScalingMode(false, true);
2439,7 → 2437,6
else
m_doc->Items->removeAll(ite);
imgStr->close();
delete tempFile;
delete imgStr;
delete image;
}
2539,16 → 2536,14
ite->setFillEvenOdd(false);
ite->setFillTransparency(1.0 - state->getFillOpacity());
ite->setFillBlendmode(getBlendMode(state));
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
tempFile->setAutoRemove(false);
if (tempFile->open())
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
if (ite->tempImageFile->open())
{
QString fileName = getLongPathName(tempFile->fileName());
QString fileName = getLongPathName(ite->tempImageFile->fileName());
if (!fileName.isEmpty())
{
tempFile->close();
ite->tempImageFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
res.save(fileName, "PNG");
m_doc->loadPict(fileName, ite);
ite->setImageScalingMode(false, true);
2565,7 → 2560,6
}
else
m_doc->Items->removeAll(ite);
delete tempFile;
delete imgStr;
delete[] buffer;
delete image;
2657,16 → 2651,14
ite->setFillEvenOdd(false);
ite->setFillTransparency(1.0 - state->getFillOpacity());
ite->setFillBlendmode(getBlendMode(state));
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
tempFile->setAutoRemove(false);
if (tempFile->open())
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
if (ite->tempImageFile->open())
{
QString fileName = getLongPathName(tempFile->fileName());
QString fileName = getLongPathName(ite->tempImageFile->fileName());
if (!fileName.isEmpty())
{
tempFile->close();
ite->tempImageFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
img.save(fileName, "PNG");
m_doc->loadPict(fileName, ite);
ite->setImageScalingMode(false, true);
2683,7 → 2675,6
}
else
m_doc->Items->removeAll(ite);
delete tempFile;
delete imgStr;
delete[] buffer;
delete image;
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
4440,11 → 4440,10
{
if (inlineImageData.size() > 0)
{
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineImageExt);
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
currItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineImageExt);
currItem->tempImageFile->open();
QString fileName = getLongPathName(currItem->tempImageFile->fileName());
currItem->tempImageFile->close();
inlineImageData = qUncompress(QByteArray::fromBase64(inlineImageData));
QFile outFil(fileName);
if (outFil.open(QIODevice::WriteOnly))
4453,9 → 4452,7
outFil.close();
currItem->isInlineImage = true;
currItem->Pfile = fileName;
currItem->isTempFile = true;
}
delete tempFile;
}
}
else
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
2499,11 → 2499,10
{
if (inlineImageData.size() > 0)
{
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineImageExt);
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
currItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineImageExt);
currItem->tempImageFile->open();
QString fileName = getLongPathName(currItem->tempImageFile->fileName());
currItem->tempImageFile->close();
inlineImageData = qUncompress(QByteArray::fromBase64(inlineImageData));
QFile outFil(fileName);
if (outFil.open(QIODevice::WriteOnly))
2512,9 → 2511,7
outFil.close();
currItem->isInlineImage = true;
currItem->Pfile = fileName;
currItem->isTempFile = true;
}
delete tempFile;
}
}
else
/trunk/Scribus/scribus/scribusdoc.cpp
5796,10 → 5796,10
if ((ScCore->fileWatcher->files().contains(pageItem->Pfile) != 0) && (pageItem->PictureIsAvailable))
{
ScCore->fileWatcher->removeFile(pageItem->Pfile);
QFile::remove(pageItem->Pfile);
pageItem->Pfile = "";
if (pageItem->tempImageFile != NULL)
delete pageItem->tempImageFile;
pageItem->tempImageFile = NULL;
pageItem->isInlineImage = false;
pageItem->isTempFile = false;
}
}
if(!pageItem->loadImage(fn, reload, -1, showMsg))
/trunk/Scribus/scribus/pageitem_imageframe.cpp
246,9 → 246,9
setFillTransparency(0.0);
setLineTransparency(0.0);
imageClip.resize(0);
if ((isTempFile) && (!Pfile.isEmpty()))
QFile::remove(Pfile);
isTempFile = false;
if (tempImageFile != NULL)
delete tempImageFile;
tempImageFile = NULL;
isInlineImage = false;
// emit UpdtObj(Doc->currentPage->pageNr(), ItemNr);
}
/trunk/Scribus/scribus/pageitem.cpp
347,21 → 347,18
{
QFileInfo inlFi(Pfile);
QString ext = inlFi.suffix();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + ext);
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + ext);
tempImageFile->open();
QString fileName = getLongPathName(tempImageFile->fileName());
tempImageFile->close();
copyFile(Pfile, fileName);
Pfile = fileName;
delete tempFile;
isInlineImage = true;
isTempFile = true;
}
else
{
tempImageFile = NULL;
isInlineImage = false;
isTempFile = false;
}
Parent = NULL;
unWeld();
825,14 → 822,14
)
pageItemAttributes.append(*objAttrIt);
}
tempImageFile = NULL;
isInlineImage = false;
isTempFile = false;
}
 
PageItem::~PageItem()
{
if ((isTempFile) && (!Pfile.isEmpty()))
QFile::remove(Pfile);
if (tempImageFile != NULL)
delete tempImageFile;
//remove marks
 
if (isTextFrame())
10223,11 → 10220,10
inlineImageData.append(data);
if (inlineImageData.size() > 0)
{
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineExt);
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineExt);
tempImageFile->open();
QString fileName = getLongPathName(tempImageFile->fileName());
tempImageFile->close();
inlineImageData = qUncompress(QByteArray::fromBase64(inlineImageData));
QFile outFil(fileName);
if (outFil.open(QIODevice::WriteOnly))
10235,9 → 10231,7
outFil.write(inlineImageData);
outFil.close();
isInlineImage = true;
isTempFile = true;
Pfile = fileName;
delete tempFile;
}
}
}
10246,28 → 10240,24
{
QFileInfo fi(Pfile);
QString ext = fi.suffix();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + ext);
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + ext);
tempImageFile->open();
QString fileName = getLongPathName(tempImageFile->fileName());
tempImageFile->close();
isInlineImage = true;
isTempFile = true;
copyFile(Pfile, fileName);
Pfile = fileName;
delete tempFile;
}
 
void PageItem::makeImageExternal(QString path)
{
if ((isTempFile) && (isInlineImage) && (!path.isEmpty()))
if ((tempImageFile) && (isInlineImage) && (!path.isEmpty()))
{
QString oldF = Pfile;
copyFile(Pfile, path);
Pfile = path;
QFile::remove(oldF);
isInlineImage = false;
isTempFile = false;
delete tempImageFile;
tempImageFile = NULL;
}
}
 
/trunk/Scribus/scribus/pageitem.h
1378,7 → 1378,7
 
/** Inline Image */
bool isInlineImage;
bool isTempFile;
QTemporaryFile *tempImageFile;
//items welding (item follows while item moves which they are connected with)
struct weldingInfo
{
/trunk/Scribus/scribus/pageitem_osgframe.cpp
108,15 → 108,12
}
else
{
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_osg_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString imgName = getLongPathName(tempFile->fileName());
tempFile->close();
tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_osg_XXXXXX.png");
tempImageFile->open();
QString imgName = getLongPathName(tempImageFile->fileName());
tempImageFile->close();
image.save(imgName, "PNG");
m_Doc->loadPict(imgName, this);
delete tempFile;
isTempFile = true;
}
setImageScalingMode(false, true);
}