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