diff options
-rw-r--r-- | sd/source/core/drawdoc4.cxx | 48 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob.cxx | 18 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 14 |
3 files changed, 52 insertions, 28 deletions
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 687172d6f456..c71e25cdf55f 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drawdoc4.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: ka $ $Date: 2002-08-01 11:29:43 $ + * last change: $Author: ka $ $Date: 2002-08-15 07:25:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,9 +72,6 @@ #include <offmgr/osplcfg.hxx> #endif #include "sdoutl.hxx" -#ifndef _SVX_WRITINGMODEITEM_HXX -#include <svx/writingmodeitem.hxx> -#endif #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ #include <comphelper/processfactory.hxx> #endif#else @@ -98,10 +95,11 @@ #include <eetext.hxx> -#define ITEMID_SEARCH SID_SEARCH_ITEM -#define ITEMID_LANGUAGE EE_CHAR_LANGUAGE -#define ITEMID_EMPHASISMARK EE_CHAR_EMPHASISMARK -#define ITEMID_CHARRELIEF EE_CHAR_RELIEF +#define ITEMID_SEARCH SID_SEARCH_ITEM +#define ITEMID_LANGUAGE EE_CHAR_LANGUAGE +#define ITEMID_EMPHASISMARK EE_CHAR_EMPHASISMARK +#define ITEMID_CHARRELIEF EE_CHAR_RELIEF +#define ITEMID_FRAMEDIR EE_PARA_WRITINGDIR #include <svx/svxids.hrc> #include <svx/srchitem.hxx> @@ -242,6 +240,9 @@ #ifndef _SVX_LANGITEM_HXX #include <svx/langitem.hxx> #endif +#ifndef _SVX_FRMDIRITEM_HXX +#include <svx/frmdiritem.hxx> +#endif #include "sdresid.hxx" #include "drawdoc.hxx" @@ -384,14 +385,14 @@ void SdDrawDocument::CreateLayoutTemplates() pDocSh->IsNewDocument() && SD_MOD()->GetDefaultWritingMode() == ::com::sun::star::text::WritingMode_RL_TB ) { - SvxAdjustItem aAdjust( SVX_ADJUST_RIGHT ); - SvxWritingModeItem aWritingMode( ::com::sun::star::text::WritingMode_RL_TB, EE_PARA_WRITINGDIR ); + SvxAdjustItem aAdjust( SVX_ADJUST_RIGHT ); + SvxFrameDirectionItem aFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ); rISet.Put( aAdjust ); - rISet.Put( aWritingMode ); + rISet.Put( aFrameDirectionItem ); pItemPool->SetPoolDefaultItem( aAdjust ); - pItemPool->SetPoolDefaultItem( aWritingMode ); + pItemPool->SetPoolDefaultItem( aFrameDirectionItem ); } else rISet.Put( SvxAdjustItem() ); @@ -1453,9 +1454,22 @@ void SdDrawDocument::SetTextDefaults() const ::com::sun::star::text::WritingMode SdDrawDocument::GetDefaultWritingMode() const { - const SfxPoolItem* pItem = ( pItemPool ? pItemPool->GetPoolDefaultItem( EE_PARA_WRITINGDIR ) : NULL ); + const SfxPoolItem* pItem = ( pItemPool ? pItemPool->GetPoolDefaultItem( EE_PARA_WRITINGDIR ) : NULL ); + ::com::sun::star::text::WritingMode eRet = ::com::sun::star::text::WritingMode_LR_TB; + + if( pItem ) + { + switch( ( (SvxFrameDirectionItem&)( *pItem ) ).GetValue() ) + { + case( FRMDIR_HORI_LEFT_TOP ): eRet = ::com::sun::star::text::WritingMode_LR_TB; break; + case( FRMDIR_HORI_RIGHT_TOP ): eRet = ::com::sun::star::text::WritingMode_RL_TB; break; + case( FRMDIR_VERT_TOP_RIGHT ): eRet = ::com::sun::star::text::WritingMode_TB_RL; break; + + default: + DBG_ERROR( "Frame direction not supported yet" ); + break; + } + } - return( pItem ? - (::com::sun::star::text::WritingMode)( (SvxWritingModeItem&)( *pItem ) ).GetValue() : - ::com::sun::star::text::WritingMode_LR_TB ); + return eRet; } diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index e3ca23d926a8..e944f7782ca6 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.12 $ + * $Revision: 1.13 $ * - * last change: $Author: ka $ $Date: 2002-08-01 11:30:11 $ + * last change: $Author: ka $ $Date: 2002-08-15 07:25:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,6 +59,8 @@ * ************************************************************************/ +#define ITEMID_FRAMEDIR EE_PARA_WRITINGDIR + #ifndef _EEITEMID_HXX #include <svx/eeitemid.hxx> #endif @@ -110,6 +112,9 @@ #ifndef _SVX_WRITINGMODEITEM_HXX #include <svx/writingmodeitem.hxx> #endif +#ifndef _SVX_FRMDIRITEM_HXX +#include <svx/frmdiritem.hxx> +#endif #pragma hdrstop @@ -489,20 +494,21 @@ void SdDrawTextObjectBar::GetAttrState( SfxItemSet& rSet ) } else { - switch( ( ( (SvxWritingModeItem&) aAttrSet.Get( EE_PARA_WRITINGDIR ) ) ).GetValue() ) + switch( ( ( (SvxFrameDirectionItem&) aAttrSet.Get( EE_PARA_WRITINGDIR ) ) ).GetValue() ) { - case com::sun::star::text::WritingMode_TB_RL: + case FRMDIR_VERT_TOP_LEFT: + case FRMDIR_VERT_TOP_RIGHT: { rSet.DisableItem( SID_ATTR_PARA_LEFT_TO_RIGHT ); rSet.DisableItem( SID_ATTR_PARA_RIGHT_TO_LEFT ); } break; - case com::sun::star::text::WritingMode_LR_TB: + case FRMDIR_HORI_LEFT_TOP: rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, TRUE ) ); break; - case com::sun::star::text::WritingMode_RL_TB: + case FRMDIR_HORI_RIGHT_TOP: 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 e6e2bc814508..98e82e78238c 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.14 $ + * $Revision: 1.15 $ * - * last change: $Author: ka $ $Date: 2002-08-01 11:30:12 $ + * last change: $Author: ka $ $Date: 2002-08-15 07:25:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,6 +59,8 @@ * ************************************************************************/ +#define ITEMID_FRAMEDIR EE_PARA_WRITINGDIR + #ifndef _OUTLINER_HXX #include <svx/outliner.hxx> #endif @@ -141,11 +143,13 @@ #ifndef _SVX_WRITINGMODEITEM_HXX #include <svx/writingmodeitem.hxx> #endif +#ifndef _SVX_FRMDIRITEM_HXX +#include <svx/frmdiritem.hxx> +#endif #ifndef _SFXITEMITER_HXX #include <svtools/itemiter.hxx> #endif - #pragma hdrstop #include "app.hrc" @@ -470,13 +474,13 @@ void SdDrawTextObjectBar::Execute( SfxRequest &rReq ) break; case SID_ATTR_PARA_LEFT_TO_RIGHT: { - aNewAttr.Put( SvxWritingModeItem( ::com::sun::star::text::WritingMode_LR_TB, EE_PARA_WRITINGDIR ) ); + 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( SvxWritingModeItem( ::com::sun::star::text::WritingMode_RL_TB, EE_PARA_WRITINGDIR ) ); + aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) ); aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT ) ); } break; |