summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2002-03-22 08:59:27 +0000
committerArmin Weiss <aw@openoffice.org>2002-03-22 08:59:27 +0000
commit21db76c195a352c15856d2bcac2157dfc55fd0a1 (patch)
tree34615081712469974f95841a1bf0eecf4d1a207f /sc/source/ui
parent4cec4b95fcd980e08ef7c1c13f873c0303c7a43d (diff)
#98185# Create default drawing objects via keyboard
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/fuconarc.hxx7
-rw-r--r--sc/source/ui/inc/fuconpol.hxx7
-rw-r--r--sc/source/ui/inc/fuconrec.hxx7
-rw-r--r--sc/source/ui/inc/fuconuno.hxx7
-rw-r--r--sc/source/ui/inc/fupoor.hxx11
-rw-r--r--sc/source/ui/inc/futext.hxx7
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx58
7 files changed, 90 insertions, 14 deletions
diff --git a/sc/source/ui/inc/fuconarc.hxx b/sc/source/ui/inc/fuconarc.hxx
index 4ed8175076e8..a25315b528d3 100644
--- a/sc/source/ui/inc/fuconarc.hxx
+++ b/sc/source/ui/inc/fuconarc.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fuconarc.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:44:58 $
+ * last change: $Author: aw $ $Date: 2002-03-22 09:52:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -91,6 +91,9 @@ class FuConstArc : public FuConstruct
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
+
+ // #98185# Create default drawing objects via keyboard
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
};
diff --git a/sc/source/ui/inc/fuconpol.hxx b/sc/source/ui/inc/fuconpol.hxx
index 07aff64055b1..b2ba8c9eb3c1 100644
--- a/sc/source/ui/inc/fuconpol.hxx
+++ b/sc/source/ui/inc/fuconpol.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fuconpol.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:44:58 $
+ * last change: $Author: aw $ $Date: 2002-03-22 09:53:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,6 +94,9 @@ class FuConstPolygon : public FuConstruct
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
+
+ // #98185# Create default drawing objects via keyboard
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
};
diff --git a/sc/source/ui/inc/fuconrec.hxx b/sc/source/ui/inc/fuconrec.hxx
index 286cf17bed19..8eef7e8f4d18 100644
--- a/sc/source/ui/inc/fuconrec.hxx
+++ b/sc/source/ui/inc/fuconrec.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fuconrec.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:44:58 $
+ * last change: $Author: aw $ $Date: 2002-03-22 09:55:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -91,6 +91,9 @@ class FuConstRectangle : public FuConstruct
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
+
+ // #98185# Create default drawing objects via keyboard
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
};
diff --git a/sc/source/ui/inc/fuconuno.hxx b/sc/source/ui/inc/fuconuno.hxx
index 2eb62d83d5ad..b981468faccf 100644
--- a/sc/source/ui/inc/fuconuno.hxx
+++ b/sc/source/ui/inc/fuconuno.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fuconuno.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:44:58 $
+ * last change: $Author: aw $ $Date: 2002-03-22 09:56:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,6 +92,9 @@ public:
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
+
+ // #98185# Create default drawing objects via keyboard
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
};
diff --git a/sc/source/ui/inc/fupoor.hxx b/sc/source/ui/inc/fupoor.hxx
index 3db7ec5d025e..f15965c95290 100644
--- a/sc/source/ui/inc/fupoor.hxx
+++ b/sc/source/ui/inc/fupoor.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fupoor.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:44:59 $
+ * last change: $Author: aw $ $Date: 2002-03-22 09:57:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,6 +78,8 @@ class Window;
class SdrModel;
class Dialog;
+// #98185# Create default drawing objects via keyboard
+class SdrObject;
// Return-Werte fuer Command
#define SC_CMD_NONE 0
@@ -142,6 +144,11 @@ class FuPoor
BOOL IsDetectiveHit( const Point& rLogicPos );
void StopDragTimer();
+
+ // #98185# Create default drawing objects via keyboard
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+protected:
+ void ImpForceQuadratic(Rectangle& rRect);
};
diff --git a/sc/source/ui/inc/futext.hxx b/sc/source/ui/inc/futext.hxx
index a67d35fe9874..3e90d2b567a2 100644
--- a/sc/source/ui/inc/futext.hxx
+++ b/sc/source/ui/inc/futext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: futext.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:44:59 $
+ * last change: $Author: aw $ $Date: 2002-03-22 09:58:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -102,6 +102,9 @@ public:
void SetInEditMode( SdrObject* pObj = NULL, const Point* pMousePixel = NULL );
void StopEditMode();
+ // #98185# Create default drawing objects via keyboard
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+
private:
SdrOutliner* MakeOutliner();
};
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index 05a27c61cf9d..a5eb6e94de89 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tabvwsh2.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: nn $ $Date: 2002-03-14 15:12:44 $
+ * last change: $Author: aw $ $Date: 2002-03-22 09:59:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,6 +94,14 @@
#include "sc.hrc"
#include "scmod.hxx"
+// #98185# Create default drawing objects via keyboard
+#ifndef _SVDPAGV_HXX
+#include <svx/svdpagv.hxx>
+#endif
+
+#ifndef _SVDPAGE_HXX
+#include <svx/svdpage.hxx>
+#endif
// -----------------------------------------------------------------------
@@ -341,6 +349,52 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
rBindings.Invalidate( SID_INSERT_DRAW );
rBindings.Update( SID_INSERT_DRAW );
+
+ // #98185# Create default drawing objects via keyboard
+ // with qualifier construct directly
+ FuPoor* pFuActual = GetDrawFuncPtr();
+
+ if(pFuActual && (rReq.GetModifier() & KEY_MOD1))
+ {
+ // get ScAppOptions
+
+ // #98185# Create default drawing objects via keyboard
+ // Here the width and height needs to be read from the settings.
+ // This needs to be done by the calc.
+
+ // SdOptions* pOptions = SD_MOD()->GetSdOptions(pDoc->GetDocumentType());
+ // sal_uInt32 nDefaultObjectSizeWidth(pOptions->GetDefaultObjectSizeWidth());
+ // sal_uInt32 nDefaultObjectSizeHeight(pOptions->GetDefaultObjectSizeHeight());
+
+ sal_uInt32 nDefaultObjectSizeWidth(8000);
+ sal_uInt32 nDefaultObjectSizeHeight(6000);
+
+ // calc position and size
+ Rectangle aVisArea = pWin->PixelToLogic(Rectangle(Point(0,0), pWin->GetOutputSizePixel()));
+ Point aPagePos = aVisArea.Center();
+ aPagePos.X() -= nDefaultObjectSizeWidth / 2;
+ aPagePos.Y() -= nDefaultObjectSizeHeight / 2;
+ Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
+
+ ScDrawView* pDrView = GetScDrawView();
+
+ if(pDrView)
+ {
+ SdrPageView* pPageView = pDrView->GetPageViewPvNum(0);
+
+ if(pPageView)
+ {
+ // create the default object
+ SdrObject* pObj = pFuActual->CreateDefaultObject(nNewId, aNewObjectRectangle);
+
+ if(pObj)
+ {
+ // insert into page
+ pView->InsertObject(pObj, *pPageView, pView->IsSolidDraggingNow() ? SDRINSERT_NOBROADCAST : 0);
+ }
+ }
+ }
+ }
}
void ScTabViewShell::GetDrawState(SfxItemSet &rSet)