summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2017-10-28 02:28:18 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-10-30 08:21:55 +0100
commit08a43cc97ccf88faa9d3a04afc3aacd2c885a2d1 (patch)
tree11f416701d1be0a962c7653ea86060f30f708b56 /xmloff
parent8d994f83568073eb79ab987069f740c3c940405e (diff)
related: tdf#103884 remove gltf/collada feature
Change-Id: Icd26ad96c0337844ef1463dabfbe791caa00dd2d Reviewed-on: https://gerrit.libreoffice.org/43972 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/shapeexport.cxx141
-rw-r--r--xmloff/source/draw/ximpshap.cxx6
-rw-r--r--xmloff/source/draw/ximpshap.hxx2
3 files changed, 0 insertions, 149 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index aff07db2e138..7c1c9cb206bb 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -3184,138 +3184,6 @@ lcl_StoreMediaAndGetURL(SvXMLExport & rExport,
}
}
-#if HAVE_FEATURE_GLTF
-static void lcl_StoreGltfExternals(
- SvXMLExport& rExport,
- const OUString& rURL )
-{
- OUString sUrlPath;
- if (rURL.startsWithIgnoreAsciiCase("vnd.sun.star.Package:", &sUrlPath))
- {
- sUrlPath = sUrlPath.copy(0,sUrlPath.lastIndexOf("/"));
- try
- {
- // Base storage
- uno::Reference<document::XStorageBasedDocument> const xSBD(
- rExport.GetModel(), uno::UNO_QUERY_THROW);
- const uno::Reference<embed::XStorage> xStorage(
- xSBD->getDocumentStorage(), uno::UNO_QUERY_THROW);
-
- // Model source
- ::comphelper::LifecycleProxy proxy;
- const uno::Reference<embed::XStorage> xModelStorage(
- ::comphelper::OStorageHelper::GetStorageAtPath(xStorage, sUrlPath,
- embed::ElementModes::READ, proxy));
-
- // Target storage
- uno::Reference<embed::XStorage> const xTarget(
- rExport.GetTargetStorage(), uno::UNO_QUERY_THROW);
-
- // Target of all models
- const uno::Reference<embed::XStorage> xModelsTarget(
- xTarget->openStorageElement(sUrlPath.copy(0,sUrlPath.lastIndexOf("/")), embed::ElementModes::WRITE));
-
- // Target of current model
- const OUString sModelName = sUrlPath.copy(sUrlPath.lastIndexOf("/")+1);
- const uno::Reference<embed::XStorage> xModelTarget(
- xModelsTarget->openStorageElement(sModelName, embed::ElementModes::WRITE));
-
- xModelStorage->copyToStorage(xModelTarget);
-
- const uno::Reference<embed::XTransactedObject> xModelsTransaction(xModelsTarget, uno::UNO_QUERY);
- if (xModelsTransaction.is())
- {
- xModelsTransaction->commit();
- }
- }
- catch (uno::Exception const& e)
- {
- SAL_INFO("xmloff", "exception while saving embedded model: '" << e << "'");
- }
- }
-}
-
-static void lcl_StoreGltfFallback(
- SvXMLExport& rExport,
- const uno::Reference<beans::XPropertySet>& rPropSet,
- const OUString& rURL )
-{
- OUString sUrlPath;
- if (rURL.startsWithIgnoreAsciiCase("vnd.sun.star.Package:", &sUrlPath))
- {
- sUrlPath = sUrlPath.copy(0,sUrlPath.lastIndexOf("/"));
- try
- {
- // Base storage
- uno::Reference<document::XStorageBasedDocument> const xSBD(
- rExport.GetModel(), uno::UNO_QUERY_THROW);
- const uno::Reference<embed::XStorage> xStorage(
- xSBD->getDocumentStorage(), uno::UNO_QUERY_THROW);
-
- // Model source
- ::comphelper::LifecycleProxy proxy;
- const uno::Reference<embed::XStorage> xModelStorage(
- ::comphelper::OStorageHelper::GetStorageAtPath(xStorage, sUrlPath,
- embed::ElementModes::READ, proxy));
-
- // Target storage
- uno::Reference<embed::XStorage> const xTarget(
- rExport.GetTargetStorage(), uno::UNO_QUERY_THROW);
-
- // Target of all models
- const uno::Reference<embed::XStorage> xModelsTarget(
- xTarget->openStorageElement(sUrlPath.copy(0,sUrlPath.lastIndexOf("/")), embed::ElementModes::WRITE));
-
- /// Save the fallback image under the 'Models/Fallbacks/' folder
- uno::Reference< graphic::XGraphic > xGraphic( rPropSet->getPropertyValue("FallbackGraphic"), uno::UNO_QUERY );
- if( xGraphic.is() )
- {
- // Fallback storage
- const uno::Reference<embed::XStorage> xFallbackTarget(
- xModelsTarget->openStorageElement("Fallbacks", embed::ElementModes::WRITE));
-
- const OUString sModelName = sUrlPath.copy(sUrlPath.lastIndexOf("/")+1);
- uno::Reference< io::XStream > xPictureStream(
- xFallbackTarget->openStreamElement( sModelName + ".png", embed::ElementModes::WRITE ), uno::UNO_QUERY_THROW );
-
- uno::Reference< graphic::XGraphicProvider > xProvider( graphic::GraphicProvider::create(comphelper::getProcessComponentContext()) );
- uno::Sequence< beans::PropertyValue > aArgs( 2 );
- aArgs[ 0 ].Name = "MimeType";
- aArgs[ 0 ].Value <<= OUString( "image/png" );
- aArgs[ 1 ].Name = "OutputStream";
- aArgs[ 1 ].Value <<= xPictureStream->getOutputStream();
- xProvider->storeGraphic( xGraphic, aArgs );
-
- const uno::Reference<embed::XTransactedObject> xFallbackTransaction(xFallbackTarget, uno::UNO_QUERY);
- if (xFallbackTransaction.is())
- {
- xFallbackTransaction->commit();
- }
-
- const OUString sFallbackURL( sUrlPath.copy(0,sUrlPath.lastIndexOf("/")) + "/Fallbacks/" + sModelName + ".png");
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sFallbackURL );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
-
- SvXMLElementExport aImage( rExport, XML_NAMESPACE_DRAW, XML_IMAGE, false, true );
- }
-
- const uno::Reference<embed::XTransactedObject> xModelsTransaction(xModelsTarget, uno::UNO_QUERY);
- if (xModelsTransaction.is())
- {
- xModelsTransaction->commit();
- }
- }
- catch (uno::Exception const& e)
- {
- SAL_INFO("xmloff", "exception while saving fallback image of glTF model: '" << e << "'");
- }
- }
-}
-
-#endif
-
void XMLShapeExport::ImpExportMediaShape(
const uno::Reference< drawing::XShape >& xShape,
XmlShapeType eShapeType, XMLShapeExportFlags nFeatures, css::awt::Point* pRefPoint)
@@ -3342,10 +3210,6 @@ void XMLShapeExport::ImpExportMediaShape(
OUString const persistentURL =
lcl_StoreMediaAndGetURL(GetExport(), xPropSet, aMediaURL, sMimeType);
-#if HAVE_FEATURE_GLTF
- if( sMimeType == "model/vnd.gltf+json" )
- lcl_StoreGltfExternals(GetExport(), aMediaURL);
-#endif
mrExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, persistentURL );
mrExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
@@ -3407,11 +3271,6 @@ void XMLShapeExport::ImpExportMediaShape(
mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_VALUE, aZoomValue );
delete( new SvXMLElementExport( mrExport, XML_NAMESPACE_DRAW, XML_PARAM, false, true ) );
}
-
-#if HAVE_FEATURE_GLTF
- if( sMimeType == "model/vnd.gltf+json" )
- lcl_StoreGltfFallback(GetExport(), xPropSet, aMediaURL);
-#endif
}
}
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index c4fc1b294187..c0864e683761 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -2980,10 +2980,6 @@ void SdXMLPluginShapeContext::StartElement( const css::uno::Reference< css::xml:
{
if( xAttrList->getValueByIndex( n ) == "application/vnd.sun.star.media" )
mbMedia = true;
-#if HAVE_FEATURE_GLTF
- if( xAttrList->getValueByIndex( n ) == "model/vnd.gltf+json" )
- mbMedia = true;
-#endif
// leave this loop
n = nAttrCount - 1;
}
@@ -3417,7 +3413,6 @@ SvXMLImportContextRef SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPr
if ( !msHyperlink.isEmpty() )
pShapeContext->setHyperlink( msHyperlink );
-#if !HAVE_FEATURE_GLTF
// Ignore gltf model if necessary and so the fallback image will be imported
if( IsXMLToken(rLocalName, XML_PLUGIN ) )
{
@@ -3428,7 +3423,6 @@ SvXMLImportContextRef SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPr
return new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
}
}
-#endif
mxImplContext = xContext;
mbSupportsReplacement = IsXMLToken(rLocalName, XML_OBJECT ) || IsXMLToken(rLocalName, XML_OBJECT_OLE);
diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx
index 4f185fe8d149..950d8645aae8 100644
--- a/xmloff/source/draw/ximpshap.hxx
+++ b/xmloff/source/draw/ximpshap.hxx
@@ -510,9 +510,7 @@ public:
// this is called from the parent group for each unparsed attribute in the attribute list
virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) override;
-#if !HAVE_FEATURE_GLTF
const OUString& getMimeType() const { return maMimeType; }
-#endif
};
// draw:floating-frame