Fix bad URL encoding in .svg

preferencesAboutTextFull
Craig Watson 9 years ago
parent 82e5f92ca6
commit c220bf470f
  1. 13
      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

Loading…
Cancel
Save