summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/sdrmasterpagedescriptor.cxx9
-rw-r--r--svx/source/svdraw/svddrgv.cxx39
-rw-r--r--svx/source/svdraw/svdedtv1.cxx84
-rw-r--r--svx/source/svdraw/svdhdl.cxx139
-rw-r--r--svx/source/svdraw/svdmrkv.cxx77
-rw-r--r--svx/source/svdraw/svdobj.cxx31
-rw-r--r--svx/source/svdraw/svdopath.cxx34
-rw-r--r--svx/source/svdraw/svdorect.cxx46
-rw-r--r--svx/source/svdraw/svdouno.cxx6
-rw-r--r--svx/source/svdraw/svdpage.cxx78
-rw-r--r--svx/source/svdraw/svdpntv.cxx1
11 files changed, 342 insertions, 202 deletions
diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
index 9500c350e8d0..652327f3ff85 100644
--- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx
+++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
@@ -82,15 +82,6 @@ namespace sdr
return *mpViewContact;
}
- void MasterPageDescriptor::FlushViewContact() const
- {
- if(mpViewContact)
- {
- delete mpViewContact;
- ((MasterPageDescriptor*)this)->mpViewContact = 0;
- }
- }
-
// this method is called form the destructor of the referenced page.
// do all necessary action to forget the page. It is not necessary to call
// RemovePageUser(), that is done form the destructor.
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 4d99598bed78..6cc43df61a3e 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -634,32 +634,49 @@ BOOL SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl
} break;
default:
- { // SDRDRAG_MOVE
- if ( ( eDragHdl == HDL_MOVE ) && !IsMoveAllowed() )
+ {
+ // SDRDRAG_MOVE
+ if((eDragHdl == HDL_MOVE) && !IsMoveAllowed())
+ {
return FALSE;
- else if ( eDragHdl==HDL_GLUE )
+ }
+ else if(eDragHdl == HDL_GLUE)
+ {
pDragBla = new SdrDragMove(*this);
+ }
else
{
- if ( bFramDrag )
+ if(bFramDrag)
{
- if ( eDragHdl == HDL_MOVE )
+ if(eDragHdl == HDL_MOVE)
+ {
pDragBla=new SdrDragMove(*this);
+ }
else
{
- if (!IsResizeAllowed(TRUE)) return FALSE;
- pDragBla=new SdrDragResize(*this);
+ if(!IsResizeAllowed(TRUE))
+ {
+ return FALSE;
+ }
+
+ pDragBla = new SdrDragResize(*this);
}
}
else
{
- if ( ( eDragHdl == HDL_MOVE ) && ( GetMarkedObjectCount() == 1 )
- && GetMarkedObjectByIndex( 0 )->ISA( SdrObjCustomShape ) )
+ if((eDragHdl == HDL_MOVE) && (GetMarkedObjectCount() == 1) && GetMarkedObjectByIndex(0)->ISA(SdrObjCustomShape))
+ {
pDragBla = new SdrDragMove( *this );
+ }
+ else if((eDragHdl == HDL_POLY) && (!IsMoveAllowed() || !IsResizeAllowed()))
+ {
+ // #i77187# do not allow move of polygon points if object is move or size protected
+ return FALSE;
+ }
else
{
- bDragSpecial=TRUE;
- pDragBla=new SdrDragObjOwn(*this);
+ bDragSpecial = TRUE;
+ pDragBla = new SdrDragObjOwn(*this);
}
}
}
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 632761bb819c..ba1f8914ba8b 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -1410,40 +1410,74 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
MoveMarkedObj(Size(nPosDX,nPosDY));
}
- // Position geschuetzt
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS,TRUE,&pPoolItem))
+ // protect position
+ if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS, TRUE, &pPoolItem))
{
- BOOL bProtPos=((const SfxBoolItem*)pPoolItem)->GetValue();
- for (ULONG i=0; i<nMarkCount; i++) {
- pObj=rMarkList.GetMark(i)->GetMarkedSdrObj();
- pObj->SetMoveProtect(bProtPos);
- if( bProtPos )
- pObj->SetResizeProtect(true);
+ const sal_Bool bProtPos(((const SfxBoolItem*)pPoolItem)->GetValue());
+ bool bChanged(false);
+
+ for(sal_uInt32 i(0); i < nMarkCount; i++)
+ {
+ pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+
+ if(pObj->IsMoveProtect() != bProtPos)
+ {
+ bChanged = true;
+ pObj->SetMoveProtect(bProtPos);
+
+ if(bProtPos)
+ {
+ pObj->SetResizeProtect(true);
+ }
+ }
+ }
+
+ if(bChanged)
+ {
+ bMoveProtect = bProtPos;
+
+ if(bProtPos)
+ {
+ bResizeProtect = true;
+ }
+
+ // #i77187# there is no simple method to get the toolbars updated
+ // in the application. The App is listening to selection change and i
+ // will use it here (even if not true). It's acceptable since changing
+ // this model data is pretty rare and only possible using the F4 dialog
+ MarkListHasChanged();
}
- // BugFix 13897: hier muesste besser ein Broadcast her!
- // Ausserdem fehlt Undo
- // oder -> bProtPos/Size als Item (Interface)
- bMoveProtect=bProtPos;
- if( bProtPos )
- bResizeProtect=true;
}
- if( !bMoveProtect )
+ if(!bMoveProtect)
{
- // Groesse geschuetzt
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_SIZE,TRUE,&pPoolItem))
+ // protect size
+ if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_SIZE, TRUE, &pPoolItem))
{
- BOOL bProtSize=((const SfxBoolItem*)pPoolItem)->GetValue();
- for (ULONG i=0; i<nMarkCount; i++) {
- pObj=rMarkList.GetMark(i)->GetMarkedSdrObj();
- pObj->SetResizeProtect(bProtSize);
+ const sal_Bool bProtSize(((const SfxBoolItem*)pPoolItem)->GetValue());
+ bool bChanged(false);
+
+ for(sal_uInt32 i(0); i < nMarkCount; i++)
+ {
+ pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+
+ if(pObj->IsResizeProtect() != bProtSize)
+ {
+ bChanged = true;
+ pObj->SetResizeProtect(bProtSize);
+ }
+ }
+
+ if(bChanged)
+ {
+ bResizeProtect = bProtSize;
+
+ // #i77187# see above
+ MarkListHasChanged();
}
- // BugFix 13897: hier muesste besser ein Broadcast her!
- // Ausserdem fehlt Undo
- // oder -> bProtPos/Size als Item (Interface)
- bResizeProtect=bProtSize;
}
}
+
EndUndo();
}
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 8ada8ace73fa..c338d9845c21 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -65,6 +65,7 @@
#include <svx/sdr/overlay/overlaybitmap.hxx>
#include <svx/sdr/overlay/overlaylinestriped.hxx>
#include <svx/sdr/overlay/overlaytriangle.hxx>
+#include <svx/sdr/overlay/overlayhatchrect.hxx>
#include <svx/sdrpagewindow.hxx>
#include <sdrpaintwindow.hxx>
#include <vcl/svapp.hxx>
@@ -815,55 +816,50 @@ bool SdrHdl::IsHdlHit(const Point& rPnt) const
Pointer SdrHdl::GetPointer() const
{
PointerStyle ePtr=POINTER_MOVE;
- BOOL bSize=eKind>=HDL_UPLFT && eKind<=HDL_LWRGT;
- // Fuer Resize von gedrehten Rechtecken die Mauszeiger etwas mitdrehen
- if (bSize && nDrehWink!=0)
- {
- long nHdlWink=0;
+ const BOOL bSize=eKind>=HDL_UPLFT && eKind<=HDL_LWRGT;
+ const BOOL bRot=pHdlList!=NULL && pHdlList->IsRotateShear();
+ const BOOL bDis=pHdlList!=NULL && pHdlList->IsDistortShear();
+ if (bSize && pHdlList!=NULL && (bRot || bDis)) {
switch (eKind) {
- case HDL_UPLFT: nHdlWink=13500; break;
- case HDL_UPPER: nHdlWink=9000; break;
- case HDL_UPRGT: nHdlWink=4500; break;
- case HDL_LEFT : nHdlWink=0; break;
- case HDL_RIGHT: nHdlWink=0; break;
- case HDL_LWLFT: nHdlWink=4500; break;
- case HDL_LOWER: nHdlWink=9000; break;
- case HDL_LWRGT: nHdlWink=13500; break;
+ case HDL_UPLFT: case HDL_UPRGT:
+ case HDL_LWLFT: case HDL_LWRGT: ePtr=bRot ? POINTER_ROTATE : POINTER_REFHAND; break;
+ case HDL_LEFT : case HDL_RIGHT: ePtr=POINTER_VSHEAR; break;
+ case HDL_UPPER: case HDL_LOWER: ePtr=POINTER_HSHEAR; break;
default:
break;
}
- nHdlWink+=nDrehWink+2249; // und etwas drauf (zum runden)
- while (nHdlWink<0) nHdlWink+=18000;
- while (nHdlWink>=18000) nHdlWink-=18000;
- nHdlWink/=4500;
- switch ((BYTE)nHdlWink)
- {
- case 0: ePtr=POINTER_ESIZE; break;
- case 1: ePtr=POINTER_NESIZE; break;
- case 2: ePtr=POINTER_SSIZE; break;
- case 3: ePtr=POINTER_SESIZE; break;
- } // switch
- }
- if (ePtr==POINTER_MOVE)
- {
- BOOL bRot=pHdlList!=NULL && pHdlList->IsRotateShear();
- BOOL bDis=pHdlList!=NULL && pHdlList->IsDistortShear();
- if (bSize && pHdlList!=NULL && (bRot || bDis))
- {
- switch (eKind)
- {
- case HDL_UPLFT: case HDL_UPRGT:
- case HDL_LWLFT: case HDL_LWRGT: ePtr=bRot ? POINTER_ROTATE : POINTER_REFHAND; break;
- case HDL_LEFT : case HDL_RIGHT: ePtr=POINTER_VSHEAR; break;
- case HDL_UPPER: case HDL_LOWER: ePtr=POINTER_HSHEAR; break;
+ } else {
+ // Fuer Resize von gedrehten Rechtecken die Mauszeiger etwas mitdrehen
+ if (bSize && nDrehWink!=0) {
+ long nHdlWink=0;
+ switch (eKind) {
+ case HDL_LWRGT: nHdlWink=31500; break;
+ case HDL_LOWER: nHdlWink=27000; break;
+ case HDL_LWLFT: nHdlWink=22500; break;
+ case HDL_LEFT : nHdlWink=18000; break;
+ case HDL_UPLFT: nHdlWink=13500; break;
+ case HDL_UPPER: nHdlWink=9000; break;
+ case HDL_UPRGT: nHdlWink=4500; break;
+ case HDL_RIGHT: nHdlWink=0; break;
default:
break;
}
- }
- else
- {
- switch (eKind)
- {
+ nHdlWink+=nDrehWink+2249; // und etwas drauf (zum runden)
+ while (nHdlWink<0) nHdlWink+=36000;
+ while (nHdlWink>=36000) nHdlWink-=36000;
+ nHdlWink/=4500;
+ switch ((BYTE)nHdlWink) {
+ case 0: ePtr=POINTER_ESIZE; break;
+ case 1: ePtr=POINTER_NESIZE; break;
+ case 2: ePtr=POINTER_NSIZE; break;
+ case 3: ePtr=POINTER_NWSIZE; break;
+ case 4: ePtr=POINTER_WSIZE; break;
+ case 5: ePtr=POINTER_SWSIZE; break;
+ case 6: ePtr=POINTER_SSIZE; break;
+ case 7: ePtr=POINTER_SESIZE; break;
+ } // switch
+ } else {
+ switch (eKind) {
case HDL_UPLFT: ePtr=POINTER_NWSIZE; break;
case HDL_UPPER: ePtr=POINTER_NSIZE; break;
case HDL_UPRGT: ePtr=POINTER_NESIZE; break;
@@ -1655,6 +1651,65 @@ Pointer ImpMeasureHdl::GetPointer() const
////////////////////////////////////////////////////////////////////////////////////////////////////
+ImpTextframeHdl::ImpTextframeHdl(const Rectangle& rRect) :
+ SdrHdl(rRect.TopLeft(),HDL_MOVE),
+ maRect(rRect)
+{
+}
+
+void ImpTextframeHdl::CreateB2dIAObject()
+{
+ // first throw away old one
+ GetRidOfIAObject();
+
+ if(pHdlList)
+ {
+ SdrMarkView* pView = pHdlList->GetView();
+
+ if(pView && !pView->areMarkHandlesHidden())
+ {
+ SdrPageView* pPageView = pView->GetSdrPageView();
+
+ if(pPageView)
+ {
+ for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
+ {
+ const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
+
+ if(rPageWindow.GetPaintWindow().OutputToWindow())
+ {
+ if(rPageWindow.GetOverlayManager())
+ {
+ const basegfx::B2DPoint aTopLeft(maRect.Left(), maRect.Top());
+ const basegfx::B2DPoint aBottomRight(maRect.Right(), maRect.Bottom());
+ const svtools::ColorConfig aColorConfig;
+ const Color aHatchCol( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
+
+ ::sdr::overlay::OverlayHatchRect* pNewOverlayObject = new ::sdr::overlay::OverlayHatchRect(
+ aTopLeft,
+ aBottomRight,
+ aHatchCol,
+ 6.0,
+ 45 * F_PI180,
+ nDrehWink * -F_PI18000);
+ pNewOverlayObject->setHittable(false);
+
+ // OVERLAYMANAGER
+ if(pNewOverlayObject)
+ {
+ rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
class ImpSdrHdlListSorter: public ContainerSorter {
public:
ImpSdrHdlListSorter(Container& rNewCont): ContainerSorter(rNewCont) {}
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 97793ffa769e..fb5f76d41229 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -696,10 +696,15 @@ void SdrMarkView::SetMarkHandles()
{
ULONG nMarkAnz=GetMarkedObjectCount();
BOOL bStdDrag=eDragMode==SDRDRAG_MOVE;
+ BOOL bSingleTextObjMark=FALSE;
if (nMarkAnz==1)
{
pMarkedObj=GetMarkedObjectByIndex(0);
+ bSingleTextObjMark =
+ pMarkedObj &&
+ pMarkedObj->ISA(SdrTextObj) &&
+ static_cast<SdrTextObj*>(pMarkedObj)->IsTextFrame();
}
BOOL bFrmHdl=ImpIsFrameHandles();
@@ -732,8 +737,20 @@ void SdrMarkView::SetMarkHandles()
if(!aRect.IsEmpty() && !bHideHandlesWhenInTextEdit)
{ // sonst nix gefunden
-
- if( eDragMode==SDRDRAG_CROP )
+ if( bSingleTextObjMark )
+ {
+ const ULONG nSiz0=aHdl.GetHdlCount();
+ pMarkedObj->AddToHdlList(aHdl);
+ const ULONG nSiz1=aHdl.GetHdlCount();
+ for (ULONG i=nSiz0; i<nSiz1; i++)
+ {
+ SdrHdl* pHdl=aHdl.GetHdl(i);
+ pHdl->SetObj(pMarkedObj);
+ pHdl->SetPageView(pMarkedPV);
+ pHdl->SetObjHdlNum(USHORT(i-nSiz0));
+ }
+ }
+ else if( eDragMode==SDRDRAG_CROP )
{
aHdl.AddHdl(new SdrCropHdl(aRect.TopLeft() ,HDL_UPLFT));
aHdl.AddHdl(new SdrCropHdl(aRect.TopCenter() ,HDL_UPPER));
@@ -778,9 +795,9 @@ void SdrMarkView::SetMarkHandles()
const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
SdrObject* pObj=pM->GetMarkedSdrObj();
SdrPageView* pPV=pM->GetPageView();
- ULONG nSiz0=aHdl.GetHdlCount();
+ const ULONG nSiz0=aHdl.GetHdlCount();
pObj->AddToHdlList(aHdl);
- ULONG nSiz1=aHdl.GetHdlCount();
+ const ULONG nSiz1=aHdl.GetHdlCount();
bool bPoly=pObj->IsPolyObj();
const SdrUShortCont* pMrkPnts=pM->GetMarkedPoints();
for (ULONG i=nSiz0; i<nSiz1; i++)
@@ -1572,47 +1589,69 @@ void SdrMarkView::SetMarkHdlSizePixel(USHORT nSiz)
#define SDRSEARCH_IMPISMASTER 0x80000000 /* MasterPage wird gerade durchsucht */
SdrObject* SdrMarkView::ImpCheckObjHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const
{
- if ((nOptions & SDRSEARCH_IMPISMASTER) !=0 && pObj->IsNotVisibleAsMaster()) {
+ if((nOptions & SDRSEARCH_IMPISMASTER) && pObj->IsNotVisibleAsMaster())
+ {
return NULL;
}
- BOOL bCheckIfMarkable=(nOptions & SDRSEARCH_TESTMARKABLE)!=0;
- //BOOL bBack=(nOptions & SDRSEARCH_BACKWARD)!=0;
- BOOL bDeep=(nOptions & SDRSEARCH_DEEP)!=0;
- BOOL bOLE=pObj->ISA(SdrOle2Obj);
+
+ const bool bCheckIfMarkable(nOptions & SDRSEARCH_TESTMARKABLE);
+ const bool bDeep(nOptions & SDRSEARCH_DEEP);
+ const bool bOLE(pObj->ISA(SdrOle2Obj));
+ const bool bTXT(pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsTextFrame());
SdrObject* pRet=NULL;
Rectangle aRect(pObj->GetCurrentBoundRect());
- USHORT nTol2=nTol;
- // Doppelte Tolezanz fuer ein an dieser View im TextEdit befindliches Objekt
- if (bOLE || pObj==((SdrObjEditView*)this)->GetTextEditObject()) nTol2*=2;
+ USHORT nTol2(nTol);
+
+ // double tolerance for OLE, text frames and objects in
+ // active text edit
+ if(bOLE || bTXT || pObj==((SdrObjEditView*)this)->GetTextEditObject())
+ {
+ nTol2*=2;
+ }
+
aRect.Left ()-=nTol2; // Einmal Toleranz drauf fuer alle Objekte
aRect.Top ()-=nTol2;
aRect.Right ()+=nTol2;
aRect.Bottom()+=nTol2;
- if (aRect.IsInside(rPnt)) {
- if ((!bCheckIfMarkable || IsObjMarkable(pObj,pPV))) {
+
+ if (aRect.IsInside(rPnt))
+ {
+ if ((!bCheckIfMarkable || IsObjMarkable(pObj,pPV)))
+ {
SdrObjList* pOL=pObj->GetSubList();
- if (pOL!=NULL && pOL->GetObjCount()!=0) {
+
+ if (pOL!=NULL && pOL->GetObjCount()!=0)
+ {
SdrObject* pTmpObj;
// OD 30.06.2003 #108784# - adjustment hit point for virtual
// objects.
Point aPnt( rPnt );
+
if ( pObj->ISA(SdrVirtObj) )
{
Point aOffset = static_cast<SdrVirtObj*>(pObj)->GetOffset();
aPnt.Move( -aOffset.X(), -aOffset.Y() );
}
+
pRet=ImpCheckObjHit(aPnt,nTol,pOL,pPV,nOptions,pMVisLay,pTmpObj);
- } else {
+ }
+ else
+ {
SdrLayerID nLay=pObj->GetLayer();
- if (pPV->GetVisibleLayers().IsSet(nLay) &&
- (pMVisLay==NULL || pMVisLay->IsSet(nLay)))
+
+ if(pPV->GetVisibleLayers().IsSet(nLay) && (pMVisLay==NULL || pMVisLay->IsSet(nLay)))
{
pRet=pObj->CheckHit(rPnt,nTol2,&pPV->GetVisibleLayers());
}
}
}
}
- if (!bDeep && pRet!=NULL) pRet=pObj;
+
+ if (!bDeep && pRet!=NULL)
+ {
+ pRet=pObj;
+ }
+
return pRet;
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index b68dddbd4637..514d78e2cbf9 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -365,15 +365,6 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const
return *mpViewContact;
}
-void SdrObject::FlushViewContact() const
-{
- if(mpViewContact)
- {
- delete mpViewContact;
- ((SdrObject*)this)->mpViewContact = 0;
- }
-}
-
// DrawContact support: Methods for handling Object changes
void SdrObject::ActionChanged() const
{
@@ -2637,23 +2628,23 @@ void SdrObject::SetInserted(sal_Bool bIns)
void SdrObject::SetMoveProtect(sal_Bool bProt)
{
- bMovProt = bProt;
- SetChanged();
-
- if(IsInserted() && pModel)
+ if(IsMoveProtect() != bProt)
{
- SdrHint aHint(*this);
- pModel->Broadcast(aHint);
+ // #i77187# secured and simplified
+ bMovProt = bProt;
+ SetChanged();
+ BroadcastObjectChange();
}
}
void SdrObject::SetResizeProtect(sal_Bool bProt)
{
- bSizProt=bProt;
- SetChanged();
- if (IsInserted() && pModel!=NULL) {
- SdrHint aHint(*this);
- pModel->Broadcast(aHint);
+ if(IsResizeProtect() != bProt)
+ {
+ // #i77187# secured and simplified
+ bSizProt = bProt;
+ SetChanged();
+ BroadcastObjectChange();
}
}
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 6dd5003ae2ef..0f8213d37e9e 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -2346,50 +2346,52 @@ Pointer SdrPathObj::GetCreatePointer() const
void SdrPathObj::NbcMove(const Size& rSiz)
{
- SdrTextObj::NbcMove(rSiz);
-
basegfx::B2DHomMatrix aTrans;
aTrans.translate(rSiz.Width(), rSiz.Height());
maPathPolygon.transform(aTrans);
+
+ // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
+ SdrTextObj::NbcMove(rSiz);
}
void SdrPathObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
{
- SdrTextObj::NbcResize(rRef,xFact,yFact);
-
basegfx::B2DHomMatrix aTrans;
aTrans.translate(-rRef.X(), -rRef.Y());
aTrans.scale(double(xFact), double(yFact));
aTrans.translate(rRef.X(), rRef.Y());
maPathPolygon.transform(aTrans);
+
+ // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
+ SdrTextObj::NbcResize(rRef,xFact,yFact);
}
void SdrPathObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
{
- SdrTextObj::NbcRotate(rRef,nWink,sn,cs);
-
basegfx::B2DHomMatrix aTrans;
aTrans.translate(-rRef.X(), -rRef.Y());
aTrans.rotate(-nWink * nPi180); // Thank JOE, the angles are defined mirrored to the mathematical meanings
aTrans.translate(rRef.X(), rRef.Y());
maPathPolygon.transform(aTrans);
+
+ // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
+ SdrTextObj::NbcRotate(rRef,nWink,sn,cs);
}
void SdrPathObj::NbcShear(const Point& rRefPnt, long nAngle, double fTan, FASTBOOL bVShear)
{
- SdrTextObj::NbcShear(rRefPnt,nAngle,fTan,bVShear);
-
basegfx::B2DHomMatrix aTrans;
aTrans.translate(-rRefPnt.X(), -rRefPnt.Y());
aTrans.shearX(-fTan); // Thank JOE, the angles are defined mirrored to the mathematical meanings
aTrans.translate(rRefPnt.X(), rRefPnt.Y());
maPathPolygon.transform(aTrans);
+
+ // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
+ SdrTextObj::NbcShear(rRefPnt,nAngle,fTan,bVShear);
}
void SdrPathObj::NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2)
{
- SdrTextObj::NbcMirror(rRefPnt1,rRefPnt2);
-
basegfx::B2DHomMatrix aTrans;
const double fDiffX(rRefPnt2.X() - rRefPnt1.X());
const double fDiffY(rRefPnt2.Y() - rRefPnt1.Y());
@@ -2403,13 +2405,19 @@ void SdrPathObj::NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2)
// #97538# Do Joe's special handling for lines when mirroring, too
ImpForceKind();
+
+ // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
+ SdrTextObj::NbcMirror(rRefPnt1,rRefPnt2);
}
void SdrPathObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
{
- if (aGeo.nDrehWink==0) {
- rRect=GetSnapRect();
- } else {
+ if(!aGeo.nDrehWink)
+ {
+ rRect = GetSnapRect();
+ }
+ else
+ {
XPolyPolygon aXPP(GetPathPoly());
RotateXPoly(aXPP,Point(),-aGeo.nSin,aGeo.nCos);
rRect=aXPP.GetBoundRect();
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index a338889afa48..8620110d6979 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -403,24 +403,34 @@ SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const
SdrHdl* pH=NULL;
Point aPnt;
SdrHdlKind eKind=HDL_MOVE;
- switch (nHdlNum) {
- case 0: {
- long a=GetEckenradius();
- long b=Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert
- if (a>b) a=b;
- if (a<0) a=0;
- aPnt=aRect.TopLeft();
- aPnt.X()+=a;
- eKind=HDL_CIRC;
- } break; // Eckenradius
- case 1: aPnt=aRect.TopLeft(); eKind=HDL_UPLFT; break; // Oben links
- case 2: aPnt=aRect.TopCenter(); eKind=HDL_UPPER; break; // Oben
- case 3: aPnt=aRect.TopRight(); eKind=HDL_UPRGT; break; // Oben rechts
- case 4: aPnt=aRect.LeftCenter(); eKind=HDL_LEFT ; break; // Links
- case 5: aPnt=aRect.RightCenter(); eKind=HDL_RIGHT; break; // Rechts
- case 6: aPnt=aRect.BottomLeft(); eKind=HDL_LWLFT; break; // Unten links
- case 7: aPnt=aRect.BottomCenter(); eKind=HDL_LOWER; break; // Unten
- case 8: aPnt=aRect.BottomRight(); eKind=HDL_LWRGT; break; // Unten rechts
+ if( IsTextFrame() && !nHdlNum )
+ {
+ pH=new ImpTextframeHdl(aRect);
+ pH->SetObj((SdrObject*)this);
+ pH->SetDrehWink(aGeo.nDrehWink);
+ return pH;
+ }
+ else
+ {
+ switch (nHdlNum) {
+ case 0: {
+ long a=GetEckenradius();
+ long b=Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert
+ if (a>b) a=b;
+ if (a<0) a=0;
+ aPnt=aRect.TopLeft();
+ aPnt.X()+=a;
+ eKind=HDL_CIRC;
+ } break; // Eckenradius
+ case 1: aPnt=aRect.TopLeft(); eKind=HDL_UPLFT; break; // Oben links
+ case 2: aPnt=aRect.TopCenter(); eKind=HDL_UPPER; break; // Oben
+ case 3: aPnt=aRect.TopRight(); eKind=HDL_UPRGT; break; // Oben rechts
+ case 4: aPnt=aRect.LeftCenter(); eKind=HDL_LEFT ; break; // Links
+ case 5: aPnt=aRect.RightCenter(); eKind=HDL_RIGHT; break; // Rechts
+ case 6: aPnt=aRect.BottomLeft(); eKind=HDL_LWLFT; break; // Unten links
+ case 7: aPnt=aRect.BottomCenter(); eKind=HDL_LOWER; break; // Unten
+ case 8: aPnt=aRect.BottomRight(); eKind=HDL_LWRGT; break; // Unten rechts
+ }
}
if (aGeo.nShearWink!=0) ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan);
if (aGeo.nDrehWink!=0) RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index ddf6e87fe51a..2c42adfd63c6 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -559,9 +559,9 @@ void SdrUnoObj::SetUnoControlModel( uno::Reference< awt::XControlModel > xModel)
ViewContactOfUnoControl* pVC = NULL;
if ( impl_getViewContact( pVC ) )
{
- // FlushViewContact() removes all existing VOCs. This is always allowed
- // since they will be re-created on demand (and with the changed model)
- FlushViewContact();
+ // flushViewObjectContacts() removes all existing VOCs for the local DrawHierarchy. This
+ // is always allowed since they will be re-created on demand (and with the changed model)
+ GetViewContact().flushViewObjectContacts(true);
}
}
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index f7dca8ee7e00..2986cb482aae 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -257,9 +257,9 @@ void SdrObjList::Clear()
SdrObject* pObj = maList.back();
RemoveObjectFromContainer(maList.size()-1);
- // FlushViewContact() is done since SdrObject::Free is not guaranteed
+ // flushViewObjectContacts() is done since SdrObject::Free is not guaranteed
// to delete the object and thus refresh visualisations
- pObj->FlushViewContact();
+ pObj->GetViewContact().flushViewObjectContacts(true);
bObjectsRemoved = sal_True;
@@ -441,8 +441,8 @@ SdrObject* SdrObjList::NbcRemoveObject(ULONG nObjNum)
SdrObject* pObj=maList[nObjNum];
RemoveObjectFromContainer(nObjNum);
- // FlushViewContact() clears the VOC's and those invalidate
- pObj->FlushViewContact();
+ // flushViewObjectContacts() clears the VOC's and those invalidate
+ pObj->GetViewContact().flushViewObjectContacts(true);
DBG_ASSERT(pObj!=NULL,"Object zum Removen nicht gefunden");
if (pObj!=NULL) {
@@ -475,8 +475,8 @@ SdrObject* SdrObjList::RemoveObject(ULONG nObjNum)
DBG_ASSERT(pObj!=NULL,"Object zum Removen nicht gefunden");
if(pObj)
{
- // FlushViewContact() clears the VOC's and those invalidate
- pObj->FlushViewContact();
+ // flushViewObjectContacts() clears the VOC's and those invalidate
+ pObj->GetViewContact().flushViewObjectContacts(true);
DBG_ASSERT(pObj->IsInserted(),"ZObjekt hat keinen Inserted-Status");
if (pModel!=NULL) {
@@ -526,8 +526,8 @@ SdrObject* SdrObjList::NbcReplaceObject(SdrObject* pNewObj, ULONG nObjNum)
pObj->SetPage(NULL);
ReplaceObjectInContainer(*pNewObj,nObjNum);
- // FlushViewContact() clears the VOC's and those invalidate
- pObj->FlushViewContact();
+ // flushViewObjectContacts() clears the VOC's and those invalidate
+ pObj->GetViewContact().flushViewObjectContacts(true);
pNewObj->SetOrdNum(nObjNum);
pNewObj->SetObjList(this);
@@ -573,8 +573,8 @@ SdrObject* SdrObjList::ReplaceObject(SdrObject* pNewObj, ULONG nObjNum)
pObj->SetPage(NULL);
ReplaceObjectInContainer(*pNewObj,nObjNum);
- // FlushViewContact() clears the VOC's and those invalidate
- pObj->FlushViewContact();
+ // flushViewObjectContacts() clears the VOC's and those invalidate
+ pObj->GetViewContact().flushViewObjectContacts(true);
pNewObj->SetOrdNum(nObjNum);
pNewObj->SetObjList(this);
@@ -1231,15 +1231,6 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const
return *mpViewContact;
}
-void SdrPage::FlushViewContact() const
-{
- if(mpViewContact)
- {
- delete mpViewContact;
- ((SdrPage*)this)->mpViewContact = 0;
- }
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
TYPEINIT1(SdrPage,SdrObjList);
@@ -1257,10 +1248,11 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
pBackgroundObj(0L),
mpMasterPageDescriptor(0L),
nPageNum(0L),
- bMaster(bMasterPage),
- bInserted(sal_False),
- bObjectsNotPersistent(sal_False),
- bSwappingLocked(sal_False)
+ mbMaster(bMasterPage),
+ mbInserted(false),
+ mbObjectsNotPersistent(false),
+ mbSwappingLocked(false),
+ mbPageBorderOnlyLeftRight(false)
{
DBG_CTOR(SdrPage,NULL);
aPrefVisiLayers.SetAll();
@@ -1281,14 +1273,15 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
pBackgroundObj(0L),
mpMasterPageDescriptor(0L),
nPageNum(rSrcPage.nPageNum),
- bMaster(rSrcPage.bMaster),
- bInserted(sal_False),
- bObjectsNotPersistent(rSrcPage.bObjectsNotPersistent),
- bSwappingLocked(rSrcPage.bSwappingLocked)
+ mbMaster(rSrcPage.mbMaster),
+ mbInserted(false),
+ mbObjectsNotPersistent(rSrcPage.mbObjectsNotPersistent),
+ mbSwappingLocked(rSrcPage.mbSwappingLocked),
+ mbPageBorderOnlyLeftRight(rSrcPage.mbPageBorderOnlyLeftRight)
{
DBG_CTOR(SdrPage,NULL);
aPrefVisiLayers.SetAll();
- eListKind = (bMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
+ eListKind = (mbMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
// copy things from source
// Warning: this leads to slicing (see issue 93186) and has to be
@@ -1297,7 +1290,7 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
// be careful and correct eListKind, a member of SdrObjList which
// will be changed by the SdrOIbjList::operator= before...
- eListKind = (bMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
+ eListKind = (mbMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
// The previous assignment to *this may have resulted in a call to
// createUnoPage at a partially initialized (sliced) SdrPage object.
@@ -1377,8 +1370,9 @@ void SdrPage::operator=(const SdrPage& rSrcPage)
// copy all the local parameters to make this instance
// a valid copy od source page before copying and inserting
// the contained objects
- bMaster = rSrcPage.bMaster;
- bSwappingLocked = rSrcPage.bSwappingLocked;
+ mbMaster = rSrcPage.mbMaster;
+ mbSwappingLocked = rSrcPage.mbSwappingLocked;
+ mbPageBorderOnlyLeftRight = rSrcPage.mbPageBorderOnlyLeftRight;
aPrefVisiLayers = rSrcPage.aPrefVisiLayers;
nWdt = rSrcPage.nWdt;
nHgt = rSrcPage.nHgt;
@@ -1399,7 +1393,7 @@ void SdrPage::operator=(const SdrPage& rSrcPage)
}
//aMasters = rSrcPage.aMasters;
- bObjectsNotPersistent = rSrcPage.bObjectsNotPersistent;
+ mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent;
if(rSrcPage.pBackgroundObj)
{
@@ -1621,8 +1615,10 @@ void SdrPage::SetPageNum(sal_uInt16 nNew)
USHORT SdrPage::GetPageNum() const
{
- if (!bInserted) return 0;
- if (bMaster) {
+ if (!mbInserted)
+ return 0;
+
+ if (mbMaster) {
if (pModel && pModel->IsMPgNumsDirty())
((SdrModel*)pModel)->RecalcPageNums(TRUE);
} else {
@@ -1666,8 +1662,8 @@ void SdrPage::TRG_ClearMasterPage()
{
SetChanged();
- // the FlushViewContact() will do needed invalidates by deleting the involved VOCs
- mpMasterPageDescriptor->GetUsedPage().FlushViewContact();
+ // the flushViewObjectContacts() will do needed invalidates by deleting the involved VOCs
+ mpMasterPageDescriptor->GetUsedPage().GetViewContact().flushViewObjectContacts(true);
delete mpMasterPageDescriptor;
mpMasterPageDescriptor = 0L;
@@ -1718,7 +1714,7 @@ FASTBOOL SdrPage::ImplGetFillColor(const Point& rPnt, const SetOfByte& rVisLayer
{
if (pModel==NULL) return FALSE;
FASTBOOL bRet=SdrObjList::GetFillColor(rPnt,rVisLayers,/*bLayerSorted,*/rCol);
- if (!bRet && !bMaster)
+ if (!bRet && !mbMaster)
{
// nun zu den Masterpages
if(TRG_HasMasterPage())
@@ -1787,11 +1783,11 @@ void SdrPage::SetBackgroundObj( SdrObject* pObj )
pBackgroundObj = pObj;
}
-void SdrPage::SetInserted( FASTBOOL bIns )
+void SdrPage::SetInserted( bool bIns )
{
- if( bInserted != bIns )
+ if( mbInserted != bIns )
{
- bInserted = bIns;
+ mbInserted = bIns;
SdrObjListIter aIter( *this, IM_FLAT );
while ( aIter.IsMore() )
@@ -1799,7 +1795,7 @@ void SdrPage::SetInserted( FASTBOOL bIns )
SdrObject* pObj = aIter.Next();
if ( pObj->ISA(SdrOle2Obj) )
{
- if( bInserted )
+ if( mbInserted )
( (SdrOle2Obj*) pObj)->Connect();
else
( (SdrOle2Obj*) pObj)->Disconnect();
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index be6805c3c544..da0f28cce54c 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -228,7 +228,6 @@ void SdrPaintView::ImpClearVars()
bPageVisible=TRUE;
bPageBorderVisible=TRUE;
bBordVisible=TRUE;
- bBordVisibleOnlyLeftRight=FALSE;
bGridVisible=TRUE;
bGridFront =FALSE;
bHlplVisible=TRUE;