|
|
@ -975,6 +975,24 @@ UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup() |
|
|
|
if(mStrokesList.contains(id)) |
|
|
|
if(mStrokesList.contains(id)) |
|
|
|
shouldSkipSubElements = true; |
|
|
|
shouldSkipSubElements = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString ubLocked = mXmlReader.attributes().value(mNamespaceUri, "locked").toString(); |
|
|
|
|
|
|
|
if (!ubLocked.isEmpty()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
bool isLocked = ubLocked.contains(xmlTrue); |
|
|
|
|
|
|
|
group->setData(UBGraphicsItemData::ItemLocked, QVariant(isLocked)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QStringRef ubLayer = mXmlReader.attributes().value(mNamespaceUri, "layer"); |
|
|
|
|
|
|
|
if (!ubLayer.isNull()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
bool ok; |
|
|
|
|
|
|
|
int layerAsInt = ubLayer.toString().toInt(&ok); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ok) |
|
|
|
|
|
|
|
group->setData(UBGraphicsItemData::ItemLayerType, QVariant(layerAsInt)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mXmlReader.readNext(); |
|
|
|
mXmlReader.readNext(); |
|
|
|
while (!mXmlReader.atEnd()) |
|
|
|
while (!mXmlReader.atEnd()) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1031,13 +1049,9 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroupRoot() |
|
|
|
} |
|
|
|
} |
|
|
|
else if (mXmlReader.isStartElement()) { |
|
|
|
else if (mXmlReader.isStartElement()) { |
|
|
|
if (mXmlReader.name() == tGroup) { |
|
|
|
if (mXmlReader.name() == tGroup) { |
|
|
|
QString ubLocked = mXmlReader.attributes().value(UBSettings::uniboardDocumentNamespaceUri, "locked").toString(); |
|
|
|
|
|
|
|
UBGraphicsGroupContainerItem *curGroup = readGroup(); |
|
|
|
UBGraphicsGroupContainerItem *curGroup = readGroup(); |
|
|
|
if (!ubLocked.isEmpty()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
bool isLocked = ubLocked.contains(xmlTrue); |
|
|
|
|
|
|
|
curGroup->Delegate()->setLocked(isLocked); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (curGroup) { |
|
|
|
if (curGroup) { |
|
|
|
mScene->addGroup(curGroup); |
|
|
|
mScene->addGroup(curGroup); |
|
|
|
} |
|
|
|
} |
|
|
@ -1400,6 +1414,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(UBDocumentProxy* proxy, |
|
|
|
if(curElement.hasAttribute("locked")){ |
|
|
|
if(curElement.hasAttribute("locked")){ |
|
|
|
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri,"locked",curElement.attribute("locked")); |
|
|
|
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri,"locked",curElement.attribute("locked")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(curElement.hasAttribute("layer")){ |
|
|
|
|
|
|
|
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri,"layer",curElement.attribute("layer")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QDomElement curSubElement = curElement.firstChildElement(); |
|
|
|
QDomElement curSubElement = curElement.firstChildElement(); |
|
|
|
while (!curSubElement.isNull()) { |
|
|
|
while (!curSubElement.isNull()) { |
|
|
|
if (curSubElement.hasAttribute(aId)) { |
|
|
|
if (curSubElement.hasAttribute(aId)) { |
|
|
@ -1444,6 +1462,8 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro |
|
|
|
curGroupElement.setAttribute("locked", xmlTrue); |
|
|
|
curGroupElement.setAttribute("locked", xmlTrue); |
|
|
|
else |
|
|
|
else |
|
|
|
curGroupElement.setAttribute("locked", xmlFalse); |
|
|
|
curGroupElement.setAttribute("locked", xmlFalse); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curGroupElement.setAttribute("layer", group->data(UBGraphicsItemData::ItemLayerType).toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
curParent->appendChild(curGroupElement); |
|
|
|
curParent->appendChild(curGroupElement); |
|
|
|
foreach (QGraphicsItem *item, groupItem->childItems()) { |
|
|
|
foreach (QGraphicsItem *item, groupItem->childItems()) { |
|
|
|