r17003 by fschmid - Fixed Bug 9570: "drag and drop to Scrapbook no longer works"
scribus-commit
scribus-commit at lists.scribus.net
Mon Nov 21 17:45:14 UTC 2011
Author: fschmid
Date: Mon Nov 21 17:45:14 2011
New Revision: 17003
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17003
Log:
Fixed Bug 9570: "drag and drop to Scrapbook no longer works"
Modified:
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
trunk/Scribus/scribus/ui/scrapbookpalette.cpp
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17003&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Mon Nov 21 17:45:14 2011
@@ -48,6 +48,7 @@
documentStr.reserve(524288);
ScXmlStreamWriter writer(&documentStr);
writer.setAutoFormatting(true);
+// writer.writeStartDocument();
writer.writeStartElement("SCRIBUSELEMUTF8");
writer.writeAttribute("XP", xp);
writer.writeAttribute("YP", yp);
@@ -103,9 +104,9 @@
writePatterns(writer, fileDir, true, selection);
WriteObjects(m_Doc, writer, fileDir, 0, 0, ItemSelectionElements, &emG);
writer.writeEndElement();
- writer.writeEndDocument();
+// writer.writeEndDocument();
documentStr.squeeze();
- return documentStr;
+ return documentStr.trimmed();
}
bool Scribus150Format::savePalette(const QString & fileName)
Modified: trunk/Scribus/scribus/ui/scrapbookpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17003&path=/trunk/Scribus/scribus/ui/scrapbookpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrapbookpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/scrapbookpalette.cpp Mon Nov 21 17:45:14 2011
@@ -134,9 +134,9 @@
e->acceptProposedAction();
if (e->source() == this)
return;
- QString nam, tmp = "";
QString text = e->mimeData()->text();
- if (text.startsWith("<SCRIBUSELEM"))
+ int startElemPos = text.left(512).indexOf("<SCRIBUSELEM");
+ if (startElemPos >= 0)
emit objDropped(text);
}
else if ( e->mimeData()->hasFormat("text/uri-list"))
More information about the scribus-commit
mailing list