summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2012-09-26 21:20:27 +0200
committerTomaž Vajngerl <quikee@gmail.com>2012-09-26 21:22:41 +0200
commit0cd97e8c33c49a6c44d26ba309493dbfec00eb8d (patch)
treef6fa8a08f4564058eaac2238fff075c5769df9b9 /svx
parent70412d0f3f7979d3d069be8121d49dbb96775cce (diff)
Change the image rotation widget to better looking DialControl
Change-Id: Ie11827a924a5b22d86bad24aa7f14a66b870e90c
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/dialcontrol.hxx6
-rw-r--r--svx/source/dialog/dialcontrol.cxx12
2 files changed, 18 insertions, 0 deletions
diff --git a/svx/inc/svx/dialcontrol.hxx b/svx/inc/svx/dialcontrol.hxx
index 4b5c15df84a1..fde436781cf3 100644
--- a/svx/inc/svx/dialcontrol.hxx
+++ b/svx/inc/svx/dialcontrol.hxx
@@ -86,6 +86,12 @@ public:
/** Links the passed numeric edit field to the control (bi-directional). */
void SetLinkedField( NumericField* pField );
+ /** Save value for later comparison */
+ void SaveValue();
+
+ /** Compare value with the saved value */
+ bool IsValueModified();
+
private:
void Init( const Size& rWinSize, const Font& rWinFont );
void Init( const Size& rWinSize );
diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx
index e715a1cf0599..ce44493b2e3a 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -249,6 +249,7 @@ struct DialControl_Impl
Size maWinSize;
Font maWinFont;
sal_Int32 mnAngle;
+ sal_Int32 mnInitialAngle;
sal_Int32 mnOldAngle;
long mnCenterX;
long mnCenterY;
@@ -266,6 +267,7 @@ DialControl_Impl::DialControl_Impl( Window& rParent ) :
maBmpBuffered( rParent ),
mpLinkField( 0 ),
mnAngle( 0 ),
+ mnInitialAngle( 0 ),
mnCenterX( 0 ),
mnCenterY( 0 ),
mbNoRot( false )
@@ -417,6 +419,16 @@ void DialControl::SetLinkedField( NumericField* pField )
ImplSetFieldLink( LINK( this, DialControl, LinkedFieldModifyHdl ) );
}
+void DialControl::SaveValue()
+{
+ mpImpl->mnInitialAngle = mpImpl->mnAngle;
+}
+
+bool DialControl::IsValueModified()
+{
+ return mpImpl->mnInitialAngle != mpImpl->mnAngle;
+}
+
// private --------------------------------------------------------------------
void DialControl::Init( const Size& rWinSize, const Font& rWinFont )