diff options
Diffstat (limited to 'vcl/source/gdi/impgraph.cxx')
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 64 |
1 files changed, 61 insertions, 3 deletions
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index bf99364a0f64..84e962bd2f6e 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -28,22 +28,26 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" + #include <tools/vcompat.hxx> #include <tools/urlobj.hxx> #include <tools/debug.hxx> +#include <tools/stream.hxx> + #include <ucbhelper/content.hxx> + #include <unotools/ucbstreamhelper.hxx> #include <unotools/tempfile.hxx> #include <vcl/outdev.hxx> #include <vcl/virdev.hxx> -#include <tools/debug.hxx> -#include <tools/stream.hxx> -#include <vcl/impgraph.hxx> #include <vcl/gfxlink.hxx> #include <vcl/cvtgrf.hxx> #include <vcl/salbtype.hxx> #include <vcl/graph.hxx> #include <vcl/metaact.hxx> + +#include <impgraph.hxx> + #include <com/sun/star/ucb/CommandAbortedException.hpp> // ----------- @@ -479,6 +483,48 @@ sal_Bool ImpGraphic::ImplIsAnimated() const // ------------------------------------------------------------------------ +sal_Bool ImpGraphic::ImplIsEPS() const +{ + return( ( meType == GRAPHIC_GDIMETAFILE ) && + ( maMetaFile.GetActionCount() > 0 ) && + ( maMetaFile.GetAction( 0 )->GetType() == META_EPS_ACTION ) ); +} + +// ------------------------------------------------------------------------ + +sal_Bool ImpGraphic::ImplIsRenderGraphic() const +{ + return( ( GRAPHIC_GDIMETAFILE == meType ) && + ( 1 == maMetaFile.GetActionCount() ) && + ( META_RENDERGRAPHIC_ACTION == maMetaFile.GetAction( 0 )->GetType() ) ); +} + +// ------------------------------------------------------------------------ + +sal_Bool ImpGraphic::ImplHasRenderGraphic() const +{ + sal_Bool bRet = sal_False; + + if( GRAPHIC_GDIMETAFILE == meType ) + { + GDIMetaFile& rMtf = const_cast< ImpGraphic* >( this )->maMetaFile; + + for( MetaAction* pAct = rMtf.FirstAction(); pAct && !bRet; pAct = rMtf.NextAction() ) + { + if( META_RENDERGRAPHIC_ACTION == pAct->GetType() ) + { + bRet = sal_True; + } + } + + rMtf.WindStart(); + } + + return( bRet ); +} + +// ------------------------------------------------------------------------ + Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters) const { Bitmap aRetBmp; @@ -591,6 +637,18 @@ Animation ImpGraphic::ImplGetAnimation() const // ------------------------------------------------------------------------ +::vcl::RenderGraphic ImpGraphic::ImplGetRenderGraphic() const +{ + ::vcl::RenderGraphic aRet; + + if( ImplIsRenderGraphic() ) + aRet = static_cast< MetaRenderGraphicAction* >( maMetaFile.GetAction( 0 ) )->GetRenderGraphic(); + + return( aRet ); +} + +// ------------------------------------------------------------------------ + const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const { return maMetaFile; |