summaryrefslogtreecommitdiff
path: root/vcl/source/filter/GraphicNativeTransform.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-04-21 14:05:01 +0200
committerTomaž Vajngerl <quikee@gmail.com>2013-04-21 21:55:46 +0200
commit8ae05bf7a04c961d82c6436f9d299ff22e2cc05a (patch)
tree74801cc4abc7b03b3fb1c76e620a1adb9539add8 /vcl/source/filter/GraphicNativeTransform.cxx
parent29545247e4bab9f0e0acd7043bfc52880409a310 (diff)
canBeRotated added to ask if native rotation can be performed.
The canBeRotated method was added to determine if a native rotation can be performed for a graphics or not. Change-Id: I026cf6fe4baa4d964d0a2c2b6e36c3b15aa91549
Diffstat (limited to 'vcl/source/filter/GraphicNativeTransform.cxx')
-rw-r--r--vcl/source/filter/GraphicNativeTransform.cxx20
1 files changed, 20 insertions, 0 deletions
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