r23583 by jghali - Recognize "image/svg+xml" mime type when user copies data in clipbard from other applications

scribus-commit scribus-commit at lists.scribus.net
Fri Apr 10 12:38:16 UTC 2020


Author: jghali
Date: Fri Apr 10 12:38:16 2020
New Revision: 23583

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23583
Log:
Recognize "image/svg+xml" mime type when user copies data in clipbard from other applications

Modified:
    trunk/Scribus/scribus/scmimedata.cpp

Modified: trunk/Scribus/scribus/scmimedata.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23583&path=/trunk/Scribus/scribus/scmimedata.cpp
==============================================================================
--- trunk/Scribus/scribus/scmimedata.cpp	(original)
+++ trunk/Scribus/scribus/scmimedata.cpp	Fri Apr 10 12:38:16 2020
@@ -40,6 +40,7 @@
 		hasData |= mimeData->hasFormat(ScMimeData::ScribusTextMimeType);
 		hasData |= mimeData->hasText();
 		hasData |= mimeData->hasFormat("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"");
+		hasData |= mimeData->hasFormat("image/svg+xml");
 		hasData |= mimeData->hasFormat("image/x-inkscape-svg");
 		hasData |= mimeData->hasFormat("application/vnd.oasis.opendocument.graphics");
 	}
@@ -85,6 +86,7 @@
 	if (mimeData)
 	{
 		hasData |= mimeData->hasFormat("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"");
+		hasData |= mimeData->hasFormat("image/svg+xml");
 		hasData |= mimeData->hasFormat("image/x-inkscape-svg");
 		hasData |= mimeData->hasFormat("application/vnd.oasis.opendocument.graphics");
 	}
@@ -99,7 +101,7 @@
 	{
 		if (mimeData->hasFormat("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\""))
 			ext = "svm";
-		else if (mimeData->hasFormat("image/x-inkscape-svg"))
+		else if (mimeData->hasFormat("image/svg+xml") || mimeData->hasFormat("image/x-inkscape-svg"))
 			ext = "svg";
 		else if (mimeData->hasFormat("application/vnd.oasis.opendocument.graphics"))
 			ext = "odg";
@@ -115,6 +117,8 @@
 	{
 		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/svg+xml"))
+			data = mimeData->data("image/svg+xml");
 		else if (mimeData->hasFormat("image/x-inkscape-svg"))
 			data = mimeData->data("image/x-inkscape-svg");
 		else if (mimeData->hasFormat("application/vnd.oasis.opendocument.graphics"))




More information about the scribus-commit mailing list