r19917 by fschmid - Enable Copy/Paste from LibreOffice and Inkscape to Scribus.

scribus-commit scribus-commit at lists.scribus.net
Sat Mar 14 08:23:40 UTC 2015


Author: fschmid
Date: Sat Mar 14 08:23:40 2015
New Revision: 19917

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19917
Log:
Enable Copy/Paste from LibreOffice and Inkscape to Scribus.

Modified:
    trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
    trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
    trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp
    trunk/Scribus/scribus/scmimedata.cpp
    trunk/Scribus/scribus/scmimedata.h
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/util_file.cpp
    trunk/Scribus/scribus/util_file.h

Modified: trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19917&path=/trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/emf/importemf.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/emf/importemf.cpp Sat Mar 14 08:23:40 2015
@@ -54,6 +54,7 @@
 #include "selection.h"
 #include "undomanager.h"
 #include "util.h"
+#include "util_file.h"
 #include "util_formats.h"
 #include "util_icon.h"
 #include "util_math.h"
@@ -1345,6 +1346,36 @@
 								currentDC.clipPath = currentDC.Coords.copy();
 						}
 						break;
+				/*	case U_EMR_INTERSECTCLIPRECT:
+						{
+							QPointF p1 = getPoint(ds, true);
+							QPointF p2 = getPoint(ds, true);
+							FPointArray clipPath;
+							clipPath.resize(0);
+							clipPath.svgInit();
+							clipPath.svgMoveTo(p1.x(), p1.y());
+							clipPath.svgLineTo(p2.x(), p1.y());
+							clipPath.svgLineTo(p2.x(), p2.y());
+							clipPath.svgLineTo(p1.x(), p2.y());
+							clipPath.svgClosePath();
+							if (currentDC.clipPath.isEmpty())
+								currentDC.clipPath = clipPath.copy();
+							else
+							{
+								QPainterPath pathN = clipPath.toQPainterPath(true);
+								QPainterPath pathA = currentDC.clipPath.toQPainterPath(true);
+								QPainterPath resultPath = pathA.intersected(pathN);
+								if (!resultPath.isEmpty())
+								{
+									FPointArray polyline;
+									polyline.resize(0);
+									polyline.fromQPainterPath(resultPath, true);
+									polyline.svgClosePath();
+									currentDC.clipPath = polyline.copy();
+								}
+							}
+						}
+						break;*/
 					case U_EMR_ABORTPATH:
 						inPath = false;
 						currentDC.Coords.resize(0);
@@ -1618,7 +1649,6 @@
 	double scaleY = (bBoxMM.height() / 1000.0 / 2.54 * 72.0) / bBoxDev.height(); // Device -> Pts
 	out.setX(in.x() * scaleX);
 	out.setY(in.y() * scaleY);
-
 	return out;
 }
 
@@ -2208,8 +2238,8 @@
 				FPoint xy = getMinClipF(&iteG->PoLine);
 				iteG->setXYPos(xy.x(), xy.y(), true);
 				iteG->PoLine.translate(-xy.x(), -xy.y());
-				FPoint wh = getMaxClipF(&iteG->PoLine);
-				iteG->setWidthHeight(wh.x(),wh.y());
+				FPoint whi = getMaxClipF(&iteG->PoLine);
+				iteG->setWidthHeight(whi.x(),whi.y());
 				iteG->groupWidth = oldgW * (iteG->width() / oldW);
 				iteG->groupHeight = oldgH * (iteG->height() / oldH);
 				double dx = (iteG->xPos() - oldX) / (iteG->width() / iteG->groupWidth);
@@ -5466,42 +5496,13 @@
 		QString ext = "emf";
 		if (emfStyleMapEMP[flagsH].imageType < U_MDT_Emf)
 			ext = "wmf";
-		QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_emf_XXXXXX." + ext);
-		if (tempFile->open())
-		{
-			QString fileName = getLongPathName(tempFile->fileName());
-			if (!fileName.isEmpty())
-			{
-				tempFile->write(emfStyleMapEMP[flagsH].imageData);
-				tempFile->close();
-				FileLoader *fileLoader = new FileLoader(fileName);
-				int testResult = fileLoader->testFile();
-				delete fileLoader;
-				if (testResult != -1)
-				{
-					const FileFormat * fmt = LoadSavePlugin::getFormatById(testResult);
-					if(fmt)
-					{
-						m_Doc->m_Selection->clear();
-						fmt->setupTargets(m_Doc, 0, 0, 0, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
-						fmt->loadFile(fileName, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-						if (m_Doc->m_Selection->count() > 0)
-						{
-							PageItem* ite = m_Doc->groupObjectsSelection();
-							ite->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
-							ite->setXYPos(baseX + p1.x(), baseY + p1.y(), true);
-							ite->setWidthHeight(QLineF(p1, p2).length(), QLineF(p1, p3).length(), true);
-							if (QLineF(p1, p2).angle() != 0)
-								ite->setRotation(-QLineF(p1, p2).angle(), true);
-							ite->updateClip();
-							finishItem(ite, false);
-						}
-						m_Doc->m_Selection->clear();
-					}
-				}
-			}
-		}
-		delete tempFile;
+		PageItem* ite = getVectorFileFromData(m_Doc, emfStyleMapEMP[flagsH].imageData, ext, baseX + p1.x(), baseY + p1.y(), QLineF(p1, p2).length(), QLineF(p1, p3).length());
+		if (ite != NULL)
+		{
+			if (QLineF(p1, p2).angle() != 0)
+				ite->setRotation(-QLineF(p1, p2).angle(), true);
+			finishItem(ite, false);
+		}
 	}
 	else
 	{

Modified: trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19917&path=/trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/odg/importodg.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/odg/importodg.cpp Sat Mar 14 08:23:40 2015
@@ -65,6 +65,7 @@
 #include "ui/propertiespalette.h"
 #include "undomanager.h"
 #include "util.h"
+#include "util_file.h"
 #include "util_formats.h"
 #include "util_icon.h"
 #include "util_math.h"
@@ -1592,40 +1593,9 @@
 							if ((f[0] == '\x01') && (f[1] == '\x00') && (f[2] == '\x00') && (f[3] == '\x00') && (f[40] == '\x20') && (f[41] == '\x45') && (f[42] == '\x4D') && (f[43] == '\x46'))
 								ext = "emf";
 						}
-						QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_odg_XXXXXX." + ext);
-						if (tempFile->open())
-						{
-							QString fileName = getLongPathName(tempFile->fileName());
-							if (!fileName.isEmpty())
-							{
-								tempFile->write(f);
-								tempFile->close();
-								FileLoader *fileLoader = new FileLoader(fileName);
-								int testResult = fileLoader->testFile();
-								delete fileLoader;
-								if (testResult != -1)
-								{
-									const FileFormat * fmt = LoadSavePlugin::getFormatById(testResult);
-									if( fmt )
-									{
-										m_Doc->m_Selection->clear();
-										fmt->setupTargets(m_Doc, 0, 0, 0, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
-										fmt->loadFile(fileName, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-										if (m_Doc->m_Selection->count() > 0)
-										{
-											retObj = m_Doc->groupObjectsSelection();
-											retObj->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
-											retObj->setXYPos(baseX + x, baseY + y, true);
-											retObj->setWidthHeight(w, h, true);
-											retObj->updateClip();
-										}
-										m_Doc->m_Selection->clear();
-										m_Doc->Items->removeLast();
-									}
-								}
-							}
-						}
-						delete tempFile;
+						retObj = getVectorFileFromData(m_Doc, f, ext, baseX + x, baseY + y, w, h);
+						if (retObj != NULL)
+							m_Doc->Items->removeLast();
 					}
 				}
 			}
@@ -1663,44 +1633,15 @@
 							ext = "emf";
 						else if ((buf[0] == '<') && (buf[1] == '?') && (buf[2] == 'x') && (buf[3] == 'm') && (buf[4] == 'l'))
 							ext = "svg";
+						else if ((buf[0] == 'V') && (buf[1] == 'C') && (buf[2] == 'L') && (buf[3] == 'M') && (buf[4] == 'T') && (buf[5] == 'F'))
+							ext = "svm";
 						if (!ext.isEmpty())
 						{
-							if ((ext == "eps") || (ext == "wmf") || (ext == "emf") || (ext == "svg"))
+							if ((ext == "eps") || (ext == "wmf") || (ext == "emf") || (ext == "svg") || (ext == "svm"))
 							{
-								QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_odg_XXXXXX." + ext);
-								if (tempFile->open())
-								{
-									QString fileName = getLongPathName(tempFile->fileName());
-									if (!fileName.isEmpty())
-									{
-										tempFile->write(buf);
-										tempFile->close();
-										FileLoader *fileLoader = new FileLoader(fileName);
-										int testResult = fileLoader->testFile();
-										delete fileLoader;
-										if (testResult != -1)
-										{
-											const FileFormat * fmt = LoadSavePlugin::getFormatById(testResult);
-											if( fmt )
-											{
-												m_Doc->m_Selection->clear();
-												fmt->setupTargets(m_Doc, 0, 0, 0, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
-												fmt->loadFile(fileName, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-												if (m_Doc->m_Selection->count() > 0)
-												{
-													retObj = m_Doc->groupObjectsSelection();
-													retObj->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
-													retObj->setXYPos(baseX + x, baseY + y, true);
-													retObj->setWidthHeight(w, h, true);
-													retObj->updateClip();
-												}
-												m_Doc->m_Selection->clear();
-												m_Doc->Items->removeLast();
-											}
-										}
-									}
-								}
-								delete tempFile;
+								retObj = getVectorFileFromData(m_Doc, buf, ext, baseX + x, baseY + y, w, h);
+								if (retObj != NULL)
+									m_Doc->Items->removeLast();
 							}
 							else
 							{
@@ -4003,6 +3944,8 @@
 					ext = "tif";
 				else if ((buf[0] == '/') && (buf[1] == '*') && (buf[2] == ' ') && (buf[3] == 'X') && (buf[4] == 'P') && (buf[5] == 'M'))
 					ext = "xpm";
+				else if ((buf[0] == 'V') && (buf[1] == 'C') && (buf[2] == 'L') && (buf[3] == 'M') && (buf[4] == 'T') && (buf[5] == 'F'))
+					ext = "svm";
 				if (!ext.isEmpty())
 				{
 					QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_odg_XXXXXX." + ext);

Modified: trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19917&path=/trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp Sat Mar 14 08:23:40 2015
@@ -54,6 +54,7 @@
 #include "selection.h"
 #include "undomanager.h"
 #include "util.h"
+#include "util_file.h"
 #include "util_formats.h"
 #include "util_icon.h"
 #include "util_math.h"
@@ -4559,42 +4560,13 @@
 		QString ext = "emf";
 		if (emfStyleMapEMP[flagsH].imageType < U_MDT_Emf)
 			ext = "wmf";
-		QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_emf_XXXXXX." + ext);
-		if (tempFile->open())
-		{
-			QString fileName = getLongPathName(tempFile->fileName());
-			if (!fileName.isEmpty())
-			{
-				tempFile->write(emfStyleMapEMP[flagsH].imageData);
-				tempFile->close();
-				FileLoader *fileLoader = new FileLoader(fileName);
-				int testResult = fileLoader->testFile();
-				delete fileLoader;
-				if (testResult != -1)
-				{
-					const FileFormat * fmt = LoadSavePlugin::getFormatById(testResult);
-					if(fmt)
-					{
-						m_Doc->m_Selection->clear();
-						fmt->setupTargets(m_Doc, 0, 0, 0, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
-						fmt->loadFile(fileName, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-						if (m_Doc->m_Selection->count() > 0)
-						{
-							PageItem* ite = m_Doc->groupObjectsSelection();
-							ite->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
-							ite->setXYPos(baseX + p1.x(), baseY + p1.y(), true);
-							ite->setWidthHeight(QLineF(p1, p2).length(), QLineF(p1, p3).length(), true);
-							if (QLineF(p1, p2).angle() != 0)
-								ite->setRotation(-QLineF(p1, p2).angle(), true);
-							ite->updateClip();
-							finishItem(ite, false);
-						}
-						m_Doc->m_Selection->clear();
-					}
-				}
-			}
-		}
-		delete tempFile;
+		PageItem* ite = getVectorFileFromData(m_Doc, emfStyleMapEMP[flagsH].imageData, ext, baseX + p1.x(), baseY + p1.y(), QLineF(p1, p2).length(), QLineF(p1, p3).length());
+		if (ite != NULL)
+		{
+			if (QLineF(p1, p2).angle() != 0)
+				ite->setRotation(-QLineF(p1, p2).angle(), true);
+			finishItem(ite, false);
+		}
 	}
 	else
 	{

Modified: trunk/Scribus/scribus/scmimedata.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19917&path=/trunk/Scribus/scribus/scmimedata.cpp
==============================================================================
--- trunk/Scribus/scribus/scmimedata.cpp (original)
+++ trunk/Scribus/scribus/scmimedata.cpp Sat Mar 14 08:23:40 2015
@@ -33,6 +33,9 @@
 		hasData |= mimeData->hasFormat(ScMimeData::ScribusFragmentMimeType);
 		hasData |= mimeData->hasFormat(ScMimeData::ScribusTextMimeType);
 		hasData |= mimeData->hasText();
+		hasData |= mimeData->hasFormat("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"");
+		hasData |= mimeData->hasFormat("image/x-inkscape-svg");
+		hasData |= mimeData->hasFormat("application/vnd.oasis.opendocument.graphics");
 	}
 	return hasData;
 }
@@ -67,6 +70,51 @@
 	if (mimeData)
 		return mimeData->hasText();
 	return false;
+}
+
+bool ScMimeData::clipboardHasKnownData(void)
+{
+	bool  hasData = false;
+	const QMimeData* mimeData = QApplication::clipboard()->mimeData();
+	if (mimeData)
+	{
+		hasData |= mimeData->hasFormat("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"");
+		hasData |= mimeData->hasFormat("image/x-inkscape-svg");
+		hasData |= mimeData->hasFormat("application/vnd.oasis.opendocument.graphics");
+	}
+	return hasData;
+}
+
+QString ScMimeData::clipboardKnownDataExt(void)
+{
+	QString ext = "";
+	const QMimeData* mimeData = QApplication::clipboard()->mimeData();
+	if (mimeData)
+	{
+		if (mimeData->hasFormat("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\""))
+			ext = "svm";
+		else if (mimeData->hasFormat("image/x-inkscape-svg"))
+			ext = "svg";
+		else if (mimeData->hasFormat("application/vnd.oasis.opendocument.graphics"))
+			ext = "odg";
+	}
+	return ext;
+}
+
+QByteArray ScMimeData::clipboardKnownDataData(void)
+{
+	QByteArray data = "";
+	const QMimeData* mimeData = QApplication::clipboard()->mimeData();
+	if (mimeData)
+	{
+		if (mimeData->hasFormat("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\""))
+			data = mimeData->data("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"");
+		else if (mimeData->hasFormat("image/x-inkscape-svg"))
+			data = mimeData->data("image/x-inkscape-svg");
+		else if (mimeData->hasFormat("application/vnd.oasis.opendocument.graphics"))
+			data = mimeData->data("application/vnd.oasis.opendocument.graphics");
+	}
+	return data;
 }
 
 QString ScMimeData::clipboardScribusElem(void)

Modified: trunk/Scribus/scribus/scmimedata.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19917&path=/trunk/Scribus/scribus/scmimedata.h
==============================================================================
--- trunk/Scribus/scribus/scmimedata.h (original)
+++ trunk/Scribus/scribus/scmimedata.h Sat Mar 14 08:23:40 2015
@@ -38,6 +38,9 @@
 	static bool clipboardHasScribusFragment(void);
 	static bool clipboardHasScribusText(void);
 	static bool clipboardHasPlainText(void);
+	static bool clipboardHasKnownData(void);
+	static QString clipboardKnownDataExt(void);
+	static QByteArray clipboardKnownDataData(void);
 
 	static QString    clipboardScribusElem(void);
 	static QByteArray clipboardScribusFragment(void);

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19917&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Mar 14 08:23:40 2015
@@ -257,6 +257,7 @@
 #include "units.h"
 #include "urllauncher.h"
 #include "util.h"
+#include "util_file.h"
 #include "util_formats.h"
 #include "util_ghostscript.h"
 #include "util_icon.h"
@@ -4799,6 +4800,21 @@
 			if (doc->m_Selection->count() > 1)
 				doc->m_Selection->setGroupRect();
 		}
+		else if (ScMimeData::clipboardHasKnownData())
+		{
+			QString ext = ScMimeData::clipboardKnownDataExt();
+			QByteArray bitsBits = ScMimeData::clipboardKnownDataData();
+			double x0 = (view->contentsX() / view->scale()) + ((view->visibleWidth() / 2.0) / view->scale());
+			double y0 = (view->contentsY() / view->scale()) + ((view->visibleHeight() / 2.0) / view->scale());
+			PageItem *retObj = getVectorFileFromData(doc, bitsBits, ext, x0, y0);
+			if (retObj != NULL)
+			{
+				double x = (view->contentsX() / view->scale()) + ((view->visibleWidth() / 2.0) / view->scale()) - (retObj->width() / 2.0);
+				double y = (view->contentsY() / view->scale()) + ((view->visibleHeight() / 2.0) / view->scale()) - (retObj->height() / 2.0);
+				retObj->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
+				retObj->setXYPos(x, y, true);
+			}
+		}
 		view->DrawNew();
 	}
 	if (activeTransaction)
@@ -4960,6 +4976,7 @@
 	bool textFrameEditMode = false;
 	bool tableEditMode = false;
 	bool hasScribusData = ScMimeData::clipboardHasScribusElem() || ScMimeData::clipboardHasScribusFragment();
+	bool hasExternalData = ScMimeData::clipboardHasKnownData();
 	if (HaveDoc && !doc->m_Selection->isEmpty())
 	{
 		PageItem *currItem = NULL;
@@ -4967,7 +4984,7 @@
 		textFrameEditMode  = ((doc->appMode == modeEdit) && (currItem->asTextFrame()));
 		tableEditMode = ((doc->appMode == modeEditTable) && (currItem->asTable()));
 	}
-	scrActions["editPaste"]->setEnabled(HaveDoc && (hasScribusData || textFrameEditMode || tableEditMode));
+	scrActions["editPaste"]->setEnabled(HaveDoc && (hasScribusData || textFrameEditMode || tableEditMode || hasExternalData));
 }
 
 void ScribusMainWindow::EnableTxEdit()

Modified: trunk/Scribus/scribus/util_file.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19917&path=/trunk/Scribus/scribus/util_file.cpp
==============================================================================
--- trunk/Scribus/scribus/util_file.cpp (original)
+++ trunk/Scribus/scribus/util_file.cpp Sat Mar 14 08:23:40 2015
@@ -13,6 +13,7 @@
 # include <utime.h>
 #endif
 
+#include <QByteArray>
 #include <QDataStream>
 #include <QDir>
 #include <QFile>
@@ -21,7 +22,13 @@
 #include <QProcess>
 #include <QTemporaryFile>
 
+#include "fileloader.h"
+#include "loadsaveplugin.h"
+#include "prefsmanager.h"
+#include "scribusdoc.h"
 #include "scstreamfilter.h"
+#include "selection.h"
+#include "util.h"
 
 bool copyData(QIODevice& src, QIODevice& dest)
 {
@@ -233,3 +240,46 @@
 	}
 	return false;
 }
+
+PageItem*  getVectorFileFromData(ScribusDoc *doc, QByteArray &data, QString ext, double x, double y, double w, double h)
+{
+	PageItem* retObj = NULL;
+	QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + ext);
+	if (tempFile->open())
+	{
+		QString fileName = getLongPathName(tempFile->fileName());
+		if (!fileName.isEmpty())
+		{
+			tempFile->write(data);
+			tempFile->close();
+			FileLoader *fileLoader = new FileLoader(fileName);
+			int testResult = fileLoader->testFile();
+			delete fileLoader;
+			if (testResult != -1)
+			{
+				const FileFormat * fmt = LoadSavePlugin::getFormatById(testResult);
+				if( fmt )
+				{
+					doc->m_Selection->clear();
+					doc->m_Selection->delaySignalsOn();
+					fmt->setupTargets(doc, 0, 0, 0, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
+					fmt->loadFile(fileName, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
+					if (doc->m_Selection->count() > 0)
+					{
+						retObj = doc->groupObjectsSelection();
+						retObj->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
+						retObj->setXYPos(x, y, true);
+						if ((w >= 0) && (h >= 0))
+							retObj->setWidthHeight(w, h, true);
+						retObj->updateClip();
+						retObj->update();
+					}
+					doc->m_Selection->clear();
+					doc->m_Selection->delaySignalsOff();
+				}
+			}
+		}
+	}
+	delete tempFile;
+	return retObj;
+}

Modified: trunk/Scribus/scribus/util_file.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19917&path=/trunk/Scribus/scribus/util_file.h
==============================================================================
--- trunk/Scribus/scribus/util_file.h (original)
+++ trunk/Scribus/scribus/util_file.h Sat Mar 14 08:23:40 2015
@@ -11,7 +11,10 @@
 
 class QDataStream;
 class QString;
+class QByteArray;
 class ScStreamFilter;
+class ScribusDoc;
+class PageItem;
 
 /**
 * @brief Copy a source file to a target
@@ -83,4 +86,5 @@
 **/
 bool SCRIBUS_API fileInPath(const QString& filename);
 
+PageItem* SCRIBUS_API getVectorFileFromData(ScribusDoc *doc, QByteArray &data, QString ext, double x, double y, double w = -1.0, double h = -1.0);
 #endif




More information about the scribus-commit mailing list