Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 15238 → Rev 15239

/trunk/Scribus/scribus/scribusdoc.cpp
23,6 → 23,7
 
#include <memory>
#include <utility>
#include <sstream>
 
#include <QByteArray>
#include <QDebug>
37,12 → 38,12
#include "canvas.h"
#include "colorblind.h"
#include "commonstrings.h"
#include "desaxe/digester.h"
#include "desaxe/saxXML.h"
#include "fileloader.h"
#include "filewatcher.h"
#include "ui/guidemanager.h"
#include "ui/hruler.h"
#include "hyphenator.h"
#include "ui/layers.h"
#include "page.h"
#include "pageitem.h"
#include "pageitem_imageframe.h"
77,6 → 78,8
#include "scribuswin.h"
#include "selection.h"
#include "serializer.h"
#include "ui/hruler.h"
#include "ui/layers.h"
#include "ui/storyeditor.h"
#include "text/nlsconfig.h"
#include "undomanager.h"
5547,7 → 5550,7
Page* lastDest = NULL;
 
uint oldItems = Items->count();
QStringList itemBuffer;
QList<QByteArray> itemBuffer;
m_Selection->clear();
m_Selection->delaySignalsOn();
if (oldItems>0)
5567,14 → 5570,16
}
if (m_Selection->count() != 0)
{
ScriXmlDoc *ss = new ScriXmlDoc();
itemBuffer.append(ss->WriteElem(this, m_Selection));
std::ostringstream xmlString;
SaxXML xmlStream(xmlString);
Serializer::serializeObjects(*m_Selection, xmlStream);
std::string xml(xmlString.str());
itemBuffer.append( QByteArray(xml.c_str(), xml.size()) );
m_Selection->clear();
delete ss;
}
else
{
itemBuffer.append(QString());
itemBuffer.append(QByteArray());
}
}
setActiveLayer(currActiveLayer);
5641,16 → 5646,27
if (Layers.count()!= 0)
{
int currActiveLayer = activeLayer();
bool savedAlignGrid = this->useRaster;
bool savedAlignGuides = this->SnapGuides;
this->useRaster = false;
this->SnapGuides = false;
for (it = Layers.begin(); it != Layers.end(); ++it)
{
if ((lcount < itemBuffer.count()) && !itemBuffer[lcount].isEmpty())
{
ScriXmlDoc *ss = new ScriXmlDoc();
ss->ReadElemToLayer(itemBuffer[lcount], appPrefsData.fontPrefs.AvailFonts, this, destination->xOffset(), destination->yOffset(), false, true, appPrefsData.fontPrefs.GFontSub,(*it).ID);
delete ss;
QByteArray fragment = itemBuffer[lcount];
Selection pastedObjects = Serializer(*this).deserializeObjects(fragment);
for (int i=0; i < pastedObjects.count(); ++i)
pastedObjects.itemAt(i)->LayerID = it->ID;
// We do not need moveGroup undo actions
UndoManager::instance()->setUndoEnabled(false);
moveGroup(destination->xOffset() - from->xOffset(), destination->yOffset() - from->yOffset(), false, &pastedObjects);
UndoManager::instance()->setUndoEnabled(true);
}
lcount++;
}
this->useRaster = savedAlignGrid;
this->SnapGuides = savedAlignGuides;
setActiveLayer(currActiveLayer);
}
}