summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/oox/drawingml/fillproperties.hxx26
-rw-r--r--include/oox/drawingml/fillpropertiesgroupcontext.hxx42
-rw-r--r--include/oox/export/drawingml.hxx4
-rw-r--r--include/oox/ole/oleobjecthelper.hxx3
-rw-r--r--oox/source/drawingml/fillproperties.cxx205
-rw-r--r--oox/source/drawingml/fillpropertiesgroupcontext.cxx82
-rw-r--r--oox/source/drawingml/shape.cxx5
-rw-r--r--oox/source/export/drawingml.cxx100
-rw-r--r--oox/source/token/namespaces-strict.txt1
-rw-r--r--oox/source/token/namespaces.txt1
-rw-r--r--oox/source/token/tokens.txt43
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx1
-rw-r--r--sw/qa/extras/ooxmlexport/data/picture-artistic-effects-preservation.docxbin0 -> 17272 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx99
-rw-r--r--writerfilter/CustomTarget_source.mk1
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx3
-rw-r--r--writerfilter/source/ooxml/model.xml412
17 files changed, 1026 insertions, 2 deletions
diff --git a/include/oox/drawingml/fillproperties.hxx b/include/oox/drawingml/fillproperties.hxx
index 447cba2fa76c..dcf3afbfd230 100644
--- a/include/oox/drawingml/fillproperties.hxx
+++ b/include/oox/drawingml/fillproperties.hxx
@@ -26,6 +26,7 @@
#include <oox/drawingml/color.hxx>
#include <oox/helper/helper.hxx>
#include <oox/drawingml/embeddedwavaudiofile.hxx>
+#include <oox/ole/oleobjecthelper.hxx>
namespace oox {
class GraphicHelper;
@@ -65,6 +66,29 @@ struct PatternFillProperties
void assignUsed( const PatternFillProperties& rSourceProps );
};
+struct ArtisticEffectProperties
+{
+ OUString msName;
+ std::map< OUString, css::uno::Any >
+ maAttribs;
+ ::oox::ole::OleObjectInfo mrOleObjectInfo; /// The original graphic as embedded object.
+
+ bool isEmpty() const;
+
+ /** Returns the struct as a PropertyValue with Name = msName and
+ * Value = maAttribs as a Sequence< PropertyValue >. */
+ css::beans::PropertyValue getEffect();
+
+ /** Overwrites all members that are explicitly set in rSourceProps. */
+ void assignUsed( const ArtisticEffectProperties& rSourceProps );
+
+ /** Translate effect tokens to strings. */
+ static OUString getEffectString( sal_Int32 nToken );
+
+ /** Translate effect strings to tokens. */
+ static sal_Int32 getEffectToken( OUString sName );
+};
+
struct BlipFillProperties
{
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
@@ -89,6 +113,8 @@ struct BlipFillProperties
Color maColorChangeTo; /// Destination color of color transformation.
Color maDuotoneColors[2]; /// Duotone Colors
+ ArtisticEffectProperties maEffect; /// Artistic effect, not supported by core.
+
/** Overwrites all members that are explicitly set in rSourceProps. */
void assignUsed( const BlipFillProperties& rSourceProps );
};
diff --git a/include/oox/drawingml/fillpropertiesgroupcontext.hxx b/include/oox/drawingml/fillpropertiesgroupcontext.hxx
index bbeed0837903..aae88df408be 100644
--- a/include/oox/drawingml/fillpropertiesgroupcontext.hxx
+++ b/include/oox/drawingml/fillpropertiesgroupcontext.hxx
@@ -78,6 +78,48 @@ private:
+/** Context handler that imports a14:imgProps, a14:imgLayer, a14:imgEffect containers
+ and the a14:artistic* effect tags defined in the MS-ODRAWXML extension. */
+class ArtisticEffectContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit ArtisticEffectContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ ArtisticEffectProperties& rEffect );
+ virtual ~ArtisticEffectContext();
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext(
+ sal_Int32 nElement,
+ const ::oox::AttributeList& rAttribs ) SAL_OVERRIDE;
+
+private:
+ ArtisticEffectProperties& maEffect;
+};
+
+
+
+/** Context handler that imports the a:extLst element inside a:blip and its
+ children a:ext, which can contain transformations to the bitmap. */
+class BlipExtensionContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit BlipExtensionContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ BlipFillProperties& rBlipProps );
+ virtual ~BlipExtensionContext();
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext(
+ sal_Int32 nElement,
+ const ::oox::AttributeList& rAttribs ) SAL_OVERRIDE;
+
+private:
+ BlipFillProperties& mrBlipProps;
+};
+
+
+
/** Context handler that imports the a:duotone element containing the colors
of a bitmap duotone transformation. */
class DuotoneContext : public ::oox::core::ContextHandler2
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index 86e3d0769449..e97f05da8cf5 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -82,6 +82,8 @@ public:
private:
static int mnImageCounter;
+ static int mnWdpImageCounter;
+ static std::map<OUString, OUString> maWdpCache;
/// To specify where write eg. the images to (like 'ppt', or 'word' - according to the OPC).
DocumentType meDocumentType;
@@ -176,6 +178,8 @@ public:
void WriteShapeEffects( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
void WriteShapeEffect( const OUString& sName, const css::uno::Sequence< css::beans::PropertyValue >& aEffectProps );
void WriteShape3DEffects( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
+ void WriteArtisticEffect( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
+ OString WriteWdpPicture( const OUString& rFileId, const ::com::sun::star::uno::Sequence< sal_Int8 >& rPictureData );
static void ResetCounters();
diff --git a/include/oox/ole/oleobjecthelper.hxx b/include/oox/ole/oleobjecthelper.hxx
index a723949f539c..ef32483d74ab 100644
--- a/include/oox/ole/oleobjecthelper.hxx
+++ b/include/oox/ole/oleobjecthelper.hxx
@@ -20,6 +20,7 @@
#ifndef INCLUDED_OOX_OLE_OLEOBJECTHELPER_HXX
#define INCLUDED_OOX_OLE_OLEOBJECTHELPER_HXX
+#include <oox/dllapi.h>
#include <oox/helper/binarystreambase.hxx>
namespace com { namespace sun { namespace star {
@@ -36,7 +37,7 @@ namespace ole {
/** Contains generic information about an OLE object. */
-struct OleObjectInfo
+struct OOX_DLLPUBLIC OleObjectInfo
{
StreamDataSequence maEmbeddedData; ///< Data of an embedded OLE object.
OUString maTargetLink; ///< Path to external data for linked OLE object.
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 6ae078a46465..96770425b047 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -205,6 +205,7 @@ void BlipFillProperties::assignUsed( const BlipFillProperties& rSourceProps )
maColorChangeTo.assignIfUsed( rSourceProps.maColorChangeTo );
maDuotoneColors[0].assignIfUsed( rSourceProps.maDuotoneColors[0] );
maDuotoneColors[1].assignIfUsed( rSourceProps.maDuotoneColors[1] );
+ maEffect.assignUsed( rSourceProps.maEffect );
}
@@ -596,6 +597,210 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
rPropMap.setProperty(PROP_MediaURL, maAudio.msEmbed);
}
+bool ArtisticEffectProperties::isEmpty() const
+{
+ return msName.isEmpty();
+}
+
+css::beans::PropertyValue ArtisticEffectProperties::getEffect()
+{
+ css::beans::PropertyValue pRet;
+ if( msName.isEmpty() )
+ return pRet;
+
+ css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() + 1 );
+ sal_uInt32 i = 0;
+ for( std::map< OUString, css::uno::Any >::iterator it = maAttribs.begin(); it != maAttribs.end(); ++it )
+ {
+ aSeq[i].Name = it->first;
+ aSeq[i].Value = it->second;
+ i++;
+ }
+
+ if( mrOleObjectInfo.maEmbeddedData.hasElements() )
+ {
+ css::uno::Sequence< css::beans::PropertyValue > aGraphicSeq( 2 );
+ aGraphicSeq[0].Name = "Id";
+ aGraphicSeq[0].Value = uno::makeAny( mrOleObjectInfo.maProgId );
+ aGraphicSeq[1].Name = "Data";
+ aGraphicSeq[1].Value = uno::makeAny( mrOleObjectInfo.maEmbeddedData );
+
+ aSeq[i].Name = "OriginalGraphic";
+ aSeq[i].Value = uno::makeAny( aGraphicSeq );
+ }
+
+ pRet.Name = msName;
+ pRet.Value = css::uno::Any( aSeq );
+
+ return pRet;
+}
+
+void ArtisticEffectProperties::assignUsed( const ArtisticEffectProperties& rSourceProps )
+{
+ if( !rSourceProps.isEmpty() )
+ {
+ msName = rSourceProps.msName;
+ maAttribs = rSourceProps.maAttribs;
+ }
+}
+
+OUString ArtisticEffectProperties::getEffectString( sal_Int32 nToken )
+{
+ switch( nToken )
+ {
+ // effects
+ case OOX_TOKEN( a14, artisticBlur ): return OUString( "artisticBlur" );
+ case OOX_TOKEN( a14, artisticCement ): return OUString( "artisticCement" );
+ case OOX_TOKEN( a14, artisticChalkSketch ): return OUString( "artisticChalkSketch" );
+ case OOX_TOKEN( a14, artisticCrisscrossEtching ): return OUString( "artisticCrisscrossEtching" );
+ case OOX_TOKEN( a14, artisticCutout ): return OUString( "artisticCutout" );
+ case OOX_TOKEN( a14, artisticFilmGrain ): return OUString( "artisticFilmGrain" );
+ case OOX_TOKEN( a14, artisticGlass ): return OUString( "artisticGlass" );
+ case OOX_TOKEN( a14, artisticGlowDiffused ): return OUString( "artisticGlowDiffused" );
+ case OOX_TOKEN( a14, artisticGlowEdges ): return OUString( "artisticGlowEdges" );
+ case OOX_TOKEN( a14, artisticLightScreen ): return OUString( "artisticLightScreen" );
+ case OOX_TOKEN( a14, artisticLineDrawing ): return OUString( "artisticLineDrawing" );
+ case OOX_TOKEN( a14, artisticMarker ): return OUString( "artisticMarker" );
+ case OOX_TOKEN( a14, artisticMosiaicBubbles ): return OUString( "artisticMosiaicBubbles" );
+ case OOX_TOKEN( a14, artisticPaintStrokes ): return OUString( "artisticPaintStrokes" );
+ case OOX_TOKEN( a14, artisticPaintBrush ): return OUString( "artisticPaintBrush" );
+ case OOX_TOKEN( a14, artisticPastelsSmooth ): return OUString( "artisticPastelsSmooth" );
+ case OOX_TOKEN( a14, artisticPencilGrayscale ): return OUString( "artisticPencilGrayscale" );
+ case OOX_TOKEN( a14, artisticPencilSketch ): return OUString( "artisticPencilSketch" );
+ case OOX_TOKEN( a14, artisticPhotocopy ): return OUString( "artisticPhotocopy" );
+ case OOX_TOKEN( a14, artisticPlasticWrap ): return OUString( "artisticPlasticWrap" );
+ case OOX_TOKEN( a14, artisticTexturizer ): return OUString( "artisticTexturizer" );
+ case OOX_TOKEN( a14, artisticWatercolorSponge ): return OUString( "artisticWatercolorSponge" );
+ case OOX_TOKEN( a14, artisticBrightnessContrast ): return OUString( "artisticBrightnessContrast" );
+ case OOX_TOKEN( a14, artisticColorTemperature ): return OUString( "artisticColorTemperature" );
+ case OOX_TOKEN( a14, artisticSaturation ): return OUString( "artisticSaturation" );
+ case OOX_TOKEN( a14, artisticSharpenSoften ): return OUString( "artisticSharpenSoften" );
+
+ // attributes
+ case XML_visible: return OUString( "visible" );
+ case XML_trans: return OUString( "trans" );
+ case XML_crackSpacing: return OUString( "crackSpacing" );
+ case XML_pressure: return OUString( "pressure" );
+ case XML_numberOfShades: return OUString( "numberOfShades" );
+ case XML_grainSize: return OUString( "grainSize" );
+ case XML_intensity: return OUString( "intensity" );
+ case XML_smoothness: return OUString( "smoothness" );
+ case XML_gridSize: return OUString( "gridSize" );
+ case XML_pencilSize: return OUString( "pencilSize" );
+ case XML_size: return OUString( "size" );
+ case XML_brushSize: return OUString( "brushSize" );
+ case XML_scaling: return OUString( "scaling" );
+ case XML_detail: return OUString( "detail" );
+ case XML_bright: return OUString( "bright" );
+ case XML_contrast: return OUString( "contrast" );
+ case XML_colorTemp: return OUString( "colorTemp" );
+ case XML_sat: return OUString( "sat" );
+ case XML_amount: return OUString( "amount" );
+ }
+ SAL_WARN( "oox.drawingml", "ArtisticEffectProperties::getEffectString - unexpected token" );
+ return OUString();
+}
+
+sal_Int32 ArtisticEffectProperties::getEffectToken( OUString sName )
+{
+ // effects
+ if( sName == "artisticBlur" )
+ return XML_artisticBlur;
+ else if( sName == "artisticCement" )
+ return XML_artisticCement;
+ else if( sName == "artisticChalkSketch" )
+ return XML_artisticChalkSketch;
+ else if( sName == "artisticCrisscrossEtching" )
+ return XML_artisticCrisscrossEtching;
+ else if( sName == "artisticCutout" )
+ return XML_artisticCutout;
+ else if( sName == "artisticFilmGrain" )
+ return XML_artisticFilmGrain;
+ else if( sName == "artisticGlass" )
+ return XML_artisticGlass;
+ else if( sName == "artisticGlowDiffused" )
+ return XML_artisticGlowDiffused;
+ else if( sName == "artisticGlowEdges" )
+ return XML_artisticGlowEdges;
+ else if( sName == "artisticLightScreen" )
+ return XML_artisticLightScreen;
+ else if( sName == "artisticLineDrawing" )
+ return XML_artisticLineDrawing;
+ else if( sName == "artisticMarker" )
+ return XML_artisticMarker;
+ else if( sName == "artisticMosiaicBubbles" )
+ return XML_artisticMosiaicBubbles;
+ else if( sName == "artisticPaintStrokes" )
+ return XML_artisticPaintStrokes;
+ else if( sName == "artisticPaintBrush" )
+ return XML_artisticPaintBrush;
+ else if( sName == "artisticPastelsSmooth" )
+ return XML_artisticPastelsSmooth;
+ else if( sName == "artisticPencilGrayscale" )
+ return XML_artisticPencilGrayscale;
+ else if( sName == "artisticPencilSketch" )
+ return XML_artisticPencilSketch;
+ else if( sName == "artisticPhotocopy" )
+ return XML_artisticPhotocopy;
+ else if( sName == "artisticPlasticWrap" )
+ return XML_artisticPlasticWrap;
+ else if( sName == "artisticTexturizer" )
+ return XML_artisticTexturizer;
+ else if( sName == "artisticWatercolorSponge" )
+ return XML_artisticWatercolorSponge;
+ else if( sName == "artisticBrightnessContrast" )
+ return XML_artisticBrightnessContrast;
+ else if( sName == "artisticColorTemperature" )
+ return XML_artisticColorTemperature;
+ else if( sName == "artisticSaturation" )
+ return XML_artisticSaturation;
+ else if( sName == "artisticSharpenSoften" )
+ return XML_artisticSharpenSoften;
+
+ // attributes
+ else if( sName == "visible" )
+ return XML_visible;
+ else if( sName == "trans" )
+ return XML_trans;
+ else if( sName == "crackSpacing" )
+ return XML_crackSpacing;
+ else if( sName == "pressure" )
+ return XML_pressure;
+ else if( sName == "numberOfShades" )
+ return XML_numberOfShades;
+ else if( sName == "grainSize" )
+ return XML_grainSize;
+ else if( sName == "intensity" )
+ return XML_intensity;
+ else if( sName == "smoothness" )
+ return XML_smoothness;
+ else if( sName == "gridSize" )
+ return XML_gridSize;
+ else if( sName == "pencilSize" )
+ return XML_pencilSize;
+ else if( sName == "size" )
+ return XML_size;
+ else if( sName == "brushSize" )
+ return XML_brushSize;
+ else if( sName == "scaling" )
+ return XML_scaling;
+ else if( sName == "detail" )
+ return XML_detail;
+ else if( sName == "bright" )
+ return XML_bright;
+ else if( sName == "contrast" )
+ return XML_contrast;
+ else if( sName == "colorTemp" )
+ return XML_colorTemp;
+ else if( sName == "sat" )
+ return XML_sat;
+ else if( sName == "amount" )
+ return XML_amount;
+
+ SAL_WARN( "oox.drawingml", "ArtisticEffectProperties::getEffectToken - unexpected token name" );
+ return XML_none;
+}
+
} // namespace drawingml
diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
index 89fdb26f7b74..e60f68947738 100644
--- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx
+++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
@@ -182,6 +182,9 @@ ContextHandlerRef BlipContext::onCreateContext(
case A_TOKEN( duotone ):
return new DuotoneContext( *this, rAttribs, mrBlipProps );
+ case A_TOKEN( extLst ):
+ return new BlipExtensionContext( *this, mrBlipProps );
+
case A_TOKEN( lum ):
mrBlipProps.moBrightness = rAttribs.getInteger( XML_bright );
mrBlipProps.moContrast = rAttribs.getInteger( XML_contrast );
@@ -292,6 +295,85 @@ SimpleFillPropertiesContext::~SimpleFillPropertiesContext()
mrColor = getBestSolidColor();
}
+BlipExtensionContext::BlipExtensionContext( ContextHandler2Helper& rParent, BlipFillProperties& rBlipProps ) :
+ ContextHandler2( rParent ),
+ mrBlipProps( rBlipProps )
+{
+}
+
+BlipExtensionContext::~BlipExtensionContext()
+{
+}
+
+ContextHandlerRef BlipExtensionContext::onCreateContext(
+ sal_Int32 nElement, const AttributeList& )
+{
+ switch( nElement )
+ {
+ case A_TOKEN( ext ):
+ return new BlipExtensionContext( *this, mrBlipProps );
+
+ case OOX_TOKEN( a14, imgProps ):
+ return new ArtisticEffectContext( *this, mrBlipProps.maEffect );
+ }
+ return 0;
+}
+
+ArtisticEffectContext::ArtisticEffectContext( ContextHandler2Helper& rParent, ArtisticEffectProperties& rEffect ) :
+ ContextHandler2( rParent ),
+ maEffect( rEffect )
+{
+}
+
+ArtisticEffectContext::~ArtisticEffectContext()
+{
+}
+
+ContextHandlerRef ArtisticEffectContext::onCreateContext(
+ sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ // containers
+ if( nElement == OOX_TOKEN( a14, imgLayer ) )
+ {
+ if( rAttribs.hasAttribute( R_TOKEN( embed ) ) )
+ {
+ OUString aFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( embed ), OUString() ) );
+ if( !aFragmentPath.isEmpty() )
+ {
+ getFilter().importBinaryData( maEffect.mrOleObjectInfo.maEmbeddedData, aFragmentPath );
+ maEffect.mrOleObjectInfo.maProgId = aFragmentPath;
+ }
+ }
+ return new ArtisticEffectContext( *this, maEffect );
+ }
+ if( nElement == OOX_TOKEN( a14, imgEffect ) )
+ return new ArtisticEffectContext( *this, maEffect );
+
+ // effects
+ maEffect.msName = ArtisticEffectProperties::getEffectString( nElement );
+ if( maEffect.isEmpty() )
+ return 0;
+
+ // effect attributes
+ sal_Int32 aAttribs[19] = {
+ XML_visible, XML_trans, XML_crackSpacing, XML_pressure, XML_numberOfShades,
+ XML_grainSize, XML_intensity, XML_smoothness, XML_gridSize, XML_pencilSize,
+ XML_size, XML_brushSize, XML_scaling, XML_detail, XML_bright, XML_contrast,
+ XML_colorTemp, XML_sat, XML_amount
+ };
+ for( sal_Int32 i=0; i<19; ++i )
+ {
+ if( rAttribs.hasAttribute( aAttribs[i] ) )
+ {
+ OUString sName = ArtisticEffectProperties::getEffectString( aAttribs[i] );
+ if( !sName.isEmpty() )
+ maEffect.maAttribs[sName] = uno::makeAny( rAttribs.getInteger( aAttribs[i], 0 ) );
+ }
+ }
+
+ return 0;
+}
+
} // namespace drawingml
} // namespace oox
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index ca42d4a5d9f1..8c97b8781473 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -960,6 +960,11 @@ Reference< XShape > Shape::createAndInsert(
PUT_PROP( a3DEffectsGrabBag, 2, "Shape3D", Any( aShape3DEffects ) );
putPropertyToGrabBag( "3DEffectProperties", Any( a3DEffectsGrabBag ) );
}
+
+ // store bitmap artistic effects in the grab bag
+ if( !mpGraphicPropertiesPtr->maBlipProps.maEffect.isEmpty() )
+ putPropertyToGrabBag( "ArtisticEffectProperties",
+ Any( mpGraphicPropertiesPtr->maBlipProps.maEffect.getEffect() ) );
}
else if( mbLockedCanvas )
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 037466ad9eaf..05faa6d696bc 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -23,6 +23,7 @@
#include "oox/export/drawingml.hxx"
#include "oox/export/utils.hxx"
#include <oox/drawingml/color.hxx>
+#include <oox/drawingml/fillproperties.hxx>
#include <oox/token/tokens.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
@@ -118,10 +119,14 @@ namespace drawingml {
// not thread safe
int DrawingML::mnImageCounter = 1;
+int DrawingML::mnWdpImageCounter = 1;
+std::map<OUString, OUString> DrawingML::maWdpCache;
void DrawingML::ResetCounters()
{
mnImageCounter = 1;
+ mnWdpImageCounter = 1;
+ maWdpCache.clear();
}
bool DrawingML::GetProperty( Reference< XPropertySet > rXPropSet, const OUString& aName )
@@ -836,6 +841,7 @@ OUString DrawingML::WriteBlip( Reference< XPropertySet > rXPropSet, const OUStri
XML_bright, nBright ? I32S( nBright*1000 ) : NULL,
XML_contrast, nContrast ? I32S( nContrast*1000 ) : NULL,
FSEND );
+ WriteArtisticEffect( rXPropSet );
mpFS->endElementNS( XML_a, XML_blip );
@@ -2565,6 +2571,100 @@ void DrawingML::WriteShape3DEffects( Reference< XPropertySet > xPropSet )
mpFS->endElementNS( XML_a, XML_sp3d );
}
+void DrawingML::WriteArtisticEffect( Reference< XPropertySet > rXPropSet )
+{
+ if( !GetProperty( rXPropSet, "InteropGrabBag" ) )
+ return;
+
+ PropertyValue aEffect;
+ Sequence< PropertyValue > aGrabBag;
+ mAny >>= aGrabBag;
+ for( sal_Int32 i=0; i < aGrabBag.getLength(); ++i )
+ {
+ if( aGrabBag[i].Name == "ArtisticEffectProperties" )
+ {
+ aGrabBag[i].Value >>= aEffect;
+ break;
+ }
+ }
+ sal_Int32 nEffectToken = ArtisticEffectProperties::getEffectToken( aEffect.Name );
+ if( nEffectToken == XML_none )
+ return;
+
+ Sequence< PropertyValue > aAttrs;
+ aEffect.Value >>= aAttrs;
+ sax_fastparser::FastAttributeList *aAttrList = mpFS->createAttrList();
+ OString sRelId;
+ for( sal_Int32 i=0; i < aAttrs.getLength(); ++i )
+ {
+ sal_Int32 nToken = ArtisticEffectProperties::getEffectToken( aAttrs[i].Name );
+ if( nToken != XML_none )
+ {
+ sal_Int32 nVal = 0;
+ aAttrs[i].Value >>= nVal;
+ aAttrList->add( nToken, OString::number( nVal ).getStr() );
+ }
+ else if( aAttrs[i].Name == "OriginalGraphic" )
+ {
+ Sequence< PropertyValue > aGraphic;
+ aAttrs[i].Value >>= aGraphic;
+ Sequence< sal_Int8 > aGraphicData;
+ OUString sGraphicId;
+ for( sal_Int32 j=0; j < aGraphic.getLength(); ++j )
+ {
+ if( aGraphic[j].Name == "Id" )
+ aGraphic[j].Value >>= sGraphicId;
+ else if( aGraphic[j].Name == "Data" )
+ aGraphic[j].Value >>= aGraphicData;
+ }
+ sRelId = WriteWdpPicture( sGraphicId, aGraphicData );
+ }
+ }
+
+ mpFS->startElementNS( XML_a, XML_extLst, FSEND );
+ mpFS->startElementNS( XML_a, XML_ext,
+ XML_uri, "{BEBA8EAE-BF5A-486C-A8C5-ECC9F3942E4B}",
+ FSEND );
+ mpFS->startElementNS( XML_a14, XML_imgProps,
+ FSNS( XML_xmlns, XML_a14 ), "http://schemas.microsoft.com/office/drawing/2010/main",
+ FSEND );
+ mpFS->startElementNS( XML_a14, XML_imgLayer,
+ FSNS( XML_r, XML_embed), sRelId.getStr(),
+ FSEND );
+ mpFS->startElementNS( XML_a14, XML_imgEffect, FSEND );
+
+ sax_fastparser::XFastAttributeListRef xAttrList( aAttrList );
+ mpFS->singleElementNS( XML_a14, nEffectToken, xAttrList );
+
+ mpFS->endElementNS( XML_a14, XML_imgEffect );
+ mpFS->endElementNS( XML_a14, XML_imgLayer );
+ mpFS->endElementNS( XML_a14, XML_imgProps );
+ mpFS->endElementNS( XML_a, XML_ext );
+ mpFS->endElementNS( XML_a, XML_extLst );
+}
+
+OString DrawingML::WriteWdpPicture( const OUString& rFileId, const Sequence< sal_Int8 >& rPictureData )
+{
+ std::map<OUString, OUString>::iterator aCachedItem = maWdpCache.find( rFileId );
+ if( aCachedItem != maWdpCache.end() )
+ return OUStringToOString( aCachedItem->second, RTL_TEXTENCODING_UTF8 );
+
+ OUString sFileName = "media/hdphoto" + OUString::number( mnWdpImageCounter++ ) + ".wdp";
+ uno::Reference< io::XOutputStream > xOutStream =
+ mpFB->openFragmentStream( "word/" + sFileName,
+ "image/vnd.ms-photo" );
+ OUString sId;
+ xOutStream->writeBytes( rPictureData );
+ xOutStream->closeOutput();
+
+ sId = mpFB->addRelation( mpFS->getOutputStream(),
+ "http://schemas.microsoft.com/office/2007/relationships/hdphoto",
+ sFileName, false );
+
+ maWdpCache[rFileId] = sId;
+ return OUStringToOString( sId, RTL_TEXTENCODING_UTF8 );
+}
+
}
}
diff --git a/oox/source/token/namespaces-strict.txt b/oox/source/token/namespaces-strict.txt
index 9549483ec280..d49be5eed128 100644
--- a/oox/source/token/namespaces-strict.txt
+++ b/oox/source/token/namespaces-strict.txt
@@ -75,6 +75,7 @@ wps http://schemas.microsoft.com/office/word/2010/wordproces
wpg http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
wp14 http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
w14 http://schemas.microsoft.com/office/word/2010/wordml
+a14 http://schemas.microsoft.com/office/drawingml/2010/main
# extlst namespaces
diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt
index 6f0bee242736..63c0ce6af2f2 100644
--- a/oox/source/token/namespaces.txt
+++ b/oox/source/token/namespaces.txt
@@ -75,6 +75,7 @@ wps http://schemas.microsoft.com/office/word/2010/wordproces
wpg http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
wp14 http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
w14 http://schemas.microsoft.com/office/word/2010/wordml
+a14 http://schemas.microsoft.com/office/drawingml/2010/main
# extlst namespaces
diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt
index bab7cf1dc859..1bdca90e2147 100644
--- a/oox/source/token/tokens.txt
+++ b/oox/source/token/tokens.txt
@@ -414,6 +414,7 @@ YZ
Year
YearAccessed
ZX
+a14
a
aa
above
@@ -560,6 +561,7 @@ always
alwaysMergeEmptyNamespace
alwaysShow
alwaysShowPlaceholderText
+amount
amt
anchor
anchorCtr
@@ -640,6 +642,33 @@ array
arrow
arrowok
artDeco
+artisticBlur
+artisticCement
+artisticChalkSketch
+artisticCrisscrossEtching
+artisticCutout
+artisticFilmGrain
+artisticGlass
+artisticGlowDiffused
+artisticGlowEdges
+artisticLightScreen
+artisticLineDrawing
+artisticMarker
+artisticMosiaicBubbles
+artisticPaintStrokes
+artisticPaintBrush
+artisticPastelsSmooth
+artisticPencilGrayscale
+artisticPencilSketch
+artisticPhotocopy
+artisticPlasticWrap
+artisticTexturizer
+artisticWatercolorSponge
+artisticBackgroundRemoval
+artisticBrightnessContrast
+artisticColorTemperature
+artisticSaturation
+artisticSharpenSoften
asDisplayed
ascending
ascendingAlpha
@@ -947,6 +976,7 @@ brkBinSub
brown
browse
browser
+brushSize
bstr
btLr
btnFace
@@ -1257,6 +1287,7 @@ color2
colorFilter
colorId
colorScale
+colorTemp
colormenu
colormode
colormru
@@ -1390,6 +1421,7 @@ cover
coverPg
cp
cr
+crackSpacing
crashSave
crazyMaze
created
@@ -1729,6 +1761,7 @@ destId
destOrd
destination
destinationFile
+detail
detectmouseclick
dgm
dgmbasetextscale
@@ -2430,6 +2463,7 @@ gradientInactiveCaption
gradientRadial
gradientUnscaled
gradientshapeok
+grainSize
gramEnd
gramStart
grammar
@@ -2471,6 +2505,7 @@ gridDropZones
gridLegend
gridLines
gridLinesSet
+gridSize
gridSpacing
gridSpan
group
@@ -2732,7 +2767,10 @@ imagedata
imagesize
imeMode
img
+imgEffect
imgH
+imgLayer
+imgProps
imgSz
imgW
immersive
@@ -2795,6 +2833,7 @@ intLim
intVal
integer
integrated
+intensity
interSp
interactiveSeq
intercept
@@ -3568,6 +3607,7 @@ numStyleLink
numTab
number
numberInDash
+numberOfShades
numberStoredAsText
numbering
numberingChange
@@ -3839,6 +3879,7 @@ pctPosVOffset
pctWidth
peachPuff
penClr
+pencilSize
pencils
pentagon
people
@@ -4002,6 +4043,7 @@ preserveSortFilterLayout
presetClass
presetID
presetSubtype
+pressure
prev
prevAc
prevCondLst
@@ -4710,6 +4752,7 @@ smartTags
smileyFace
smooth
smoothMarker
+smoothness
smtClean
smtId
snake
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 2c688fdfbb23..da802cff0216 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -613,6 +613,7 @@ protected:
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("ContentType"), BAD_CAST("http://schemas.openxmlformats.org/package/2006/content-types"));
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("lc"), BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas"));
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("extended-properties"), BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("a14"), BAD_CAST("http://schemas.microsoft.com/office/drawing/2010/main"));
}
};
diff --git a/sw/qa/extras/ooxmlexport/data/picture-artistic-effects-preservation.docx b/sw/qa/extras/ooxmlexport/data/picture-artistic-effects-preservation.docx
new file mode 100644
index 000000000000..85f31d8c3211
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/picture-artistic-effects-preservation.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index 2dde9d120825..f3ebd43349a7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
@@ -1338,6 +1338,105 @@ DECLARE_OOXMLEXPORT_TEST(testPictureEffectPreservation, "picture-effects-preserv
"rad", "63500");
}
+DECLARE_OOXMLEXPORT_TEST(testPictureArtisticEffectPreservation, "picture-artistic-effects-preservation.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ xmlDocPtr pRelsDoc = parseExport("word/_rels/document.xml.rels");
+ if (!pXmlDoc || !pRelsDoc)
+ return;
+
+ uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(
+ comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL());
+
+ // 1st picture: marker effect
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
+ "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
+ "a14:artisticMarker",
+ "trans", "14000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
+ "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
+ "a14:artisticMarker",
+ "size", "80");
+
+ OUString sEmbedId1 = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
+ "embed");
+ OUString sXmlPath = "/rels:Relationships/rels:Relationship[@Id='" + sEmbedId1 + "']";
+ OUString sFile = getXPath(pRelsDoc, OUStringToOString( sXmlPath, RTL_TEXTENCODING_UTF8 ), "Target");
+ CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/" + sFile)));
+
+ // 2nd picture: pencil grayscale
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
+ "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
+ "a14:artisticPencilGrayscale",
+ "trans", "15000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
+ "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
+ "a14:artisticPencilGrayscale",
+ "pencilSize", "66");
+
+ OUString sEmbedId2 = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
+ "embed");
+ CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId2);
+
+ // 3rd picture: pencil sketch
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
+ "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
+ "a14:artisticPencilSketch",
+ "trans", "7000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
+ "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
+ "a14:artisticPencilSketch",
+ "pressure", "17");
+
+ OUString sEmbedId3 = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
+ "embed");
+ CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId3);
+
+ // 4th picture: light screen
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
+ "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
+ "a14:artisticLightScreen",
+ "trans", "13000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
+ "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
+ "a14:artisticLightScreen",
+ "gridSize", "1");
+
+ OUString sEmbedId4 = getXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
+ "embed");
+ sXmlPath = "/rels:Relationships/rels:Relationship[@Id='" + sEmbedId4 + "']";
+ sFile = getXPath(pRelsDoc, OUStringToOString( sXmlPath, RTL_TEXTENCODING_UTF8 ), "Target");
+ CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/" + sFile)));
+
+ // 5th picture: watercolor sponge
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
+ "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
+ "a14:artisticWatercolorSponge",
+ "brushSize", "4");
+
+ OUString sEmbedId5 = getXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
+ "embed");
+ CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId5);
+
+ // 6th picture: photocopy (no attributes)
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
+ "a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
+ "a14:artisticPhotocopy", 1);
+
+ OUString sEmbedId6 = getXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
+ "embed");
+ CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId6);
+
+ // no redundant wdp files saved
+ CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("word/media/hdphoto3.wdp")));
+}
+
DECLARE_OOXMLEXPORT_TEST(fdo77719, "fdo77719.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/writerfilter/CustomTarget_source.mk b/writerfilter/CustomTarget_source.mk
index 789a627bdc2e..249ebca5b6bb 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -41,6 +41,7 @@ writerfilter_OOXMLNAMESPACES= \
mce \
wp14 \
w14 \
+ a14 \
wml
writerfilter_ALL = \
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 1d19df08de5b..11f5a73345c2 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -650,7 +650,8 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
{
// if the shape contains effects in the grab bag, we should not transform it
// in a XTextContent so those effects can be preserved
- if( aGrabBag[i].Name == "EffectProperties" || aGrabBag[i].Name == "3DEffectProperties" )
+ if( aGrabBag[i].Name == "EffectProperties" || aGrabBag[i].Name == "3DEffectProperties" ||
+ aGrabBag[i].Name == "ArtisticEffectProperties" )
bContainsEffects = true;
}
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 6f43179712be..36a37f61e736 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -46,6 +46,7 @@
<namespace-alias name="http://schemas.openxmlformats.org/markup-compatibility/2006" alias="mce" id="mce"/>
<namespace-alias name="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" alias="wp14" id="wp14"/>
<namespace-alias name="http://schemas.microsoft.com/office/word/2010/wordml" alias="w14" id="w14"/>
+ <namespace-alias name="http://schemas.microsoft.com/office/drawing/2010/main" alias="a14" id="a14"/>
<namespace-alias name="http://sprm" alias="sprm" id="sprm"/>
<token tokenid="ooxml:shape"/>
<token tokenid="ooxml:token"/>
@@ -6793,6 +6794,417 @@
<element name="cntxtAlts" tokenid="ooxml:cntxtAlts_cntxtAlts"/>
</resource>
</namespace>
+ <namespace name="a14" file="a14.rng">
+ <grammar xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2006/xpath-functions" xmlns="http://relaxng.org/ns/structure/1.0" ns="http://schemas.microsoft.com/office/drawingml/2010/main" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <!-- Simple types -->
+ <define name="ST_ArtisticEffectParam10">
+ <data type="integer">
+ <xs:documentation>Integer value (0 to 10)</xs:documentation>
+ <param name="minInclusive">0</param>
+ <param name="maxInclusive">10</param>
+ </data>
+ </define>
+ <define name="ST_ArtisticEffectParam100">
+ <data type="integer">
+ <xs:documentation>Integer value (0 to 100)</xs:documentation>
+ <param name="minInclusive">0</param>
+ <param name="maxInclusive">100</param>
+ </data>
+ </define>
+ <define name="ST_ArtisticEffectParam4">
+ <data type="integer">
+ <xs:documentation>Integer value (0 to 4)</xs:documentation>
+ <param name="minInclusive">0</param>
+ <param name="maxInclusive">4</param>
+ </data>
+ </define>
+ <define name="ST_ArtisticEffectParam6">
+ <data type="integer">
+ <xs:documentation>Integer value (0 to 6)</xs:documentation>
+ <param name="minInclusive">0</param>
+ <param name="maxInclusive">6</param>
+ </data>
+ </define>
+ <define name="ST_ColorTemperature">
+ <data type="integer">
+ <xs:documentation>Integer value (1500 to 11500)</xs:documentation>
+ <param name="minInclusive">1500</param>
+ <param name="maxInclusive">11500</param>
+ </data>
+ </define>
+ <define name="ST_LegacySpreadsheetColorIndex">
+ <data type="integer">
+ <xs:documentation>Integer value (0 to 80)</xs:documentation>
+ <param name="minInclusive">0</param>
+ <param name="maxInclusive">80</param>
+ </data>
+ </define>
+ <define name="ST_SaturationAmount">
+ <data type="integer">
+ <xs:documentation>Integer value (0 to 400000)</xs:documentation>
+ <param name="minInclusive">0</param>
+ <param name="maxInclusive">400000</param>
+ </data>
+ </define>
+
+ <!-- Complex types for effects -->
+ <define name="CT_PictureEffectBlur">
+ <optional>
+ <attribute name="visible">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectCement">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="crackSpacing">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectChalkSketch">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="pressure">
+ <ref name="ST_ArtisticEffectParam4"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectCrisscrossEtching">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="pressure">
+ <ref name="ST_ArtisticEffectParam4"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectCutout">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="numberOfShades">
+ <ref name="ST_ArtisticEffectParam6"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectFilmGrain">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="grainSize">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectGlass">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="scaling">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectGlowDiffused">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="intensity">
+ <ref name="ST_ArtisticEffectParam10"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectGlowEdges">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="smoothness">
+ <ref name="ST_ArtisticEffectParam10"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectLightScreen">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="gridSize">
+ <ref name="ST_ArtisticEffectParam10"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectLineDrawing">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="pencilSize">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectMarker">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="size">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectMosiaicBubbles">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="pressure">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectPaintStrokes">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="intensity">
+ <ref name="ST_ArtisticEffectParam10"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectPaintBrush">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="brushSize">
+ <ref name="ST_ArtisticEffectParam10"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectPastelsSmooth">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="scaling">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectPencilGrayscale">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="pencilSize">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectPencilSketch">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="pressure">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectPhotocopy">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="detail">
+ <ref name="ST_ArtisticEffectParam10"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectPlasticWrap">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="smoothness">
+ <ref name="ST_ArtisticEffectParam10"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectTexturizer">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="scaling">
+ <ref name="ST_ArtisticEffectParam100"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectWatercolorSponge">
+ <optional>
+ <attribute name="trans">
+ <ref name="a:ST_PositiveFixedPercentage"/>
+ </attribute>
+ <attribute name="brushSize">
+ <ref name="ST_ArtisticEffectParam10"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectBrightnessContrast">
+ <optional>
+ <attribute name="bright">
+ <ref name="a:ST_FixedPercentage"/>
+ </attribute>
+ <attribute name="contrast">
+ <ref name="a:ST_FixedPercentage"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectColorTemperature">
+ <optional>
+ <attribute name="colorTemp">
+ <ref name="ST_ColorTemperature"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectSaturation">
+ <optional>
+ <attribute name="sat">
+ <ref name="ST_SaturationAmount"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureEffectSharpenSoften">
+ <optional>
+ <attribute name="amount">
+ <ref name="ST_FixedPercentage"/>
+ </attribute>
+ </optional>
+ </define>
+
+ <!-- Complex types for containers -->
+ <define name="CT_PictureEffect">
+ <choice>
+ <element name="artisticBlur">
+ <ref name="CT_PictureEffectBlur"/>
+ </element>
+ <element name="artisticCement">
+ <ref name="CT_PictureEffectCement"/>
+ </element>
+ <element name="artisticChalkSketch">
+ <ref name="CT_PictureEffectChalkSketch"/>
+ </element>
+ <element name="artisticCrisscrossEtching">
+ <ref name="CT_PictureEffectCrisscrossEtching"/>
+ </element>
+ <element name="artisticCutout">
+ <ref name="CT_PictureEffectCutout"/>
+ </element>
+ <element name="artisticFilmGrain">
+ <ref name="CT_PictureEffectFilmGrain"/>
+ </element>
+ <element name="artisticGlass">
+ <ref name="CT_PictureEffectGlass"/>
+ </element>
+ <element name="artisticGlowDiffused">
+ <ref name="CT_PictureEffectGlowDiffused"/>
+ </element>
+ <element name="artisticGlowEdges">
+ <ref name="CT_PictureEffectGlowEdges"/>
+ </element>
+ <element name="artisticLightScreen">
+ <ref name="CT_PictureEffectLightScreen"/>
+ </element>
+ <element name="artisticLineDrawing">
+ <ref name="CT_PictureEffectLineDrawing"/>
+ </element>
+ <element name="artisticMarker">
+ <ref name="CT_PictureEffectMarker"/>
+ </element>
+ <element name="artisticMosiaicBubbles">
+ <ref name="CT_PictureEffectMosiaicBubbles"/>
+ </element>
+ <element name="artisticPaintStrokes">
+ <ref name="CT_PictureEffectPaintStrokes"/>
+ </element>
+ <element name="artisticPaintBrush">
+ <ref name="CT_PictureEffectPaintBrush"/>
+ </element>
+ <element name="artisticPastelsSmooth">
+ <ref name="CT_PictureEffectPastelsSmooth"/>
+ </element>
+ <element name="artisticPencilGrayscale">
+ <ref name="CT_PictureEffectPencilGrayscale"/>
+ </element>
+ <element name="artisticPencilSketch">
+ <ref name="CT_PictureEffectPencilSketch"/>
+ </element>
+ <element name="artisticPhotocopy">
+ <ref name="CT_PictureEffectPhotocopy"/>
+ </element>
+ <element name="artisticPlasticWrap">
+ <ref name="CT_PictureEffectPlasticWrap"/>
+ </element>
+ <element name="artisticTexturizer">
+ <ref name="CT_PictureEffectTexturizer"/>
+ </element>
+ <element name="artisticWatercolorSponge">
+ <ref name="CT_PictureEffectWatercolorSponge"/>
+ </element>
+ <element name="artisticBrightnessContrast">
+ <ref name="CT_PictureEffectBrightnessContrast"/>
+ </element>
+ <element name="artisticColorTemperature">
+ <ref name="CT_PictureEffectColorTemperature"/>
+ </element>
+ <element name="artisticSaturation">
+ <ref name="CT_PictureEffectSaturation"/>
+ </element>
+ <element name="artisticSharpenSoften">
+ <ref name="CT_PictureEffectSharpenSoften"/>
+ </element>
+ </choice>
+ <optional>
+ <attribute name="visible">
+ <data type="boolean"/>
+ </attribute>
+ </optional>
+ </define>
+ <define name="CT_PictureLayer">
+ <zeroOrMore>
+ <element name="imgEffect">
+ <ref name="CT_PictureEffect"/>
+ </element>
+ </zeroOrMore>
+ <attribute name="r:embed">
+ <text/>
+ <xs:documentation>Embedded Image Relationship Target</xs:documentation>
+ </attribute>
+ </define>
+ <define name="CT_Photo">
+ <zeroOrMore>
+ <element name="imgLayer">
+ <ref name="CT_PictureLayer"/>
+ </element>
+ </zeroOrMore>
+ </define>
+ </grammar>
+ </namespace>
<namespace name="dml-shapeGeometry" file="dml-shapeGeometry.rng" todo="ignore">
<grammar xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2006/xpath-functions" xmlns="http://relaxng.org/ns/structure/1.0" ns="http://schemas.openxmlformats.org/drawingml/2006/main" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<!-- ISO RELAX NG Schema -->