|
|
@ -249,7 +249,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgRect(const QDomElement &elem |
|
|
|
painter.end(); |
|
|
|
painter.end(); |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
svgItem->setUuid(QUuid::createUuid()); |
|
|
|
|
|
|
|
|
|
|
|
QString uuid = QUuid::createUuid().toString(); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), uuid); |
|
|
|
|
|
|
|
svgItem->setUuid(QUuid(uuid)); |
|
|
|
|
|
|
|
|
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -300,7 +304,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgEllipse(const QDomElement &e |
|
|
|
painter.end(); |
|
|
|
painter.end(); |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
svgItem->setUuid(QUuid::createUuid()); |
|
|
|
|
|
|
|
|
|
|
|
QString uuid = QUuid::createUuid().toString(); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), uuid); |
|
|
|
|
|
|
|
svgItem->setUuid(QUuid(uuid)); |
|
|
|
|
|
|
|
|
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -395,6 +403,7 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolygon(const QDomElement &e |
|
|
|
mCurrentScene->addItem(graphicsPolygon); |
|
|
|
mCurrentScene->addItem(graphicsPolygon); |
|
|
|
|
|
|
|
|
|
|
|
graphicsPolygon->setUuid(itemUuid); |
|
|
|
graphicsPolygon->setUuid(itemUuid); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), itemUuid); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else // single CFF
|
|
|
|
else // single CFF
|
|
|
@ -415,7 +424,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolygon(const QDomElement &e |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
svgItem->setUuid(QUuid::createUuid()); |
|
|
|
|
|
|
|
|
|
|
|
QUuid uuid = QUuid::createUuid().toString(); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), uuid); |
|
|
|
|
|
|
|
svgItem->setUuid(uuid); |
|
|
|
|
|
|
|
|
|
|
|
svgItem->resetTransform(); |
|
|
|
svgItem->resetTransform(); |
|
|
|
if (!textTransform.isNull()) { |
|
|
|
if (!textTransform.isNull()) { |
|
|
|
transform = transformFromString(textTransform, svgItem); |
|
|
|
transform = transformFromString(textTransform, svgItem); |
|
|
@ -508,6 +521,9 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolyline(const QDomElement & |
|
|
|
} |
|
|
|
} |
|
|
|
mCurrentScene->addItem(graphicsPolygon); |
|
|
|
mCurrentScene->addItem(graphicsPolygon); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
graphicsPolygon->setUuid(itemUuid); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), itemUuid); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else // simple CFF
|
|
|
|
else // simple CFF
|
|
|
|
{ |
|
|
|
{ |
|
|
@ -525,7 +541,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolyline(const QDomElement & |
|
|
|
|
|
|
|
|
|
|
|
//add resulting svg file to scene
|
|
|
|
//add resulting svg file to scene
|
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
svgItem->setUuid(QUuid::createUuid()); |
|
|
|
|
|
|
|
|
|
|
|
QString uuid = QUuid::createUuid().toString(); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), uuid); |
|
|
|
|
|
|
|
svgItem->setUuid(QUuid(uuid)); |
|
|
|
|
|
|
|
|
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -678,6 +698,10 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgText(const QDomElement &elem |
|
|
|
//add resulting svg file to scene
|
|
|
|
//add resulting svg file to scene
|
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString uuid = QUuid::createUuid().toString(); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), uuid); |
|
|
|
|
|
|
|
svgItem->setUuid(QUuid(uuid)); |
|
|
|
|
|
|
|
|
|
|
|
svgItem->resetTransform(); |
|
|
|
svgItem->resetTransform(); |
|
|
|
repositionSvgItem(svgItem, width, height, x + transform.m31(), y + transform.m32(), transform); |
|
|
|
repositionSvgItem(svgItem, width, height, x + transform.m31(), y + transform.m32(), transform); |
|
|
|
hashSceneItem(element, svgItem); |
|
|
|
hashSceneItem(element, svgItem); |
|
|
@ -791,6 +815,10 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgTextarea(const QDomElement & |
|
|
|
UBGraphicsTextItem *svgItem = mCurrentScene->addTextHtml(doc.toHtml()); |
|
|
|
UBGraphicsTextItem *svgItem = mCurrentScene->addTextHtml(doc.toHtml()); |
|
|
|
svgItem->resize(width, height); |
|
|
|
svgItem->resize(width, height); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString uuid = QUuid::createUuid().toString(); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), uuid); |
|
|
|
|
|
|
|
svgItem->setUuid(QUuid(uuid)); |
|
|
|
|
|
|
|
|
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -840,6 +868,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &ele |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsPixmapItem *pixItem = mCurrentScene->addPixmap(pix, NULL); |
|
|
|
UBGraphicsPixmapItem *pixItem = mCurrentScene->addPixmap(pix, NULL); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString uuid = QUuid::createUuid().toString(); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), uuid); |
|
|
|
|
|
|
|
pixItem->setUuid(QUuid(uuid)); |
|
|
|
|
|
|
|
|
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -887,6 +920,10 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgFlash(const QDomElement &ele |
|
|
|
UBGraphicsWidgetItem *flashItem = mCurrentScene->addW3CWidget(QUrl::fromLocalFile(flashUrl)); |
|
|
|
UBGraphicsWidgetItem *flashItem = mCurrentScene->addW3CWidget(QUrl::fromLocalFile(flashUrl)); |
|
|
|
flashItem->setSourceUrl(urlPath); |
|
|
|
flashItem->setSourceUrl(urlPath); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString uuid = QUuid::createUuid().toString(); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), uuid); |
|
|
|
|
|
|
|
flashItem->setUuid(QUuid(uuid)); |
|
|
|
|
|
|
|
|
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -924,14 +961,15 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgAudio(const QDomElement &ele |
|
|
|
concreteUrl = QUrl::fromLocalFile(audioPath); |
|
|
|
concreteUrl = QUrl::fromLocalFile(audioPath); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QUuid uuid = QUuid::createUuid(); |
|
|
|
QString uuid = QUuid::createUuid().toString(); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), uuid); |
|
|
|
|
|
|
|
|
|
|
|
QString destFile; |
|
|
|
QString destFile; |
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument( |
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument( |
|
|
|
mCurrentScene->document(),
|
|
|
|
mCurrentScene->document(),
|
|
|
|
concreteUrl.toLocalFile(),
|
|
|
|
concreteUrl.toLocalFile(),
|
|
|
|
UBPersistenceManager::audioDirectory, |
|
|
|
UBPersistenceManager::audioDirectory, |
|
|
|
uuid, |
|
|
|
QUuid(uuid), |
|
|
|
destFile); |
|
|
|
destFile); |
|
|
|
if (!b) |
|
|
|
if (!b) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -940,6 +978,7 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgAudio(const QDomElement &ele |
|
|
|
concreteUrl = QUrl::fromLocalFile(destFile); |
|
|
|
concreteUrl = QUrl::fromLocalFile(destFile); |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsMediaItem *audioItem = mCurrentScene->addAudio(concreteUrl, false); |
|
|
|
UBGraphicsMediaItem *audioItem = mCurrentScene->addAudio(concreteUrl, false); |
|
|
|
|
|
|
|
|
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = parentOfAudio.attribute(aTransform); |
|
|
|
QString textTransform = parentOfAudio.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -977,15 +1016,15 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgVideo(const QDomElement &ele |
|
|
|
concreteUrl = QUrl::fromLocalFile(videoPath); |
|
|
|
concreteUrl = QUrl::fromLocalFile(videoPath); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QUuid uuid = QUuid::createUuid(); |
|
|
|
QString uuid = QUuid::createUuid().toString(); |
|
|
|
|
|
|
|
mRefToUuidMap.insert(element.attribute(aId), uuid); |
|
|
|
|
|
|
|
|
|
|
|
QString destFile; |
|
|
|
QString destFile; |
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument( |
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument( |
|
|
|
mCurrentScene->document(),
|
|
|
|
mCurrentScene->document(),
|
|
|
|
concreteUrl.toLocalFile(),
|
|
|
|
concreteUrl.toLocalFile(),
|
|
|
|
UBPersistenceManager::videoDirectory, |
|
|
|
UBPersistenceManager::videoDirectory, |
|
|
|
uuid, |
|
|
|
QUuid(uuid), |
|
|
|
destFile); |
|
|
|
destFile); |
|
|
|
if (!b) |
|
|
|
if (!b) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -994,6 +1033,7 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgVideo(const QDomElement &ele |
|
|
|
concreteUrl = QUrl::fromLocalFile(destFile); |
|
|
|
concreteUrl = QUrl::fromLocalFile(destFile); |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsMediaItem *videoItem = mCurrentScene->addVideo(concreteUrl, false); |
|
|
|
UBGraphicsMediaItem *videoItem = mCurrentScene->addVideo(concreteUrl, false); |
|
|
|
|
|
|
|
|
|
|
|
QTransform transform; |
|
|
|
QTransform transform; |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
QString textTransform = element.attribute(aTransform); |
|
|
|
|
|
|
|
|
|
|
@ -1129,13 +1169,15 @@ UBGraphicsGroupContainerItem *UBCFFSubsetAdaptor::UBCFFSubsetReader::parseIwbGro |
|
|
|
group->addToGroup(parseIwbGroup(currentStrokeElement)); |
|
|
|
group->addToGroup(parseIwbGroup(currentStrokeElement)); |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
QString uuid = currentStrokeElement.attribute(aRef); |
|
|
|
|
|
|
|
|
|
|
|
QString ref = currentStrokeElement.attribute(aRef); |
|
|
|
|
|
|
|
QString uuid = mRefToUuidMap[ref]; |
|
|
|
if (!uuid.isEmpty()) |
|
|
|
if (!uuid.isEmpty()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (uuid.size() > QUuid().toString().length()) // create stroke group
|
|
|
|
if (ref.size() > QUuid().toString().length()) // create stroke group
|
|
|
|
{
|
|
|
|
{
|
|
|
|
currentStrokeIdentifier = uuid.left(QUuid().toString().length()-1); |
|
|
|
currentStrokeIdentifier = ref.left(QUuid().toString().length()-1); |
|
|
|
UBGraphicsPolygonItem *strokeByUuid = qgraphicsitem_cast<UBGraphicsPolygonItem *>(mCurrentScene->itemForUuid(QUuid(uuid.right(QUuid().toString().length())))); |
|
|
|
UBGraphicsPolygonItem *strokeByUuid = qgraphicsitem_cast<UBGraphicsPolygonItem *>(mCurrentScene->itemForUuid(QUuid(ref.right(QUuid().toString().length())))); |
|
|
|
|
|
|
|
|
|
|
|
if (strokeByUuid) |
|
|
|
if (strokeByUuid) |
|
|
|
strokesGroupsContainer.insert(currentStrokeIdentifier, strokeByUuid); |
|
|
|
strokesGroupsContainer.insert(currentStrokeIdentifier, strokeByUuid); |
|
|
|