1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svdedtv1.cxx,v $
10 * $Revision: 1.30.146.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 #include <svx/svdedtv.hxx>
40 #include <tools/bigint.hxx>
41 #include <svtools/itemiter.hxx>
42 #include <vcl/msgbox.hxx>
43 #include <svx/rectenum.hxx>
44 #include <svx/svxids.hrc> // fuer SID_ATTR_TRANSFORM_...
45 #include <svx/svdattr.hxx> // fuer Get/SetGeoAttr
46 #include "svditext.hxx"
47 #include "svditer.hxx"
48 #include <svx/svdtrans.hxx>
49 #include <svx/svdundo.hxx>
50 #include <svx/svdpage.hxx>
51 #include <svx/svdpagv.hxx>
52 #include <svx/svdlayer.hxx> // fuer MergeNotPersistAttr
53 #include <svx/svdattrx.hxx> // fuer MergeNotPersistAttr
54 #include <svx/svdetc.hxx> // fuer SearchOutlinerItems
55 #include <svx/svdopath.hxx> // fuer Crook
56 #include "svdstr.hrc" // Namen aus der Resource
57 #include "svdglob.hxx" // StringCache
58 #include <svx/eeitem.hxx>
59 #include <svtools/aeitem.hxx>
60 #include <svtools/whiter.hxx>
61 #include <svx/sdr/contact/objectcontact.hxx>
62 #include <svx/sdr/contact/viewcontact.hxx>
63 #include <svx/e3dsceneupdater.hxx>
64 #include <svx/obj3d.hxx>
66 ////////////////////////////////////////////////////////////////////////////////////////////////////
67 ////////////////////////////////////////////////////////////////////////////////////////////////////
68 ////////////////////////////////////////////////////////////////////////////////////////////////////
69 ////////////////////////////////////////////////////////////////////////////////////////////////////
71 // @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
72 // @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
73 // @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
74 // @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
75 // @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
76 // @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
77 // @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
79 ////////////////////////////////////////////////////////////////////////////////////////////////////
80 ////////////////////////////////////////////////////////////////////////////////////////////////////
82 void SdrEditView::SetMarkedObjRect(const Rectangle
& rRect
, BOOL bCopy
)
84 DBG_ASSERT(!rRect
.IsEmpty(),"SetMarkedObjRect() mit leerem Rect mach keinen Sinn");
85 if (rRect
.IsEmpty()) return;
86 ULONG nAnz
=GetMarkedObjectCount();
88 Rectangle
aR0(GetMarkedObjRect());
89 DBG_ASSERT(!aR0
.IsEmpty(),"SetMarkedObjRect(): GetMarkedObjRect() ist leer");
90 if (aR0
.IsEmpty()) return;
93 long w0
=aR0
.Right()-x0
;
94 long h0
=aR0
.Bottom()-y0
;
97 long w1
=rRect
.Right()-x1
;
98 long h1
=rRect
.Bottom()-y1
;
100 ImpTakeDescriptionStr(STR_EditPosSize
,aStr
);
102 aStr
+=ImpGetResStr(STR_EditWithCopy
);
104 const bool bUndo
= IsUndoEnabled();
111 for (ULONG nm
=0; nm
<nAnz
; nm
++)
113 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
114 SdrObject
* pO
=pM
->GetMarkedSdrObj();
116 AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO
));
118 Rectangle
aR1(pO
->GetSnapRect());
126 { // aR1 von aR0 nach rRect transformieren
128 BigInt
l(aR1
.Left());
129 BigInt
r(aR1
.Right());
131 BigInt
b(aR1
.Bottom());
145 aR1
.Right ()=long(r
);
147 aR1
.Bottom()=long(b
);
150 pO
->SetSnapRect(aR1
);
152 DBG_ERROR("SetMarkedObjRect(): pObj->GetSnapRect() liefert leeres Rect");
159 std::vector
< SdrUndoAction
* > SdrEditView::CreateConnectorUndo( SdrObject
& rO
)
161 std::vector
< SdrUndoAction
* > vUndoActions
;
163 if ( rO
.GetBroadcaster() )
165 const SdrPage
* pPage
= rO
.GetPage();
168 SdrObjListIter
aIter( *pPage
, IM_DEEPWITHGROUPS
);
169 while( aIter
.IsMore() )
171 SdrObject
* pPartObj
= aIter
.Next();
172 if ( pPartObj
->ISA( SdrEdgeObj
) )
174 if ( ( pPartObj
->GetConnectedNode( sal_False
) == &rO
) ||
175 ( pPartObj
->GetConnectedNode( sal_True
) == &rO
) )
177 vUndoActions
.push_back( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject( *pPartObj
) );
186 void SdrEditView::AddUndoActions( std::vector
< SdrUndoAction
* >& rUndoActions
)
188 std::vector
< SdrUndoAction
* >::iterator
aUndoActionIter( rUndoActions
.begin() );
189 while( aUndoActionIter
!= rUndoActions
.end() )
190 AddUndo( *aUndoActionIter
++ );
193 void SdrEditView::MoveMarkedObj(const Size
& rSiz
, bool bCopy
)
195 const bool bUndo
= IsUndoEnabled();
199 XubString
aStr(ImpGetResStr(STR_EditMove
));
201 aStr
+=ImpGetResStr(STR_EditWithCopy
);
202 // benoetigt eigene UndoGroup wegen Parameter
203 BegUndo(aStr
,GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_MOVE
);
209 ULONG nMarkAnz
=GetMarkedObjectCount();
210 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++)
212 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
213 SdrObject
* pO
=pM
->GetMarkedSdrObj();
216 std::vector
< SdrUndoAction
* > vConnectorUndoActions( CreateConnectorUndo( *pO
) );
217 AddUndoActions( vConnectorUndoActions
);
218 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pO
,rSiz
));
227 void SdrEditView::ResizeMarkedObj(const Point
& rRef
, const Fraction
& xFact
, const Fraction
& yFact
, bool bCopy
)
229 const bool bUndo
= IsUndoEnabled();
233 ImpTakeDescriptionStr(STR_EditResize
,aStr
);
235 aStr
+=ImpGetResStr(STR_EditWithCopy
);
242 ULONG nMarkAnz
=GetMarkedObjectCount();
243 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++)
245 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
246 SdrObject
* pO
=pM
->GetMarkedSdrObj();
249 std::vector
< SdrUndoAction
* > vConnectorUndoActions( CreateConnectorUndo( *pO
) );
250 AddUndoActions( vConnectorUndoActions
);
251 AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO
));
253 pO
->Resize(rRef
,xFact
,yFact
);
260 long SdrEditView::GetMarkedObjRotate() const
265 ULONG nMarkAnz
=GetMarkedObjectCount();
266 for (ULONG nm
=0; nm
<nMarkAnz
&& bOk
; nm
++) {
267 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
268 SdrObject
* pO
=pM
->GetMarkedSdrObj();
269 long nWink2
=pO
->GetRotateAngle();
270 if (b1st
) nWink
=nWink2
;
271 else if (nWink2
!=nWink
) bOk
=FALSE
;
278 void SdrEditView::RotateMarkedObj(const Point
& rRef
, long nWink
, bool bCopy
)
280 const bool bUndo
= IsUndoEnabled();
284 ImpTakeDescriptionStr(STR_EditRotate
,aStr
);
285 if (bCopy
) aStr
+=ImpGetResStr(STR_EditWithCopy
);
292 double nSin
=sin(nWink
*nPi180
);
293 double nCos
=cos(nWink
*nPi180
);
294 const sal_uInt32
nMarkAnz(GetMarkedObjectCount());
298 std::vector
< E3DModifySceneSnapRectUpdater
* > aUpdaters
;
300 for(sal_uInt32
nm(0); nm
< nMarkAnz
; nm
++)
302 SdrMark
* pM
= GetSdrMarkByIndex(nm
);
303 SdrObject
* pO
= pM
->GetMarkedSdrObj();
307 // extra undo actions for changed connector which now may hold it's layouted path (SJ)
308 std::vector
< SdrUndoAction
* > vConnectorUndoActions( CreateConnectorUndo( *pO
) );
309 AddUndoActions( vConnectorUndoActions
);
311 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO
));
314 // set up a scene updater if object is a 3d object
315 if(dynamic_cast< E3dObject
* >(pO
))
317 aUpdaters
.push_back(new E3DModifySceneSnapRectUpdater(pO
));
320 pO
->Rotate(rRef
,nWink
,nSin
,nCos
);
323 // fire scene updaters
324 while(aUpdaters
.size())
326 delete aUpdaters
.back();
327 aUpdaters
.pop_back();
335 void SdrEditView::MirrorMarkedObj(const Point
& rRef1
, const Point
& rRef2
, bool bCopy
)
337 const bool bUndo
= IsUndoEnabled();
342 Point
aDif(rRef2
-rRef1
);
343 if (aDif
.X()==0) ImpTakeDescriptionStr(STR_EditMirrorHori
,aStr
);
344 else if (aDif
.Y()==0) ImpTakeDescriptionStr(STR_EditMirrorVert
,aStr
);
345 else if (Abs(aDif
.X())==Abs(aDif
.Y())) ImpTakeDescriptionStr(STR_EditMirrorDiag
,aStr
);
346 else ImpTakeDescriptionStr(STR_EditMirrorFree
,aStr
);
347 if (bCopy
) aStr
+=ImpGetResStr(STR_EditWithCopy
);
354 const sal_uInt32
nMarkAnz(GetMarkedObjectCount());
358 std::vector
< E3DModifySceneSnapRectUpdater
* > aUpdaters
;
360 for(sal_uInt32
nm(0); nm
< nMarkAnz
; nm
++)
362 SdrMark
* pM
= GetSdrMarkByIndex(nm
);
363 SdrObject
* pO
= pM
->GetMarkedSdrObj();
367 // extra undo actions for changed connector which now may hold it's layouted path (SJ)
368 std::vector
< SdrUndoAction
* > vConnectorUndoActions( CreateConnectorUndo( *pO
) );
369 AddUndoActions( vConnectorUndoActions
);
371 AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO
));
374 // set up a scene updater if object is a 3d object
375 if(dynamic_cast< E3dObject
* >(pO
))
377 aUpdaters
.push_back(new E3DModifySceneSnapRectUpdater(pO
));
380 pO
->Mirror(rRef1
,rRef2
);
383 // fire scene updaters
384 while(aUpdaters
.size())
386 delete aUpdaters
.back();
387 aUpdaters
.pop_back();
395 void SdrEditView::MirrorMarkedObjHorizontal(BOOL bCopy
)
397 Point
aCenter(GetMarkedObjRect().Center());
400 MirrorMarkedObj(aCenter
,aPt2
,bCopy
);
403 void SdrEditView::MirrorMarkedObjVertical(BOOL bCopy
)
405 Point
aCenter(GetMarkedObjRect().Center());
408 MirrorMarkedObj(aCenter
,aPt2
,bCopy
);
411 long SdrEditView::GetMarkedObjShear() const
416 ULONG nMarkAnz
=GetMarkedObjectCount();
417 for (ULONG nm
=0; nm
<nMarkAnz
&& bOk
; nm
++) {
418 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
419 SdrObject
* pO
=pM
->GetMarkedSdrObj();
420 long nWink2
=pO
->GetShearAngle();
421 if (b1st
) nWink
=nWink2
;
422 else if (nWink2
!=nWink
) bOk
=FALSE
;
425 if (nWink
>SDRMAXSHEAR
) nWink
=SDRMAXSHEAR
;
426 if (nWink
<-SDRMAXSHEAR
) nWink
=-SDRMAXSHEAR
;
431 void SdrEditView::ShearMarkedObj(const Point
& rRef
, long nWink
, bool bVShear
, bool bCopy
)
433 const bool bUndo
= IsUndoEnabled();
438 ImpTakeDescriptionStr(STR_EditShear
,aStr
);
440 aStr
+=ImpGetResStr(STR_EditWithCopy
);
447 double nTan
=tan(nWink
*nPi180
);
448 ULONG nMarkAnz
=GetMarkedObjectCount();
449 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++)
451 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
452 SdrObject
* pO
=pM
->GetMarkedSdrObj();
455 std::vector
< SdrUndoAction
* > vConnectorUndoActions( CreateConnectorUndo( *pO
) );
456 AddUndoActions( vConnectorUndoActions
);
457 AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO
));
459 pO
->Shear(rRef
,nWink
,nTan
,bVShear
);
466 void SdrEditView::ImpCrookObj(SdrObject
* pO
, const Point
& rRef
, const Point
& rRad
,
467 SdrCrookMode eMode
, BOOL bVertical
, BOOL bNoContortion
, BOOL bRotate
, const Rectangle
& rMarkRect
)
469 SdrPathObj
* pPath
=PTR_CAST(SdrPathObj
,pO
);
472 if(pPath
!=NULL
&& !bNoContortion
)
474 XPolyPolygon
aXPP(pPath
->GetPathPoly());
476 case SDRCROOK_ROTATE
: CrookRotatePoly (aXPP
,rRef
,rRad
,bVertical
); break;
477 case SDRCROOK_SLANT
: CrookSlantPoly (aXPP
,rRef
,rRad
,bVertical
); break;
478 case SDRCROOK_STRETCH
: CrookStretchPoly(aXPP
,rRef
,rRad
,bVertical
,rMarkRect
); break;
480 pPath
->SetPathPoly(aXPP
.getB2DPolyPolygon());
484 if(!bDone
&& !pPath
&& pO
->IsPolyObj() && 0L != pO
->GetPointCount())
486 // FuerPolyObj's, aber NICHT fuer SdrPathObj's, z.B. fuer's Bemassungsobjekt
487 sal_uInt32
nPtAnz(pO
->GetPointCount());
488 XPolygon
aXP((sal_uInt16
)nPtAnz
);
491 for(nPtNum
= 0L; nPtNum
< nPtAnz
; nPtNum
++)
493 Point
aPt(pO
->GetPoint(nPtNum
));
494 aXP
[(sal_uInt16
)nPtNum
]=aPt
;
499 case SDRCROOK_ROTATE
: CrookRotatePoly (aXP
,rRef
,rRad
,bVertical
); break;
500 case SDRCROOK_SLANT
: CrookSlantPoly (aXP
,rRef
,rRad
,bVertical
); break;
501 case SDRCROOK_STRETCH
: CrookStretchPoly(aXP
,rRef
,rRad
,bVertical
,rMarkRect
); break;
504 for(nPtNum
= 0L; nPtNum
< nPtAnz
; nPtNum
++)
506 // hier koennte man vieleicht auch mal das Broadcasting optimieren
507 // ist aber z.Zt. bei den 2 Punkten des Bemassungsobjekts noch nicht so tragisch
508 pO
->SetPoint(aXP
[(sal_uInt16
)nPtNum
],nPtNum
);
516 // Fuer alle anderen oder wenn bNoContortion
517 Point
aCtr0(pO
->GetSnapRect().Center());
519 sal_Bool
bRotOk(sal_False
);
520 double nSin(0.0), nCos(1.0);
523 if(0 != rRad
.X() && 0 != rRad
.Y())
529 case SDRCROOK_ROTATE
: nWink
=CrookRotateXPoint (aCtr1
,NULL
,NULL
,rRef
,rRad
,nSin
,nCos
,bVertical
); bRotOk
=bRotate
; break;
530 case SDRCROOK_SLANT
: nWink
=CrookSlantXPoint (aCtr1
,NULL
,NULL
,rRef
,rRad
,nSin
,nCos
,bVertical
); break;
531 case SDRCROOK_STRETCH
: nWink
=CrookStretchXPoint(aCtr1
,NULL
,NULL
,rRef
,rRad
,nSin
,nCos
,bVertical
,rMarkRect
); break;
538 pO
->Rotate(aCtr0
, Round(nWink
/nPi180
), nSin
, nCos
);
540 pO
->Move(Size(aCtr1
.X(),aCtr1
.Y()));
544 void SdrEditView::CrookMarkedObj(const Point
& rRef
, const Point
& rRad
, SdrCrookMode eMode
,
545 bool bVertical
, bool bNoContortion
, bool bCopy
)
547 Rectangle
aMarkRect(GetMarkedObjRect());
548 const bool bUndo
= IsUndoEnabled();
550 bool bRotate
=bNoContortion
&& eMode
==SDRCROOK_ROTATE
&& IsRotateAllowed(FALSE
);
555 ImpTakeDescriptionStr(bNoContortion
?STR_EditCrook
:STR_EditCrookContortion
,aStr
);
557 aStr
+=ImpGetResStr(STR_EditWithCopy
);
564 ULONG nMarkAnz
=GetMarkedObjectCount();
565 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++)
567 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
568 SdrObject
* pO
=pM
->GetMarkedSdrObj();
570 AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO
));
572 const SdrObjList
* pOL
=pO
->GetSubList();
573 if (bNoContortion
|| pOL
==NULL
) {
574 ImpCrookObj(pO
,rRef
,rRad
,eMode
,bVertical
,bNoContortion
,bRotate
,aMarkRect
);
576 SdrObjListIter
aIter(*pOL
,IM_DEEPNOGROUPS
);
577 while (aIter
.IsMore()) {
578 SdrObject
* pO1
=aIter
.Next();
579 ImpCrookObj(pO1
,rRef
,rRad
,eMode
,bVertical
,bNoContortion
,bRotate
,aMarkRect
);
588 void SdrEditView::ImpDistortObj(SdrObject
* pO
, const Rectangle
& rRef
, const XPolygon
& rDistortedRect
, BOOL bNoContortion
)
590 SdrPathObj
* pPath
= PTR_CAST(SdrPathObj
, pO
);
592 if(!bNoContortion
&& pPath
)
594 XPolyPolygon
aXPP(pPath
->GetPathPoly());
595 aXPP
.Distort(rRef
, rDistortedRect
);
596 pPath
->SetPathPoly(aXPP
.getB2DPolyPolygon());
598 else if(pO
->IsPolyObj())
600 // z.B. fuer's Bemassungsobjekt
601 sal_uInt32
nPtAnz(pO
->GetPointCount());
602 XPolygon
aXP((sal_uInt16
)nPtAnz
);
605 for(nPtNum
= 0L; nPtNum
< nPtAnz
; nPtNum
++)
607 Point
aPt(pO
->GetPoint(nPtNum
));
608 aXP
[(sal_uInt16
)nPtNum
]=aPt
;
611 aXP
.Distort(rRef
, rDistortedRect
);
613 for(nPtNum
= 0L; nPtNum
< nPtAnz
; nPtNum
++)
615 // hier koennte man vieleicht auch mal das Broadcasting optimieren
616 // ist aber z.Zt. bei den 2 Punkten des Bemassungsobjekts noch nicht so tragisch
617 pO
->SetPoint(aXP
[(sal_uInt16
)nPtNum
],nPtNum
);
622 void SdrEditView::DistortMarkedObj(const Rectangle
& rRef
, const XPolygon
& rDistortedRect
, bool bNoContortion
, bool bCopy
)
624 const bool bUndo
= IsUndoEnabled();
629 ImpTakeDescriptionStr(STR_EditDistort
,aStr
);
631 aStr
+=ImpGetResStr(STR_EditWithCopy
);
638 ULONG nMarkAnz
=GetMarkedObjectCount();
639 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++)
641 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
642 SdrObject
* pO
=pM
->GetMarkedSdrObj();
644 AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO
));
646 Rectangle
aRefRect(rRef
);
647 XPolygon
aRefPoly(rDistortedRect
);
648 const SdrObjList
* pOL
=pO
->GetSubList();
649 if (bNoContortion
|| pOL
==NULL
) {
650 ImpDistortObj(pO
,aRefRect
,aRefPoly
,bNoContortion
);
652 SdrObjListIter
aIter(*pOL
,IM_DEEPNOGROUPS
);
653 while (aIter
.IsMore()) {
654 SdrObject
* pO1
=aIter
.Next();
655 ImpDistortObj(pO1
,aRefRect
,aRefPoly
,bNoContortion
);
663 ////////////////////////////////////////////////////////////////////////////////////////////////////
665 void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet
& rAttr
, BOOL
/*bReplaceAll*/)
667 // bReplaceAll hat hier keinerlei Wirkung
668 Rectangle
aAllSnapRect(GetMarkedObjRect());
669 const SfxPoolItem
*pPoolItem
=NULL
;
670 if (rAttr
.GetItemState(SDRATTR_TRANSFORMREF1X
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
671 long n
=((const SdrTransformRef1XItem
*)pPoolItem
)->GetValue();
672 SetRef1(Point(n
,GetRef1().Y()));
674 if (rAttr
.GetItemState(SDRATTR_TRANSFORMREF1Y
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
675 long n
=((const SdrTransformRef1YItem
*)pPoolItem
)->GetValue();
676 SetRef1(Point(GetRef1().X(),n
));
678 if (rAttr
.GetItemState(SDRATTR_TRANSFORMREF2X
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
679 long n
=((const SdrTransformRef2XItem
*)pPoolItem
)->GetValue();
680 SetRef2(Point(n
,GetRef2().Y()));
682 if (rAttr
.GetItemState(SDRATTR_TRANSFORMREF2Y
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
683 long n
=((const SdrTransformRef2YItem
*)pPoolItem
)->GetValue();
684 SetRef2(Point(GetRef2().X(),n
));
686 long nAllPosX
=0; BOOL bAllPosX
=FALSE
;
687 long nAllPosY
=0; BOOL bAllPosY
=FALSE
;
688 long nAllWdt
=0; BOOL bAllWdt
=FALSE
;
689 long nAllHgt
=0; BOOL bAllHgt
=FALSE
;
691 if (rAttr
.GetItemState(SDRATTR_ALLPOSITIONX
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
692 nAllPosX
=((const SdrAllPositionXItem
*)pPoolItem
)->GetValue();
693 bAllPosX
=TRUE
; bDoIt
=TRUE
;
695 if (rAttr
.GetItemState(SDRATTR_ALLPOSITIONY
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
696 nAllPosY
=((const SdrAllPositionYItem
*)pPoolItem
)->GetValue();
697 bAllPosY
=TRUE
; bDoIt
=TRUE
;
699 if (rAttr
.GetItemState(SDRATTR_ALLSIZEWIDTH
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
700 nAllWdt
=((const SdrAllSizeWidthItem
*)pPoolItem
)->GetValue();
701 bAllWdt
=TRUE
; bDoIt
=TRUE
;
703 if (rAttr
.GetItemState(SDRATTR_ALLSIZEHEIGHT
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
704 nAllHgt
=((const SdrAllSizeHeightItem
*)pPoolItem
)->GetValue();
705 bAllHgt
=TRUE
; bDoIt
=TRUE
;
708 Rectangle
aRect(aAllSnapRect
); // !!! fuer PolyPt's und GluePt's aber bitte noch aendern !!!
709 if (bAllPosX
) aRect
.Move(nAllPosX
-aRect
.Left(),0);
710 if (bAllPosY
) aRect
.Move(0,nAllPosY
-aRect
.Top());
711 if (bAllWdt
) aRect
.Right()=aAllSnapRect
.Left()+nAllWdt
;
712 if (bAllHgt
) aRect
.Bottom()=aAllSnapRect
.Top()+nAllHgt
;
713 SetMarkedObjRect(aRect
);
715 if (rAttr
.GetItemState(SDRATTR_RESIZEXALL
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
716 Fraction aXFact
=((const SdrResizeXAllItem
*)pPoolItem
)->GetValue();
717 ResizeMarkedObj(aAllSnapRect
.TopLeft(),aXFact
,Fraction(1,1));
719 if (rAttr
.GetItemState(SDRATTR_RESIZEYALL
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
720 Fraction aYFact
=((const SdrResizeYAllItem
*)pPoolItem
)->GetValue();
721 ResizeMarkedObj(aAllSnapRect
.TopLeft(),Fraction(1,1),aYFact
);
723 if (rAttr
.GetItemState(SDRATTR_ROTATEALL
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
724 long nAngle
=((const SdrRotateAllItem
*)pPoolItem
)->GetValue();
725 RotateMarkedObj(aAllSnapRect
.Center(),nAngle
);
727 if (rAttr
.GetItemState(SDRATTR_HORZSHEARALL
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
728 long nAngle
=((const SdrHorzShearAllItem
*)pPoolItem
)->GetValue();
729 ShearMarkedObj(aAllSnapRect
.Center(),nAngle
,FALSE
);
731 if (rAttr
.GetItemState(SDRATTR_VERTSHEARALL
,TRUE
,&pPoolItem
)==SFX_ITEM_SET
) {
732 long nAngle
=((const SdrVertShearAllItem
*)pPoolItem
)->GetValue();
733 ShearMarkedObj(aAllSnapRect
.Center(),nAngle
,TRUE
);
736 const bool bUndo
= IsUndoEnabled();
738 // Todo: WhichRange nach Notwendigkeit ueberpruefen.
739 ULONG nMarkAnz
=GetMarkedObjectCount();
740 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++)
742 const SdrMark
* pM
=GetSdrMarkByIndex(nm
);
743 SdrObject
* pObj
=pM
->GetMarkedSdrObj();
744 //const SdrPageView* pPV=pM->GetPageView();
746 AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj
));
748 pObj
->ApplyNotPersistAttr(rAttr
);
752 void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet
& rAttr
, BOOL
/*bOnlyHardAttr*/) const
754 // bOnlyHardAttr hat hier keinerlei Wirkung
755 // Hier muss ausserdem noch der Nullpunkt und
756 // die PvPos berueksichtigt werden.
757 Rectangle
aAllSnapRect(GetMarkedObjRect()); // !!! fuer PolyPt's und GluePt's aber bitte noch aendern !!!
758 long nAllSnapPosX
=aAllSnapRect
.Left();
759 long nAllSnapPosY
=aAllSnapRect
.Top();
760 long nAllSnapWdt
=aAllSnapRect
.GetWidth()-1;
761 long nAllSnapHgt
=aAllSnapRect
.GetHeight()-1;
762 // koennte mal zu CheckPossibilities mit rein
763 BOOL bMovProtect
=FALSE
,bMovProtectDC
=FALSE
;
764 BOOL bSizProtect
=FALSE
,bSizProtectDC
=FALSE
;
765 BOOL bPrintable
=TRUE
,bPrintableDC
=FALSE
;
766 SdrLayerID nLayerId
=0; BOOL bLayerDC
=FALSE
;
767 XubString aObjName
; BOOL bObjNameDC
=FALSE
,bObjNameSet
=FALSE
;
768 long nSnapPosX
=0; BOOL bSnapPosXDC
=FALSE
;
769 long nSnapPosY
=0; BOOL bSnapPosYDC
=FALSE
;
770 long nSnapWdt
=0; BOOL bSnapWdtDC
=FALSE
;
771 long nSnapHgt
=0; BOOL bSnapHgtDC
=FALSE
;
772 long nLogicWdt
=0; BOOL bLogicWdtDC
=FALSE
,bLogicWdtDiff
=FALSE
;
773 long nLogicHgt
=0; BOOL bLogicHgtDC
=FALSE
,bLogicHgtDiff
=FALSE
;
774 long nRotAngle
=0; BOOL bRotAngleDC
=FALSE
;
775 long nShrAngle
=0; BOOL bShrAngleDC
=FALSE
;
777 Rectangle aLogicRect
;
778 ULONG nMarkAnz
=GetMarkedObjectCount();
779 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++) {
780 const SdrMark
* pM
=GetSdrMarkByIndex(nm
);
781 const SdrObject
* pObj
=pM
->GetMarkedSdrObj();
783 nLayerId
=pObj
->GetLayer();
784 bMovProtect
=pObj
->IsMoveProtect();
785 bSizProtect
=pObj
->IsResizeProtect();
786 bPrintable
=pObj
->IsPrintable();
787 Rectangle
aSnapRect2(pObj
->GetSnapRect());
788 Rectangle
aLogicRect2(pObj
->GetLogicRect());
789 nSnapPosX
=aSnapRect2
.Left();
790 nSnapPosY
=aSnapRect2
.Top();
791 nSnapWdt
=aSnapRect2
.GetWidth()-1;
792 nSnapHgt
=aSnapRect2
.GetHeight()-1;
793 nLogicWdt
=aLogicRect2
.GetWidth()-1;
794 nLogicHgt
=aLogicRect2
.GetHeight()-1;
795 bLogicWdtDiff
=nLogicWdt
!=nSnapWdt
;
796 bLogicHgtDiff
=nLogicHgt
!=nSnapHgt
;
797 nRotAngle
=pObj
->GetRotateAngle();
798 nShrAngle
=pObj
->GetShearAngle();
800 if (!bLayerDC
&& nLayerId
!=pObj
->GetLayer()) bLayerDC
=TRUE
;
801 if (!bMovProtectDC
&& bMovProtect
!=pObj
->IsMoveProtect()) bMovProtectDC
=TRUE
;
802 if (!bSizProtectDC
&& bSizProtect
!=pObj
->IsResizeProtect()) bSizProtectDC
=TRUE
;
803 if (!bPrintableDC
&& bPrintable
!=pObj
->IsPrintable()) bPrintableDC
=TRUE
;
804 if (!bRotAngleDC
&& nRotAngle
!=pObj
->GetRotateAngle()) bRotAngleDC
=TRUE
;
805 if (!bShrAngleDC
&& nShrAngle
!=pObj
->GetShearAngle()) bShrAngleDC
=TRUE
;
806 if (!bSnapWdtDC
|| !bSnapHgtDC
|| !bSnapPosXDC
|| !bSnapPosYDC
|| !bLogicWdtDiff
|| !bLogicHgtDiff
) {
807 aSnapRect
=pObj
->GetSnapRect();
808 if (nSnapPosX
!=aSnapRect
.Left()) bSnapPosXDC
=TRUE
;
809 if (nSnapPosY
!=aSnapRect
.Top()) bSnapPosYDC
=TRUE
;
810 if (nSnapWdt
!=aSnapRect
.GetWidth()-1) bSnapWdtDC
=TRUE
;
811 if (nSnapHgt
!=aSnapRect
.GetHeight()-1) bSnapHgtDC
=TRUE
;
813 if (!bLogicWdtDC
|| !bLogicHgtDC
|| !bLogicWdtDiff
|| !bLogicHgtDiff
) {
814 aLogicRect
=pObj
->GetLogicRect();
815 if (nLogicWdt
!=aLogicRect
.GetWidth()-1) bLogicWdtDC
=TRUE
;
816 if (nLogicHgt
!=aLogicRect
.GetHeight()-1) bLogicHgtDC
=TRUE
;
817 if (!bLogicWdtDiff
&& aSnapRect
.GetWidth()!=aLogicRect
.GetWidth()) bLogicWdtDiff
=TRUE
;
818 if (!bLogicHgtDiff
&& aSnapRect
.GetHeight()!=aLogicRect
.GetHeight()) bLogicHgtDiff
=TRUE
;
823 aObjName
=pObj
->GetName();
825 if (aObjName
!=pObj
->GetName()) bObjNameDC
=TRUE
;
830 if (bSnapPosXDC
|| nAllSnapPosX
!=nSnapPosX
) rAttr
.Put(SdrAllPositionXItem(nAllSnapPosX
));
831 if (bSnapPosYDC
|| nAllSnapPosY
!=nSnapPosY
) rAttr
.Put(SdrAllPositionYItem(nAllSnapPosY
));
832 if (bSnapWdtDC
|| nAllSnapWdt
!=nSnapWdt
) rAttr
.Put(SdrAllSizeWidthItem(nAllSnapWdt
));
833 if (bSnapHgtDC
|| nAllSnapHgt
!=nSnapHgt
) rAttr
.Put(SdrAllSizeHeightItem(nAllSnapHgt
));
835 // Items fuer reine Transformationen
836 rAttr
.Put(SdrMoveXItem());
837 rAttr
.Put(SdrMoveYItem());
838 rAttr
.Put(SdrResizeXOneItem());
839 rAttr
.Put(SdrResizeYOneItem());
840 rAttr
.Put(SdrRotateOneItem());
841 rAttr
.Put(SdrHorzShearOneItem());
842 rAttr
.Put(SdrVertShearOneItem());
844 rAttr
.Put(SdrResizeXAllItem());
845 rAttr
.Put(SdrResizeYAllItem());
846 rAttr
.Put(SdrRotateAllItem());
847 rAttr
.Put(SdrHorzShearAllItem());
848 rAttr
.Put(SdrVertShearAllItem());
851 if(eDragMode
== SDRDRAG_ROTATE
|| eDragMode
== SDRDRAG_MIRROR
)
853 rAttr
.Put(SdrTransformRef1XItem(GetRef1().X()));
854 rAttr
.Put(SdrTransformRef1YItem(GetRef1().Y()));
857 if(eDragMode
== SDRDRAG_MIRROR
)
859 rAttr
.Put(SdrTransformRef2XItem(GetRef2().X()));
860 rAttr
.Put(SdrTransformRef2YItem(GetRef2().Y()));
864 SfxItemSet
SdrEditView::GetAttrFromMarked(BOOL bOnlyHardAttr
) const
866 SfxItemSet
aSet(pMod
->GetItemPool());
867 MergeAttrFromMarked(aSet
,bOnlyHardAttr
);
868 //the EE_FEATURE items should not be set with SetAttrToMarked (see error message there)
869 //so we do not set them here
871 // Do not disable, but clear the items.
872 aSet
.ClearItem(EE_FEATURE_TAB
);
873 aSet
.ClearItem(EE_FEATURE_LINEBR
);
874 aSet
.ClearItem(EE_FEATURE_NOTCONV
);
875 aSet
.ClearItem(EE_FEATURE_FIELD
);
879 void SdrEditView::MergeAttrFromMarked(SfxItemSet
& rAttr
, BOOL bOnlyHardAttr
) const
881 sal_uInt32
nMarkAnz(GetMarkedObjectCount());
883 for(sal_uInt32
a(0); a
< nMarkAnz
; a
++)
885 // #80277# merging was done wrong in the prev version
886 //const SfxItemSet& rSet = GetMarkedObjectByIndex()->GetItemSet();
887 const SfxItemSet
& rSet
= GetMarkedObjectByIndex(a
)->GetMergedItemSet();
888 SfxWhichIter
aIter(rSet
);
889 sal_uInt16
nWhich(aIter
.FirstWhich());
895 if(SFX_ITEM_DONTCARE
== rSet
.GetItemState(nWhich
, FALSE
))
896 rAttr
.InvalidateItem(nWhich
);
898 rAttr
.MergeValue(rSet
.Get(nWhich
), TRUE
);
900 else if(SFX_ITEM_SET
== rSet
.GetItemState(nWhich
, FALSE
))
902 const SfxPoolItem
& rItem
= rSet
.Get(nWhich
);
903 rAttr
.MergeValue(rItem
, TRUE
);
906 nWhich
= aIter
.NextWhich();
911 void SdrEditView::SetAttrToMarked(const SfxItemSet
& rAttr
, BOOL bReplaceAll
)
913 if (AreObjectsMarked())
917 BOOL bHasEEFeatureItems
=FALSE
;
918 SfxItemIter
aIter(rAttr
);
919 const SfxPoolItem
* pItem
=aIter
.FirstItem();
920 while (!bHasEEFeatureItems
&& pItem
!=NULL
) {
921 if (!IsInvalidItem(pItem
)) {
922 USHORT nW
=pItem
->Which();
923 if (nW
>=EE_FEATURE_START
&& nW
<=EE_FEATURE_END
) bHasEEFeatureItems
=TRUE
;
925 pItem
=aIter
.NextItem();
927 if(bHasEEFeatureItems
)
930 aMessage
.AppendAscii("SdrEditView::SetAttrToMarked(): Das setzen von EE_FEATURE-Items an der SdrView macht keinen Sinn! Es fuehrt nur zu Overhead und nicht mehr lesbaren Dokumenten.");
931 InfoBox(NULL
, aMessage
).Execute();
936 // #103836# if the user thets character attributes to the complete shape,
937 // we want to remove all hard set character attributes with same
938 // which ids from the text. We do that later but here we remember
939 // all character attribute which id's that are set.
940 std::vector
<sal_uInt16
> aCharWhichIds
;
942 SfxItemIter
aIter(rAttr
);
943 const SfxPoolItem
* pItem
=aIter
.FirstItem();
946 if (!IsInvalidItem(pItem
))
948 sal_uInt16 nWhich
= pItem
->Which();
949 if (nWhich
>=EE_CHAR_START
&& nWhich
<=EE_CHAR_END
)
950 aCharWhichIds
.push_back( nWhich
);
952 pItem
=aIter
.NextItem();
956 // Joe, 2.7.98: Damit Undo nach Format.Standard auch die Textattribute korrekt restauriert
957 BOOL bHasEEItems
=SearchOutlinerItems(rAttr
,bReplaceAll
);
959 // AW 030100: save additional geom info when para or char attributes
960 // are changed and the geom form of the text object might be changed
961 BOOL
bPossibleGeomChange(FALSE
);
962 SfxWhichIter
aIter(rAttr
);
963 UINT16 nWhich
= aIter
.FirstWhich();
964 while(!bPossibleGeomChange
&& nWhich
)
966 SfxItemState eState
= rAttr
.GetItemState(nWhich
);
967 if(eState
== SFX_ITEM_SET
)
969 if((nWhich
>= SDRATTR_TEXT_MINFRAMEHEIGHT
&& nWhich
<= SDRATTR_TEXT_CONTOURFRAME
)
970 || nWhich
== SDRATTR_3DOBJ_PERCENT_DIAGONAL
971 || nWhich
== SDRATTR_3DOBJ_BACKSCALE
972 || nWhich
== SDRATTR_3DOBJ_DEPTH
973 || nWhich
== SDRATTR_3DOBJ_END_ANGLE
974 || nWhich
== SDRATTR_3DSCENE_DISTANCE
)
976 bPossibleGeomChange
= TRUE
;
979 nWhich
= aIter
.NextWhich();
982 const bool bUndo
= IsUndoEnabled();
986 ImpTakeDescriptionStr(STR_EditSetAttributes
,aStr
);
990 const sal_uInt32
nMarkAnz(GetMarkedObjectCount());
991 std::vector
< E3DModifySceneSnapRectUpdater
* > aUpdaters
;
993 // create ItemSet without SFX_ITEM_DONTCARE. Put()
994 // uses it's second parameter (bInvalidAsDefault) to
995 // remove all such items to set them to default.
996 SfxItemSet
aAttr(*rAttr
.GetPool(), rAttr
.GetRanges());
997 aAttr
.Put(rAttr
, TRUE
);
1000 bool bResetAnimationTimer(false);
1002 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++)
1004 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
1005 SdrObject
* pObj
= pM
->GetMarkedSdrObj();
1009 std::vector
< SdrUndoAction
* > vConnectorUndoActions
;
1010 SdrEdgeObj
* pEdgeObj
= dynamic_cast< SdrEdgeObj
* >( pObj
);
1012 bPossibleGeomChange
= TRUE
;
1014 vConnectorUndoActions
= CreateConnectorUndo( *pObj
);
1016 AddUndoActions( vConnectorUndoActions
);
1019 // new geometry undo
1020 if(bPossibleGeomChange
&& bUndo
)
1022 // save position and size of obect, too
1023 AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj
));
1029 // If this is a text object also rescue the OutlinerParaObject since
1030 // applying attributes to the object may change text layout when
1031 // multiple portions exist with multiple formats. If a OutlinerParaObject
1032 // really exists and needs to be rescued is evaluated in the undo
1033 // implementation itself.
1034 const bool bRescueText
= dynamic_cast< SdrTextObj
* >(pObj
) != 0;
1036 // add attribute undo
1037 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj
,FALSE
,bHasEEItems
|| bPossibleGeomChange
|| bRescueText
));
1040 // set up a scxene updater if object is a 3d object
1041 if(dynamic_cast< E3dObject
* >(pObj
))
1043 aUpdaters
.push_back(new E3DModifySceneSnapRectUpdater(pObj
));
1046 // set attributes at object
1047 pObj
->SetMergedItemSetAndBroadcast(aAttr
, bReplaceAll
);
1049 if(pObj
->ISA(SdrTextObj
))
1051 SdrTextObj
* pTextObj
= ((SdrTextObj
*)pObj
);
1053 if(0 != aCharWhichIds
.size())
1055 Rectangle aOldBoundRect
= pTextObj
->GetLastBoundRect();
1057 // #110094#-14 pTextObj->SendRepaintBroadcast(pTextObj->GetBoundRect());
1058 pTextObj
->RemoveOutlinerCharacterAttribs( aCharWhichIds
);
1060 // object has changed, should be called form
1061 // RemoveOutlinerCharacterAttribs. This will change when the text
1062 // object implementation changes.
1063 pTextObj
->SetChanged();
1065 pTextObj
->BroadcastObjectChange();
1066 pTextObj
->SendUserCall(SDRUSERCALL_CHGATTR
, aOldBoundRect
);
1071 if(!bResetAnimationTimer
)
1073 if(pObj
->GetViewContact().isAnimatedInAnyViewObjectContact())
1075 bResetAnimationTimer
= true;
1080 // fire scene updaters
1081 while(aUpdaters
.size())
1083 delete aUpdaters
.back();
1084 aUpdaters
.pop_back();
1088 if(bResetAnimationTimer
)
1090 SetAnimationTimer(0L);
1093 // besser vorher checken, was gemacht werden soll:
1094 // pObj->SetAttr() oder SetNotPersistAttr()
1095 // !!! fehlende Implementation !!!
1096 SetNotPersistAttrToMarked(rAttr
,bReplaceAll
);
1103 SfxStyleSheet
* SdrEditView::GetStyleSheetFromMarked() const
1105 SfxStyleSheet
* pRet
=NULL
;
1107 ULONG nMarkAnz
=GetMarkedObjectCount();
1108 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++) {
1109 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
1110 SfxStyleSheet
* pSS
=pM
->GetMarkedSdrObj()->GetStyleSheet();
1112 else if (pRet
!=pSS
) return NULL
; // verschiedene StyleSheets
1118 void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet
* pStyleSheet
, BOOL bDontRemoveHardAttr
)
1120 if (AreObjectsMarked())
1122 const bool bUndo
= IsUndoEnabled();
1127 if (pStyleSheet
!=NULL
)
1128 ImpTakeDescriptionStr(STR_EditSetStylesheet
,aStr
);
1130 ImpTakeDescriptionStr(STR_EditDelStylesheet
,aStr
);
1134 ULONG nMarkAnz
=GetMarkedObjectCount();
1135 for (ULONG nm
=0; nm
<nMarkAnz
; nm
++)
1137 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
1140 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pM
->GetMarkedSdrObj()));
1141 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pM
->GetMarkedSdrObj(),true,true));
1143 pM
->GetMarkedSdrObj()->SetStyleSheet(pStyleSheet
,bDontRemoveHardAttr
);
1151 ////////////////////////////////////////////////////////////////////////////////////////////////////
1153 /* new interface src537 */
1154 BOOL
SdrEditView::GetAttributes(SfxItemSet
& rTargetSet
, BOOL bOnlyHardAttr
) const
1156 if(GetMarkedObjectCount())
1158 rTargetSet
.Put(GetAttrFromMarked(bOnlyHardAttr
), FALSE
);
1163 return SdrMarkView::GetAttributes(rTargetSet
, bOnlyHardAttr
);
1167 BOOL
SdrEditView::SetAttributes(const SfxItemSet
& rSet
, BOOL bReplaceAll
)
1169 if (GetMarkedObjectCount()!=0) {
1170 SetAttrToMarked(rSet
,bReplaceAll
);
1173 return SdrMarkView::SetAttributes(rSet
,bReplaceAll
);
1177 SfxStyleSheet
* SdrEditView::GetStyleSheet() const // SfxStyleSheet* SdrEditView::GetStyleSheet(BOOL& rOk) const
1179 if (GetMarkedObjectCount()!=0) {
1181 return GetStyleSheetFromMarked();
1183 return SdrMarkView::GetStyleSheet(); // SdrMarkView::GetStyleSheet(rOk);
1187 BOOL
SdrEditView::SetStyleSheet(SfxStyleSheet
* pStyleSheet
, BOOL bDontRemoveHardAttr
)
1189 if (GetMarkedObjectCount()!=0) {
1190 SetStyleSheetToMarked(pStyleSheet
,bDontRemoveHardAttr
);
1193 return SdrMarkView::SetStyleSheet(pStyleSheet
,bDontRemoveHardAttr
);
1197 ////////////////////////////////////////////////////////////////////////////////////////////////////
1199 SfxItemSet
SdrEditView::GetGeoAttrFromMarked() const
1201 SfxItemSet
aRetSet(pMod
->GetItemPool(), // SID_ATTR_TRANSFORM_... aus s:svxids.hrc
1202 SID_ATTR_TRANSFORM_POS_X
,SID_ATTR_TRANSFORM_ANGLE
,
1203 SID_ATTR_TRANSFORM_PROTECT_POS
,SID_ATTR_TRANSFORM_AUTOHEIGHT
,
1204 SDRATTR_ECKENRADIUS
,SDRATTR_ECKENRADIUS
,
1206 if (AreObjectsMarked()) {
1207 SfxItemSet
aMarkAttr(GetAttrFromMarked(FALSE
)); // wg. AutoGrowHeight und Eckenradius
1208 Rectangle
aRect(GetMarkedObjRect());
1210 if(GetSdrPageView())
1212 GetSdrPageView()->LogicToPagePos(aRect
);
1216 aRetSet
.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_X
,aRect
.Left()));
1217 aRetSet
.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_Y
,aRect
.Top()));
1220 long nResizeRefX
=aRect
.Left();
1221 long nResizeRefY
=aRect
.Top();
1222 if (eDragMode
==SDRDRAG_ROTATE
) { // Drehachse auch als Referenz fuer Resize
1223 nResizeRefX
=aRef1
.X();
1224 nResizeRefY
=aRef1
.Y();
1226 aRetSet
.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_WIDTH
,aRect
.Right()-aRect
.Left()));
1227 aRetSet
.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_HEIGHT
,aRect
.Bottom()-aRect
.Top()));
1228 aRetSet
.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_X
,nResizeRefX
));
1229 aRetSet
.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_Y
,nResizeRefY
));
1231 Point
aRotateAxe(aRef1
);
1233 if(GetSdrPageView())
1235 GetSdrPageView()->LogicToPagePos(aRotateAxe
);
1239 long nRotateRefX
=aRect
.Center().X();
1240 long nRotateRefY
=aRect
.Center().Y();
1241 if (eDragMode
==SDRDRAG_ROTATE
) {
1242 nRotateRefX
=aRotateAxe
.X();
1243 nRotateRefY
=aRotateAxe
.Y();
1245 aRetSet
.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ANGLE
,GetMarkedObjRotate()));
1246 aRetSet
.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_X
,nRotateRefX
));
1247 aRetSet
.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_Y
,nRotateRefY
));
1250 long nShearRefX
=aRect
.Left();
1251 long nShearRefY
=aRect
.Bottom();
1252 if (eDragMode
==SDRDRAG_ROTATE
) { // Drehachse auch als Referenz fuer Shear
1253 nShearRefX
=aRotateAxe
.X();
1254 nShearRefY
=aRotateAxe
.Y();
1256 aRetSet
.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR
,GetMarkedObjShear()));
1257 aRetSet
.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X
,nShearRefX
));
1258 aRetSet
.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y
,nShearRefY
));
1260 // Pruefen der einzelnen Objekte, ob Objekte geschuetzt sind
1261 const SdrMarkList
& rMarkList
=GetMarkedObjectList();
1262 ULONG nMarkCount
=rMarkList
.GetMarkCount();
1263 SdrObject
* pObj
=rMarkList
.GetMark(0)->GetMarkedSdrObj();
1264 BOOL bPosProt
=pObj
->IsMoveProtect();
1265 BOOL bSizProt
=pObj
->IsResizeProtect();
1266 BOOL bPosProtDontCare
=FALSE
;
1267 BOOL bSizProtDontCare
=FALSE
;
1268 for (ULONG i
=1; i
<nMarkCount
&& (!bPosProtDontCare
|| !bSizProtDontCare
); i
++) {
1269 pObj
=rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1270 if (bPosProt
!=pObj
->IsMoveProtect()) bPosProtDontCare
=TRUE
;
1271 if (bSizProt
!=pObj
->IsResizeProtect()) bSizProtDontCare
=TRUE
;
1274 // InvalidateItem setzt das Item auf DONT_CARE
1275 if (bPosProtDontCare
) {
1276 aRetSet
.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_POS
);
1278 aRetSet
.Put(SfxBoolItem(SID_ATTR_TRANSFORM_PROTECT_POS
,bPosProt
));
1280 if (bSizProtDontCare
) {
1281 aRetSet
.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_SIZE
);
1283 aRetSet
.Put(SfxBoolItem(SID_ATTR_TRANSFORM_PROTECT_SIZE
,bSizProt
));
1286 SfxItemState eState
=aMarkAttr
.GetItemState(SDRATTR_TEXT_AUTOGROWWIDTH
);
1287 BOOL bAutoGrow
=((SdrTextAutoGrowWidthItem
&)(aMarkAttr
.Get(SDRATTR_TEXT_AUTOGROWWIDTH
))).GetValue();
1288 if (eState
==SFX_ITEM_DONTCARE
) {
1289 aRetSet
.InvalidateItem(SID_ATTR_TRANSFORM_AUTOWIDTH
);
1290 } else if (eState
==SFX_ITEM_SET
) {
1291 aRetSet
.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOWIDTH
,bAutoGrow
));
1294 eState
=aMarkAttr
.GetItemState(SDRATTR_TEXT_AUTOGROWHEIGHT
);
1295 bAutoGrow
=((SdrTextAutoGrowHeightItem
&)(aMarkAttr
.Get(SDRATTR_TEXT_AUTOGROWHEIGHT
))).GetValue();
1296 if (eState
==SFX_ITEM_DONTCARE
) {
1297 aRetSet
.InvalidateItem(SID_ATTR_TRANSFORM_AUTOHEIGHT
);
1298 } else if (eState
==SFX_ITEM_SET
) {
1299 aRetSet
.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOHEIGHT
,bAutoGrow
));
1302 eState
=aMarkAttr
.GetItemState(SDRATTR_ECKENRADIUS
);
1303 long nRadius
=((SdrEckenradiusItem
&)(aMarkAttr
.Get(SDRATTR_ECKENRADIUS
))).GetValue();
1304 if (eState
==SFX_ITEM_DONTCARE
) {
1305 aRetSet
.InvalidateItem(SDRATTR_ECKENRADIUS
);
1306 } else if (eState
==SFX_ITEM_SET
) {
1307 aRetSet
.Put(SdrEckenradiusItem(nRadius
));
1314 Point
ImpGetPoint(Rectangle aRect
, RECT_POINT eRP
)
1317 case RP_LT
: return aRect
.TopLeft();
1318 case RP_MT
: return aRect
.TopCenter();
1319 case RP_RT
: return aRect
.TopRight();
1320 case RP_LM
: return aRect
.LeftCenter();
1321 case RP_MM
: return aRect
.Center();
1322 case RP_RM
: return aRect
.RightCenter();
1323 case RP_LB
: return aRect
.BottomLeft();
1324 case RP_MB
: return aRect
.BottomCenter();
1325 case RP_RB
: return aRect
.BottomRight();
1327 return Point(); // Sollte nicht vorkommen !
1330 void SdrEditView::SetGeoAttrToMarked(const SfxItemSet
& rAttr
)
1332 Rectangle
aRect(GetMarkedObjRect());
1334 if(GetSdrPageView())
1336 GetSdrPageView()->LogicToPagePos(aRect
);
1339 long nOldRotateAngle
=GetMarkedObjRotate();
1340 long nOldShearAngle
=GetMarkedObjShear();
1341 const SdrMarkList
& rMarkList
=GetMarkedObjectList();
1342 ULONG nMarkCount
=rMarkList
.GetMarkCount();
1343 SdrObject
* pObj
=NULL
;
1345 RECT_POINT eSizePoint
=RP_MM
;
1350 long nRotateAngle
=0;
1353 sal_Bool
bModeIsRotate(eDragMode
== SDRDRAG_ROTATE
);
1356 long nOldRotateX(0);
1357 long nOldRotateY(0);
1360 Point
aRotateAxe(aRef1
);
1362 if(GetSdrPageView())
1364 GetSdrPageView()->LogicToPagePos(aRotateAxe
);
1367 nRotateX
= nOldRotateX
= aRotateAxe
.X();
1368 nRotateY
= nOldRotateY
= aRotateAxe
.Y();
1371 long nNewShearAngle
=0;
1375 BOOL bShearVert
=FALSE
;
1383 BOOL bSetAttr
=FALSE
;
1384 SfxItemSet
aSetAttr(pMod
->GetItemPool());
1386 const SfxPoolItem
* pPoolItem
=NULL
;
1389 if (SFX_ITEM_SET
==rAttr
.GetItemState(SID_ATTR_TRANSFORM_POS_X
,TRUE
,&pPoolItem
)) {
1390 nPosDX
=((const SfxInt32Item
*)pPoolItem
)->GetValue()-aRect
.Left();
1393 if (SFX_ITEM_SET
==rAttr
.GetItemState(SID_ATTR_TRANSFORM_POS_Y
,TRUE
,&pPoolItem
)){
1394 nPosDY
=((const SfxInt32Item
*)pPoolItem
)->GetValue()-aRect
.Top();
1398 if (SFX_ITEM_SET
==rAttr
.GetItemState(SID_ATTR_TRANSFORM_WIDTH
,TRUE
,&pPoolItem
)) {
1399 nSizX
=((const SfxUInt32Item
*)pPoolItem
)->GetValue();
1402 if (SFX_ITEM_SET
==rAttr
.GetItemState(SID_ATTR_TRANSFORM_HEIGHT
,TRUE
,&pPoolItem
)) {
1403 nSizY
=((const SfxUInt32Item
*)pPoolItem
)->GetValue();
1408 eSizePoint
=(RECT_POINT
)((const SfxAllEnumItem
&)rAttr
.Get(SID_ATTR_TRANSFORM_SIZE_POINT
)).GetValue();
1412 if (SFX_ITEM_SET
==rAttr
.GetItemState(SID_ATTR_TRANSFORM_ANGLE
,TRUE
,&pPoolItem
)) {
1413 nRotateAngle
=((const SfxInt32Item
*)pPoolItem
)->GetValue()-nOldRotateAngle
;
1414 bRotate
= (nRotateAngle
!= 0);
1417 // #86909# pos rot point x
1418 if(bRotate
|| SFX_ITEM_SET
==rAttr
.GetItemState(SID_ATTR_TRANSFORM_ROT_X
, TRUE
,&pPoolItem
))
1419 nRotateX
= ((const SfxInt32Item
&)rAttr
.Get(SID_ATTR_TRANSFORM_ROT_X
)).GetValue();
1421 // #86909# pos rot point y
1422 if(bRotate
|| SFX_ITEM_SET
==rAttr
.GetItemState(SID_ATTR_TRANSFORM_ROT_Y
, TRUE
,&pPoolItem
))
1423 nRotateY
= ((const SfxInt32Item
&)rAttr
.Get(SID_ATTR_TRANSFORM_ROT_Y
)).GetValue();
1426 if (SFX_ITEM_SET
==rAttr
.GetItemState(SID_ATTR_TRANSFORM_SHEAR
,TRUE
,&pPoolItem
)) {
1427 nNewShearAngle
=((const SfxInt32Item
*)pPoolItem
)->GetValue();
1428 if (nNewShearAngle
>SDRMAXSHEAR
) nNewShearAngle
=SDRMAXSHEAR
;
1429 if (nNewShearAngle
<-SDRMAXSHEAR
) nNewShearAngle
=-SDRMAXSHEAR
;
1430 if (nNewShearAngle
!=nOldShearAngle
) {
1431 bShearVert
=((const SfxBoolItem
&)rAttr
.Get(SID_ATTR_TRANSFORM_SHEAR_VERTICAL
)).GetValue();
1433 nShearAngle
=nNewShearAngle
;
1435 if (nNewShearAngle
!=0 && nOldShearAngle
!=0) {
1437 double nOld
=tan((double)nOldShearAngle
*nPi180
);
1438 double nNew
=tan((double)nNewShearAngle
*nPi180
);
1440 nNew
=atan(nNew
)/nPi180
;
1441 nShearAngle
=Round(nNew
);
1443 nShearAngle
=nNewShearAngle
-nOldShearAngle
;
1446 bShear
=nShearAngle
!=0;
1448 nShearX
=((const SfxInt32Item
&)rAttr
.Get(SID_ATTR_TRANSFORM_SHEAR_X
)).GetValue();
1449 nShearY
=((const SfxInt32Item
&)rAttr
.Get(SID_ATTR_TRANSFORM_SHEAR_Y
)).GetValue();
1455 if (SFX_ITEM_SET
==rAttr
.GetItemState(SID_ATTR_TRANSFORM_AUTOWIDTH
,TRUE
,&pPoolItem
)) {
1456 BOOL bAutoGrow
=((const SfxBoolItem
*)pPoolItem
)->GetValue();
1457 aSetAttr
.Put(SdrTextAutoGrowWidthItem(bAutoGrow
));
1461 if (SFX_ITEM_SET
==rAttr
.GetItemState(SID_ATTR_TRANSFORM_AUTOHEIGHT
,TRUE
,&pPoolItem
)) {
1462 BOOL bAutoGrow
=((const SfxBoolItem
*)pPoolItem
)->GetValue();
1463 aSetAttr
.Put(SdrTextAutoGrowHeightItem(bAutoGrow
));
1468 if (bEdgeRadiusAllowed
&& SFX_ITEM_SET
==rAttr
.GetItemState(SDRATTR_ECKENRADIUS
,TRUE
,&pPoolItem
)) {
1469 long nRadius
=((SdrEckenradiusItem
*)pPoolItem
)->GetValue();
1470 aSetAttr
.Put(SdrEckenradiusItem(nRadius
));
1474 ForcePossibilities();
1476 BegUndo(ImpGetResStr(STR_EditTransform
),GetDescriptionOfMarkedObjects());
1479 SetAttrToMarked(aSetAttr
,FALSE
);
1482 // Groesse und Hoehe aendern
1483 if (bChgSiz
&& (bResizeFreeAllowed
|| bResizePropAllowed
)) {
1484 Fraction
aWdt(nSizX
,aRect
.Right()-aRect
.Left());
1485 Fraction
aHgt(nSizY
,aRect
.Bottom()-aRect
.Top());
1486 Point
aRef(ImpGetPoint(aRect
,eSizePoint
));
1488 if(GetSdrPageView())
1490 GetSdrPageView()->PagePosToLogic(aRef
);
1493 ResizeMarkedObj(aRef
,aWdt
,aHgt
);
1497 if (bRotate
&& (bRotateFreeAllowed
|| bRotate90Allowed
)) {
1498 Point
aRef(nRotateX
,nRotateY
);
1500 if(GetSdrPageView())
1502 GetSdrPageView()->PagePosToLogic(aRef
);
1505 RotateMarkedObj(aRef
,nRotateAngle
);
1508 // #86909# set rotation point position
1509 if(bModeIsRotate
&& (nRotateX
!= nOldRotateX
|| nRotateY
!= nOldRotateY
))
1511 Point
aNewRef1(nRotateX
, nRotateY
);
1513 if(GetSdrPageView())
1515 GetSdrPageView()->PagePosToLogic(aNewRef1
);
1522 if (bShear
&& bShearAllowed
) {
1523 Point
aRef(nShearX
,nShearY
);
1525 if(GetSdrPageView())
1527 GetSdrPageView()->PagePosToLogic(aRef
);
1530 ShearMarkedObj(aRef
,nShearAngle
,bShearVert
);
1533 // ShearMarkedObj creates a linear combination of the existing transformation and
1534 // the new shear to apply. If the object is already transformed (e.g. rotated) the
1535 // linear combination will not decompose to the same start values again, but to a
1536 // new combination. Thus it makes no sense to check if the wanted shear is reached
1537 // or not. Taking out.
1539 long nTempAngle
=GetMarkedObjShear();
1540 if (nTempAngle
!=0 && nTempAngle
!=nNewShearAngle
&& !bShearVert
) {
1541 // noch eine 2. Iteration zur Kompensation der Rundungsfehler
1542 double nOld
=tan((double)nTempAngle
*nPi180
);
1543 double nNew
=tan((double)nNewShearAngle
*nPi180
);
1545 nNew
=atan(nNew
)/nPi180
;
1546 nTempAngle
=Round(nNew
);
1547 if (nTempAngle
!=0) {
1548 ShearMarkedObj(aRef
,nTempAngle
,bShearVert
);
1555 if (bChgPos
&& bMoveAllowed
) {
1556 MoveMarkedObj(Size(nPosDX
,nPosDY
));
1560 if(SFX_ITEM_SET
== rAttr
.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS
, TRUE
, &pPoolItem
))
1562 const sal_Bool
bProtPos(((const SfxBoolItem
*)pPoolItem
)->GetValue());
1563 bool bChanged(false);
1565 for(sal_uInt32
i(0); i
< nMarkCount
; i
++)
1567 pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1569 if(pObj
->IsMoveProtect() != bProtPos
)
1572 pObj
->SetMoveProtect(bProtPos
);
1576 pObj
->SetResizeProtect(true);
1583 bMoveProtect
= bProtPos
;
1587 bResizeProtect
= true;
1590 // #i77187# there is no simple method to get the toolbars updated
1591 // in the application. The App is listening to selection change and i
1592 // will use it here (even if not true). It's acceptable since changing
1593 // this model data is pretty rare and only possible using the F4 dialog
1594 MarkListHasChanged();
1601 if(SFX_ITEM_SET
== rAttr
.GetItemState(SID_ATTR_TRANSFORM_PROTECT_SIZE
, TRUE
, &pPoolItem
))
1603 const sal_Bool
bProtSize(((const SfxBoolItem
*)pPoolItem
)->GetValue());
1604 bool bChanged(false);
1606 for(sal_uInt32
i(0); i
< nMarkCount
; i
++)
1608 pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1610 if(pObj
->IsResizeProtect() != bProtSize
)
1613 pObj
->SetResizeProtect(bProtSize
);
1619 bResizeProtect
= bProtSize
;
1621 // #i77187# see above
1622 MarkListHasChanged();
1630 ////////////////////////////////////////////////////////////////////////////////////////////////////
1632 BOOL
SdrEditView::IsAlignPossible() const
1633 { // Mindestens 2 markierte Objekte, davon mind. 1 beweglich
1634 ForcePossibilities();
1635 ULONG nAnz
=GetMarkedObjectCount();
1636 if (nAnz
==0) return FALSE
; // Nix markiert!
1637 if (nAnz
==1) return bMoveAllowed
; // einzelnes Obj an der Seite ausrichten
1638 return bOneOrMoreMovable
; // ansonsten ist MarkCount>=2
1641 void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor
, SdrVertAlign eVert
, BOOL bBoundRects
)
1643 if (eHor
==SDRHALIGN_NONE
&& eVert
==SDRVALIGN_NONE
)
1646 SortMarkedObjects();
1647 if (GetMarkedObjectCount()<1)
1650 const bool bUndo
= IsUndoEnabled();
1653 XubString
aStr(GetDescriptionOfMarkedObjects());
1654 if (eHor
==SDRHALIGN_NONE
)
1658 case SDRVALIGN_TOP
: ImpTakeDescriptionStr(STR_EditAlignVTop
,aStr
); break;
1659 case SDRVALIGN_BOTTOM
: ImpTakeDescriptionStr(STR_EditAlignVBottom
,aStr
); break;
1660 case SDRVALIGN_CENTER
: ImpTakeDescriptionStr(STR_EditAlignVCenter
,aStr
); break;
1664 else if (eVert
==SDRVALIGN_NONE
)
1668 case SDRHALIGN_LEFT
: ImpTakeDescriptionStr(STR_EditAlignHLeft
,aStr
); break;
1669 case SDRHALIGN_RIGHT
: ImpTakeDescriptionStr(STR_EditAlignHRight
,aStr
); break;
1670 case SDRHALIGN_CENTER
: ImpTakeDescriptionStr(STR_EditAlignHCenter
,aStr
); break;
1674 else if (eHor
==SDRHALIGN_CENTER
&& eVert
==SDRVALIGN_CENTER
)
1676 ImpTakeDescriptionStr(STR_EditAlignCenter
,aStr
);
1680 ImpTakeDescriptionStr(STR_EditAlign
,aStr
);
1686 ULONG nMarkAnz
=GetMarkedObjectCount();
1688 BOOL bHasFixed
=FALSE
;
1689 for (nm
=0; nm
<nMarkAnz
; nm
++)
1691 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
1692 SdrObject
* pObj
=pM
->GetMarkedSdrObj();
1693 SdrObjTransformInfoRec aInfo
;
1694 pObj
->TakeObjInfo(aInfo
);
1695 if (!aInfo
.bMoveAllowed
|| pObj
->IsMoveProtect())
1697 Rectangle
aObjRect(bBoundRects
?pObj
->GetCurrentBoundRect():pObj
->GetSnapRect());
1698 aBound
.Union(aObjRect
);
1705 { // einzelnes Obj an der Seite ausrichten
1706 const SdrObject
* pObj
=GetMarkedObjectByIndex(0L);
1707 const SdrPage
* pPage
=pObj
->GetPage();
1708 const SdrPageGridFrameList
* pGFL
=pPage
->GetGridFrameList(GetSdrPageViewOfMarkedByIndex(0),&(pObj
->GetSnapRect()));
1709 const SdrPageGridFrame
* pFrame
=NULL
;
1710 if (pGFL
!=NULL
&& pGFL
->GetCount()!=0)
1712 pFrame
=&((*pGFL
)[0]);
1717 aBound
=pFrame
->GetUserArea();
1721 aBound
=Rectangle(pPage
->GetLftBorder(),pPage
->GetUppBorder(),
1722 pPage
->GetWdt()-pPage
->GetRgtBorder(),
1723 pPage
->GetHgt()-pPage
->GetLwrBorder());
1729 aBound
=GetMarkedObjBoundRect();
1731 aBound
=GetMarkedObjRect();
1734 Point
aCenter(aBound
.Center());
1735 for (nm
=0; nm
<nMarkAnz
; nm
++)
1737 SdrMark
* pM
=GetSdrMarkByIndex(nm
);
1738 SdrObject
* pObj
=pM
->GetMarkedSdrObj();
1739 SdrObjTransformInfoRec aInfo
;
1740 pObj
->TakeObjInfo(aInfo
);
1741 if (aInfo
.bMoveAllowed
&& !pObj
->IsMoveProtect())
1743 // SdrPageView* pPV=pM->GetPageView();
1746 Rectangle
aObjRect(bBoundRects
?pObj
->GetCurrentBoundRect():pObj
->GetSnapRect());
1749 case SDRVALIGN_TOP
: nYMov
=aBound
.Top() -aObjRect
.Top() ; break;
1750 case SDRVALIGN_BOTTOM
: nYMov
=aBound
.Bottom()-aObjRect
.Bottom() ; break;
1751 case SDRVALIGN_CENTER
: nYMov
=aCenter
.Y() -aObjRect
.Center().Y(); break;
1756 case SDRHALIGN_LEFT
: nXMov
=aBound
.Left() -aObjRect
.Left() ; break;
1757 case SDRHALIGN_RIGHT
: nXMov
=aBound
.Right() -aObjRect
.Right() ; break;
1758 case SDRHALIGN_CENTER
: nXMov
=aCenter
.X() -aObjRect
.Center().X(); break;
1761 if (nXMov
!=0 || nYMov
!=0)
1763 // #104104# SdrEdgeObj needs an extra SdrUndoGeoObj since the
1764 // connections may need to be saved
1767 if( dynamic_cast<SdrEdgeObj
*>(pObj
) )
1769 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj
));
1772 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pObj
,Size(nXMov
,nYMov
)));
1775 pObj
->Move(Size(nXMov
,nYMov
));