diff options
author | Rüdiger Timm <rt@openoffice.org> | 2003-11-24 15:56:30 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2003-11-24 15:56:30 +0000 |
commit | 3f092bd94107533e333c4aef50310dd7e3d657e2 (patch) | |
tree | d9c7031c6f2a06b3b7bff4dc4672a4b79ce12f5e /svx/source | |
parent | 976fe48a4e5012162e1101362445bfc5ab6ae916 (diff) |
INTEGRATION: CWS aw003 (1.12.200); FILE MERGED
2003/10/23 14:37:42 aw 1.12.200.9: #111111#
Changed GetBoundRect() to GetCurrentBoundRect() and GetLastBoundRect()
2003/10/07 12:21:39 aw 1.12.200.8: #111097#
2003/07/25 16:32:49 aw 1.12.200.7: #110094#
Changed Paint() to DoPaintObject() for identifying reasons
2003/07/24 14:39:02 aw 1.12.200.6: #110094# Adaptions for DrawingLayer changes
2003/06/30 16:12:05 aw 1.12.200.5: RESYNC: (1.12-1.14); FILE MERGED
2003/06/30 13:28:43 aw 1.12.200.4: #110094#
2003/06/06 12:59:36 aw 1.12.200.3: #109820#
2nd run of changes for ItemSet isolation
2003/05/26 12:52:04 aw 1.12.200.2: #109820#
Removed all itemset handling stuff, migrated to new properties implementations completely. I had to change from base class Properties to BaseProperties due to a solaris compiler bug.
2003/05/21 11:47:36 aw 1.12.200.1: #109820#
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/svdraw/svdocapt.cxx | 121 |
1 files changed, 37 insertions, 84 deletions
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 5cb93b9f073b..9ad62da2693f 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdocapt.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: vg $ $Date: 2003-06-06 10:44:07 $ + * last change: $Author: rt $ $Date: 2003-11-24 16:56:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,6 +107,10 @@ #include "eeitem.hxx" #endif +#ifndef _SDR_PROPERTIES_CAPTIONPROPERTIES_HXX +#include <svx/sdr/properties/captionproperties.hxx> +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////// enum EscDir {LKS,RTS,OBN,UNT}; @@ -222,6 +226,15 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi rDir=eBestDir; } +////////////////////////////////////////////////////////////////////////////// + +sdr::properties::BaseProperties* SdrCaptionObj::CreateObjectSpecificProperties() +{ + return new sdr::properties::CaptionProperties(*this); +} + +////////////////////////////////////////////////////////////////////////////// + TYPEINIT1(SdrCaptionObj,SdrRectObj); SdrCaptionObj::SdrCaptionObj(): @@ -250,12 +263,12 @@ SdrCaptionObj::~SdrCaptionObj() { } -FASTBOOL SdrCaptionObj::Paint(ExtOutputDevice& rOut, const SdrPaintInfoRec& rInfoRec) const +sal_Bool SdrCaptionObj::DoPaintObject(ExtOutputDevice& rOut, const SdrPaintInfoRec& rInfoRec) const { // special shadow paint for calc if(mbSpecialTextBoxShadow) { - const SfxItemSet& rSet = GetItemSet(); + const SfxItemSet& rSet = GetObjectItemSet(); sal_uInt32 nXDist = ((SdrShadowXDistItem&)(rSet.Get(SDRATTR_SHADOWXDIST))).GetValue(); sal_uInt32 nYDist = ((SdrShadowYDistItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue(); const SdrShadowColorItem& rShadColItem = ((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))); @@ -305,7 +318,7 @@ FASTBOOL SdrCaptionObj::Paint(ExtOutputDevice& rOut, const SdrPaintInfoRec& rInf } // call parent for normal paint - return SdrRectObj::Paint(rOut, rInfoRec); + return SdrRectObj::DoPaintObject(rOut, rInfoRec); } void SdrCaptionObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const @@ -354,7 +367,7 @@ SdrObject* SdrCaptionObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfBy FASTBOOL bHit=SdrRectObj::CheckHit(rPnt,nTol,pVisiLayer)!=NULL; if (!bHit) { INT32 nMyTol=nTol; - INT32 nWdt = ((XLineWidthItem&)(GetItem(XATTR_LINEWIDTH))).GetValue(); + INT32 nWdt = ((XLineWidthItem&)(GetObjectItem(XATTR_LINEWIDTH))).GetValue(); nWdt++; nWdt /= 2; @@ -400,9 +413,10 @@ void SdrCaptionObj::TakeXorPoly(XPolyPolygon& rPoly, FASTBOOL bDetail) const rPoly.Insert(XPolygon(aTailPoly)); } -void SdrCaptionObj::TakeContour(XPolyPolygon& rXPoly, SdrContourType eType) const -{ -} +//#110094#-12 +//void SdrCaptionObj::TakeContour(XPolyPolygon& rXPoly, SdrContourType eType) const +//{ +//} USHORT SdrCaptionObj::GetHdlCount() const { @@ -490,16 +504,20 @@ FASTBOOL SdrCaptionObj::MovDrag(SdrDragStat& rDrag) const FASTBOOL SdrCaptionObj::EndDrag(SdrDragStat& rDrag) { - Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetBoundRect(); + Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect(); const SdrHdl* pHdl=rDrag.GetHdl(); if (pHdl!=NULL && pHdl->GetPolyNum()==0) { FASTBOOL bRet=SdrRectObj::EndDrag(rDrag); ImpRecalcTail(); - SendRepaintBroadcast(); + + // Here only redraw wanted + ActionChanged(); + // BroadcastObjectChange(); + SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0); return bRet; } else { - SendRepaintBroadcast(); + // #110094#-14 SendRepaintBroadcast(); Point aDelt(rDrag.GetNow()-rDrag.GetStart()); if (pHdl==NULL) { // Rect verschoben aRect.Move(aDelt.X(),aDelt.Y()); @@ -508,7 +526,7 @@ FASTBOOL SdrCaptionObj::EndDrag(SdrDragStat& rDrag) } ImpRecalcTail(); SetChanged(); - SendRepaintBroadcast(); + BroadcastObjectChange(); SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0); return TRUE; } @@ -571,7 +589,7 @@ void SdrCaptionObj::TakeDragPoly(const SdrDragStat& rDrag, XPolyPolygon& rXPP) c void SdrCaptionObj::ImpGetCaptParams(ImpCaptParams& rPara) const { - const SfxItemSet& rSet = GetItemSet(); + const SfxItemSet& rSet = GetObjectItemSet(); rPara.eType =((SdrCaptionTypeItem&) (rSet.Get(SDRATTR_CAPTIONTYPE ))).GetValue(); rPara.bFixedAngle=((SdrCaptionFixedAngleItem&)(rSet.Get(SDRATTR_CAPTIONANGLE ))).GetValue(); rPara.nAngle =((SdrCaptionAngleItem&) (rSet.Get(SDRATTR_CAPTIONFIXEDANGLE))).GetValue(); @@ -856,11 +874,11 @@ const Point& SdrCaptionObj::GetTailPos() const void SdrCaptionObj::SetTailPos(const Point& rPos) { if (aTailPoly.GetSize()==0 || aTailPoly[0]!=rPos) { - Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetBoundRect(); - SendRepaintBroadcast(); + Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect(); + // #110094#-14 SendRepaintBroadcast(); NbcSetTailPos(rPos); SetChanged(); - SendRepaintBroadcast(); + BroadcastObjectChange(); SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0); } } @@ -889,45 +907,6 @@ void SdrCaptionObj::SetModel(SdrModel* pNewModel) ImpRecalcTail(); } -//////////////////////////////////////////////////////////////////////////////////////////////////// -// ItemSet access - -SfxItemSet* SdrCaptionObj::CreateNewItemSet(SfxItemPool& rPool) -{ - // include ALL items, 2D and 3D - return new SfxItemSet(rPool, - // ranges from SdrAttrObj - SDRATTR_START, SDRATTRSET_SHADOW, - SDRATTRSET_OUTLINER, SDRATTRSET_MISC, - SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, - - // caption attributes - SDRATTR_CAPTION_FIRST, SDRATTRSET_CAPTION, - - // outliner and end - EE_ITEMS_START, EE_ITEMS_END, - 0, 0); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// private support routines for ItemSet access -void SdrCaptionObj::ItemSetChanged(const SfxItemSet& rSet) -{ - // local changes - ImpRecalcTail(); - - // call parent - SdrRectObj::ItemSetChanged(rSet); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -void SdrCaptionObj::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDontRemoveHardAttr) -{ - SdrRectObj::NbcSetStyleSheet(pNewStyleSheet,bDontRemoveHardAttr); - ImpRecalcTail(); -} - void SdrCaptionObj::SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType) { SdrRectObj::SFX_NOTIFY(rBC,rBCType,rHint,rHintType); @@ -977,32 +956,6 @@ SdrObject* SdrCaptionObj::DoConvertToPolyObj(BOOL bBezier) const } //////////////////////////////////////////////////////////////////////////////////////////////////// -// pre- and postprocessing for objects for saving - -void SdrCaptionObj::PreSave() -{ - // call parent - SdrRectObj::PreSave(); - - // prepare SetItems for storage - const SfxItemSet& rSet = GetUnmergedItemSet(); - const SfxItemSet* pParent = GetStyleSheet() ? &GetStyleSheet()->GetItemSet() : 0L; - SdrCaptionSetItem aCaptAttr(rSet.GetPool()); - aCaptAttr.GetItemSet().Put(rSet); - aCaptAttr.GetItemSet().SetParent(pParent); - mpObjectItemSet->Put(aCaptAttr); -} - -void SdrCaptionObj::PostSave() -{ - // call parent - SdrRectObj::PostSave(); - - // remove SetItems from local itemset - mpObjectItemSet->ClearItem(SDRATTRSET_CAPTION); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// void SdrCaptionObj::WriteData(SvStream& rOut) const { @@ -1017,7 +970,7 @@ void SdrCaptionObj::WriteData(SvStream& rOut) const if(pPool) { - const SfxItemSet& rSet = GetUnmergedItemSet(); + const SfxItemSet& rSet = GetObjectItemSet(); pPool->StoreSurrogate(rOut, &rSet.Get(SDRATTRSET_CAPTION)); } @@ -1049,7 +1002,7 @@ void SdrCaptionObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn) sal_uInt16 nSetID = SDRATTRSET_CAPTION; const SdrCaptionSetItem* pCaptAttr = (const SdrCaptionSetItem*)pPool->LoadSurrogate(rIn, nSetID, 0); if(pCaptAttr) - SetItemSet(pCaptAttr->GetItemSet()); + SetObjectItemSet(pCaptAttr->GetItemSet()); } else { |