summaryrefslogtreecommitdiff
path: root/svx/source/items
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-08-02 16:47:33 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-08-02 16:47:33 +0000
commit56ce215d39efdb96703a53b7b51c9c5a0d61c9f1 (patch)
tree6b51d51a51004823b4720dc229f57759eb426838 /svx/source/items
parent1d3b4f1fdef16a582d9d9dc39eb6b2a83994e783 (diff)
INTEGRATION: CWS dr14 (1.5.334); FILE MERGED
2003/12/18 13:26:09 dr 1.5.334.1: #i22640# SvxOrientationItem replaced by SfxBoolItem for stacked state
Diffstat (limited to 'svx/source/items')
-rw-r--r--svx/source/items/algitem.cxx42
1 files changed, 40 insertions, 2 deletions
diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx
index 76f8d6afa1da..dfbf816c54ef 100644
--- a/svx/source/items/algitem.cxx
+++ b/svx/source/items/algitem.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: algitem.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: hr $ $Date: 2003-04-04 18:02:42 $
+ * last change: $Author: hr $ $Date: 2004-08-02 17:47:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -404,6 +404,12 @@ SvxOrientationItem::SvxOrientationItem( const SvxCellOrientation eOrientation,
{
}
+SvxOrientationItem::SvxOrientationItem( INT32 nRotation, BOOL bStacked, const USHORT nId ) :
+ SfxEnumItem( nId )
+{
+ SetFromRotation( nRotation, bStacked );
+}
+
//------------------------------------------------------------------------
SfxItemPresentation SvxOrientationItem::GetPresentation
@@ -496,6 +502,38 @@ USHORT SvxOrientationItem::GetValueCount() const
return SVX_ORIENTATION_STACKED + 1; // letzter Enum-Wert + 1
}
+//------------------------------------------------------------------------
+
+BOOL SvxOrientationItem::IsStacked() const
+{
+ return static_cast< SvxCellOrientation >( GetValue() ) == SVX_ORIENTATION_STACKED;
+}
+
+INT32 SvxOrientationItem::GetRotation( INT32 nStdAngle ) const
+{
+ INT32 nAngle = nStdAngle;
+ switch( static_cast< SvxCellOrientation >( GetValue() ) )
+ {
+ case SVX_ORIENTATION_BOTTOMTOP: nAngle = 9000;
+ case SVX_ORIENTATION_TOPBOTTOM: nAngle = 27000;
+ }
+ return nAngle;
+}
+
+void SvxOrientationItem::SetFromRotation( INT32 nRotation, BOOL bStacked )
+{
+ if( bStacked )
+ {
+ SetValue( SVX_ORIENTATION_STACKED );
+ }
+ else switch( nRotation )
+ {
+ case 9000: SetValue( SVX_ORIENTATION_BOTTOMTOP ); break;
+ case 27000: SetValue( SVX_ORIENTATION_TOPBOTTOM ); break;
+ default: SetValue( SVX_ORIENTATION_STANDARD );
+ }
+}
+
// class SvxMarginItem ---------------------------------------------------
SvxMarginItem::SvxMarginItem( const USHORT nId ) :