diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 840747fa..48fc20b4 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -1983,10 +1983,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::audioItemToLinkedAudio(UBGraphicsMed mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "position", QString("%1").arg(pos)); } - QString audioFileHref = audioItem->mediaFileUrl().toString(); - audioFileHref = UBFileSystemUtils::removeLocalFilePrefix(audioFileHref); - if(audioFileHref.startsWith(mDocumentPath)) - audioFileHref = audioFileHref.replace(mDocumentPath + "/",""); + QString audioFileHref = "audios/" + audioItem->mediaFileUrl().fileName(); mXmlWriter.writeAttribute(nsXLink, "href", audioFileHref); mXmlWriter.writeEndElement(); @@ -2225,7 +2222,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::graphicsItemToSvg(QGraphicsItem* ite QUrl sourceUrl = ubItem->sourceUrl(); if (!sourceUrl.isEmpty()) - mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "source", sourceUrl.toString()); + mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "source", sourceUrl.path()); } @@ -2285,8 +2282,10 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::graphicsWidgetToSvg(UBGraphicsWidget widgetRootUrl = widgetTargetDir; } + QString widgetPath = "widgets/" + widgetRootUrl.fileName(); + mXmlWriter.writeStartElement("foreignObject"); - mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "src", widgetRootUrl.toString()); + mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "src", widgetPath); graphicsItemToSvg(item); @@ -2307,6 +2306,8 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::graphicsWidgetToSvg(UBGraphicsWidget else startFileUrl = widgetRootUrl.toString() + "/" + item->mainHtmlFileName(); + startFileUrl = QUrl::fromPercentEncoding(startFileUrl.toUtf8()); + mXmlWriter.writeAttribute("src", startFileUrl); mXmlWriter.writeEndElement(); //iFrame