summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2002-02-15 15:56:24 +0000
committerArmin Weiss <aw@openoffice.org>2002-02-15 15:56:24 +0000
commit4f48ca5bb396aebaf0a566a84be56fd1a36646e1 (patch)
treeaf272874e0f6c747d6ba0a1d272718f90b04fecc
parente1ba0299c9bea94ff4a91c717981ded144513867 (diff)
#97016# Added ::CreateDefaultObject implementations to the FuCon classes
-rw-r--r--sd/source/ui/func/fucon3d.cxx492
-rw-r--r--sd/source/ui/func/fuconarc.cxx55
-rw-r--r--sd/source/ui/func/fuconbez.cxx140
-rw-r--r--sd/source/ui/func/fuconrec.cxx216
-rw-r--r--sd/source/ui/func/fuconuno.cxx19
-rw-r--r--sd/source/ui/func/fudraw.cxx22
-rw-r--r--sd/source/ui/func/fupoor.cxx32
-rw-r--r--sd/source/ui/func/futext.cxx261
8 files changed, 919 insertions, 318 deletions
diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx
index 23fa76a47cf4..de598bdb4dec 100644
--- a/sd/source/ui/func/fucon3d.cxx
+++ b/sd/source/ui/func/fucon3d.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fucon3d.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: aw $ $Date: 2001-01-17 17:11:44 $
+ * last change: $Author: aw $ $Date: 2002-02-15 16:51:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -103,6 +103,11 @@
#include <svx/svx3ditems.hxx>
#endif
+// #97016#
+#ifndef _E3D_POLYSC3D_HXX
+#include <svx/polysc3d.hxx>
+#endif
+
class SfxRequest;
class SdDrawDocument;
@@ -140,245 +145,265 @@ FuConst3dObj::~FuConst3dObj()
|*
\************************************************************************/
-BOOL FuConst3dObj::MouseButtonDown(const MouseEvent& rMEvt)
+// #97016#
+E3dCompoundObject* FuConst3dObj::ImpCreateBasic3DShape()
{
- BOOL bReturn = FuConstruct::MouseButtonDown(rMEvt);
+ E3dCompoundObject* p3DObj = NULL;
- if ( rMEvt.IsLeft() && !pView->IsAction() )
+ switch (nSlotId)
{
- Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ default:
+ case SID_3D_CUBE:
+ {
+ p3DObj = new E3dCubeObj(
+ pView->Get3DDefaultAttributes(),
+ Vector3D(-2500, -2500, -2500),
+ Vector3D(5000, 5000, 5000));
+ break;
+ }
- pWindow->CaptureMouse();
- USHORT nDrgLog = USHORT ( pWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
+ case SID_3D_SPHERE:
+ {
+ p3DObj = new E3dSphereObj(
+ pView->Get3DDefaultAttributes(),
+ Vector3D(0, 0, 0),
+ Vector3D(5000, 5000, 5000));
+ break;
+ }
- E3dCompoundObject* p3DObj = NULL;
+ case SID_3D_SHELL:
+ {
+ XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0, 900, FALSE);
+ aXPoly.Scale(5.0, 5.0);
- WaitObject aWait( (Window*)pViewShell->GetActiveWindow() );
+ p3DObj = new E3dLatheObj(
+ pView->Get3DDefaultAttributes(),
+ (XPolygon)XOutCreatePolygon (aXPoly, pWindow));
- switch (nSlotId)
+ // Dies ist ein offenes Objekt, muss daher defaultmaessig
+ // doppelseitig behandelt werden
+ p3DObj->SetItem(Svx3DDoubleSidedItem(TRUE));
+ break;
+ }
+
+ case SID_3D_HALF_SPHERE:
{
- default:
- case SID_3D_CUBE:
- p3DObj = new E3dCubeObj(
- pView->Get3DDefaultAttributes(),
- Vector3D(-2500, -2500, -2500),
- Vector3D(5000, 5000, 5000));
- break;
-
- case SID_3D_SPHERE:
- p3DObj = new E3dSphereObj(
- pView->Get3DDefaultAttributes(),
- Vector3D(0, 0, 0),
- Vector3D(5000, 5000, 5000));
- break;
-
- case SID_3D_SHELL:
- {
- XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0, 900, FALSE);
- aXPoly.Scale(5.0, 5.0);
-
- p3DObj = new E3dLatheObj(
- pView->Get3DDefaultAttributes(),
- (XPolygon)XOutCreatePolygon (aXPoly, pWindow));
-
- // Dies ist ein offenes Objekt, muss daher defaultmaessig
- // doppelseitig behandelt werden
- p3DObj->SetItem(Svx3DDoubleSidedItem(TRUE));
- }
+ XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0, 900, FALSE);
+ aXPoly.Scale(5.0, 5.0);
+
+ aXPoly.Insert(0, Point (2400*5, 1250*5), XPOLY_NORMAL);
+ aXPoly.Insert(0, Point (2000*5, 1250*5), XPOLY_NORMAL);
+ aXPoly.Insert(0, Point (1500*5, 1250*5), XPOLY_NORMAL);
+ aXPoly.Insert(0, Point (1000*5, 1250*5), XPOLY_NORMAL);
+ aXPoly.Insert(0, Point (500*5, 1250*5), XPOLY_NORMAL);
+ aXPoly.Insert(0, Point (250*5, 1250*5), XPOLY_NORMAL);
+ aXPoly.Insert(0, Point (50*5, 1250*5), XPOLY_NORMAL);
+ aXPoly.Insert(0, Point (0*5, 1250*5), XPOLY_NORMAL);
+ p3DObj = new E3dLatheObj(
+ pView->Get3DDefaultAttributes(),
+ (XPolygon)XOutCreatePolygon (aXPoly, pWindow));
break;
+ }
- case SID_3D_HALF_SPHERE:
- {
- XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0, 900, FALSE);
- aXPoly.Scale(5.0, 5.0);
-
- aXPoly.Insert(0, Point (2400*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (2000*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (1500*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (1000*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (500*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (250*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (50*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (0*5, 1250*5), XPOLY_NORMAL);
- p3DObj = new E3dLatheObj(
- pView->Get3DDefaultAttributes(),
- (XPolygon)XOutCreatePolygon (aXPoly, pWindow));
- }
+ case SID_3D_TORUS:
+ {
+ p3DObj = new E3dLatheObj(
+ pView->Get3DDefaultAttributes(),
+ (XPolygon)XOutCreatePolygon(XPolygon (Point (1000, 0), 500, 500, 0, 3600), pWindow));
break;
+ }
- case SID_3D_TORUS:
- p3DObj = new E3dLatheObj(
- pView->Get3DDefaultAttributes(),
- (XPolygon)XOutCreatePolygon(XPolygon (Point (1000, 0), 500, 500, 0, 3600), pWindow));
- break;
-
- case SID_3D_CYLINDER:
- {
- XPolygon aXPoly(16);
- aXPoly[0] = Point(0, 1000*5);
- aXPoly[1] = Point(50*5, 1000*5);
- aXPoly[2] = Point(100*5, 1000*5);
- aXPoly[3] = Point(200*5, 1000*5);
- aXPoly[4] = Point(300*5, 1000*5);
- aXPoly[5] = Point(400*5, 1000*5);
- aXPoly[6] = Point(450*5, 1000*5);
- aXPoly[7] = Point(500*5, 1000*5);
- aXPoly[8] = Point(500*5, -1000*5);
- aXPoly[9] = Point(450*5, -1000*5);
- aXPoly[10] = Point(400*5, -1000*5);
- aXPoly[11] = Point(300*5, -1000*5);
- aXPoly[12] = Point(200*5, -1000*5);
- aXPoly[13] = Point(100*5, -1000*5);
- aXPoly[14] = Point(50*5, -1000*5);
- aXPoly[15] = Point(0*5, -1000*5);
-
- p3DObj = new E3dLatheObj(
- pView->Get3DDefaultAttributes(),
- aXPoly);
- }
+ case SID_3D_CYLINDER:
+ {
+ XPolygon aXPoly(16);
+ aXPoly[0] = Point(0, 1000*5);
+ aXPoly[1] = Point(50*5, 1000*5);
+ aXPoly[2] = Point(100*5, 1000*5);
+ aXPoly[3] = Point(200*5, 1000*5);
+ aXPoly[4] = Point(300*5, 1000*5);
+ aXPoly[5] = Point(400*5, 1000*5);
+ aXPoly[6] = Point(450*5, 1000*5);
+ aXPoly[7] = Point(500*5, 1000*5);
+ aXPoly[8] = Point(500*5, -1000*5);
+ aXPoly[9] = Point(450*5, -1000*5);
+ aXPoly[10] = Point(400*5, -1000*5);
+ aXPoly[11] = Point(300*5, -1000*5);
+ aXPoly[12] = Point(200*5, -1000*5);
+ aXPoly[13] = Point(100*5, -1000*5);
+ aXPoly[14] = Point(50*5, -1000*5);
+ aXPoly[15] = Point(0*5, -1000*5);
+
+ p3DObj = new E3dLatheObj(
+ pView->Get3DDefaultAttributes(),
+ aXPoly);
break;
+ }
- case SID_3D_CONE:
- {
- XPolygon aXPoly(14);
- aXPoly[0] = Point(0, -1000*5);
- aXPoly[1] = Point(25*5, -900*5);
- aXPoly[2] = Point(50*5, -800*5);
- aXPoly[3] = Point(100*5, -600*5);
- aXPoly[4] = Point(200*5, -200*5);
- aXPoly[5] = Point(300*5, 200*5);
- aXPoly[6] = Point(400*5, 600*5);
- aXPoly[7] = Point(500*5, 1000*5);
- aXPoly[8] = Point(400*5, 1000*5);
- aXPoly[9] = Point(300*5, 1000*5);
- aXPoly[10] = Point(200*5, 1000*5);
- aXPoly[11] = Point(100*5, 1000*5);
- aXPoly[12] = Point(50*5, 1000*5);
- aXPoly[13] = Point(0*5, 1000*5);
-
- p3DObj = new E3dLatheObj(
- pView->Get3DDefaultAttributes(),
- aXPoly);
- }
+ case SID_3D_CONE:
+ {
+ XPolygon aXPoly(14);
+ aXPoly[0] = Point(0, -1000*5);
+ aXPoly[1] = Point(25*5, -900*5);
+ aXPoly[2] = Point(50*5, -800*5);
+ aXPoly[3] = Point(100*5, -600*5);
+ aXPoly[4] = Point(200*5, -200*5);
+ aXPoly[5] = Point(300*5, 200*5);
+ aXPoly[6] = Point(400*5, 600*5);
+ aXPoly[7] = Point(500*5, 1000*5);
+ aXPoly[8] = Point(400*5, 1000*5);
+ aXPoly[9] = Point(300*5, 1000*5);
+ aXPoly[10] = Point(200*5, 1000*5);
+ aXPoly[11] = Point(100*5, 1000*5);
+ aXPoly[12] = Point(50*5, 1000*5);
+ aXPoly[13] = Point(0*5, 1000*5);
+
+ p3DObj = new E3dLatheObj(
+ pView->Get3DDefaultAttributes(),
+ aXPoly);
break;
+ }
- case SID_3D_PYRAMID:
- {
- XPolygon aXPoly(14);
- aXPoly[0] = Point(0, -1000*5);
- aXPoly[1] = Point(25*5, -900*5);
- aXPoly[2] = Point(50*5, -800*5);
- aXPoly[3] = Point(100*5, -600*5);
- aXPoly[4] = Point(200*5, -200*5);
- aXPoly[5] = Point(300*5, 200*5);
- aXPoly[6] = Point(400*5, 600*5);
- aXPoly[7] = Point(500*5, 1000*5);
- aXPoly[8] = Point(400*5, 1000*5);
- aXPoly[9] = Point(300*5, 1000*5);
- aXPoly[10] = Point(200*5, 1000*5);
- aXPoly[11] = Point(100*5, 1000*5);
- aXPoly[12] = Point(50*5, 1000*5);
- aXPoly[13] = Point(0, 1000*5);
-
- p3DObj = new E3dLatheObj(
- pView->Get3DDefaultAttributes(),
- aXPoly);
- p3DObj->SetItem(Svx3DHorizontalSegmentsItem(4));
- }
+ case SID_3D_PYRAMID:
+ {
+ XPolygon aXPoly(14);
+ aXPoly[0] = Point(0, -1000*5);
+ aXPoly[1] = Point(25*5, -900*5);
+ aXPoly[2] = Point(50*5, -800*5);
+ aXPoly[3] = Point(100*5, -600*5);
+ aXPoly[4] = Point(200*5, -200*5);
+ aXPoly[5] = Point(300*5, 200*5);
+ aXPoly[6] = Point(400*5, 600*5);
+ aXPoly[7] = Point(500*5, 1000*5);
+ aXPoly[8] = Point(400*5, 1000*5);
+ aXPoly[9] = Point(300*5, 1000*5);
+ aXPoly[10] = Point(200*5, 1000*5);
+ aXPoly[11] = Point(100*5, 1000*5);
+ aXPoly[12] = Point(50*5, 1000*5);
+ aXPoly[13] = Point(0, 1000*5);
+
+ p3DObj = new E3dLatheObj(
+ pView->Get3DDefaultAttributes(),
+ aXPoly);
+ p3DObj->SetItem(Svx3DHorizontalSegmentsItem(4));
break;
}
+ }
- pView->SetCurrent3DObj(p3DObj);
- E3dScene *pScene = (E3dScene*) pView->GetCurrentLibObj();
- Camera3D &aCamera = (Camera3D&) pScene->GetCamera ();
+ return p3DObj;
+}
- // get transformed BoundVolume of the new object
- Volume3D aBoundVol;
- const Volume3D& rObjVol = p3DObj->GetBoundVolume();
- const Matrix4D& rObjTrans = p3DObj->GetTransform();
- aBoundVol.Union(rObjVol.GetTransformVolume(rObjTrans));
+// #97016#
+void FuConst3dObj::ImpPrepareBasic3DShape(E3dCompoundObject* p3DObj, E3dScene *pScene)
+{
+ Camera3D &aCamera = (Camera3D&) pScene->GetCamera ();
- Vector3D aMinVec (aBoundVol.MinVec ());
- Vector3D aMaxVec (aBoundVol.MaxVec ());
- double fDeepth = fabs (aMaxVec.Z () - aMinVec.Z ());
+ // get transformed BoundVolume of the new object
+ Volume3D aBoundVol;
+ const Volume3D& rObjVol = p3DObj->GetBoundVolume();
+ const Matrix4D& rObjTrans = p3DObj->GetTransform();
+ aBoundVol.Union(rObjVol.GetTransformVolume(rObjTrans));
- aCamera.SetPRP(Vector3D(0, 0, 1000));
- aCamera.SetPosition(Vector3D(
- 0.0, 0.0, pView->GetDefaultCamPosZ() + fDeepth / 2));
- aCamera.SetFocalLength(pView->GetDefaultCamFocal());
- pScene->SetCamera(aCamera);
+ Vector3D aMinVec (aBoundVol.MinVec ());
+ Vector3D aMaxVec (aBoundVol.MaxVec ());
+ double fDeepth = fabs (aMaxVec.Z () - aMinVec.Z ());
- switch (nSlotId)
+ aCamera.SetPRP(Vector3D(0, 0, 1000));
+ aCamera.SetPosition(Vector3D(0.0, 0.0, pView->GetDefaultCamPosZ() + fDeepth / 2));
+ aCamera.SetFocalLength(pView->GetDefaultCamFocal());
+ pScene->SetCamera(aCamera);
+
+ switch (nSlotId)
+ {
+ case SID_3D_CUBE:
{
- case SID_3D_CUBE:
- {
- pScene->RotateX(DEG2RAD(20));
- }
- break;
+ pScene->RotateX(DEG2RAD(20));
+ }
+ break;
- case SID_3D_SPHERE:
- {
+ case SID_3D_SPHERE:
+ {
// pScene->RotateX(DEG2RAD(60));
- }
- break;
-
- case SID_3D_SHELL:
- case SID_3D_HALF_SPHERE:
- {
- pScene->RotateX(DEG2RAD(200));
- }
- break;
-
- case SID_3D_CYLINDER:
- case SID_3D_CONE:
- case SID_3D_PYRAMID:
- {
-// pScene->RotateX(DEG2RAD(25));
- }
- break;
-
- case SID_3D_TORUS:
- {
-// pScene->RotateX(DEG2RAD(15));
- pScene->RotateX(DEG2RAD(90));
- }
- break;
+ }
+ break;
- default:
- {
- }
- break;
+ case SID_3D_SHELL:
+ case SID_3D_HALF_SPHERE:
+ {
+ pScene->RotateX(DEG2RAD(200));
}
+ break;
- if (nSlotId == SID_3D_SPHERE)
+ case SID_3D_CYLINDER:
+ case SID_3D_CONE:
+ case SID_3D_PYRAMID:
{
- // Keine Sortierung noetig
- pScene->SetSortingMode(E3D_SORT_NO_SORTING);
+// pScene->RotateX(DEG2RAD(25));
}
- else if (nSlotId == SID_3D_CYLINDER)
+ break;
+
+ case SID_3D_TORUS:
{
- // Das muss auch ohne aufwendige Sortierung gehen!
- // Ersteinaml jedoch: Sortierung ueber Lookupfield
- pScene->SetSortingMode(E3D_SORT_LOOKUP_FIELD |
- E3D_SORT_IN_PARENTS |
- E3D_SORT_TEST_LENGTH);
+// pScene->RotateX(DEG2RAD(15));
+ pScene->RotateX(DEG2RAD(90));
}
- else
+ break;
+
+ default:
{
- // Einfache Sortierung
- pScene->SetSortingMode(E3D_SORT_FAST_SORTING |
- E3D_SORT_IN_PARENTS |
- E3D_SORT_TEST_LENGTH);
}
+ break;
+ }
- pScene->FitSnapRectToBoundVol();
+ if (nSlotId == SID_3D_SPHERE)
+ {
+ // Keine Sortierung noetig
+ pScene->SetSortingMode(E3D_SORT_NO_SORTING);
+ }
+ else if (nSlotId == SID_3D_CYLINDER)
+ {
+ // Das muss auch ohne aufwendige Sortierung gehen!
+ // Ersteinaml jedoch: Sortierung ueber Lookupfield
+ pScene->SetSortingMode(E3D_SORT_LOOKUP_FIELD |
+ E3D_SORT_IN_PARENTS |
+ E3D_SORT_TEST_LENGTH);
+ }
+ else
+ {
+ // Einfache Sortierung
+ pScene->SetSortingMode(E3D_SORT_FAST_SORTING |
+ E3D_SORT_IN_PARENTS |
+ E3D_SORT_TEST_LENGTH);
+ }
- SfxItemSet aAttr (pViewShell->GetPool());
+ pScene->FitSnapRectToBoundVol();
-//-/ pScene->SetAttributes (aAttr, FALSE);
-//-/ SdrBroadcastItemChange aItemChange(*pScene);
- pScene->SetItemSetAndBroadcast(aAttr);
-//-/ pScene->BroadcastItemChange(aItemChange);
+ SfxItemSet aAttr (pViewShell->GetPool());
+ pScene->SetItemSetAndBroadcast(aAttr);
+}
+
+BOOL FuConst3dObj::MouseButtonDown(const MouseEvent& rMEvt)
+{
+ BOOL bReturn = FuConstruct::MouseButtonDown(rMEvt);
+
+ if ( rMEvt.IsLeft() && !pView->IsAction() )
+ {
+ Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+
+ pWindow->CaptureMouse();
+ USHORT nDrgLog = USHORT ( pWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
+
+ E3dCompoundObject* p3DObj = NULL;
+
+ WaitObject aWait( (Window*)pViewShell->GetActiveWindow() );
+
+ // #97016#
+ p3DObj = ImpCreateBasic3DShape();
+
+ pView->SetCurrent3DObj(p3DObj);
+ E3dScene *pScene = (E3dScene*) pView->GetCurrentLibObj();
+
+ // #97016#
+ ImpPrepareBasic3DShape(p3DObj, pScene);
bReturn = pView->BegCreateObj(aPnt, (OutputDevice*) NULL, nDrgLog);
@@ -392,7 +417,6 @@ BOOL FuConst3dObj::MouseButtonDown(const MouseEvent& rMEvt)
// LineStyle rausnehmen
aAttr.Put(XLineStyleItem (XLINE_NONE));
-//-/ pObj->NbcSetAttributes(aAttr, FALSE);
pObj->SetItemSet(aAttr);
}
}
@@ -474,5 +498,61 @@ void FuConst3dObj::Deactivate()
FuConstruct::Deactivate();
}
-
-
+// #97016#
+SdrObject* FuConst3dObj::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+{
+ // case SID_3D_CUBE:
+ // case SID_3D_SHELL:
+ // case SID_3D_SPHERE:
+ // case SID_3D_TORUS:
+ // case SID_3D_HALF_SPHERE:
+ // case SID_3D_CYLINDER:
+ // case SID_3D_CONE:
+ // case SID_3D_PYRAMID:
+
+ E3dCompoundObject* p3DObj = ImpCreateBasic3DShape();
+
+ // E3dView::SetCurrent3DObj part
+ // get transformed BoundVolume of the object
+ const Volume3D& rObjVol = p3DObj->GetBoundVolume();
+ const Matrix4D& rObjTrans = p3DObj->GetTransform();
+ Volume3D aVolume;
+ aVolume.Union(rObjVol.GetTransformVolume(rObjTrans));
+ double fW(aVolume.GetWidth());
+ double fH(aVolume.GetHeight());
+ Rectangle aRect(0, 0, (long)fW, (long)fH);
+ E3dScene* pScene = new E3dPolyScene(pView->Get3DDefaultAttributes());
+
+ // pView->InitScene(pScene, fW, fH, aVolume.MaxVec().Z() + ((fW + fH) / 4.0));
+ // copied code from E3dView::InitScene
+ double fCamZ(aVolume.MaxVec().Z() + ((fW + fH) / 4.0));
+ Camera3D aCam(pScene->GetCamera());
+ aCam.SetAutoAdjustProjection(FALSE);
+ aCam.SetViewWindow(- fW / 2, - fH / 2, fW, fH);
+ Vector3D aLookAt;
+ double fDefaultCamPosZ = pView->GetDefaultCamPosZ();
+ Vector3D aCamPos(0.0, 0.0, fCamZ < fDefaultCamPosZ ? fDefaultCamPosZ : fCamZ);
+ aCam.SetPosAndLookAt(aCamPos, aLookAt);
+ aCam.SetFocalLength(pView->GetDefaultCamFocal());
+ aCam.SetDefaults(Vector3D(0.0, 0.0, fDefaultCamPosZ), aLookAt, pView->GetDefaultCamFocal());
+ pScene->SetCamera(aCam);
+
+ pScene->Insert3DObj(p3DObj);
+ pScene->NbcSetSnapRect(aRect);
+ // SetCurrentLibObj(pScene);
+ pScene->SetModel(pDoc);
+
+ ImpPrepareBasic3DShape(p3DObj, pScene);
+
+ SfxItemSet aAttr(pDoc->GetPool());
+ SetStyleSheet(aAttr, p3DObj);
+ aAttr.Put(XLineStyleItem (XLINE_NONE));
+ p3DObj->SetItemSet(aAttr);
+
+ // make object interactive at once
+ pScene->SetRectsDirty();
+ pScene->InitTransformationSet();
+ pScene->SetLogicRect(rRectangle);
+
+ return pScene;
+}
diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx
index cc2a592dc2e1..a2b98c19d6dd 100644
--- a/sd/source/ui/func/fuconarc.cxx
+++ b/sd/source/ui/func/fuconarc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fuconarc.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: tbe $ $Date: 2000-11-10 16:17:40 $
+ * last change: $Author: aw $ $Date: 2002-02-15 16:51:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -311,4 +311,55 @@ void FuConstArc::Deactivate()
// FuDraw::Deactivate();
}
+// #97016#
+#ifndef _SXCIAITM_HXX
+#include <svx/sxciaitm.hxx>
+#endif
+
+// #97016#
+SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+{
+ // case SID_DRAW_ARC:
+ // case SID_DRAW_CIRCLEARC:
+ // case SID_DRAW_PIE:
+ // case SID_DRAW_PIE_NOFILL:
+ // case SID_DRAW_CIRCLEPIE:
+ // case SID_DRAW_CIRCLEPIE_NOFILL:
+ // case SID_DRAW_ELLIPSECUT:
+ // case SID_DRAW_ELLIPSECUT_NOFILL:
+ // case SID_DRAW_CIRCLECUT:
+ // case SID_DRAW_CIRCLECUT_NOFILL:
+
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
+ 0L, pDoc);
+
+ if(pObj)
+ {
+ if(pObj->ISA(SdrCircObj))
+ {
+ pObj->SetLogicRect(rRectangle);
+
+ SfxItemSet aAttr(pDoc->GetPool());
+ aAttr.Put(SdrCircStartAngleItem(9000));
+ aAttr.Put(SdrCircEndAngleItem(0));
+
+ if(SID_DRAW_PIE_NOFILL == nID ||
+ SID_DRAW_CIRCLEPIE_NOFILL == nID ||
+ SID_DRAW_ELLIPSECUT_NOFILL == nID ||
+ SID_DRAW_CIRCLECUT_NOFILL == nID)
+ {
+ aAttr.Put(XFillStyleItem(XFILL_NONE));
+ }
+
+ pObj->SetItemSet(aAttr);
+ }
+ else
+ {
+ DBG_ERROR("Object is NO circle object");
+ }
+ }
+
+ return pObj;
+}
diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx
index 39ec3c725969..a1ad632cc084 100644
--- a/sd/source/ui/func/fuconbez.cxx
+++ b/sd/source/ui/func/fuconbez.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fuconbez.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: tbe $ $Date: 2000-11-10 16:18:43 $
+ * last change: $Author: aw $ $Date: 2002-02-15 16:51:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -380,7 +380,141 @@ void FuConstBezPoly::SetEditMode(USHORT nMode)
rBindings.Invalidate(SID_BEZIER_INSERT);
}
+// #97016#
+SdrObject* FuConstBezPoly::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+{
+ // case SID_DRAW_POLYGON:
+ // case SID_DRAW_POLYGON_NOFILL:
+ // case SID_DRAW_XPOLYGON:
+ // case SID_DRAW_XPOLYGON_NOFILL:
+ // case SID_DRAW_FREELINE:
+ // case SID_DRAW_FREELINE_NOFILL:
+ // case SID_DRAW_BEZIER_FILL: // BASIC
+ // case SID_DRAW_BEZIER_NOFILL: // BASIC
+
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
+ 0L, pDoc);
+
+ if(pObj)
+ {
+ if(pObj->ISA(SdrPathObj))
+ {
+ XPolyPolygon aPoly;
+
+ switch(nID)
+ {
+ case SID_DRAW_BEZIER_FILL:
+ {
+ sal_Int32 nWdt(rRectangle.GetWidth() / 2);
+ sal_Int32 nHgt(rRectangle.GetHeight() / 2);
+
+ XPolygon aInnerPoly(rRectangle.Center(), nWdt, nHgt);
+
+ aPoly.Insert(aInnerPoly);
+ break;
+ }
+ case SID_DRAW_BEZIER_NOFILL:
+ {
+ XPolygon aInnerPoly;
+ aInnerPoly[0] = rRectangle.BottomLeft();
+ aInnerPoly[1] = rRectangle.BottomCenter();
+ aInnerPoly[2] = rRectangle.BottomCenter();
+ aInnerPoly[3] = rRectangle.Center();
+ aInnerPoly[4] = rRectangle.TopCenter();
+ aInnerPoly[5] = rRectangle.TopCenter();
+ aInnerPoly[6] = rRectangle.TopRight();
+
+ aInnerPoly.SetFlags(1, XPOLY_CONTROL);
+ aInnerPoly.SetFlags(2, XPOLY_CONTROL);
+ aInnerPoly.SetFlags(3, XPOLY_SYMMTR);
+ aInnerPoly.SetFlags(4, XPOLY_CONTROL);
+ aInnerPoly.SetFlags(5, XPOLY_CONTROL);
+
+ aPoly.Insert(aInnerPoly);
+ break;
+ }
+ case SID_DRAW_FREELINE:
+ case SID_DRAW_FREELINE_NOFILL:
+ {
+ XPolygon aInnerPoly;
+ aInnerPoly[0] = rRectangle.BottomLeft();
+ aInnerPoly[1] = rRectangle.TopLeft();
+ aInnerPoly[2] = rRectangle.TopCenter();
+ aInnerPoly[3] = rRectangle.Center();
+ aInnerPoly[4] = rRectangle.BottomCenter();
+ aInnerPoly[5] = rRectangle.BottomRight();
+ aInnerPoly[6] = rRectangle.TopRight();
+
+ aInnerPoly.SetFlags(1, XPOLY_CONTROL);
+ aInnerPoly.SetFlags(2, XPOLY_CONTROL);
+ aInnerPoly.SetFlags(3, XPOLY_SMOOTH);
+ aInnerPoly.SetFlags(4, XPOLY_CONTROL);
+ aInnerPoly.SetFlags(5, XPOLY_CONTROL);
+
+ if(SID_DRAW_FREELINE == nID)
+ {
+ aInnerPoly[7] = rRectangle.BottomRight();
+ }
+
+ aPoly.Insert(aInnerPoly);
+ break;
+ }
+ case SID_DRAW_XPOLYGON:
+ case SID_DRAW_XPOLYGON_NOFILL:
+ {
+ XPolygon aInnerPoly;
+ aInnerPoly[0] = rRectangle.BottomLeft();
+ aInnerPoly[1] = rRectangle.TopLeft();
+ aInnerPoly[2] = rRectangle.TopCenter();
+ aInnerPoly[3] = rRectangle.Center();
+ aInnerPoly[4] = rRectangle.RightCenter();
+ aInnerPoly[5] = rRectangle.BottomRight();
+
+ if(SID_DRAW_XPOLYGON_NOFILL == nID)
+ {
+ aInnerPoly[6] = rRectangle.BottomCenter();
+ }
+
+ aPoly.Insert(aInnerPoly);
+ break;
+ }
+ case SID_DRAW_POLYGON:
+ case SID_DRAW_POLYGON_NOFILL:
+ {
+ XPolygon aInnerPoly;
+ sal_Int32 nWdt(rRectangle.GetWidth());
+ sal_Int32 nHgt(rRectangle.GetHeight());
+
+ aInnerPoly[0] = rRectangle.BottomLeft();
+ aInnerPoly[1] = rRectangle.TopLeft() + Point((nWdt * 30) / 100, (nHgt * 70) / 100);
+ aInnerPoly[2] = rRectangle.TopLeft() + Point(0, (nHgt * 15) / 100);
+ aInnerPoly[3] = rRectangle.TopLeft() + Point((nWdt * 65) / 100, 0);
+ aInnerPoly[4] = rRectangle.TopLeft() + Point(nWdt, (nHgt * 30) / 100);
+ aInnerPoly[5] = rRectangle.TopLeft() + Point((nWdt * 80) / 100, (nHgt * 50) / 100);
+ aInnerPoly[6] = rRectangle.TopLeft() + Point((nWdt * 80) / 100, (nHgt * 75) / 100);
+ aInnerPoly[7] = rRectangle.BottomRight();
+
+ if(SID_DRAW_POLYGON_NOFILL == nID)
+ {
+ aInnerPoly[8] = rRectangle.BottomCenter();
+ }
+
+ aPoly.Insert(aInnerPoly);
+ break;
+ }
+ }
+
+ ((SdrPathObj*)pObj)->SetPathPoly(aPoly);
+ }
+ else
+ {
+ DBG_ERROR("Object is NO path object");
+ }
+ pObj->SetLogicRect(rRectangle);
+ }
-
+ return pObj;
+}
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index 144647a51805..89a590a3fea9 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fuconrec.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: hr $ $Date: 2001-10-18 16:13:10 $
+ * last change: $Author: aw $ $Date: 2002-02-15 16:51:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -131,6 +131,11 @@
#include <svx/svdocapt.hxx>
#endif
+// #97016#
+#ifndef _SVDOMEAS_HXX
+#include <svx/svdomeas.hxx>
+#endif
+
#include "viewshel.hxx"
#include "sdresid.hxx"
#include "sdview.hxx"
@@ -841,5 +846,212 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject* pObj)
}
}
+// #97016#
+SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+{
+ // case SID_DRAW_LINE:
+ // case SID_DRAW_XLINE:
+ // case SID_DRAW_MEASURELINE:
+ // case SID_LINE_ARROW_START:
+ // case SID_LINE_ARROW_END:
+ // case SID_LINE_ARROWS:
+ // case SID_LINE_ARROW_CIRCLE:
+ // case SID_LINE_CIRCLE_ARROW:
+ // case SID_LINE_ARROW_SQUARE:
+ // case SID_LINE_SQUARE_ARROW:
+ // case SID_DRAW_RECT:
+ // case SID_DRAW_RECT_NOFILL:
+ // case SID_DRAW_RECT_ROUND:
+ // case SID_DRAW_RECT_ROUND_NOFILL:
+ // case SID_DRAW_SQUARE:
+ // case SID_DRAW_SQUARE_NOFILL:
+ // case SID_DRAW_SQUARE_ROUND:
+ // case SID_DRAW_SQUARE_ROUND_NOFILL:
+ // case SID_DRAW_ELLIPSE:
+ // case SID_DRAW_ELLIPSE_NOFILL:
+ // case SID_DRAW_CIRCLE:
+ // case SID_DRAW_CIRCLE_NOFILL:
+ // case SID_DRAW_CAPTION:
+ // case SID_DRAW_CAPTION_VERTICAL:
+ // case SID_TOOL_CONNECTOR:
+ // case SID_CONNECTOR_ARROW_START:
+ // case SID_CONNECTOR_ARROW_END:
+ // case SID_CONNECTOR_ARROWS:
+ // case SID_CONNECTOR_CIRCLE_START:
+ // case SID_CONNECTOR_CIRCLE_END:
+ // case SID_CONNECTOR_CIRCLES:
+ // case SID_CONNECTOR_LINE:
+ // case SID_CONNECTOR_LINE_ARROW_START:
+ // case SID_CONNECTOR_LINE_ARROW_END:
+ // case SID_CONNECTOR_LINE_ARROWS:
+ // case SID_CONNECTOR_LINE_CIRCLE_START:
+ // case SID_CONNECTOR_LINE_CIRCLE_END:
+ // case SID_CONNECTOR_LINE_CIRCLES:
+ // case SID_CONNECTOR_CURVE:
+ // case SID_CONNECTOR_CURVE_ARROW_START:
+ // case SID_CONNECTOR_CURVE_ARROW_END:
+ // case SID_CONNECTOR_CURVE_ARROWS:
+ // case SID_CONNECTOR_CURVE_CIRCLE_START:
+ // case SID_CONNECTOR_CURVE_CIRCLE_END:
+ // case SID_CONNECTOR_CURVE_CIRCLES:
+ // case SID_CONNECTOR_LINES:
+ // case SID_CONNECTOR_LINES_ARROW_START:
+ // case SID_CONNECTOR_LINES_ARROW_END:
+ // case SID_CONNECTOR_LINES_ARROWS:
+ // case SID_CONNECTOR_LINES_CIRCLE_START:
+ // case SID_CONNECTOR_LINES_CIRCLE_END:
+ // case SID_CONNECTOR_LINES_CIRCLES:
+
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
+ 0L, pDoc);
+ Point aStart = rRectangle.TopLeft();
+ Point aEnd = rRectangle.BottomRight();
+
+ if(pObj)
+ {
+ switch(nID)
+ {
+ case SID_DRAW_LINE:
+ case SID_DRAW_XLINE:
+ case SID_LINE_ARROW_START:
+ case SID_LINE_ARROW_END:
+ case SID_LINE_ARROWS:
+ case SID_LINE_ARROW_CIRCLE:
+ case SID_LINE_CIRCLE_ARROW:
+ case SID_LINE_ARROW_SQUARE:
+ case SID_LINE_SQUARE_ARROW:
+ {
+ if(pObj->ISA(SdrPathObj))
+ {
+ XPolyPolygon aPoly;
+ aPoly.Insert(XPolygon(2));
+
+ if(SID_DRAW_LINE == nID || SID_DRAW_XLINE == nID)
+ {
+ aPoly[0][0] = aStart;
+ aPoly[0][1] = aEnd;
+ }
+ else
+ {
+ sal_Int32 nYMiddle((rRectangle.Top() + rRectangle.Bottom()) / 2);
+ aPoly[0][0] = Point(aStart.X(), nYMiddle);
+ aPoly[0][1] = Point(aEnd.X(), nYMiddle);
+ }
+
+ ((SdrPathObj*)pObj)->SetPathPoly(aPoly);
+ }
+ else
+ {
+ DBG_ERROR("Object is NO line object");
+ }
+
+ break;
+ }
+
+ case SID_DRAW_MEASURELINE:
+ {
+ if(pObj->ISA(SdrMeasureObj))
+ {
+ sal_Int32 nYMiddle((rRectangle.Top() + rRectangle.Bottom()) / 2);
+ ((SdrMeasureObj*)pObj)->SetPoint(Point(aStart.X(), nYMiddle), 0);
+ ((SdrMeasureObj*)pObj)->SetPoint(Point(aEnd.X(), nYMiddle), 1);
+ }
+ else
+ {
+ DBG_ERROR("Object is NO measure object");
+ }
+
+ break;
+ }
+
+ case SID_TOOL_CONNECTOR:
+ case SID_CONNECTOR_ARROW_START:
+ case SID_CONNECTOR_ARROW_END:
+ case SID_CONNECTOR_ARROWS:
+ case SID_CONNECTOR_CIRCLE_START:
+ case SID_CONNECTOR_CIRCLE_END:
+ case SID_CONNECTOR_CIRCLES:
+ case SID_CONNECTOR_LINE:
+ case SID_CONNECTOR_LINE_ARROW_START:
+ case SID_CONNECTOR_LINE_ARROW_END:
+ case SID_CONNECTOR_LINE_ARROWS:
+ case SID_CONNECTOR_LINE_CIRCLE_START:
+ case SID_CONNECTOR_LINE_CIRCLE_END:
+ case SID_CONNECTOR_LINE_CIRCLES:
+ case SID_CONNECTOR_CURVE:
+ case SID_CONNECTOR_CURVE_ARROW_START:
+ case SID_CONNECTOR_CURVE_ARROW_END:
+ case SID_CONNECTOR_CURVE_ARROWS:
+ case SID_CONNECTOR_CURVE_CIRCLE_START:
+ case SID_CONNECTOR_CURVE_CIRCLE_END:
+ case SID_CONNECTOR_CURVE_CIRCLES:
+ case SID_CONNECTOR_LINES:
+ case SID_CONNECTOR_LINES_ARROW_START:
+ case SID_CONNECTOR_LINES_ARROW_END:
+ case SID_CONNECTOR_LINES_ARROWS:
+ case SID_CONNECTOR_LINES_CIRCLE_START:
+ case SID_CONNECTOR_LINES_CIRCLE_END:
+ case SID_CONNECTOR_LINES_CIRCLES:
+ {
+ if(pObj->ISA(SdrEdgeObj))
+ {
+ ((SdrEdgeObj*)pObj)->SetTailPoint(FALSE, aStart);
+ ((SdrEdgeObj*)pObj)->SetTailPoint(TRUE, aEnd);
+ }
+ else
+ {
+ DBG_ERROR("Object is NO connector object");
+ }
+
+ break;
+ }
+ case SID_DRAW_CAPTION:
+ case SID_DRAW_CAPTION_VERTICAL:
+ {
+ if(pObj->ISA(SdrCaptionObj))
+ {
+ sal_Bool bIsVertical(SID_DRAW_CAPTION_VERTICAL == nID);
+
+ ((SdrTextObj*)pObj)->SetVerticalWriting(bIsVertical);
+
+ if(bIsVertical)
+ {
+ SfxItemSet aSet(pObj->GetItemSet());
+ aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER));
+ aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
+ pObj->SetItemSet(aSet);
+ }
+
+ String aText(SdResId(STR_POOLSHEET_TEXT));
+ ((SdrCaptionObj*)pObj)->SetText(aText);
+ ((SdrCaptionObj*)pObj)->SetLogicRect(rRectangle);
+ ((SdrCaptionObj*)pObj)->SetTailPos(
+ rRectangle.TopLeft() - Point(rRectangle.GetWidth() / 2, rRectangle.GetHeight() / 2));
+ }
+ else
+ {
+ DBG_ERROR("Object is NO caption object");
+ }
+
+ break;
+ }
+ default:
+ {
+ pObj->SetLogicRect(rRectangle);
+
+ break;
+ }
+ }
+
+ SfxItemSet aAttr(pDoc->GetPool());
+ SetStyleSheet(aAttr, pObj);
+ SetAttributes(aAttr, pObj);
+ SetLineEnds(aAttr, pObj);
+ pObj->SetItemSet(aAttr);
+ }
+
+ return pObj;
+}
diff --git a/sd/source/ui/func/fuconuno.cxx b/sd/source/ui/func/fuconuno.cxx
index 2864d09a6254..e1c59b500510 100644
--- a/sd/source/ui/func/fuconuno.cxx
+++ b/sd/source/ui/func/fuconuno.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fuconuno.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: tbe $ $Date: 2000-11-10 16:22:17 $
+ * last change: $Author: aw $ $Date: 2002-02-15 16:51:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -232,4 +232,19 @@ void FuConstUnoControl::Deactivate()
pWindow->SetPointer( aOldPointer );
}
+// #97016#
+SdrObject* FuConstUnoControl::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+{
+ // case SID_FM_CREATE_CONTROL:
+
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
+ 0L, pDoc);
+
+ if(pObj)
+ {
+ pObj->SetLogicRect(rRectangle);
+ }
+ return pObj;
+}
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index ef2d4093ca08..c3a0dc15ca59 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fudraw.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: ka $ $Date: 2001-09-24 13:41:22 $
+ * last change: $Author: aw $ $Date: 2002-02-15 16:54:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -580,8 +580,10 @@ BOOL FuDraw::KeyInput(const KeyEvent& rKEvt)
// changeover to the next object
if(!pView->MarkNextObj( !aCode.IsShift() ))
{
- // if that does not function try the other direction
- while(pView->MarkNextObj( aCode.IsShift() )) ;
+ // #97016# No next object: go over open end and
+ // get first from the other side
+ pView->UnmarkAllObj();
+ pView->MarkNextObj(!aCode.IsShift());
}
bReturn = TRUE;
}
@@ -594,8 +596,10 @@ BOOL FuDraw::KeyInput(const KeyEvent& rKEvt)
if ( aCode.IsMod1() )
{
- // turn over to the next object
- while(pView->MarkNextObj(FALSE)) ;
+ // #97016# mark last object
+ pView->UnmarkAllObj();
+ pView->MarkNextObj(FALSE);
+
bReturn = TRUE;
}
}
@@ -607,8 +611,10 @@ BOOL FuDraw::KeyInput(const KeyEvent& rKEvt)
if ( aCode.IsMod1() )
{
- // turn over to the next object
- while(pView->MarkNextObj(TRUE)) ;
+ // #97016# mark first object
+ pView->UnmarkAllObj();
+ pView->MarkNextObj(TRUE);
+
bReturn = TRUE;
}
}
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index 80c7c3886fb4..124835b53230 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fupoor.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: ka $ $Date: 2002-01-09 12:43:18 $
+ * last change: $Author: aw $ $Date: 2002-02-15 16:56:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -500,9 +500,20 @@ BOOL FuPoor::KeyInput(const KeyEvent& rKEvt)
if (pView->HasMarkedObj() && !rKEvt.GetKeyCode().IsMod1() &&
!pDocSh->IsReadOnly())
{
- // Objekte verschieben
- nX *= 100;
- nY *= 100;
+ if(rKEvt.GetKeyCode().IsMod2())
+ {
+ // #97016# move in 1 pixel distance
+ Size aLogicSizeOnePixel = (pWindow) ? pWindow->PixelToLogic(Size(1,1)) : Size(100, 100);
+ nX *= aLogicSizeOnePixel.Width();
+ nY *= aLogicSizeOnePixel.Height();
+ }
+ else
+ {
+ // old, fixed move distance
+ nX *= 100;
+ nY *= 100;
+ }
+
pView->MoveAllMarked(Size(nX, nY));
}
else
@@ -704,4 +715,15 @@ void FuPoor::ReceiveRequest(SfxRequest& rReq)
}
}
+/*************************************************************************
+|*
+|* #97016#
+|*
+\************************************************************************/
+
+SdrObject* FuPoor::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+{
+ // empty base implementation
+ return 0L;
+}
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 0b5360a8c1ec..1e71ce632c4b 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: futext.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: aw $ $Date: 2002-02-04 13:57:25 $
+ * last change: $Author: aw $ $Date: 2002-02-15 16:54:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -555,6 +555,113 @@ BOOL FuText::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
+// #97016#
+void FuText::ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj)
+{
+ if(pDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS)
+ {
+ if( nSlotId == SID_ATTR_CHAR )
+ {
+ // Impress-Textobjekt wird erzeugt (faellt auf Zeilenhoehe zusammen)
+ // Damit das Objekt beim anschliessenden Erzeugen gleich die richtige
+ // Hoehe bekommt (sonst wird zuviel gepainted)
+ SfxItemSet aSet(pViewShell->GetPool());
+ aSet.Put(SdrTextMinFrameHeightItem(0));
+ aSet.Put(SdrTextAutoGrowWidthItem(FALSE));
+ aSet.Put(SdrTextAutoGrowHeightItem(TRUE));
+ pTxtObj->SetItemSet(aSet);
+ pTxtObj->AdjustTextFrameWidthAndHeight();
+ aSet.Put(SdrTextMaxFrameHeightItem(pTxtObj->GetLogicRect().GetSize().Height()));
+ pTxtObj->SetItemSet(aSet);
+ }
+ else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
+ {
+ SfxItemSet aSet(pViewShell->GetPool());
+ aSet.Put(SdrTextMinFrameWidthItem(0));
+ aSet.Put(SdrTextAutoGrowWidthItem(TRUE));
+ aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
+ pTxtObj->SetItemSet(aSet);
+ pTxtObj->AdjustTextFrameWidthAndHeight();
+ aSet.Put(SdrTextMaxFrameWidthItem(pTxtObj->GetLogicRect().GetSize().Width()));
+ pTxtObj->SetItemSet(aSet);
+ }
+ }
+ else
+ {
+ if( nSlotId == SID_ATTR_CHAR_VERTICAL )
+ {
+ // draw text object, needs to be initialized when vertical text is used
+ SfxItemSet aSet(pViewShell->GetPool());
+
+ // #91510#
+ aSet.Put(SdrTextAutoGrowWidthItem(TRUE));
+ aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
+
+ // #91508#
+ aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
+ aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
+
+ pTxtObj->SetItemSet(aSet);
+ }
+ }
+}
+
+// #97016#
+void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj)
+{
+ // FitToSize (An Rahmen anpassen)
+ SfxItemSet aSet(pViewShell->GetPool(), SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
+ SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
+ aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
+ aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
+ aSet.Put(SdrTextAutoGrowWidthItem(FALSE));
+ pTxtObj->SetItemSet(aSet);
+ pTxtObj->AdjustTextFrameWidthAndHeight();
+}
+
+// #97016#
+void FuText::ImpSetAttributesFitToSizeVertical(SdrTextObj* pTxtObj)
+{
+ SfxItemSet aSet(pViewShell->GetPool(),
+ SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
+ SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
+ aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
+ aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
+ aSet.Put(SdrTextAutoGrowWidthItem(FALSE));
+ pTxtObj->SetItemSet(aSet);
+ pTxtObj->AdjustTextFrameWidthAndHeight();
+}
+
+// #97016#
+void FuText::ImpSetAttributesFitCommon(SdrTextObj* pTxtObj)
+{
+ // Normales Textobjekt
+ if (pDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS)
+ {
+ if( nSlotId == SID_ATTR_CHAR )
+ {
+ // Impress-Textobjekt (faellt auf Zeilenhoehe zusammen)
+ SfxItemSet aSet(pViewShell->GetPool());
+ aSet.Put(SdrTextMinFrameHeightItem(0));
+ aSet.Put(SdrTextMaxFrameHeightItem(0));
+ aSet.Put(SdrTextAutoGrowHeightItem(TRUE));
+ aSet.Put(SdrTextAutoGrowWidthItem(FALSE));
+ pTxtObj->SetItemSet(aSet);
+ }
+ else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
+ {
+ SfxItemSet aSet(pViewShell->GetPool());
+ aSet.Put(SdrTextMinFrameWidthItem(0));
+ aSet.Put(SdrTextMaxFrameWidthItem(0));
+ aSet.Put(SdrTextAutoGrowWidthItem(TRUE));
+ aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
+ pTxtObj->SetItemSet(aSet);
+ }
+
+ pTxtObj->AdjustTextFrameWidthAndHeight();
+ }
+}
+
BOOL FuText::MouseButtonUp(const MouseEvent& rMEvt)
{
BOOL bReturn = FALSE;
@@ -631,52 +738,8 @@ BOOL FuText::MouseButtonUp(const MouseEvent& rMEvt)
// #91508# and #91510#
if(pTextObj)
{
- if(pDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS)
- {
- if( nSlotId == SID_ATTR_CHAR )
- {
- // Impress-Textobjekt wird erzeugt (faellt auf Zeilenhoehe zusammen)
- // Damit das Objekt beim anschliessenden Erzeugen gleich die richtige
- // Hoehe bekommt (sonst wird zuviel gepainted)
- SfxItemSet aSet(pViewShell->GetPool());
- aSet.Put(SdrTextMinFrameHeightItem(0));
- aSet.Put(SdrTextAutoGrowWidthItem(FALSE));
- aSet.Put(SdrTextAutoGrowHeightItem(TRUE));
- pTextObj->SetItemSet(aSet);
- pTextObj->AdjustTextFrameWidthAndHeight();
- aSet.Put(SdrTextMaxFrameHeightItem(pTextObj->GetLogicRect().GetSize().Height()));
- pTextObj->SetItemSet(aSet);
- }
- else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
- {
- SfxItemSet aSet(pViewShell->GetPool());
- aSet.Put(SdrTextMinFrameWidthItem(0));
- aSet.Put(SdrTextAutoGrowWidthItem(TRUE));
- aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
- pTextObj->SetItemSet(aSet);
- pTextObj->AdjustTextFrameWidthAndHeight();
- aSet.Put(SdrTextMaxFrameWidthItem(pTextObj->GetLogicRect().GetSize().Width()));
- pTextObj->SetItemSet(aSet);
- }
- }
- else
- {
- if( nSlotId == SID_ATTR_CHAR_VERTICAL )
- {
- // draw text object, needs to be initialized when vertical text is used
- SfxItemSet aSet(pViewShell->GetPool());
-
- // #91510#
- aSet.Put(SdrTextAutoGrowWidthItem(TRUE));
- aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
-
- // #91508#
- aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
- aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
-
- pTextObj->SetItemSet(aSet);
- }
- }
+ // #97016#
+ ImpSetAttributesForNewTextObject(pTextObj);
}
if (!pView->EndCreateObj(SDRCREATE_FORCEEND))
@@ -686,56 +749,22 @@ BOOL FuText::MouseButtonUp(const MouseEvent& rMEvt)
}
else if (nSlotId == SID_TEXT_FITTOSIZE)
{
- // FitToSize (An Rahmen anpassen)
- SfxItemSet aSet(pViewShell->GetPool(),
- SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
- SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
- aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
- aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
- aSet.Put(SdrTextAutoGrowWidthItem(FALSE));
- pTextObj->SetItemSet(aSet);
- pTextObj->AdjustTextFrameWidthAndHeight();
+ // #97016#
+ ImpSetAttributesFitToSize(pTextObj);
+
SetInEditMode(rMEvt, FALSE);
}
else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
{
- SfxItemSet aSet(pViewShell->GetPool(),
- SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
- SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
- aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
- aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
- aSet.Put(SdrTextAutoGrowWidthItem(FALSE));
- pTextObj->SetItemSet(aSet);
- pTextObj->AdjustTextFrameWidthAndHeight();
+ // #97016#
+ ImpSetAttributesFitToSizeVertical(pTextObj);
+
SetInEditMode(rMEvt, FALSE);
}
else
{
- // Normales Textobjekt
- if (pDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS)
- {
- if( nSlotId == SID_ATTR_CHAR )
- {
- // Impress-Textobjekt (faellt auf Zeilenhoehe zusammen)
- SfxItemSet aSet(pViewShell->GetPool());
- aSet.Put(SdrTextMinFrameHeightItem(0));
- aSet.Put(SdrTextMaxFrameHeightItem(0));
- aSet.Put(SdrTextAutoGrowHeightItem(TRUE));
- aSet.Put(SdrTextAutoGrowWidthItem(FALSE));
- pTextObj->SetItemSet(aSet);
- }
- else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
- {
- SfxItemSet aSet(pViewShell->GetPool());
- aSet.Put(SdrTextMinFrameWidthItem(0));
- aSet.Put(SdrTextMaxFrameWidthItem(0));
- aSet.Put(SdrTextAutoGrowWidthItem(TRUE));
- aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
- pTextObj->SetItemSet(aSet);
- }
-
- pTextObj->AdjustTextFrameWidthAndHeight();
- }
+ // #97016#
+ ImpSetAttributesFitCommon(pTextObj);
// Damit die Handles und der graue Rahmen stimmen
pView->AdjustMarkHdl();
@@ -1424,5 +1453,57 @@ void FuText::DoubleClick(const MouseEvent& rMEvt)
// Nichts zu tun
}
+// #97016#
+SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+{
+ // case SID_TEXTEDIT: // BASIC ???
+ // case SID_ATTR_CHAR:
+ // case SID_ATTR_CHAR_VERTICAL:
+ // case SID_TEXT_FITTOSIZE:
+ // case SID_TEXT_FITTOSIZE_VERTICAL:
+
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
+ 0L, pDoc);
+
+ if(pObj)
+ {
+ if(pObj->ISA(SdrTextObj))
+ {
+ SdrTextObj* pText = (SdrTextObj*)pObj;
+ pText->SetLogicRect(rRectangle);
+
+ sal_Bool bVertical = (SID_ATTR_CHAR_VERTICAL == nID || SID_TEXT_FITTOSIZE_VERTICAL == nID);
+ pText->SetVerticalWriting(bVertical);
+
+ String aText(SdResId(STR_POOLSHEET_TEXT));
+ pText->SetText(aText);
+
+ // #97016#
+ ImpSetAttributesForNewTextObject(pText);
+
+ if (nSlotId == SID_TEXT_FITTOSIZE)
+ {
+ // #97016#
+ ImpSetAttributesFitToSize(pText);
+ }
+ else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
+ {
+ // #97016#
+ ImpSetAttributesFitToSizeVertical(pText);
+ }
+ else
+ {
+ // #97016#
+ ImpSetAttributesFitCommon(pText);
+ }
+ }
+ else
+ {
+ DBG_ERROR("Object is NO text object");
+ }
+ }
+ return pObj;
+}