diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-06-11 12:36:26 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-06-12 21:43:35 +0200 |
commit | fe70101856332663f600df144b39d2638b3d0570 (patch) | |
tree | db4a1ba9353118269eec8738d6c3571bbb1c6d13 /xmloff/source/draw | |
parent | 3d3fc58a32211cf56c5238f2d9f0e86a1eb7ae7e (diff) |
Introduce HAVE_FEATURE_GLTF to enable/disable gltf related code
When it is a release build then enable it only on Windows and
Linux.
Change-Id: I7c462aeb75e6ab60eeaa0fa42ca7853a6369b742
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 66577bac9594..0597ada5694c 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -114,6 +114,8 @@ #include "XMLImageMapExport.hxx" #include <boost/scoped_ptr.hpp> +#include <config_features.h> + using namespace ::com::sun::star; using namespace ::xmloff::EnhancedCustomShapeToken; using namespace ::xmloff::token; @@ -3157,6 +3159,7 @@ lcl_StoreMediaAndGetURL(SvXMLExport & rExport, } } +#if HAVE_FEATURE_GLTF static void lcl_StoreJsonExternalsAndFallback( SvXMLExport& rExport, const uno::Reference<beans::XPropertySet> xPropSet, @@ -3243,6 +3246,7 @@ static void lcl_StoreJsonExternalsAndFallback( } } } +#endif void XMLShapeExport::ImpExportMediaShape( const uno::Reference< drawing::XShape >& xShape, @@ -3270,8 +3274,10 @@ void XMLShapeExport::ImpExportMediaShape( OUString const persistentURL = lcl_StoreMediaAndGetURL(GetExport(), xPropSet, aMediaURL, sMimeType); +#if HAVE_FEATURE_GLTF if( sMimeType == "application/vnd.gltf+json" ) lcl_StoreJsonExternalsAndFallback(GetExport(), xPropSet, aMediaURL); +#endif mrExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, persistentURL ); mrExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 9a17bd220d33..a62eefb167a1 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -82,6 +82,8 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/vector/b2dvector.hxx> +#include <config_features.h> + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing; @@ -3076,10 +3078,12 @@ void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Referen if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( aLocalName, XML_MIME_TYPE ) ) { - if( xAttrList->getValueByIndex( n ).equalsAscii( "application/vnd.sun.star.media" ) || - xAttrList->getValueByIndex( n ).equalsAscii( "application/vnd.gltf+json" )) + if( xAttrList->getValueByIndex( n ).equalsAscii( "application/vnd.sun.star.media" ) ) mbMedia = true; - +#if HAVE_FEATURE_GLTF + if( xAttrList->getValueByIndex( n ).equalsAscii( "application/vnd.gltf+json" ) ) + mbMedia = true; +#endif // leave this loop n = nAttrCount - 1; } @@ -3595,6 +3599,7 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref } } } +#if HAVE_FEATURE_GLTF // For glTF models the fallback image is placed before the real shape. // So we need to remove the fallback image after real shape is detected. else if ( mxImplContext.Is() && IsXMLToken(mxImplContext->GetLocalName(), XML_IMAGE) && @@ -3607,7 +3612,7 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref if( pContext ) removeGraphicFromImportContext(*mxImplContext); } - +#endif // call parent for content if(!pContext) pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); |