summaryrefslogtreecommitdiff
path: root/sc/source/ui/drawfunc/futext.cxx
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2002-03-22 08:41:37 +0000
committerArmin Weiss <aw@openoffice.org>2002-03-22 08:41:37 +0000
commit4cec4b95fcd980e08ef7c1c13f873c0303c7a43d (patch)
tree91ee2d8430cd170d982840d46b300ec75a57b5be /sc/source/ui/drawfunc/futext.cxx
parenta659f1714f984cdea4c261548c6f7cbbdafdb038 (diff)
#98185# Create default drawing objects via keyboard
Diffstat (limited to 'sc/source/ui/drawfunc/futext.cxx')
-rw-r--r--sc/source/ui/drawfunc/futext.cxx67
1 files changed, 65 insertions, 2 deletions
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index 981624313673..acb4124a7237 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: futext.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: aw $ $Date: 2001-10-23 10:30:41 $
+ * last change: $Author: aw $ $Date: 2002-03-22 09:41:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -85,6 +85,9 @@
#include "sc.hrc"
#include "tabvwsh.hxx"
+// #98185# Create default drawing objects via keyboard
+#include "scresid.hxx"
+
// Maximal erlaubte Mausbewegung um noch Drag&Drop zu starten
//! fusel,fuconstr,futext - zusammenfassen!
#define SC_MAXDRAGMOVE 3
@@ -828,6 +831,66 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel)
pView->SetLayerLocked( pLockLayer->GetName(), TRUE );
}
+// #98185# Create default drawing objects via keyboard
+SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+{
+ // case SID_DRAW_TEXT:
+ // case SID_DRAW_TEXT_VERTICAL:
+ // case SID_DRAW_TEXT_MARQUEE:
+ // case SID_DRAW_NOTEEDIT:
+
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
+ 0L, pDrDoc);
+
+ if(pObj)
+ {
+ if(pObj->ISA(SdrTextObj))
+ {
+ SdrTextObj* pText = (SdrTextObj*)pObj;
+ pText->SetLogicRect(rRectangle);
+
+ String aText(ScResId(STR_CAPTION_DEFAULT_TEXT));
+ pText->SetText(aText);
+ sal_Bool bVertical = (SID_DRAW_TEXT_VERTICAL == nID);
+ sal_Bool bMarquee = (SID_DRAW_TEXT_MARQUEE == nID);
+ pText->SetVerticalWriting(bVertical);
+
+ if(bVertical)
+ {
+ SdrTextObj* pText = (SdrTextObj*)pObj;
+ SfxItemSet aSet(pDrDoc->GetItemPool());
+
+ aSet.Put(SdrTextAutoGrowWidthItem(TRUE));
+ aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
+ aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
+ aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
+
+ pText->SetItemSet(aSet);
+ }
+
+ if(bMarquee)
+ {
+ SfxItemSet aSet(pDrDoc->GetItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
+
+ aSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
+ aSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
+ aSet.Put( SdrTextAniKindItem( SDRTEXTANI_SLIDE ) );
+ aSet.Put( SdrTextAniDirectionItem( SDRTEXTANI_LEFT ) );
+ aSet.Put( SdrTextAniCountItem( 1 ) );
+ aSet.Put( SdrTextAniAmountItem( (INT16)pWindow->PixelToLogic(Size(2,1)).Width()) );
+
+ pObj->SetItemSetAndBroadcast(aSet);
+ }
+ }
+ else
+ {
+ DBG_ERROR("Object is NO text object");
+ }
+ }
+
+ return pObj;
+}