diff options
Diffstat (limited to 'oox/source/drawingml/misccontexts.cxx')
-rw-r--r-- | oox/source/drawingml/misccontexts.cxx | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/oox/source/drawingml/misccontexts.cxx b/oox/source/drawingml/misccontexts.cxx index 2eef9ab6133a..244d17d9fc62 100644 --- a/oox/source/drawingml/misccontexts.cxx +++ b/oox/source/drawingml/misccontexts.cxx @@ -369,7 +369,7 @@ ContextHandlerRef BlipContext::onCreateContext( return new DuotoneContext( *this, mrBlipProps ); case A_TOKEN( extLst ): - return new BlipExtensionContext( *this, mrBlipProps ); + return new BlipExtensionContext(*this, mrBlipProps, mpBlipFill); case A_TOKEN( lum ): { @@ -598,9 +598,10 @@ SimpleFillPropertiesContext::~SimpleFillPropertiesContext() mrColor = getBestSolidColor(); } -BlipExtensionContext::BlipExtensionContext( ContextHandler2Helper const & rParent, BlipFillProperties& rBlipProps ) : - ContextHandler2( rParent ), - mrBlipProps( rBlipProps ) +BlipExtensionContext::BlipExtensionContext(ContextHandler2Helper const & rParent, BlipFillProperties& rBlipProps, model::BlipFill* pBlipFill) + : ContextHandler2(rParent) + , mrBlipProps(rBlipProps) + , mpBlipFill(pBlipFill) { } @@ -608,16 +609,32 @@ BlipExtensionContext::~BlipExtensionContext() { } -ContextHandlerRef BlipExtensionContext::onCreateContext( - sal_Int32 nElement, const AttributeList& ) +ContextHandlerRef BlipExtensionContext::onCreateContext(sal_Int32 nElement, const AttributeList& rAttribs) { switch( nElement ) { - case A_TOKEN( ext ): - return new BlipExtensionContext( *this, mrBlipProps ); + case A_TOKEN(ext): + return new BlipExtensionContext(*this, mrBlipProps, mpBlipFill); + + case OOX_TOKEN(a14, imgProps): + return new ArtisticEffectContext(*this, mrBlipProps.maEffect); - case OOX_TOKEN( a14, imgProps ): - return new ArtisticEffectContext( *this, mrBlipProps.maEffect ); + case OOX_TOKEN(asvg, svgBlip): + { + if (rAttribs.hasAttribute(R_TOKEN(embed))) + { + // internal picture URL + OUString aFragmentPath = getFragmentPathFromRelId(rAttribs.getStringDefaulted(R_TOKEN(embed))); + if (!aFragmentPath.isEmpty()) + { + auto xGraphic = getFilter().getGraphicHelper().importEmbeddedGraphic(aFragmentPath); + mrBlipProps.mxFillGraphic = xGraphic; + if (mpBlipFill) + mpBlipFill->mxGraphic = xGraphic; + } + } + } + break; } return nullptr; } |