summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Loeschky <dl@openoffice.org>2001-02-07 08:15:46 +0000
committerDieter Loeschky <dl@openoffice.org>2001-02-07 08:15:46 +0000
commitaf2c3f8662f696b2d2dbeb9421a988de89814e9f (patch)
tree64c8cc5082ffb06c16de83357f599935cb6e91fa
parente7b748b0e987b6a5aebd14626a5c0a0473664983 (diff)
SID_TEXTDIRECTION... added
-rw-r--r--sd/sdi/drtxtob.sdi10
-rw-r--r--sd/source/ui/app/app.src8
-rw-r--r--sd/source/ui/view/drtxtob.cxx65
-rw-r--r--sd/source/ui/view/drtxtob1.cxx58
4 files changed, 134 insertions, 7 deletions
diff --git a/sd/sdi/drtxtob.sdi b/sd/sdi/drtxtob.sdi
index 891dac4a2227..8ff6c5d97103 100644
--- a/sd/sdi/drtxtob.sdi
+++ b/sd/sdi/drtxtob.sdi
@@ -162,4 +162,14 @@ shell SdDrawTextObjectBar
ExecMethod = Execute;
StateMethod = GetAttrState;
]
+ SfxBoolItem TextdirectionLeftToRight SID_TEXTDIRECTION_LEFT_TO_RIGHT // ole : ?, status : ?
+ [
+ ExecMethod = Execute;
+ StateMethod = GetAttrState;
+ ]
+ SfxBoolItem TextdirectionTopToBottom SID_TEXTDIRECTION_TOP_TO_BOTTOM // ole : ?, status : ?
+ [
+ ExecMethod = Execute;
+ StateMethod = GetAttrState;
+ ]
}
diff --git a/sd/source/ui/app/app.src b/sd/source/ui/app/app.src
index 17404c70dad5..b80d3c6432c3 100644
--- a/sd/source/ui/app/app.src
+++ b/sd/source/ui/app/app.src
@@ -2,9 +2,9 @@
*
* $RCSfile: app.src,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: dl $ $Date: 2001-02-05 11:35:19 $
+ * last change: $Author: dl $ $Date: 2001-02-07 09:15:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -396,9 +396,11 @@
SID_TEXT_FITTOSIZE_VERTICAL;\
SID_ATTR_CHAR_VERTICAL;\
SID_DRAW_CAPTION_VERTICAL;\
+ SID_TEXTDIRECTION_LEFT_TO_RIGHT;\
+ SID_TEXTDIRECTION_TOP_TO_BOTTOM;\
};\
IdCount = {\
- 286;\
+ 288;\
};
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index fbe346943a8d..7be015410c3e 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.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: dl $ $Date: 2000-11-30 11:24:24 $
+ * last change: $Author: dl $ $Date: 2001-02-07 09:14:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -101,6 +101,9 @@
#ifndef _SVX_SRIPTTYPEITEM_HXX //autogen
#include <svx/scripttypeitem.hxx>
#endif
+#ifndef _OUTLOBJ_HXX
+#include <svx/outlobj.hxx>
+#endif
#pragma hdrstop
@@ -330,6 +333,62 @@ void SdDrawTextObjectBar::GetAttrState( SfxItemSet& rSet )
}
break;
+ case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
+ case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
+ {
+ BOOL bLeftToRight = FALSE;
+ BOOL bTopToBottom = FALSE;
+
+ SdrOutliner* pOutl = pView->GetTextEditOutliner();
+ if( pOutl )
+ {
+ if( pOutl->IsVertical() )
+ bTopToBottom = TRUE;
+ else
+ bLeftToRight = TRUE;
+ }
+ else
+ {
+ const SdrMarkList& rMark = pView->GetMarkList();
+ USHORT nCount = (USHORT) Min( rMark.GetMarkCount(), (ULONG) 10 );
+ OutlinerParaObject* pOPO = 0;
+ for( USHORT i = 0; i < nCount; i++ )
+ {
+ pOPO = rMark.GetMark( i )->GetObj()->GetOutlinerParaObject();
+ if( !pOPO )
+ {
+ bLeftToRight = FALSE;
+ bTopToBottom = FALSE;
+ break;
+ }
+ else if ( pOPO->IsVertical() )
+ {
+ if( bLeftToRight )
+ {
+ bLeftToRight = FALSE;
+ break;
+ }
+ else
+ bTopToBottom = TRUE;
+ }
+ else
+ {
+ if( bTopToBottom )
+ {
+ bTopToBottom = FALSE;
+ break;
+ }
+ else
+ bLeftToRight = TRUE;
+ }
+ }
+ }
+
+ rSet.Put( SfxBoolItem( SID_TEXTDIRECTION_LEFT_TO_RIGHT, bLeftToRight ) );
+ rSet.Put( SfxBoolItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM, bTopToBottom ) );
+ }
+ break;
+
default:
break;
}
@@ -356,6 +415,8 @@ void SdDrawTextObjectBar::GetAttrState( SfxItemSet& rSet )
rSet.DisableItem( SID_ATTR_PARA_LINESPACE_20 );
rSet.DisableItem( SID_PARASPACE_INCREASE );
rSet.DisableItem( SID_PARASPACE_DECREASE );
+ rSet.DisableItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM );
+ rSet.DisableItem( SID_TEXTDIRECTION_LEFT_TO_RIGHT );
}
else
{
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index c4802d643741..4010d4da526e 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.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dl $ $Date: 2000-11-30 11:24:34 $
+ * last change: $Author: dl $ $Date: 2001-02-07 09:14:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -135,6 +135,9 @@
#ifndef _SVX_SRIPTTYPEITEM_HXX //autogen
#include <svx/scripttypeitem.hxx>
#endif
+#ifndef _SVDOUTL_HXX
+#include <svx/svdoutl.hxx>
+#endif
#pragma hdrstop
@@ -336,6 +339,57 @@ void SdDrawTextObjectBar::Execute( SfxRequest &rReq )
}
break;
+ case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
+ case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
+ {
+ SdrOutliner* pOutl = pView->GetTextEditOutliner();
+ if( pOutl )
+ {
+ if( nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT )
+ {
+ if( pOutl->IsVertical() )
+ pOutl->SetVertical( FALSE );
+ }
+ else
+ {
+ if( !pOutl->IsVertical() )
+ pOutl->SetVertical( TRUE );
+ }
+ }
+
+ const SdrMarkList& rMark = pView->GetMarkList();
+ SdrObject* pObj = NULL;
+ OutlinerParaObject* pOPO = 0;
+ for( ULONG i = 0; i < rMark.GetMarkCount(); i++ )
+ {
+ pObj = rMark.GetMark( i )->GetObj();
+ pOPO = pObj->GetOutlinerParaObject();
+ if( pOPO )
+ {
+ SdrOutliner* pOutl = pView->GetTextEditOutliner();
+ if( nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT )
+ {
+ if( pOPO && pOPO->IsVertical() )
+ {
+ pOPO->SetVertical( FALSE );
+ pObj->SendRepaintBroadcast();
+ }
+ }
+ else
+ {
+ if( pOPO && !pOPO->IsVertical() )
+ {
+ pOPO->SetVertical( TRUE );
+ pObj->SendRepaintBroadcast();
+ }
+ }
+ }
+ }
+
+ rReq.Done();
+ }
+ break;
+
default:
{
SfxItemSet aEditAttr( pView->GetDoc()->GetPool() );