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: svdmrkv1.cxx,v $
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/svdmrkv.hxx>
35 #include <svx/svdetc.hxx>
36 #include <svx/svdoedge.hxx>
37 #include "svdglob.hxx"
38 #include <svx/svdpagv.hxx>
39 #include <svx/svdpage.hxx>
40 #include "svddrgm1.hxx"
42 ////////////////////////////////////////////////////////////////////////////////////////////////////
43 ////////////////////////////////////////////////////////////////////////////////////////////////////
44 ////////////////////////////////////////////////////////////////////////////////////////////////////
46 // @@@@@ @@ @@ @@ @@ @@ @@ @@@@@@ @@ @@ @@@@ @@@@@ @@ @@ @@ @@@@@ @@@@@ @@ @@ @@ @@ @@@@
47 // @@ @@ @@ @@ @@@ @@ @@ @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@
48 // @@ @@ @@ @@ @@@@@@ @@ @@ @@ @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@@@@ @@
49 // @@@@@ @@ @@ @@@@@@ @@@@ @@ @@@@@@@ @@@@@@ @@@@@ @@@@ @@ @@@@ @@@@@ @@ @@ @@@@@@ @@ @@@
50 // @@ @@ @@ @@ @@@ @@ @@ @@ @@ @ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@
51 // @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
52 // @@ @@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@@@ @@ @@ @@@@ @@ @@ @@@@@
54 ////////////////////////////////////////////////////////////////////////////////////////////////////
56 BOOL
SdrMarkView::HasMarkablePoints() const
60 if (!ImpIsFrameHandles()) {
61 ULONG nMarkAnz
=GetMarkedObjectCount();
62 if (nMarkAnz
<=nFrameHandlesLimit
) {
63 for (ULONG nMarkNum
=0; nMarkNum
<nMarkAnz
&& !bRet
; nMarkNum
++) {
64 const SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
65 const SdrObject
* pObj
=pM
->GetMarkedSdrObj();
66 bRet
=pObj
->IsPolyObj();
73 ULONG
SdrMarkView::GetMarkablePointCount() const
77 if (!ImpIsFrameHandles()) {
78 ULONG nMarkAnz
=GetMarkedObjectCount();
79 if (nMarkAnz
<=nFrameHandlesLimit
) {
80 for (ULONG nMarkNum
=0; nMarkNum
<nMarkAnz
; nMarkNum
++) {
81 const SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
82 const SdrObject
* pObj
=pM
->GetMarkedSdrObj();
83 if (pObj
->IsPolyObj()) {
84 nAnz
+=pObj
->GetPointCount();
92 BOOL
SdrMarkView::HasMarkedPoints() const
96 if (!ImpIsFrameHandles()) {
97 ULONG nMarkAnz
=GetMarkedObjectCount();
98 if (nMarkAnz
<=nFrameHandlesLimit
) {
99 for (ULONG nMarkNum
=0; nMarkNum
<nMarkAnz
&& !bRet
; nMarkNum
++) {
100 const SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
101 const SdrUShortCont
* pPts
=pM
->GetMarkedPoints();
102 bRet
=pPts
!=NULL
&& pPts
->GetCount()!=0;
109 ULONG
SdrMarkView::GetMarkedPointCount() const
111 ForceUndirtyMrkPnt();
113 if (!ImpIsFrameHandles()) {
114 ULONG nMarkAnz
=GetMarkedObjectCount();
115 if (nMarkAnz
<=nFrameHandlesLimit
) {
116 for (ULONG nMarkNum
=0; nMarkNum
<nMarkAnz
; nMarkNum
++) {
117 const SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
118 const SdrUShortCont
* pPts
=pM
->GetMarkedPoints();
119 if (pPts
!=NULL
) nAnz
+=pPts
->GetCount();
126 BOOL
SdrMarkView::IsPointMarkable(const SdrHdl
& rHdl
) const
128 return !ImpIsFrameHandles() && &rHdl
!=NULL
&& !rHdl
.IsPlusHdl() && rHdl
.GetKind()!=HDL_GLUE
&& rHdl
.GetKind()!=HDL_SMARTTAG
&& rHdl
.GetObj()!=NULL
&& rHdl
.GetObj()->IsPolyObj();
131 BOOL
SdrMarkView::MarkPointHelper(SdrHdl
* pHdl
, SdrMark
* pMark
, BOOL bUnmark
)
133 return ImpMarkPoint( pHdl
, pMark
, bUnmark
);
136 BOOL
SdrMarkView::ImpMarkPoint(SdrHdl
* pHdl
, SdrMark
* pMark
, BOOL bUnmark
)
138 if (pHdl
==NULL
|| pHdl
->IsPlusHdl() || pHdl
->GetKind()==HDL_GLUE
)
141 if (pHdl
->IsSelected() != bUnmark
)
144 SdrObject
* pObj
=pHdl
->GetObj();
145 if (pObj
==NULL
|| !pObj
->IsPolyObj())
150 ULONG nMarkNum
=TryToFindMarkedObject(pObj
);
151 if (nMarkNum
==CONTAINER_ENTRY_NOTFOUND
)
153 pMark
=GetSdrMarkByIndex(nMarkNum
);
155 const sal_uInt32
nHdlNum(pHdl
->GetObjHdlNum());
156 SdrUShortCont
* pPts
=pMark
->ForceMarkedPoints();
159 pPts
->Insert((sal_uInt16
)nHdlNum
);
163 ULONG nBla
=pPts
->GetPos((sal_uInt16
)nHdlNum
);
164 if (nBla
!=CONTAINER_ENTRY_NOTFOUND
)
170 return FALSE
; // Fehlerfall!
174 pHdl
->SetSelected(!bUnmark
);
179 sal_uInt32
nAnz(pObj
->GetPlusHdlCount(*pHdl
));
180 for (sal_uInt32 i
=0; i
<nAnz
; i
++)
182 SdrHdl
* pPlusHdl
=pObj
->GetPlusHdl(*pHdl
,i
);
185 pPlusHdl
->SetObj(pObj
);
186 pPlusHdl
->SetPageView(pMark
->GetPageView());
187 pPlusHdl
->SetPlusHdl(TRUE
);
188 aHdl
.AddHdl(pPlusHdl
);
194 for (ULONG i
= aHdl
.GetHdlCount(); i
>0;)
197 SdrHdl
* pPlusHdl
=aHdl
.GetHdl(i
);
198 if (pPlusHdl
->IsPlusHdl() && pPlusHdl
->GetSourceHdlNum()==nHdlNum
)
207 // #97016# II: Sort handles. This was missing in ImpMarkPoint all the time.
214 BOOL
SdrMarkView::MarkPoint(SdrHdl
& rHdl
, BOOL bUnmark
)
216 if (&rHdl
==NULL
) return FALSE
;
217 ForceUndirtyMrkPnt();
219 const SdrObject
* pObj
=rHdl
.GetObj();
220 if (IsPointMarkable(rHdl
) && rHdl
.IsSelected()==bUnmark
) {
221 ULONG nMarkNum
=TryToFindMarkedObject(pObj
);
222 if (nMarkNum
!=CONTAINER_ENTRY_NOTFOUND
) {
223 SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
224 SdrUShortCont
* pPts
=pM
->ForceMarkedPoints();
226 if (ImpMarkPoint(&rHdl
,pM
,bUnmark
)) {
228 MarkListHasChanged();
237 BOOL
SdrMarkView::MarkPoints(const Rectangle
* pRect
, BOOL bUnmark
)
239 ForceUndirtyMrkPnt();
242 const SdrObject
* pObj0
=NULL
;
243 const SdrPageView
* pPV0
=NULL
;
246 //HMHBOOL bHideHdl=IsMarkHdlShown() && IsSolidMarkHdl() && !bPlusHdlAlways;
247 ULONG nHdlAnz
=aHdl
.GetHdlCount();
248 for (ULONG nHdlNum
=nHdlAnz
; nHdlNum
>0;) {
250 SdrHdl
* pHdl
=aHdl
.GetHdl(nHdlNum
);
251 if (IsPointMarkable(*pHdl
) && pHdl
->IsSelected()==bUnmark
) {
252 const SdrObject
* pObj
=pHdl
->GetObj();
253 const SdrPageView
* pPV
=pHdl
->GetPageView();
254 if (pObj
!=pObj0
|| pPV
!=pPV0
|| pM
==NULL
) { // Dieser Abschnitt dient zur Optimierung,
256 SdrUShortCont
* pPts
=pM
->GetMarkedPoints();
257 if (pPts
!=NULL
) pPts
->ForceSort();
259 ULONG nMarkNum
=TryToFindMarkedObject(pObj
); // damit ImpMarkPoint() nicht staendig das
260 if (nMarkNum
!=CONTAINER_ENTRY_NOTFOUND
) { // Objekt in der MarkList suchen muss.
261 pM
=GetSdrMarkByIndex(nMarkNum
);
264 SdrUShortCont
* pPts
=pM
->ForceMarkedPoints();
268 if (pObj
->IsInserted()) {
269 DBG_ERROR("SdrMarkView::MarkPoints(const Rectangle* pRect): Markiertes Objekt nicht gefunden");
275 Point
aPos(pHdl
->GetPos());
276 if (pM
!=NULL
&& (pRect
==NULL
|| pRect
->IsInside(aPos
))) {
277 //HMHif (bHideHdl && IsMarkHdlShown() && pHdl->GetObj()!=NULL) {
278 //HMHsal_uInt32 nAnz=pHdl->GetObj()->GetPlusHdlCount(*pHdl);
279 //HMHif (nAnz!=0L) HideMarkHdl(); // #36987#
281 if (ImpMarkPoint(pHdl
,pM
,bUnmark
)) bChgd
=TRUE
;
285 if (pM
!=NULL
) { // Den zuletzt geaenderten MarkEntry ggf. noch aufraeumen
286 SdrUShortCont
* pPts
=pM
->GetMarkedPoints();
287 if (pPts
!=NULL
) pPts
->ForceSort();
289 //HMHif (bHideHdl) ShowMarkHdl(); // #36987#
291 MarkListHasChanged();
297 BOOL
SdrMarkView::MarkNextPoint(BOOL
/*bPrev*/)
299 ForceUndirtyMrkPnt();
304 MarkListHasChanged();
309 BOOL
SdrMarkView::MarkNextPoint(const Point
& /*rPnt*/, BOOL
/*bPrev*/)
311 ForceUndirtyMrkPnt();
316 MarkListHasChanged();
321 const Rectangle
& SdrMarkView::GetMarkedPointsRect() const
323 ForceUndirtyMrkPnt();
324 if (bMarkedPointsRectsDirty
) ImpSetPointsRects();
325 return aMarkedPointsRect
;
328 void SdrMarkView::SetPlusHandlesAlwaysVisible(BOOL bOn
)
329 { // HandlePaint optimieren !!!!!!!
330 ForceUndirtyMrkPnt();
331 if (bOn
!=bPlusHdlAlways
) {
332 //HMHBOOL bVis=IsMarkHdlShown();
333 //HMHif (bVis) HideMarkHdl();
336 //HMHif (bVis) ShowMarkHdl();
337 MarkListHasChanged();
341 ////////////////////////////////////////////////////////////////////////////////////////////////////
342 // ImpSetPointsRects() ist fuer PolyPoints und GluePoints!
343 ////////////////////////////////////////////////////////////////////////////////////////////////////
345 void SdrMarkView::ImpSetPointsRects() const
349 ULONG nHdlAnz
=aHdl
.GetHdlCount();
350 for (ULONG nHdlNum
=0; nHdlNum
<nHdlAnz
; nHdlNum
++) {
351 const SdrHdl
* pHdl
=aHdl
.GetHdl(nHdlNum
);
352 SdrHdlKind eKind
=pHdl
->GetKind();
353 if ((eKind
==HDL_POLY
&& pHdl
->IsSelected()) || eKind
==HDL_GLUE
) {
354 Point
aPt(pHdl
->GetPos());
355 Rectangle
& rR
=eKind
==HDL_GLUE
? aGlue
: aPnts
;
357 rR
=Rectangle(aPt
,aPt
);
359 if (aPt
.X()<rR
.Left ()) rR
.Left ()=aPt
.X();
360 if (aPt
.X()>rR
.Right ()) rR
.Right ()=aPt
.X();
361 if (aPt
.Y()<rR
.Top ()) rR
.Top ()=aPt
.Y();
362 if (aPt
.Y()>rR
.Bottom()) rR
.Bottom()=aPt
.Y();
366 ((SdrMarkView
*)this)->aMarkedPointsRect
=aPnts
;
367 ((SdrMarkView
*)this)->aMarkedGluePointsRect
=aGlue
;
368 ((SdrMarkView
*)this)->bMarkedPointsRectsDirty
=FALSE
;
371 ////////////////////////////////////////////////////////////////////////////////////////////////////
372 // UndirtyMrkPnt() ist fuer PolyPoints und GluePoints!
373 ////////////////////////////////////////////////////////////////////////////////////////////////////
375 void SdrMarkView::UndirtyMrkPnt() const
378 ULONG nMarkAnz
=GetMarkedObjectCount();
379 for (ULONG nMarkNum
=0; nMarkNum
<nMarkAnz
; nMarkNum
++) {
380 SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
381 const SdrObject
* pObj
=pM
->GetMarkedSdrObj();
383 SdrUShortCont
* pPts
=pM
->GetMarkedPoints();
385 if (pObj
->IsPolyObj()) {
386 // Ungueltig markierte Punkte entfernen, also alle
387 // Eintraege die groesser sind als die Punktanzahl des Objekts
388 sal_uInt32
nMax(pObj
->GetPointCount());
389 sal_uInt32
nPtNum(0xffffffff);
393 for (sal_uInt32
nIndex(pPts
->GetCount()); nIndex
> 0L && nPtNum
>= nMax
;)
396 nPtNum
= pPts
->GetObject(nIndex
);
400 pPts
->Remove(nIndex
);
407 DBG_ERROR("SdrMarkView::UndirtyMrkPnt(): Markierte Punkte an einem Objekt, dass kein PolyObj ist!");
408 if(pPts
&& pPts
->GetCount())
417 pPts
=pM
->GetMarkedGluePoints();
418 const SdrGluePointList
* pGPL
=pObj
->GetGluePointList();
421 // Ungueltig markierte Klebepunkte entfernen, also alle
422 // Eintraege (Id's) die nicht in der GluePointList des
423 // Objekts enthalten sind
425 for (ULONG nIndex
=pPts
->GetCount(); nIndex
>0;) {
427 USHORT nId
=pPts
->GetObject(nIndex
);
428 if (pGPL
->FindGluePoint(nId
)==SDRGLUEPOINT_NOTFOUND
) {
429 pPts
->Remove(nIndex
);
434 if (pPts
!=NULL
&& pPts
->GetCount()!=0) {
435 pPts
->Clear(); // Objekt hat keine Klebepunkte (mehr)
441 if (bChg
) ((SdrMarkView
*)this)->bMarkedPointsRectsDirty
=TRUE
;
442 ((SdrMarkView
*)this)->bMrkPntDirty
=FALSE
;
445 ////////////////////////////////////////////////////////////////////////////////////////////////////
446 ////////////////////////////////////////////////////////////////////////////////////////////////////
447 ////////////////////////////////////////////////////////////////////////////////////////////////////
449 BOOL
SdrMarkView::HasMarkableGluePoints() const
452 if (IsGluePointEditMode()) {
453 ForceUndirtyMrkPnt();
454 ULONG nMarkAnz
=GetMarkedObjectCount();
455 for (ULONG nMarkNum
=0; nMarkNum
<nMarkAnz
&& !bRet
; nMarkNum
++) {
456 const SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
457 const SdrObject
* pObj
=pM
->GetMarkedSdrObj();
458 const SdrGluePointList
* pGPL
=pObj
->GetGluePointList();
461 if(pGPL
&& pGPL
->GetCount())
463 for(sal_uInt16
a(0); !bRet
&& a
< pGPL
->GetCount(); a
++)
465 if((*pGPL
)[a
].IsUserDefined())
476 ULONG
SdrMarkView::GetMarkableGluePointCount() const
479 if (IsGluePointEditMode()) {
480 ForceUndirtyMrkPnt();
481 ULONG nMarkAnz
=GetMarkedObjectCount();
482 for (ULONG nMarkNum
=0; nMarkNum
<nMarkAnz
; nMarkNum
++) {
483 const SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
484 const SdrObject
* pObj
=pM
->GetMarkedSdrObj();
485 const SdrGluePointList
* pGPL
=pObj
->GetGluePointList();
488 if(pGPL
&& pGPL
->GetCount())
490 for(sal_uInt16
a(0); a
< pGPL
->GetCount(); a
++)
492 if((*pGPL
)[a
].IsUserDefined())
503 BOOL
SdrMarkView::HasMarkedGluePoints() const
505 ForceUndirtyMrkPnt();
507 ULONG nMarkAnz
=GetMarkedObjectCount();
508 for (ULONG nMarkNum
=0; nMarkNum
<nMarkAnz
&& !bRet
; nMarkNum
++) {
509 const SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
510 const SdrUShortCont
* pPts
=pM
->GetMarkedGluePoints();
511 bRet
=pPts
!=NULL
&& pPts
->GetCount()!=0;
516 ULONG
SdrMarkView::GetMarkedGluePointCount() const
518 ForceUndirtyMrkPnt();
520 ULONG nMarkAnz
=GetMarkedObjectCount();
521 for (ULONG nMarkNum
=0; nMarkNum
<nMarkAnz
; nMarkNum
++) {
522 const SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
523 const SdrUShortCont
* pPts
=pM
->GetMarkedGluePoints();
524 if (pPts
!=NULL
) nAnz
+=pPts
->GetCount();
529 BOOL
SdrMarkView::MarkGluePoints(const Rectangle
* pRect
, BOOL bUnmark
)
531 if (!IsGluePointEditMode() && !bUnmark
) return FALSE
;
532 ForceUndirtyMrkPnt();
535 ULONG nMarkAnz
=GetMarkedObjectCount();
536 for (ULONG nMarkNum
=0; nMarkNum
<nMarkAnz
; nMarkNum
++) {
537 SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
538 const SdrObject
* pObj
=pM
->GetMarkedSdrObj();
539 const SdrGluePointList
* pGPL
=pObj
->GetGluePointList();
540 SdrUShortCont
* pPts
=pM
->GetMarkedGluePoints();
541 if (bUnmark
&& pRect
==NULL
) { // UnmarkAll
542 if (pPts
!=NULL
&& pPts
->GetCount()!=0) {
547 if (pGPL
!=NULL
&& (pPts
!=NULL
|| !bUnmark
)) {
548 USHORT nGPAnz
=pGPL
->GetCount();
549 for (USHORT nGPNum
=0; nGPNum
<nGPAnz
; nGPNum
++) {
550 const SdrGluePoint
& rGP
=(*pGPL
)[nGPNum
];
553 if(rGP
.IsUserDefined())
555 Point
aPos(rGP
.GetAbsolutePos(*pObj
));
556 if (pRect
==NULL
|| pRect
->IsInside(aPos
)) {
557 if (pPts
==NULL
) pPts
=pM
->ForceMarkedGluePoints();
558 else pPts
->ForceSort();
559 ULONG nPos
=pPts
->GetPos(rGP
.GetId());
560 if (!bUnmark
&& nPos
==CONTAINER_ENTRY_NOTFOUND
) {
562 pPts
->Insert(rGP
.GetId());
564 if (bUnmark
&& nPos
!=CONTAINER_ENTRY_NOTFOUND
) {
576 MarkListHasChanged();
581 BOOL
SdrMarkView::PickGluePoint(const Point
& rPnt
, SdrObject
*& rpObj
, USHORT
& rnId
, SdrPageView
*& rpPV
, ULONG nOptions
) const
583 SdrObject
* pObj0
=rpObj
;
584 //SdrPageView* pPV0=rpPV;
586 rpObj
=NULL
; rpPV
=NULL
; rnId
=0;
587 if (!IsGluePointEditMode()) return FALSE
;
588 BOOL bBack
=(nOptions
& SDRSEARCH_BACKWARD
) !=0;
589 BOOL bNext
=(nOptions
& SDRSEARCH_NEXT
) !=0;
590 OutputDevice
* pOut
=(OutputDevice
*)pActualOutDev
;
591 if (pOut
==NULL
) pOut
=GetFirstOutputDevice(); //GetWin(0);
592 if (pOut
==NULL
) return FALSE
;
594 ULONG nMarkAnz
=GetMarkedObjectCount();
595 ULONG nMarkNum
=bBack
? 0 : nMarkAnz
;
597 nMarkNum
=((SdrMarkView
*)this)->TryToFindMarkedObject(pObj0
);
598 if (nMarkNum
==CONTAINER_ENTRY_NOTFOUND
) return FALSE
;
599 if (!bBack
) nMarkNum
++;
601 while (bBack
? nMarkNum
<nMarkAnz
: nMarkNum
>0) {
602 if (!bBack
) nMarkNum
--;
603 const SdrMark
* pM
=GetSdrMarkByIndex(nMarkNum
);
604 SdrObject
* pObj
=pM
->GetMarkedSdrObj();
605 SdrPageView
* pPV
=pM
->GetPageView();
606 const SdrGluePointList
* pGPL
=pObj
->GetGluePointList();
608 USHORT nNum
=pGPL
->HitTest(rPnt
,*pOut
,pObj
,bBack
,bNext
,nId0
);
609 if (nNum
!=SDRGLUEPOINT_NOTFOUND
)
612 const SdrGluePoint
& rCandidate
= (*pGPL
)[nNum
];
614 if(rCandidate
.IsUserDefined())
617 rnId
=(*pGPL
)[nNum
].GetId();
623 bNext
=FALSE
; // HitNextGluePoint nur beim ersten Obj
624 if (bBack
) nMarkNum
++;
629 BOOL
SdrMarkView::MarkGluePoint(const SdrObject
* pObj
, USHORT nId
, const SdrPageView
* /*pPV*/, BOOL bUnmark
)
631 if (!IsGluePointEditMode()) return FALSE
;
632 ForceUndirtyMrkPnt();
635 ULONG nMarkPos
=TryToFindMarkedObject(pObj
);
636 if (nMarkPos
!=CONTAINER_ENTRY_NOTFOUND
) {
637 SdrMark
* pM
=GetSdrMarkByIndex(nMarkPos
);
638 SdrUShortCont
* pPts
=bUnmark
? pM
->GetMarkedGluePoints() : pM
->ForceMarkedGluePoints();
640 ULONG nPointPos
=pPts
->GetPos(nId
);
641 if (!bUnmark
&& nPointPos
==CONTAINER_ENTRY_NOTFOUND
) {
645 if (bUnmark
&& nPointPos
!=CONTAINER_ENTRY_NOTFOUND
) {
647 pPts
->Remove(nPointPos
);
651 // Objekt implizit markieren ...
652 // ... fehlende Implementation
657 MarkListHasChanged();
662 BOOL
SdrMarkView::IsGluePointMarked(const SdrObject
* pObj
, USHORT nId
) const
664 ForceUndirtyMrkPnt();
666 ULONG nPos
=((SdrMarkView
*)this)->TryToFindMarkedObject(pObj
); // casting auf NonConst
667 if (nPos
!=CONTAINER_ENTRY_NOTFOUND
) {
668 const SdrMark
* pM
=GetSdrMarkByIndex(nPos
);
669 const SdrUShortCont
* pPts
=pM
->GetMarkedGluePoints();
671 bRet
=pPts
->Exist(nId
);
677 BOOL
SdrMarkView::UnmarkGluePoint(const SdrHdl
& rHdl
)
679 if (&rHdl
!=NULL
&& rHdl
.GetKind()==HDL_GLUE
&& rHdl
.GetObj()!=NULL
) {
680 return MarkGluePoint(rHdl
.GetObj(),(sal_uInt16
)rHdl
.GetObjHdlNum(),rHdl
.GetPageView(),TRUE
);
684 SdrHdl
* SdrMarkView::GetGluePointHdl(const SdrObject
* pObj
, USHORT nId
) const
686 ForceUndirtyMrkPnt();
687 ULONG nHdlAnz
=aHdl
.GetHdlCount();
688 for (ULONG nHdlNum
=0; nHdlNum
<nHdlAnz
; nHdlNum
++) {
689 SdrHdl
* pHdl
=aHdl
.GetHdl(nHdlNum
);
690 if (pHdl
->GetObj()==pObj
&&
691 pHdl
->GetKind()==HDL_GLUE
&&
692 pHdl
->GetObjHdlNum()==nId
) return pHdl
;
697 BOOL
SdrMarkView::MarkNextGluePoint(BOOL
/*bPrev*/)
699 ForceUndirtyMrkPnt();
704 MarkListHasChanged();
709 BOOL
SdrMarkView::MarkNextGluePoint(const Point
& /*rPnt*/, BOOL
/*bPrev*/)
711 ForceUndirtyMrkPnt();
716 MarkListHasChanged();
721 const Rectangle
& SdrMarkView::GetMarkedGluePointsRect() const
723 ForceUndirtyMrkPnt();
724 if (bMarkedPointsRectsDirty
) ImpSetPointsRects();
725 return aMarkedGluePointsRect
;