r21483 by jghali - #14319: Copied selection may be pasted on wrong location

scribus-commit scribus-commit at lists.scribus.net
Sun Oct 30 21:09:52 UTC 2016


Author: jghali
Date: Sun Oct 30 21:09:52 2016
New Revision: 21483

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21483
Log:
#14319: Copied selection may be pasted on wrong location

Modified:
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21483&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp	(original)
+++ trunk/Scribus/scribus/scribusview.cpp	Sun Oct 30 21:09:52 2016
@@ -1912,25 +1912,10 @@
 	int ac = Doc->Items->count();
 	if (UndoManager::undoEnabled())
 		activeTransaction = undoManager->beginTransaction(Doc->currentPage()->getUName(), 0, Um::Paste, "", Um::IPaste);
-/*	if (ScMimeData::clipboardHasScribusFragment())
-	{
-		bool savedAlignGrid = Doc->SnapGrid;
-		bool savedAlignGuides = Doc->SnapGuides;
-		QByteArray fragment   = ScMimeData::clipboardScribusFragment();
-		Selection pastedObjects = Doc->serializer()->deserializeObjects(fragment);
-		Doc->SnapGrid = savedAlignGrid;
-		Doc->SnapGuides = savedAlignGuides;
-		pastedObjects.setGroupRect();
-		double gx, gy, gh, gw;
-		pastedObjects.getGroupRect(&gx, &gy, &gw, &gh);
-		Doc->moveGroup(dragX - gx, dragY - gy, &pastedObjects);
-		Doc->m_Selection->clear();
-	}
-	else
-	{ */
-		QString buffer = ScMimeData::clipboardScribusElem();
-		emit LoadElem(buffer, dragX, dragY, false, false, Doc, this);
-//	}
+
+	QString buffer = ScMimeData::clipboardScribusElem();
+	emit LoadElem(buffer, dragX, dragY, false, false, Doc, this);
+
 	Doc->DraggedElem = 0;
 	Doc->DragElements.clear();
 	updateContents();
@@ -1945,8 +1930,11 @@
 	}
 	if (newObjects.count() > 1)
 	{
+		double gx, gy, gh, gw;
 		newObjects.setGroupRect();
-		double gx, gy, gh, gw;
+		newObjects.getGroupRect(&gx, &gy, &gw, &gh);
+		Doc->moveGroup(dragX - gx, dragY - gy, &newObjects);
+		newObjects.setGroupRect();
 		newObjects.getGroupRect(&gx, &gy, &gw, &gh);
 		double nx = gx;
 		double ny = gy;




More information about the scribus-commit mailing list