diff options
-rw-r--r-- | vcl/inc/vcl/GraphicNativeTransform.hxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/GraphicNativeTransform.cxx | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/vcl/inc/vcl/GraphicNativeTransform.hxx b/vcl/inc/vcl/GraphicNativeTransform.hxx index 6bf83fec0afe..db727a22c5ff 100644 --- a/vcl/inc/vcl/GraphicNativeTransform.hxx +++ b/vcl/inc/vcl/GraphicNativeTransform.hxx @@ -27,13 +27,13 @@ class VCL_DLLPUBLIC GraphicNativeTransform Graphic& mrGraphic; bool rotateJPEG (sal_uInt16 aRotation); - bool rotateSVG (sal_uInt16 aRotation); bool rotateGeneric (sal_uInt16 aRotation, OUString aType); public: GraphicNativeTransform(Graphic& rGraphic); virtual ~GraphicNativeTransform(); + bool canBeRotated(); bool rotate(sal_uInt16 aRotation); }; diff --git a/vcl/source/filter/GraphicNativeTransform.cxx b/vcl/source/filter/GraphicNativeTransform.cxx index d6790031c3f0..cf24d6ab018a 100644 --- a/vcl/source/filter/GraphicNativeTransform.cxx +++ b/vcl/source/filter/GraphicNativeTransform.cxx @@ -35,6 +35,26 @@ GraphicNativeTransform::GraphicNativeTransform(Graphic& rGraphic) : GraphicNativeTransform::~GraphicNativeTransform() {} +bool GraphicNativeTransform::canBeRotated() +{ + GfxLink aLink = mrGraphic.GetLink(); + + // Don't allow rotation on animations for now + if (mrGraphic.IsAnimated()) + { + return false; + } + + if ( aLink.GetType() == GFX_LINK_TYPE_NATIVE_JPG + || aLink.GetType() == GFX_LINK_TYPE_NATIVE_PNG + || aLink.GetType() == GFX_LINK_TYPE_NATIVE_GIF) + { + return true; + } + + return false; +} + bool GraphicNativeTransform::rotate(sal_uInt16 aInputRotation) { // Rotation can be between 0 and 3600 |