From 25e7cb0d1fa44a46460a9871a92fac70123f037e Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Fri, 13 Sep 2002 09:34:58 +0000 Subject: [PATCH] #101758# LEFT_TO_RIGHT and RIGHT_TO_LEFT is now a toggle slot --- sd/source/ui/view/drtxtob.cxx | 6 ++-- sd/source/ui/view/drtxtob1.cxx | 52 ++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index e944f7782ca6..46c2b4ed17cb 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drtxtob.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: ka $ $Date: 2002-08-15 07:25:48 $ + * last change: $Author: cl $ $Date: 2002-09-13 10:34:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -506,9 +506,11 @@ void SdDrawTextObjectBar::GetAttrState( SfxItemSet& rSet ) case FRMDIR_HORI_LEFT_TOP: rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, TRUE ) ); + rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, FALSE ) ); break; case FRMDIR_HORI_RIGHT_TOP: + rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, FALSE ) ); rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, TRUE ) ); break; } diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 98e82e78238c..592ffe5d536e 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drtxtob1.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: ka $ $Date: 2002-08-15 07:25:49 $ + * last change: $Author: cl $ $Date: 2002-09-13 10:34:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -374,6 +374,7 @@ void SdDrawTextObjectBar::Execute( SfxRequest &rReq ) } break; + default: { SfxItemSet aEditAttr( pView->GetDoc()->GetPool() ); @@ -472,19 +473,6 @@ void SdDrawTextObjectBar::Execute( SfxRequest &rReq ) aNewAttr.Put( aItem ); } break; - case SID_ATTR_PARA_LEFT_TO_RIGHT: - { - aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) ); - aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT ) ); - } - break; - case SID_ATTR_PARA_RIGHT_TO_LEFT: - { - aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) ); - aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT ) ); - } - break; - case SID_SET_SUPER_SCRIPT: { SvxEscapementItem aItem; @@ -573,6 +561,40 @@ void SdDrawTextObjectBar::Execute( SfxRequest &rReq ) rReq.Done( aNewAttr ); pArgs = rReq.GetArgs(); } + else if ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT || + nSlot == SID_ATTR_PARA_RIGHT_TO_LEFT ) + { + sal_Bool bLeftToRight = nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT; + + const SfxPoolItem* pPoolItem; + if( SFX_ITEM_SET == pArgs->GetItemState( nSlot, TRUE, &pPoolItem ) ) + { + if( false == ( (SfxBoolItem*)pPoolItem)->GetValue() ) + { + bLeftToRight = !bLeftToRight; + } + } + + USHORT nAdjust = SVX_ADJUST_LEFT; + if( SFX_ITEM_ON == aEditAttr.GetItemState(ITEMID_ADJUST, TRUE, &pPoolItem ) ) + nAdjust = ( (SvxAdjustItem*)pPoolItem)->GetEnumValue(); + + if( bLeftToRight ) + { + aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) ); + if( nAdjust == SVX_ADJUST_RIGHT ) + aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT ) ); + } + else + { + aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) ); + if( nAdjust == SVX_ADJUST_LEFT ) + aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT ) ); + } + + rReq.Done( aNewAttr ); + pArgs = rReq.GetArgs(); + } else if ( nSlot == SID_ATTR_CHAR_FONT || nSlot == SID_ATTR_CHAR_FONTHEIGHT || nSlot == SID_ATTR_CHAR_POSTURE ||