diff options
31 files changed, 412 insertions, 2458 deletions
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 351887cbf850..74546bebdab2 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdattr.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: cl $ $Date: 2000-11-28 15:30:43 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -160,10 +160,6 @@ SdrItemPool::SdrItemPool(SfxItemPool* pMaster, USHORT nAttrStart, USHORT nAttrEn void SdrItemPool::Ctor(SfxItemPool* pMaster, USHORT nAttrStart, USHORT nAttrEnd) { -//-/#ifdef SDRDEFITEMCACHE -//-/ pDefLineAttr=NULL; -//-/#endif SDRDEFITEMCACHE - if (pMaster==NULL) { pMaster=this; } @@ -449,43 +445,6 @@ void SdrItemPool::Ctor(SfxItemPool* pMaster, USHORT nAttrStart, USHORT nAttrEnd) } } -//-/void SdrItemPool::ImpMakeDefItems() -//-/{ -//-/#ifdef SDRDEFITEMCACHE -//-/ if (pDefLineAttr==NULL) { -//-/ XLineAttrSetItem aLineSetItem(this); -//-/ pDefLineAttr=(XLineAttrSetItem*)&Put(aLineSetItem); -//-/ aLineSetItem.GetItemSet().Put(XLineStyleItem(XLINE_NONE)); -//-/ pDefTextFrameLineAttr=(XLineAttrSetItem*)&Put(aLineSetItem); -//-/ -//-/ XFillAttrSetItem aFillSetItem(this); -//-/ pDefFillAttr=(XFillAttrSetItem*)&Put(aFillSetItem); -//-/ aFillSetItem.GetItemSet().Put(XFillColorItem(String(),Color(COL_WHITE))); // Falls einer auf Solid umschaltet -//-/ aFillSetItem.GetItemSet().Put(XFillStyleItem(XFILL_NONE)); -//-/ pDefTextFrameFillAttr=(XFillAttrSetItem*)&Put(aFillSetItem); -//-/ -//-/ XTextAttrSetItem aTextSetItem(this); -//-/ pDefTextAttr=(XTextAttrSetItem*)&Put(aTextSetItem); -//-/ pDefTextFrameTextAttr=pDefTextAttr; -//-/ -//-/ SdrShadowSetItem aShadSetItem(this); -//-/ pDefShadAttr=(SdrShadowSetItem*)&Put(aShadSetItem); -//-/ pDefTextFrameShadAttr=pDefShadAttr; -//-/ -//-/ SdrOutlinerSetItem aOutlSetItem(this); -//-/ pDefTextFrameOutlAttr=(SdrOutlinerSetItem*)&Put(aOutlSetItem); -//-/ aOutlSetItem.GetItemSet().Put(SvxAdjustItem(SVX_ADJUST_CENTER)); -//-/ pDefOutlAttr=(SdrOutlinerSetItem*)&Put(aOutlSetItem); -//-/ -//-/ SdrMiscSetItem aMiscSetItem(this); -//-/ pDefTextFrameMiscAttr=(SdrMiscSetItem*)&Put(aMiscSetItem); -//-/ aMiscSetItem.GetItemSet().Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_CENTER)); -//-/ aMiscSetItem.GetItemSet().Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER)); -//-/ pDefMiscAttr=(SdrMiscSetItem*)&Put(aMiscSetItem); -//-/ } -//-/#endif SDRDEFITEMCACHE -//-/} - /************************************************************************* |* |* copy ctor, sorgt dafuer, dass die static defaults gecloned werden diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 31203076eab7..ec7506c20f1c 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdcrtv.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2001-01-19 15:59:18 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -451,7 +451,6 @@ BOOL SdrCreateView::ImpBegCreateObj(UINT32 nInvent, UINT16 nIdent, const Point& BOOL bStartEdit=FALSE; // nach Ende von Create automatisch TextEdit starten if (pDefaultStyleSheet!=NULL) pAktCreate->NbcSetStyleSheet(pDefaultStyleSheet,FALSE); -//-/ pAktCreate->NbcSetAttributes(aDefaultAttr,FALSE); pAktCreate->SetItemSet(aDefaultAttr); if (HAS_BASE(SdrCaptionObj,pAktCreate)) @@ -460,7 +459,6 @@ BOOL SdrCreateView::ImpBegCreateObj(UINT32 nInvent, UINT16 nIdent, const Point& aSet.Put(XFillColorItem(String(),Color(COL_WHITE))); // Falls einer auf Solid umschaltet aSet.Put(XFillStyleItem(XFILL_NONE)); -//-/ pAktCreate->NbcSetAttributes(aSet,FALSE); pAktCreate->SetItemSet(aSet); bStartEdit=TRUE; @@ -475,7 +473,6 @@ BOOL SdrCreateView::ImpBegCreateObj(UINT32 nInvent, UINT16 nIdent, const Point& aSet.Put(XLineColorItem(String(),Color(COL_BLACK))); // Falls einer auf Solid umschaltet aSet.Put(XLineStyleItem(XLINE_NONE)); -//-/ pAktCreate->NbcSetAttributes(aSet,FALSE); pAktCreate->SetItemSet(aSet); bStartEdit=TRUE; @@ -535,7 +532,6 @@ BOOL SdrCreateView::BegCreateLibObj(const Point& rPnt, SdrObject* pObj, BOOL bMo if (bSetDefAttr) { if (pDefaultStyleSheet!=NULL) pObj->NbcSetStyleSheet(pDefaultStyleSheet,FALSE); -//-/ pObj->NbcSetAttributes(aDefaultAttr,FALSE); pObj->SetItemSet(aDefaultAttr); } if (bSetDefLayer) { @@ -577,8 +573,6 @@ void SdrCreateView::MovCreateObj(const Point& rPnt) if (IsSolidDraggingNow() && !IsSolidDraggingCheck()) { // Z.B. fuer Fill+Linelose Textrahmen bei SolidDragging SetSolidDraggingCheck(TRUE); -//-/ SfxItemSet aSet(pMod->GetItemPool()); -//-/ pAktCreate->TakeAttributes(aSet,FALSE,FALSE); const SfxItemSet& rSet = pAktCreate->GetItemSet(); XFillStyle eFill=((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue(); XLineStyle eLine=((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue(); @@ -945,7 +939,6 @@ BOOL SdrCreateView::GetAttributes(SfxItemSet& rTargetSet, BOOL bOnlyHardAttr) co { if(pAktCreate) { -//-/ pAktCreate->TakeAttributes(rTargetSet, FALSE, bOnlyHardAttr); rTargetSet.Put(pAktCreate->GetItemSet()); return TRUE; } @@ -959,7 +952,6 @@ BOOL SdrCreateView::SetAttributes(const SfxItemSet& rSet, BOOL bReplaceAll) { if(pAktCreate) { -//-/ pAktCreate->SetAttributes(rSet,bReplaceAll); SdrBroadcastItemChange aItemChange(*pAktCreate); if(bReplaceAll) pAktCreate->ClearItem(); diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index bdb91cc08c07..558da4e72f27 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdedtv.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:11:36 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -466,9 +466,6 @@ void SdrEditView::CheckPossibilities() const SdrMark* pM = aMark.GetMark(0); const SdrObject* pObj = pM->GetObj(); -//-/ SfxItemSet aSet(GetModel()->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, 0, 0); -//-/ -//-/ pObj->TakeAttributes(aSet, FALSE, TRUE); XFillStyle eFillStyle = ((XFillStyleItem&)(pObj->GetItem(XATTR_FILLSTYLE))).GetValue(); @@ -792,7 +789,6 @@ BOOL SdrEditView::InsertObject(SdrObject* pObj, SdrPageView& rPV, ULONG nOptions } if ((nOptions & SDRINSERT_SETDEFATTR)!=0) { if (pDefaultStyleSheet!=NULL) pObj->NbcSetStyleSheet(pDefaultStyleSheet,FALSE); -//-/ pObj->NbcSetAttributes(aDefaultAttr,FALSE); pObj->SetItemSet(aDefaultAttr); } if (!pObj->IsInserted()) { diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 457bdeb9b4d9..1ca72ccddde1 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdedtv1.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2001-01-12 17:02:25 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -722,113 +722,7 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, BOOL bOnlyHardAttr) con nWhich = aIter.NextWhich(); } - -// SfxWhichIter aIter(rSet); -// sal_uInt16 nWhich(aIter.FirstWhich()); -// -// while(nWhich) -// { -// const SfxPoolItem* pItem = NULL; -// rSet.GetItemState(nWhich, FALSE, &pItem); -// -// if(pItem) -// { -// if(pItem == (SfxPoolItem *)-1) -// rAttr.InvalidateItem(nWhich); -// else -// rAttr.MergeValue(*pItem, TRUE); -// } -// nWhich = aIter.NextWhich(); -// } - } - - - -//-/ ULONG nMarkAnz=aMark.GetMarkCount(); -//-/ for (ULONG nm=0; nm<nMarkAnz; nm++) { -//-/ SdrMark* pM=aMark.GetMark(nm); -//-///-/ pM->GetObj()->TakeAttributes(rAttr,TRUE,bOnlyHardAttr); -//-///-/ rAttr.Put(pM->GetObj()->GetItemSet()); -//-/ const SfxItemSet& rSet = pM->GetObj()->GetItemSet(); -//-/ -//-/ -//-/ -//-/ -//-/ -//-/ static BOOL bTestOwnLoop(FALSE); -//-/ if(bTestOwnLoop) -//-/ { -//-/ -//-/ SfxWhichIter aIter(rSet); -//-/ sal_uInt16 nWhich(aIter.FirstWhich()); -//-/ -//-/ while(nWhich) -//-/ { -//-/ rAttr.MergeValue(rSet.Get(nWhich), TRUE); -//-/ nWhich = aIter.NextWhich(); -//-/ } -//-/ -//-/ } -//-/ else -//-/ { -//-/ -//-/ rAttr.MergeValues(rSet, TRUE); -//-/ -//-/ } - -//-/ SfxWhichIter aIter(rIS); -//-/ USHORT nWhich=aIter.FirstWhich(); -//-/ while (nWhich!=0) { -//-/ if ((bHasLEnd || nWhich<XATTR_LINESTART || nWhich>XATTR_LINEENDCENTER) && -//-/ (bHasEckRad || nWhich!=SDRATTR_ECKENRADIUS) && -//-/ (bHasText || nWhich<SDRATTR_TEXT_MINFRAMEHEIGHT || nWhich>SDRATTR_TEXT_CONTOURFRAME) && -//-/ (bTextFrame || (nWhich!=SDRATTR_TEXT_AUTOGROWHEIGHT && nWhich!=SDRATTR_TEXT_MINFRAMEHEIGHT && nWhich!=SDRATTR_TEXT_MAXFRAMEHEIGHT && -//-/ nWhich!=SDRATTR_TEXT_AUTOGROWWIDTH && nWhich!=SDRATTR_TEXT_MINFRAMEWIDTH && nWhich!=SDRATTR_TEXT_MAXFRAMEWIDTH)) && -//-/ (bCanContourFrame || nWhich!=SDRATTR_TEXT_CONTOURFRAME) && -//-/ (!bIsContourFrame || nWhich<SDRATTR_TEXT_MINFRAMEHEIGHT || nWhich>SDRATTR_TEXT_HORZADJUST) && -//-/ (nWhich<EE_FEATURE_START || nWhich>EE_FEATURE_END) ) -//-/ { -//-/ if (!bOnlyHardAttr || rIS.GetItemState(nWhich,FALSE)==SFX_ITEM_SET) { -//-/ const SfxPoolItem& rItem=rIS.Get(nWhich); -//-/ if (bMerge) rAttr.MergeValue(rItem,TRUE); -//-/ else rAttr.Put(rItem); -//-/ } -//-/ } -//-/ nWhich=aIter.NextWhich(); -//-/ } - - - -//-/ SfxItemIter aIter(rSet); -//-/ const SfxPoolItem* pItem = aIter.FirstItem(); -//-/ -//-/ // merge items to destination rAttr -//-/ while(pItem) -//-/ { -//-/ sal_uInt16 nWhich = pItem->Which(); -//-/ SfxItemState eState = rSet.GetItemState(nWhich); -//-/ -//-/ if(SFX_ITEM_SET == eState) -//-/ { -//-/ // Ist gesetzt -//-/ if(*rAttr.GetItem(nWhich) != *pItem) -//-/ { -//-/ // SfxPoolItem muss invalidiert werden -//-/ rAttr.InvalidateItem(nWhich); -//-/ } -//-/ } -//-/ else -//-/ { -//-/ if(SFX_ITEM_DONTCARE != eState) -//-/ { -//-/ // Item gab es noch nicht, setze es -//-/ rAttr.Put(*pItem); -//-/ } -//-/ } -//-/ -//-/ pItem = aIter.NextItem(); -//-/ } -//-/ } + } } void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, BOOL bReplaceAll) @@ -870,8 +764,14 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, BOOL bReplaceAll) SfxItemState eState = rAttr.GetItemState(nWhich); if(eState == SFX_ITEM_SET) { - if(nWhich >= SDRATTR_TEXT_MINFRAMEHEIGHT && nWhich <= SDRATTR_TEXT_CONTOURFRAME) + if((nWhich >= SDRATTR_TEXT_MINFRAMEHEIGHT && nWhich <= SDRATTR_TEXT_CONTOURFRAME) + || nWhich == SDRATTR_3DOBJ_PERCENT_DIAGONAL + || nWhich == SDRATTR_3DOBJ_BACKSCALE + || nWhich == SDRATTR_3DOBJ_DEPTH + || nWhich == SDRATTR_3DOBJ_END_ANGLE) + { bPossibleGeomChange = TRUE; + } } nWhich = aIter.NextWhich(); } @@ -898,7 +798,6 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, BOOL bReplaceAll) // add attribute undo AddUndo(new SdrUndoAttrObj(*pM->GetObj(),FALSE,bHasEEItems || bPossibleGeomChange)); -//-/ pM->GetObj()->SetAttributes(rAttr,bReplaceAll); SdrBroadcastItemChange aItemChange(*pM->GetObj()); if(bReplaceAll) pM->GetObj()->ClearItem(); diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index a777bc05b52c..8927d0b18280 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdedtv2.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:11:36 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -569,10 +569,8 @@ void SdrEditView::ImpCopyAttributes(const SdrObject* pSource, SdrObject* pDest) EE_ITEMS_START, EE_ITEMS_END, 0, 0); // #52757#, #52762# -//-/ pSource->TakeAttributes(aSet,FALSE,FALSE); aSet.Put(pSource->GetItemSet()); -//-/ pDest->NbcSetAttributes(aSet,TRUE); pDest->ClearItem(); pDest->SetItemSet(aSet); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 7e84c31b8349..e63b1048f4b8 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdedxv.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dl $ $Date: 2000-11-30 12:53:11 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -409,8 +409,6 @@ Color SdrObjEditView::ImpGetTextEditBackgroundColor() const SdrTextObj* pText=PTR_CAST(SdrTextObj,pTextEditObj); if (pText!=NULL && pText->IsClosedObj()) { -//-/ SfxItemSet aSet(pMod->GetItemPool()); -//-/ pText->TakeAttributes(aSet,FALSE,FALSE); bFound=GetDraftFillColor(pText->GetItemSet(),aBackground); } if (!bFound && pTextEditPV!=NULL && pTextEditObj!=NULL) @@ -1330,7 +1328,6 @@ BOOL SdrObjEditView::GetAttributes(SfxItemSet& rTargetSet, BOOL bOnlyHardAttr) c DBG_ASSERT(pTextEditOutlinerView!=NULL,"SdrObjEditView::GetAttributes(): pTextEditOutlinerView=NULL"); DBG_ASSERT(pTextEditOutliner!=NULL,"SdrObjEditView::GetAttributes(): pTextEditOutliner=NULL"); -//-/ pTextEditObj->TakeAttributes(rTargetSet, TRUE, bOnlyHardAttr); rTargetSet.Put( pTextEditObj->GetItemSet() ); if( pTextEditObj->GetOutlinerParaObject() ) @@ -1410,7 +1407,6 @@ BOOL SdrObjEditView::SetAttributes(const SfxItemSet& rSet, BOOL bReplaceAll) AddUndo(new SdrUndoAttrObj(*pTextEditObj,FALSE,!bNoEEItems)); EndUndo(); -//-/ pTextEditObj->SetAttributes(*pSet,bReplaceAll); SdrBroadcastItemChange aItemChange(*pTextEditObj); if(bReplaceAll) pTextEditObj->ClearItem(); @@ -1440,7 +1436,6 @@ BOOL SdrObjEditView::SetAttributes(const SfxItemSet& rSet, BOOL bReplaceAll) AddUndo(new SdrUndoAttrObj(*pTextEditObj,FALSE,FALSE)); EndUndo(); -//-/ pTextEditObj->SetAttributes(aSet,bReplaceAll); SdrBroadcastItemChange aItemChange(*pTextEditObj); if(bReplaceAll) pTextEditObj->ClearItem(); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 5eba594c2fbb..6f2f6e103634 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdfmtf.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:11:36 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -405,9 +405,6 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, FASTBOOL bForceText if (pObj!=NULL) { pObj->SetLayer(nLayer); -//-/ if (bLine) pObj->NbcSetAttributes(*pLineAttr,FALSE); -//-/ if (bFill) pObj->NbcSetAttributes(*pFillAttr,FALSE); -//-/ if (bText) pObj->NbcSetAttributes(*pTextAttr,FALSE); if (bLine) pObj->SetItemSet(*pLineAttr); if (bFill) pObj->SetItemSet(*pFillAttr); if (bText) pObj->SetItemSet(*pTextAttr); @@ -464,7 +461,6 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction& rAct) if (nRad!=0) { SfxItemSet aSet(*pLineAttr->GetPool(),SDRATTR_ECKENRADIUS,SDRATTR_ECKENRADIUS); aSet.Put(SdrEckenradiusItem(nRad)); -//-/ pRect->NbcSetAttributes(aSet,FALSE); pRect->SetItemSet(aSet); } InsertObj(pRect); @@ -563,7 +559,6 @@ FASTBOOL ImpSdrGDIMetaFileImport::CheckLastPolyLineAndFillMerge(const XPolyPolyg if (pLastPoly->GetPathPoly()==rPoly) { SetAttributes(NULL); if (!bNoLine && bNoFill) { -//-/ pLastPoly->NbcSetAttributes(*pLineAttr,FALSE); pLastPoly->SetItemSet(*pLineAttr); return TRUE; } @@ -682,7 +677,6 @@ void ImpSdrGDIMetaFileImport::ImportText(const Point& rPos, const XubString& rSt SfxItemSet aAttr(*pFillAttr->GetPool(),XATTR_FILL_FIRST,XATTR_FILL_LAST); pFillAttr->Put(XFillStyleItem(XFILL_SOLID)); pFillAttr->Put(XFillColorItem(String(), aFnt.GetFillColor())); -//-/ pText->NbcSetAttributes(aAttr,FALSE); pText->SetItemSet(aAttr); } ULONG nWink=aFnt.GetOrientation(); @@ -800,7 +794,6 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction& rAct ) aHatchAttr.Put( XFillStyleItem( XFILL_HATCH ) ); aHatchAttr.Put( XFillHatchItem( &pModel->GetItemPool(), XHatch( rHatch.GetColor(), eStyle, rHatch.GetDistance(), rHatch.GetAngle() ) ) ); -//-/ pPath->NbcSetAttributes(aHatchAttr,FALSE); pPath->SetItemSet(aHatchAttr); InsertObj(pPath); } @@ -901,7 +894,6 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM SetAttributes( pPath ); aGradAttr.Put( XFillStyleItem( XFILL_GRADIENT ) ); aGradAttr.Put( XFillGradientItem( &pModel->GetItemPool(), aXGradient ) ); -//-/ pPath->NbcSetAttributes(aGradAttr,FALSE); pPath->SetItemSet(aGradAttr); InsertObj(pPath); } diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx index 6c78ecd480f9..d45ce9077b2d 100644 --- a/svx/source/svdraw/svdfppt.cxx +++ b/svx/source/svdraw/svdfppt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdfppt.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: sj $ $Date: 2001-01-19 11:20:13 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1286,7 +1286,6 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi aSet.Put( SdrTextMinFrameHeightItem( nMinFrameHeight ) ); pTObj->SetModel( pSdrModel ); -//-/ pTObj->NbcSetAttributes( aSet, FALSE ); pTObj->SetItemSet(aSet); pTObj = ReadObjText( &aTextObj, pTObj, rData.pPage ); @@ -2742,9 +2741,6 @@ SdrPage* SdrPowerPointImport::ImportPage() // be sure not to import masterp void* pPtr; const SfxPoolItem* pPoolItem = NULL; -//-/ SfxItemSet aSourceAttr( pSdrModel->GetItemPool() ); -//-/ pBackGroundObj->TakeAttributes( aSourceAttr, FALSE, TRUE ); -//-/ SfxItemState eState = aSourceAttr.GetItemState( XATTR_FILLCOLOR, FALSE, &pPoolItem ); SfxItemState eState = pBackGroundObj->GetItemSet().GetItemState(XATTR_FILLCOLOR, FALSE, &pPoolItem); if ( pPoolItem ) @@ -2752,10 +2748,6 @@ SdrPage* SdrPowerPointImport::ImportPage() // be sure not to import masterp for ( pPtr = pList->First(); pPtr; pPtr = pList->Next() ) { ((SdrObject*)pPtr)->SetItem(*pPoolItem); -//-/ SfxItemSet aTempAttr( pSdrModel->GetItemPool() ); -//-/ ((SdrObject*)pPtr)->TakeAttributes( aTempAttr, FALSE, TRUE ); -//-/ aTempAttr.Put( *pPoolItem ); -//-/ ((SdrObject*)pPtr)->NbcSetAttributes( aTempAttr, FALSE ); } } } @@ -3060,7 +3052,6 @@ SdrObject* SdrPowerPointImport::ImportPageBackgroundObject( const SdrPage& rPage pRet = new SdrRectObj( aRect ); pRet->SetModel( pSdrModel ); -//-/ pRet->NbcSetAttributes( *pSet, FALSE ); pRet->SetItemSet(*pSet); pRet->SetMarkProtect( TRUE ); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index b193f3e564c5..900a5cd4431e 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdhdl.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:11:36 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -852,8 +852,6 @@ IMPL_LINK(SdrHdlGradient, ColorChangeHdl, SdrHdl*, pHdl) void SdrHdlGradient::FromIAOToItem(SdrObject* pObj, BOOL bSetItemOnObject, BOOL bUndo) { // from IAO positions and colors to gradient -//-/ SfxItemSet aSet(pObj->GetModel()->GetItemPool()); -//-/ pObj->TakeAttributes(aSet, FALSE, FALSE); const SfxItemSet& rSet = pObj->GetItemSet(); GradTransformer aGradTransformer; @@ -903,10 +901,7 @@ void SdrHdlGradient::FromIAOToItem(SdrObject* pObj, BOOL bSetItemOnObject, BOOL pModel->EndUndo(); } -//-/ pObj->SetAttributes(aNewSet, FALSE); -//-/ SdrBroadcastItemChange aItemChange(*pObj); pObj->SetItemSetAndBroadcast(aNewSet); -//-/ pObj->BroadcastItemChange(aItemChange); } // back transformation, set values on pIAOHandle @@ -1144,8 +1139,6 @@ BOOL ImpEdgeHdl::IsHorzDrag() const if (pEdge==NULL) return FALSE; if (nObjHdlNum<=1) return FALSE; -//-/ SdrEdgeKind eKind=SDREDGE_ORTHOLINES; -//-/ if (pEdge->pEdgeAttr!=NULL) eKind=((SdrEdgeKindItem&)(pEdge->pEdgeAttr->GetItemSet().Get(SDRATTR_EDGEKIND))).GetValue(); SdrEdgeKind eKind = ((SdrEdgeKindItem&)(pEdge->GetItem(SDRATTR_EDGEKIND))).GetValue(); const SdrEdgeInfoRec& rInfo=pEdge->aEdgeInfo; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 657ddc809007..8a4586b0dd91 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdmodel.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: aw $ $Date: 2001-01-24 12:46:49 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -275,7 +275,6 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, SvPersist* pPers, bUIOnlyKomma=FALSE; pLayerAdmin=NULL; pItemPool=pPool; -//-/ pUndoItemPool=NULL; bMyPool=FALSE; pPersist=pPers; pDrawOutliner=NULL; @@ -345,17 +344,6 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, SvPersist* pPers, pItemPool->SetDefaultMetric((SfxMapUnit)eObjUnit); SetTextDefaults(); - // Undo-ItemPool anlegen -//-/ if(!pUndoItemPool) -//-/ { -//-/ // Pool fuer UNDO-Objekte anlegen -//-/ pUndoItemPool = new SdrItemPool(SDRATTR_START, SDRATTR_END); -//-/ SfxItemPool* pUndoOutlPool = EditEngine::CreatePool(); -//-/ pUndoItemPool->SetSecondaryPool(pUndoOutlPool); -//-/ pUndoItemPool->SetDefaultMetric((SfxMapUnit)eObjUnit); -//-/ pUndoItemPool->FreezeIdRanges(); -//-/ } - pLayerAdmin=new SdrLayerAdmin; pLayerAdmin->SetModel(this); ImpSetUIUnit(); @@ -459,14 +447,6 @@ SdrModel::~SdrModel() delete pOutlPool; } -//-/ // UndoItemPool wegwerfen -//-/ if(pUndoItemPool) -//-/ { -//-/ SfxItemPool* pUndoOutlPool = pUndoItemPool->GetSecondaryPool(); -//-/ delete pUndoItemPool; -//-/ delete pUndoOutlPool; -//-/ } - delete pLoadedModel; #ifndef SVX_LIGHT @@ -1040,7 +1020,6 @@ void SdrModel::SetScaleUnit(MapUnit eMap, const Fraction& rFrac) eObjUnit=eMap; aObjUnit=rFrac; pItemPool->SetDefaultMetric((SfxMapUnit)eObjUnit); -//-/ pUndoItemPool->SetDefaultMetric((SfxMapUnit)eObjUnit); ImpSetUIUnit(); ImpSetOutlinerDefaults( pDrawOutliner ); ImpSetOutlinerDefaults( pHitTestOutliner ); @@ -1053,7 +1032,6 @@ void SdrModel::SetScaleUnit(MapUnit eMap) if (eObjUnit!=eMap) { eObjUnit=eMap; pItemPool->SetDefaultMetric((SfxMapUnit)eObjUnit); -//-/ pUndoItemPool->SetDefaultMetric((SfxMapUnit)eObjUnit); ImpSetUIUnit(); ImpSetOutlinerDefaults( pDrawOutliner ); ImpSetOutlinerDefaults( pHitTestOutliner ); @@ -2379,36 +2357,6 @@ void SdrModel::PrepareStore() DBG_ERROR("Please call PreSave now. It'll do the desired job."); } -//-/void SdrModel::PrepareStore() -//-/{ -//-/ // Prepare OutlinerParaObjects for storing -//-/ USHORT nCnt = GetMasterPageCount(); -//-/ for ( USHORT i = 0; i < nCnt; i++ ) -//-/ { -//-/ // MasterPages -//-/ SdrObjListIter aIter( *GetMasterPage( i ) ); -//-/ while( aIter.IsMore() ) -//-/ { -//-/ OutlinerParaObject* pOPO = aIter.Next()->GetOutlinerParaObject(); -//-/ if( pOPO ) -//-/ pOPO->PrepareStore( (SfxStyleSheetPool*) pStyleSheetPool ); -//-/ } -//-/ } -//-/ -//-/ nCnt = GetPageCount(); -//-/ for ( i = 0; i < nCnt; i++ ) -//-/ { -//-/ // Pages -//-/ SdrObjListIter aIter( *GetPage( i ) ); -//-/ while( aIter.IsMore() ) -//-/ { -//-/ OutlinerParaObject* pOPO = aIter.Next()->GetOutlinerParaObject(); -//-/ if( pOPO ) -//-/ pOPO->PrepareStore( (SfxStyleSheetPool*) pStyleSheetPool ); -//-/ } -//-/ } -//-/} - void SdrModel::PreSave() { sal_uInt16 nCnt(GetMasterPageCount()); @@ -2423,9 +2371,6 @@ void SdrModel::PreSave() for(sal_uInt32 b(0); b < rPage.GetObjCount(); b++) rPage.GetObj(b)->PreSave(); -//-/ SdrObjListIter aIter(*GetMasterPage(i), IM_FLAT); -//-/ while(aIter.IsMore()) -//-/ aIter.Next()->PreSave(); } nCnt = GetPageCount(); @@ -2439,9 +2384,6 @@ void SdrModel::PreSave() for(sal_uInt32 b(0); b < rPage.GetObjCount(); b++) rPage.GetObj(b)->PreSave(); -//-/ SdrObjListIter aIter(*GetPage(i), IM_FLAT); -//-/ while(aIter.IsMore()) -//-/ aIter.Next()->PreSave(); } } @@ -2459,9 +2401,6 @@ void SdrModel::PostSave() for(sal_uInt32 b(0); b < rPage.GetObjCount(); b++) rPage.GetObj(b)->PostSave(); -//-/ SdrObjListIter aIter(*GetMasterPage(i), IM_FLAT); -//-/ while(aIter.IsMore()) -//-/ aIter.Next()->PreSave(); } nCnt = GetPageCount(); @@ -2475,9 +2414,6 @@ void SdrModel::PostSave() for(sal_uInt32 b(0); b < rPage.GetObjCount(); b++) rPage.GetObj(b)->PostSave(); -//-/ SdrObjListIter aIter(*GetPage(i), IM_FLAT); -//-/ while(aIter.IsMore()) -//-/ aIter.Next()->PreSave(); } } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 7a1ff765abbc..ac1ec17f60dd 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdmrkv.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2000-11-08 16:55:29 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1030,8 +1030,6 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) if(nMarkAnz == 1) { SdrObject* pObj = aMark.GetMark(0)->GetObj(); -//-/ SfxItemSet aSet(GetModel()->GetItemPool()); -//-/ pObj->TakeAttributes(aSet, FALSE, FALSE); const SfxItemSet& rSet = pObj->GetItemSet(); XFillStyle eFillStyle = ((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue(); diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx index 3a7def3d8305..20ab6a64c35d 100644 --- a/svx/source/svdraw/svdoattr.cxx +++ b/svx/source/svdraw/svdoattr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdoattr.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: aw $ $Date: 2001-01-15 13:27:13 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -211,12 +211,6 @@ TYPEINIT1(SdrAttrObj,SdrObject); SdrAttrObj::SdrAttrObj() -//-/ pLineAttr(NULL), -//-/ pFillAttr(NULL), -//-/ pTextAttr(NULL), -//-/ pShadAttr(NULL), -//-/ pOutlAttr(NULL), -//-/ pMiscAttr(NULL), : mpStyleSheet(NULL), mpObjectItemSet(NULL) { @@ -224,12 +218,6 @@ SdrAttrObj::SdrAttrObj() SdrAttrObj::~SdrAttrObj() { -//-/ pLineAttr=(XLineAttrSetItem*) ImpSetNewAttr(pLineAttr,NULL,FALSE); -//-/ pFillAttr=(XFillAttrSetItem*) ImpSetNewAttr(pFillAttr,NULL,FALSE); -//-/ pTextAttr=(XTextAttrSetItem*) ImpSetNewAttr(pTextAttr,NULL,FALSE); -//-/ pShadAttr=(SdrShadowSetItem*) ImpSetNewAttr(pShadAttr,NULL,FALSE); -//-/ pOutlAttr=(SdrOutlinerSetItem*)ImpSetNewAttr(pOutlAttr,NULL,FALSE); -//-/ pMiscAttr=(SdrMiscSetItem*) ImpSetNewAttr(pMiscAttr,NULL,FALSE); ImpDeleteItemSet(); } @@ -273,17 +261,10 @@ void SdrAttrObj::operator=(const SdrObject& rObj) SdrAttrObj* pAO = PTR_CAST(SdrAttrObj, (SdrObject*)&rObj); if(pAO) { -//-/ pLineAttr=(const XLineAttrSetItem*) ImpSetNewAttr(pLineAttr,pAO->pLineAttr); -//-/ pFillAttr=(const XFillAttrSetItem*) ImpSetNewAttr(pFillAttr,pAO->pFillAttr); -//-/ pTextAttr=(const XTextAttrSetItem*) ImpSetNewAttr(pTextAttr,pAO->pTextAttr); -//-/ pShadAttr=(const SdrShadowSetItem*) ImpSetNewAttr(pShadAttr,pAO->pShadAttr); -//-/ pOutlAttr=(const SdrOutlinerSetItem*)ImpSetNewAttr(pOutlAttr,pAO->pOutlAttr); -//-/ pMiscAttr=(const SdrMiscSetItem*) ImpSetNewAttr(pMiscAttr,pAO->pMiscAttr); ImpDeleteItemSet(); if(pAO->mpObjectItemSet) mpObjectItemSet = pAO->mpObjectItemSet->Clone(TRUE); -//-/ mpObjectItemSet = new SfxItemSet(*pAO->mpObjectItemSet); if(pAO->GetStyleSheet()) AddStyleSheet(pAO->GetStyleSheet(), TRUE); @@ -422,23 +403,6 @@ void SdrAttrObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn) if(pTmpStyleSheet) AddStyleSheet(pTmpStyleSheet, TRUE); -//-/ { -//-/ StartListening(*pPool); -//-/ StartListening(*pTmpStyleSheet); -//-/ -//-///-/ SfxItemSet* pParent = &pTmpStyleSheet->GetItemSet(); -//-///-/ if (pLineAttr!=NULL) ((SfxItemSet*)&pLineAttr->GetItemSet())->SetParent(pParent); -//-///-/ if (pFillAttr!=NULL) ((SfxItemSet*)&pFillAttr->GetItemSet())->SetParent(pParent); -//-///-/ if (pTextAttr!=NULL) ((SfxItemSet*)&pTextAttr->GetItemSet())->SetParent(pParent); -//-///-/ if (pShadAttr!=NULL) ((SfxItemSet*)&pShadAttr->GetItemSet())->SetParent(pParent); -//-///-/ if (pOutlAttr!=NULL) ((SfxItemSet*)&pOutlAttr->GetItemSet())->SetParent(pParent); -//-///-/ if (pMiscAttr!=NULL) ((SfxItemSet*)&pMiscAttr->GetItemSet())->SetParent(pParent); -//-/ -//-/ if(!mpObjectItemSet) -//-/ mpObjectItemSet = new SfxItemSet(*pPool); -//-/ -//-/ mpObjectItemSet->SetParent(&pTmpStyleSheet->GetItemSet()); -//-/ } } } } @@ -526,46 +490,6 @@ void SdrAttrObj::WriteData(SvStream& rOut) const pPool->StoreSurrogate(rOut, &rSet.Get(SDRATTRSET_SHADOW)); pPool->StoreSurrogate(rOut, &rSet.Get(SDRATTRSET_OUTLINER)); pPool->StoreSurrogate(rOut, &rSet.Get(SDRATTRSET_MISC)); - - - -//-/ const SfxItemSet& rSet = GetItemSet(); -//-/ -//-/ XLineAttrSetItem aLineAttr(pPool); -//-/ aLineAttr.GetItemSet().Put(rSet); -//-/ const SfxPoolItem& rLineAttr = pPool->Put(aLineAttr); -//-/ pPool->StoreSurrogate(rOut, &rLineAttr); -//-/ pPool->Remove(rLineAttr); -//-/ -//-/ XFillAttrSetItem aFillAttr(pPool); -//-/ aFillAttr.GetItemSet().Put(rSet); -//-/ const SfxPoolItem& rFillAttr = pPool->Put(aFillAttr); -//-/ pPool->StoreSurrogate(rOut, &rFillAttr); -//-/ pPool->Remove(rFillAttr); -//-/ -//-/ XTextAttrSetItem aTextAttr(pPool); -//-/ aTextAttr.GetItemSet().Put(rSet); -//-/ const SfxPoolItem& rTextAttr = pPool->Put(aTextAttr); -//-/ pPool->StoreSurrogate(rOut, &rTextAttr); -//-/ pPool->Remove(rTextAttr); -//-/ -//-/ SdrShadowSetItem aShadAttr(pPool); -//-/ aShadAttr.GetItemSet().Put(rSet); -//-/ const SfxPoolItem& rShadAttr = pPool->Put(aShadAttr); -//-/ pPool->StoreSurrogate(rOut, &rShadAttr); -//-/ pPool->Remove(rShadAttr); -//-/ -//-/ SdrOutlinerSetItem aOutlAttr(pPool); -//-/ aOutlAttr.GetItemSet().Put(rSet); -//-/ const SfxPoolItem& rOutlAttr = pPool->Put(aOutlAttr); -//-/ pPool->StoreSurrogate(rOut, &rOutlAttr); -//-/ pPool->Remove(rOutlAttr); -//-/ -//-/ SdrMiscSetItem aMiscAttr(pPool); -//-/ aMiscAttr.GetItemSet().Put(rSet); -//-/ const SfxPoolItem& rMiscAttr = pPool->Put(aMiscAttr); -//-/ pPool->StoreSurrogate(rOut, &rMiscAttr); -//-/ pPool->Remove(rMiscAttr); } else { @@ -592,50 +516,6 @@ void SdrAttrObj::WriteData(SvStream& rOut) const } } -//-/SfxItemPool* SdrAttrObj::ImpGetItemPool(const SfxPoolItem* pAlternateItem1, const SfxPoolItem* pAlternateItem2) const -//-/{ -//-/ SfxItemPool* pPool= (pModel==NULL) ? NULL : &pModel->GetItemPool(); -//-/ if (pPool==NULL) { -//-/ SfxSetItem* pSI; -//-/ if (pAlternateItem1!=NULL) { -//-/ pSI=PTR_CAST(SfxSetItem,pAlternateItem1); -//-/ if (pSI!=NULL) pPool=(SfxItemPool*)pSI->GetItemSet().GetPool(); -//-/ } -//-/ if (pPool==NULL && pAlternateItem2!=NULL) { -//-/ pSI=PTR_CAST(SfxSetItem,pAlternateItem2); -//-/ if (pSI!=NULL) pPool=(SfxItemPool*)pSI->GetItemSet().GetPool(); -//-/ } -//-/ } -//-/ return pPool; -//-/} - -//-/SfxItemPool* SdrAttrObj::ImpGetItemPool() const -//-/{ -//-/ SfxItemPool* pPool = (!pModel) ? NULL : &pModel->GetItemPool(); -//-/ -//-/ if(!pPool && mpObjectItemSet) -//-/ pPool = mpObjectItemSet->GetPool(); -//-/ { -//-/ USHORT nAnz=GetSetItemCount(); -//-/ for (USHORT i=0; i<nAnz && pPool==NULL; i++) { -//-/ const SfxSetItem* pSI=GetSetItem(i); -//-/ if (pSI!=NULL) pPool=pSI->GetItemSet().GetPool(); -//-/ } -//-/ } -//-/ -//-/ return pPool; -//-/} - -//-/const SfxPoolItem* SdrAttrObj::ImpSetNewAttr(const SfxPoolItem* pAkt, const SfxPoolItem* pNew, FASTBOOL bChg) -//-/{ -//-/ SfxItemPool* pPool=ImpGetItemPool(pAkt,pNew); -//-/ if (pPool!=NULL) { -//-/ if (pAkt!=NULL) pPool->Remove(*pAkt); -//-/ if (pNew!=NULL) pNew=&pPool->Put(*pNew); -//-/ } -//-/ return pNew; -//-/} - static void ImpScaleItemSet(SfxItemSet& rSet, const Fraction& rScale) { sal_Int32 nMul(rScale.GetNumerator()); @@ -676,9 +556,6 @@ void SdrAttrObj::SetModel(SdrModel* pNewModel) if(pOldModel != pNewModel && pNewModel && !pNewModel->IsLoading()) { -//-/ // fuer ein frisch eingefuegtes Obj die Defaultattribute setzen -//-/ if(!pOldModel) -//-/ ForceDefaultAttr(&pModel->GetItemPool()); // fuer ein bereits "lebendes" Model die Attribute von einem Pool in den anderen schieben if(pOldModel) @@ -700,42 +577,8 @@ void SdrAttrObj::SetModel(SdrModel* pNewModel) // Und nun alle Items auf die das Obj verweisst aus // dem alten Pools raus und in den neuen rein. -//-/ SdrItemPool& rOldPool = (SdrItemPool&)pOldModel->GetItemPool(); -//-/ SdrItemPool& rNewPool = (SdrItemPool&)pModel->GetItemPool(); SfxStyleSheet* pOldStyleSheet = GetStyleSheet(); -//-/ DBG_ASSERT(&rOldPool != NULL, "SdrAttrObj::SetModel(): Kein ItemPool am alten Model"); -//-/ DBG_ASSERT(&rNewPool != NULL, "SdrAttrObj::SetModel(): Kein ItemPool am neuen Model"); - -//-/ if(mpObjectItemSet) -//-/ { -//-/ SfxItemSet* pNewSet = mpObjectItemSet->Clone(TRUE, &rNewPool); -//-/ -//-/ if(bScaleUnitChanged) -//-/ ImpScaleItemSet(*pNewSet, aMetricFactor); -//-/ -//-/ // set new itemset -//-/ ImpDeleteItemSet(); -//-/ mpObjectItemSet = pNewSet; -//-/ } -//-/ sal_uInt16 nItemSetAnz(GetSetItemCount()); -//-/ for(sal_uInt16 i(0); i < nItemSetAnz; i++) -//-/ { -//-/ const SfxSetItem* pSI=GetSetItem(i); -//-/ if (pSI!=NULL) { -//-/ const SfxSetItem* pNewAttr=NULL; -//-/ if (!bScaleUnitChanged) { -//-/ pNewAttr=&(const SfxSetItem&)rNewPool.Put(*pSI); -//-/ } else { // ggf. alle MetrikItems Skalieren -//-/ SfxSetItem* pNewSetItem=(SfxSetItem*)pSI->Clone(&rNewPool); -//-/ ImpScaleItemSet(pNewSetItem->GetItemSet(),aMetricFactor); -//-/ pNewAttr=&(const SfxSetItem&)rNewPool.Put(*pNewSetItem); -//-/ } -//-/ rOldPool.Remove(*pSI); -//-/ SetSetItem(i,pNewAttr); -//-/ } -//-/ } - // ***** StyleSheets Anfang ***** // ggfs. StyleSheet und dessen Parents kopieren // Follows werden nicht beruecksichtigt (ganz wie im Writer) @@ -845,34 +688,12 @@ void SdrAttrObj::SetModel(SdrModel* pNewModel) nWhich = aIter.NextWhich(); } } -//-/ for(sal_uInt16 i(0); i < nItemSetAnz; i++) -//-/ { -//-/ const SfxSetItem* pSI = GetSetItem(i); -//-/ if(pSI) -//-/ { -//-/ const SfxItemSet& rIS = pSI->GetItemSet(); -//-/ SfxWhichIter aIter(rIS); -//-/ sal_uInt16 nWhich = aIter.FirstWhich(); -//-/ -//-/ while(nWhich) -//-/ { -//-/ if(rIS.GetItemState(nWhich, FALSE) == SFX_ITEM_SET) -//-/ aSet.ClearItem(nWhich); -//-/ -//-/ nWhich = aIter.NextWhich(); -//-/ } -//-/ } -//-/ } - if(bScaleUnitChanged) ImpScaleItemSet(*pNewSet, aMetricFactor); ImpDeleteItemSet(); mpObjectItemSet = pNewSet; - -//-/ SetAttributes(*pNewSet, FALSE); -//-/ RemoveStyleSheet(); } } // ***** StyleSheets Ende ***** @@ -895,13 +716,9 @@ void SdrAttrObj::SetModel(SdrModel* pNewModel) void SdrAttrObj::ForceDefaultAttr() { -//-/ if(pPool) -//-/ { SdrTextObj* pText = PTR_CAST(SdrTextObj, this); BOOL bTextFrame(pText && pText->IsTextFrame()); -//-/ mpObjectItemSet = CreateNewItemSet(*pPool); - ImpForceItemSet(); if(bTextFrame) { @@ -920,279 +737,10 @@ void SdrAttrObj::ForceDefaultAttr() mpObjectItemSet->Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_CENTER)); mpObjectItemSet->Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER)); } -//-/ } -//-/ if (pPool!=NULL && pLineAttr==NULL) { -//-/ SdrTextObj* pText=PTR_CAST(SdrTextObj,this); -//-/ SdrCaptionObj* pCapt=PTR_CAST(SdrCaptionObj,this); -//-/ FASTBOOL bTextFrame=pText!=NULL && pText->IsTextFrame(); -//-/ FASTBOOL bCaption=pCapt!=NULL; -//-/ -//-///-/#ifdef SDRDEFITEMCACHE -//-///-/ // SdrItemPool in der Verkettung suchen (wg. Writer) -//-///-/ SdrItemPool* pSdrPool=NULL; -//-///-/ SfxItemPool* pTmpPool=pPool; -//-///-/ while (pTmpPool!=NULL && pSdrPool==NULL) { -//-///-/ // Etwas komplizierte Abfrage und auch Hack, weil am -//-///-/ // Pool kein RTTI vorhanden ist! Joe, 02-09-1997 -//-///-/ if (pTmpPool->GetFirstWhich()<=SDRATTR_START && pTmpPool->GetLastWhich()>=SDRATTR_END) { -//-///-/ if (pTmpPool->GetName().EqualsAscii("XOutdevItemPool")) -//-///-/ pSdrPool=(SdrItemPool*)pTmpPool; -//-///-/ } -//-///-/ pTmpPool=pTmpPool->GetSecondaryPool(); -//-///-/ } -//-///-/ DBG_ASSERT(pSdrPool!=NULL,"SdrAttrObj::ForceDefaultAttr(): Kein SdrItemPool gefunden!"); -//-///-/ if (pSdrPool->pDefLineAttr==NULL) pSdrPool->ImpMakeDefItems(); -//-///-/ if (bTextFrame) { -//-///-/ pLineAttr=bCaption ? pSdrPool->pDefLineAttr : pSdrPool->pDefTextFrameLineAttr; -//-///-/ pFillAttr=pSdrPool->pDefTextFrameFillAttr; -//-///-/ pTextAttr=pSdrPool->pDefTextFrameTextAttr; -//-///-/ pShadAttr=pSdrPool->pDefTextFrameShadAttr; -//-///-/ pOutlAttr=pSdrPool->pDefTextFrameOutlAttr; -//-///-/ pMiscAttr=pSdrPool->pDefTextFrameMiscAttr; -//-///-/ } else { -//-///-/ pLineAttr=pSdrPool->pDefLineAttr; -//-///-/ pFillAttr=pSdrPool->pDefFillAttr; -//-///-/ pTextAttr=pSdrPool->pDefTextAttr; -//-///-/ pShadAttr=pSdrPool->pDefShadAttr; -//-///-/ pOutlAttr=pSdrPool->pDefOutlAttr; -//-///-/ pMiscAttr=pSdrPool->pDefMiscAttr; -//-///-/ } -//-///-/ pLineAttr->AddRef(); -//-///-/ pFillAttr->AddRef(); -//-///-/ pTextAttr->AddRef(); -//-///-/ pShadAttr->AddRef(); -//-///-/ pOutlAttr->AddRef(); -//-///-/ pMiscAttr->AddRef(); -//-///-/#else // SDRDEFITEMCACHE -//-/ if (pLineAttr==NULL) { -//-/ XLineAttrSetItem aSetItem(pPool); -//-/ if (bTextFrame && !bCaption) { -//-/ aSetItem.GetItemSet().Put(XLineStyleItem(XLINE_NONE)); -//-/ } -//-/ pLineAttr=(XLineAttrSetItem*)ImpSetNewAttr(pLineAttr,&aSetItem,FALSE); -//-/ } -//-/ if (pFillAttr==NULL) { -//-/ XFillAttrSetItem aSetItem(pPool); -//-/ if (bTextFrame) { -//-/ aSetItem.GetItemSet().Put(XFillColorItem(String(),Color(COL_WHITE))); // Falls einer auf Solid umschaltet -//-/ aSetItem.GetItemSet().Put(XFillStyleItem(XFILL_NONE)); -//-/ } -//-/ pFillAttr=(XFillAttrSetItem*)ImpSetNewAttr(pFillAttr,&aSetItem,FALSE); -//-/ } -//-/ if (pTextAttr==NULL) { -//-/ XTextAttrSetItem aSetItem(pPool); -//-/ pTextAttr=(XTextAttrSetItem*)ImpSetNewAttr(pTextAttr,&aSetItem,FALSE); -//-/ } -//-/ if (pShadAttr==NULL) { -//-/ SdrShadowSetItem aSetItem(pPool); -//-/ pShadAttr=(SdrShadowSetItem*)ImpSetNewAttr(pShadAttr,&aSetItem,FALSE); -//-/ } -//-/ if (pOutlAttr==NULL) { -//-/ SdrOutlinerSetItem aSetItem(pPool); -//-/ if (!bTextFrame) { -//-/ aSetItem.GetItemSet().Put(SvxAdjustItem(SVX_ADJUST_CENTER)); -//-/ } -//-/ pOutlAttr=(SdrOutlinerSetItem*)ImpSetNewAttr(pOutlAttr,&aSetItem,FALSE); -//-/ } -//-/ if (pMiscAttr==NULL) { -//-/ SdrMiscSetItem aSetItem(pPool); -//-/ if (!bTextFrame) { -//-/ aSetItem.GetItemSet().Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_CENTER)); -//-/ aSetItem.GetItemSet().Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER)); -//-/ } -//-/ pMiscAttr=(SdrMiscSetItem*)ImpSetNewAttr(pMiscAttr,&aSetItem,FALSE); -//-/ } -//-///-/#endif // SDRDEFITEMCACHE -//-/ } } -//-/void SdrAttrObj::TakeAttributes(SfxItemSet& rAttr, FASTBOOL bMerge, FASTBOOL bOnlyHardAttr) const -//-/{ -//-/ USHORT nAnz=GetSetItemCount(); -//-/ FASTBOOL bHasText=GetOutlinerParaObject()!=NULL; -//-/ SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,this); -//-/ FASTBOOL bIsContourFrame=pTextObj!=NULL && pTextObj->IsContourTextFrame(); -//-/ SdrMeasureObj* pMeasObj=PTR_CAST(SdrMeasureObj,this); -//-/ if (!bHasText && pTextObj!=NULL && pTextObj->IsTextEditActive()) bHasText=TRUE; -//-/ FASTBOOL bTextFrame=pTextObj!=NULL && pTextObj->IsTextFrame(); -//-/ FASTBOOL bCanFontwork=bHasText && pTextObj!=NULL && !bTextFrame && pMeasObj==NULL; -//-/ FASTBOOL bCanContourFrame=bHasText && pTextObj!=NULL && !bTextFrame; -//-/ FASTBOOL bGrafObj=HAS_BASE(SdrGrafObj,this) || HAS_BASE(SdrOle2Obj,this); -//-/ FASTBOOL bHasEckRad=!bGrafObj && !bIsUnoObj && HAS_BASE(SdrRectObj,this) && !HAS_BASE(SdrCircObj,this); -//-/ FASTBOOL bHasFill=bClosedObj; -//-/ FASTBOOL bHasLEnd=!bClosedObj || HAS_BASE(SdrCaptionObj,this); -//-/ for (USHORT i=0; i<nAnz; i++) { -//-/ const SfxSetItem* pSI=GetSetItem(i); -//-/ FASTBOOL bOk=pSI!=NULL; -//-/ if (pSI==pFillAttr && !bHasFill) bOk=FALSE; -//-/ if (pSI==pTextAttr && !bCanFontwork) bOk=FALSE; -//-/ if (pSI==pOutlAttr && !bHasText) bOk=FALSE; -//-/ if (bGrafObj && (pSI==pFillAttr || pSI==pLineAttr)) bOk=FALSE; // fuer Grafik und OLE -//-/ if (pSI!=NULL && !bMerge && bOnlyHardAttr) bOk=TRUE; // z.B. im Falle Undo -//-/ if (bOk) { -//-/ const SfxItemSet& rIS=pSI->GetItemSet(); -//-/ SfxWhichIter aIter(rIS); -//-/ USHORT nWhich=aIter.FirstWhich(); -//-/ while (nWhich!=0) { -//-/ if ((bHasLEnd || nWhich<XATTR_LINESTART || nWhich>XATTR_LINEENDCENTER) && -//-/ (bHasEckRad || nWhich!=SDRATTR_ECKENRADIUS) && -//-/ (bHasText || nWhich<SDRATTR_TEXT_MINFRAMEHEIGHT || nWhich>SDRATTR_TEXT_CONTOURFRAME) && -//-/ (bTextFrame || (nWhich!=SDRATTR_TEXT_AUTOGROWHEIGHT && nWhich!=SDRATTR_TEXT_MINFRAMEHEIGHT && nWhich!=SDRATTR_TEXT_MAXFRAMEHEIGHT && -//-/ nWhich!=SDRATTR_TEXT_AUTOGROWWIDTH && nWhich!=SDRATTR_TEXT_MINFRAMEWIDTH && nWhich!=SDRATTR_TEXT_MAXFRAMEWIDTH)) && -//-/ (bCanContourFrame || nWhich!=SDRATTR_TEXT_CONTOURFRAME) && -//-/ (!bIsContourFrame || nWhich<SDRATTR_TEXT_MINFRAMEHEIGHT || nWhich>SDRATTR_TEXT_HORZADJUST) && -//-/ (nWhich<EE_FEATURE_START || nWhich>EE_FEATURE_END) ) -//-/ { -//-/ if (!bOnlyHardAttr || rIS.GetItemState(nWhich,FALSE)==SFX_ITEM_SET) { -//-/ const SfxPoolItem& rItem=rIS.Get(nWhich); -//-/ if (bMerge) rAttr.MergeValue(rItem,TRUE); -//-/ else rAttr.Put(rItem); -//-/ } -//-/ } -//-/ nWhich=aIter.NextWhich(); -//-/ } -//-/ } -//-/ } -//-/ if (!bMerge && pLineAttr!=NULL) { -//-/ rAttr.SetParent(pLineAttr->GetItemSet().GetParent()); -//-/ } -//-/} - -//-/void SdrAttrObj::NbcSetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ SfxItemPool* pPool=GetItemPool(); -//-/ if (pPool==NULL) pPool=(SfxItemPool*)rAttr.GetPool(); -//-/ ForceDefaultAttr(pPool); -//-/ USHORT nAnz=GetSetItemCount(); -//-/ -//-/ if (bReplaceAll) { -//-/ SfxWhichIter aWhIter(rAttr); -//-/ for (USHORT i=0; i<nAnz; i++) { -//-/ const SfxSetItem* pOldSI=GetSetItem(i); -//-/ if (pOldSI!=NULL) { -//-/ const SfxItemSet& rOldIS=pOldSI->GetItemSet(); -//-/ const USHORT* pRanges=rOldIS.GetRanges(); -//-/ FASTBOOL bOneRange=pRanges[2]==0; -//-/ USHORT nAnf=pRanges[0]; -//-/ USHORT nEnd=pRanges[1]; -//-/ SfxSetItem* pNewSI=NULL; //MakeNewSetItem(i,TRUE); -//-/ SfxItemSet* pDstSet=NULL; //pNewSI->GetItemSet(); -//-/ // funkt nicht: -//-/ // pNewSI->GetItemSet().Set(rAttr); -//-/ // deshalb manuell #36313# -//-/ pNewSI=MakeNewSetItem(i,TRUE); -//-/ pDstSet=&pNewSI->GetItemSet(); -//-/ USHORT nWhich=aWhIter.FirstWhich(); -//-/ while (nWhich!=0) { -//-/ const SfxPoolItem* pItem=NULL; -//-/ SfxItemState eState=rAttr.GetItemState(nWhich,TRUE,&pItem); -//-/ if (eState==SFX_ITEM_DEFAULT) { -//-/ pDstSet->ClearItem(nWhich); -//-/ } else if (eState==SFX_ITEM_SET) { -//-/ if (nWhich<EE_FEATURE_START || nWhich>EE_FEATURE_END) { -//-/ pDstSet->Put(*pItem); -//-/ } -//-/ } -//-/ nWhich=aWhIter.NextWhich(); -//-/ } -//-/ if (pNewSI!=NULL) { -//-/ SetSetItem(i,(SfxSetItem*)ImpSetNewAttr(pOldSI,pNewSI)); -//-/ delete pNewSI; -//-/ } -//-/ } -//-/ } -//-/ } else { -//-/ SfxItemIter aItIter(rAttr); -//-/ for (USHORT i=0; i<nAnz; i++) { -//-/ const SfxSetItem* pOldSI=GetSetItem(i); -//-/ if (pOldSI!=NULL) { -//-/ const SfxItemSet& rOldIS=pOldSI->GetItemSet(); -//-/ const USHORT* pRanges=rOldIS.GetRanges(); -//-/ FASTBOOL bOneRange=pRanges[2]==0; -//-/ USHORT nAnf=pRanges[0]; -//-/ USHORT nEnd=pRanges[1]; -//-/ SfxSetItem* pNewSI=NULL; //MakeNewSetItem(i,TRUE); -//-/ SfxItemSet* pDstSet=NULL; //pNewSI->GetItemSet(); -//-/ // funkt nicht: -//-/ //pNewSI->GetItemSet().Put(rAttr,FALSE); // FALSE= InvalidItems nicht als Default, sondern als "Loecher" betrachten -//-/ // deshalb manuell. (Bug 21223) -//-/ const SfxPoolItem* pItem=aItIter.FirstItem(); -//-/ BOOL bFillAttrChangeHint(FALSE); -//-/ -//-/ while (pItem!=NULL) { -//-/ if (!IsInvalidItem(pItem)) { -//-/ USHORT nWhich=pItem->Which(); -//-/ if ((nWhich<EE_FEATURE_START || nWhich>EE_FEATURE_END) && -//-/ (!bOneRange || (nWhich>=nAnf && nWhich<=nEnd))) { -//-/ if (pNewSI==NULL) { -//-/ pNewSI=MakeNewSetItem(i,TRUE); -//-/ pDstSet=&pNewSI->GetItemSet(); -//-/ } -//-/ -//-/ // Hinweis auf Veraenderung FillStyle -//-/ if(i==1 && nWhich == XATTR_FILLSTYLE) -//-/ bFillAttrChangeHint = TRUE; -//-/ -//-/ pDstSet->Put(*pItem); -//-/ } -//-/ } -//-/ pItem=aItIter.NextItem(); -//-/ } -//-/ -//-/ if (pNewSI!=NULL) -//-/ { -//-/ if(bFillAttrChangeHint) -//-/ { -//-/ // FillStyle hat sich eventuell geaendert -//-/ XFillStyle eFillStyle = ((XFillStyleItem&)(rAttr.Get(XATTR_FILLSTYLE))).GetValue(); -//-/ -//-/ // Alle vom momentanen Stil nicht benutzten Items -//-/ // rauswerfen. Dies gilt NICHT fuer die Fuellfarbe -//-/ // (XFILL_SOLID). Diese wird als immer vorhandene -//-/ // Grundfarbe des Objektes angesehen (wird von 3D -//-/ // bereits so verwendet) -//-/ -//-/ if(eFillStyle != XFILL_GRADIENT) -//-/ pDstSet->ClearItem(XATTR_FILLGRADIENT); -//-/ -//-/ if(eFillStyle != XFILL_HATCH) -//-/ pDstSet->ClearItem(XATTR_FILLHATCH); -//-/ -//-/ if(eFillStyle != XFILL_BITMAP) -//-/ pDstSet->ClearItem(XATTR_FILLBITMAP); -//-/ } -//-/ -//-/ SetSetItem(i,(SfxSetItem*)ImpSetNewAttr(pOldSI,pNewSI)); -//-/ delete pNewSI; -//-/ } -//-/ } -//-/ } -//-/ } -//-/ bBoundRectDirty=TRUE; -//-/ SetRectsDirty(TRUE); -//-/} - -//-/void SdrAttrObj::SetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ Rectangle aBoundRect0; -//-/ -//-/ if(pUserCall) -//-/ aBoundRect0 = GetBoundRect(); -//-/ -//-/ SendRepaintBroadcast(); -//-/ NbcSetAttributes(rAttr, bReplaceAll); -//-/ SetChanged(); -//-/ SendRepaintBroadcast(); -//-/ SendUserCall(SDRUSERCALL_CHGATTR, aBoundRect0); -//-/} - //////////////////////////////////////////////////////////////////////////////////////////////////// - // ItemSet access -const SfxItemSet& SdrAttrObj::GetUnmergedItemSet() const -{ - return SdrAttrObj::GetItemSet(); -} const SfxItemSet& SdrAttrObj::GetItemSet() const { @@ -1200,35 +748,6 @@ const SfxItemSet& SdrAttrObj::GetItemSet() const return *mpObjectItemSet; } -void SdrAttrObj::SetItem(const SfxPoolItem& rItem) -{ - ((SdrAttrObj*)this)->ImpForceItemSet(); - mpObjectItemSet->Put(rItem); - bBoundRectDirty = TRUE; - SetRectsDirty(TRUE); - SetChanged(); -} - -void SdrAttrObj::ClearItem( USHORT nWhich ) -{ - if(mpObjectItemSet) - { - mpObjectItemSet->ClearItem(nWhich); - bBoundRectDirty = TRUE; - SetRectsDirty(TRUE); - SetChanged(); - } -} - -void SdrAttrObj::SetItemSet( const SfxItemSet& rSet ) -{ - ((SdrAttrObj*)this)->ImpForceItemSet(); - mpObjectItemSet->Put(rSet); - bBoundRectDirty = TRUE; - SetRectsDirty(TRUE); - SetChanged(); -} - SfxItemSet* SdrAttrObj::CreateNewItemSet(SfxItemPool& rPool) { // include ALL items, 2D and 3D @@ -1242,19 +761,45 @@ SfxItemSet* SdrAttrObj::CreateNewItemSet(SfxItemPool& rPool) 0, 0); } -//-/void SdrAttrObj::BroadcastItemChange(const SdrBroadcastItemChange& rChange) -//-/{ -//-/ Rectangle aBoundRect0; -//-/ -//-/ if(pUserCall) -//-/ aBoundRect0 = GetBoundRect(); -//-/ -//-/ SendRepaintBroadcast(); -//-/ NbcSetAttributes(rAttr, bReplaceAll); -//-/ SetChanged(); -//-/ SendRepaintBroadcast(); -//-/ SendUserCall(SDRUSERCALL_CHGATTR, aBoundRect0); -//-/} +//////////////////////////////////////////////////////////////////////////////////////////////////// +// syntactical sugar for ItemSet accesses + +const SfxItemSet& SdrAttrObj::GetUnmergedItemSet() const +{ + return SdrAttrObj::GetItemSet(); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// private support routines for ItemSet access + +void SdrAttrObj::ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem) +{ + if(pNewItem) + { + // set item + ((SdrAttrObj*)this)->ImpForceItemSet(); + mpObjectItemSet->Put(*pNewItem); + } + else + { + // clear item + if(mpObjectItemSet) + { + mpObjectItemSet->ClearItem(nWhich); + } + } +} + +void SdrAttrObj::PostItemChange(const sal_uInt16 nWhich) +{ + // call parent + SdrObject::PostItemChange(nWhich); + + // own modifications + bBoundRectDirty = TRUE; + SetRectsDirty(TRUE); + SetChanged(); +} //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1336,89 +881,12 @@ void SdrAttrObj::RemoveStyleSheet() if(mpObjectItemSet) mpObjectItemSet->SetParent(NULL); -//-/ USHORT nAnz=GetSetItemCount(); -//-/ for (USHORT i=0; i<nAnz; i++) { -//-/ SfxSetItem* pNewSI=MakeNewSetItem(i,TRUE); -//-/ if (pNewSI!=NULL) { -//-/ pNewSI->GetItemSet().SetParent(NULL); -//-/ const SfxSetItem* pOldSI=GetSetItem(i); -//-/ // Alle Items aus der Vorlage von pOldSI nach pNewSI putten, -//-/ // also hart Attributieren. -//-/ // ... fehlende Implementation -//-/ -//-/ const SfxSetItem* pNewSI2=(const SfxSetItem*)ImpSetNewAttr(pOldSI,pNewSI); -//-/ SetSetItem(i,pNewSI2); -//-/ delete pNewSI; -//-/ } -//-/ } bBoundRectDirty = TRUE; SetRectsDirty(TRUE); } -//-/ mpStyleSheet = NULL; } -//-/USHORT SdrAttrObj::GetSetItemCount() const -//-/{ -//-/ return 6; -//-/} - -//-/const SfxSetItem* SdrAttrObj::GetSetItem(USHORT nNum) const -//-/{ -//-/ switch (nNum) -//-/ { -//-/ case 0 : return pLineAttr; -//-/ case 1 : return pFillAttr; -//-/ case 2 : return pTextAttr; -//-/ case 3 : return pShadAttr; -//-/ case 4 : return pOutlAttr; -//-/ case 5 : return pMiscAttr; -//-/ } -//-/ return NULL; // damit der Compiler nicht meckert -//-/} - -//-/void SdrAttrObj::SetSetItem(USHORT nNum, const SfxSetItem* pAttr) -//-/{ -//-/ switch (nNum) -//-/ { -//-/ case 0 : pLineAttr = (const XLineAttrSetItem*) pAttr; break; -//-/ case 1 : pFillAttr = (const XFillAttrSetItem*) pAttr; break; -//-/ case 2 : pTextAttr = (const XTextAttrSetItem*) pAttr; break; -//-/ case 3 : pShadAttr = (const SdrShadowSetItem*) pAttr; break; -//-/ case 4 : pOutlAttr = (const SdrOutlinerSetItem*)pAttr; break; -//-/ case 5 : pMiscAttr = (const SdrMiscSetItem*) pAttr; break; -//-/ } -//-/} - -//-/SfxSetItem* SdrAttrObj::MakeNewSetItem(USHORT nNum, FASTBOOL bClone) const -//-/{ -//-/ if (bClone) -//-/ { -//-/ switch (nNum) -//-/ { -//-/ case 0 : return new XLineAttrSetItem(*pLineAttr); -//-/ case 1 : return new XFillAttrSetItem(*pFillAttr); -//-/ case 2 : return new XTextAttrSetItem(*pTextAttr); -//-/ case 3 : return new SdrShadowSetItem(*pShadAttr); -//-/ case 4 : return new SdrOutlinerSetItem(*pOutlAttr); -//-/ case 5 : return new SdrMiscSetItem(*pMiscAttr); -//-/ } -//-/ } -//-/ else -//-/ { -//-/ switch (nNum) -//-/ { -//-/ case 0 : return new XLineAttrSetItem(GetItemPool()); -//-/ case 1 : return new XFillAttrSetItem(GetItemPool()); -//-/ case 2 : return new XTextAttrSetItem(GetItemPool()); -//-/ case 3 : return new SdrShadowSetItem(GetItemPool()); -//-/ case 4 : return new SdrOutlinerSetItem(GetItemPool()); -//-/ case 5 : return new SdrMiscSetItem(GetItemPool()); -//-/ } -//-/ } -//-/ return NULL; // damit der Compiler nicht meckert -//-/} - void SdrAttrObj::AddStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDontRemoveHardAttr) { // old StyleSheet is deleted @@ -1453,53 +921,6 @@ void SdrAttrObj::AddStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDontRemo // set new stylesheet as parent mpObjectItemSet->SetParent(&pNewStyleSheet->GetItemSet()); } -//-/ pStyleSheet=pNewStyleSheet; -//-/ if(pNewStyleSheet && GetStyleSheet() != pNewStyleSheet) -//-/ { -//-/ // als Listener anmelden -//-/ StartListening(pNewStyleSheet->GetPool()); -//-/ StartListening(*pNewStyleSheet); -//-/ -//-/ // harte Attributierung dort loeschen, wo was in der Vorlage steht? -//-/ const SfxItemSet& rStyle = pNewStyleSheet->GetItemSet(); -//-/ -//-/ // pWhichRangesInStyle enthaelt Zahlenpaare der Which-Ranges. -//-/ // am Ende steht eine 0. -//-/ const sal_uInt16* pWhichRangesInStyle = rStyle.GetRanges(); -//-/ sal_uInt16 nAnz(GetSetItemCount()); -//-/ -//-/ for(sal_uInt16 i(0); i < nAnz; i++) -//-/ { -//-/ const SfxSetItem* pOldSI=GetSetItem(i); -//-/ SfxSetItem* pNewSI=MakeNewSetItem(i,pOldSI!=NULL); -//-/ pNewSI->GetItemSet().SetParent(NULL); -//-/ SfxItemSet& rIS=pNewSI->GetItemSet(); -//-/ -//-/ USHORT nIndex =0; -//-/ USHORT nCurrent=pWhichRangesInStyle[nIndex]; -//-/ USHORT nEnd =pWhichRangesInStyle[nIndex+1]; -//-/ -//-/ while (nCurrent!=0) { -//-/ if (!bDontRemoveHardAttr && rStyle.GetItemState(nCurrent)==SFX_ITEM_SET) { -//-/ rIS.ClearItem(nCurrent); -//-/ } -//-/ -//-/ nCurrent++; -//-/ if (nCurrent>nEnd) { -//-/ nIndex+=2; -//-/ nCurrent=pWhichRangesInStyle[nIndex]; -//-/ if (nCurrent!=0) { // Ende der Ranges? nein -//-/ nEnd=pWhichRangesInStyle[nIndex+1]; -//-/ } -//-/ } -//-/ } -//-/ // ItemSet des StyleSheets als Parent der ItemSets der SetItems setzen -//-/ rIS.SetParent(&(pNewStyleSheet->GetItemSet())); -//-/ // die Zeiger auf die SetItems neu setzen -//-/ SetSetItem(i,(const SfxSetItem*)ImpSetNewAttr(pOldSI,pNewSI)); -//-/ delete pNewSI; -//-/ } -//-/ } } void SdrAttrObj::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDontRemoveHardAttr) @@ -1752,26 +1173,8 @@ FASTBOOL SdrAttrObj::ImpSetShadowAttributes(ExtOutputDevice& rXOut, FASTBOOL bNo void SdrAttrObj::BurnInStyleSheetAttributes() { -//-/ SfxItemPool* pPool = GetItemPool(); -//-/ -//-/ if(pPool) -//-/ { -//-/ SfxItemSet aSet(*pPool, -//-/ SDRATTR_START, SDRATTR_NOTPERSIST_FIRST-1, -//-/ SDRATTR_NOTPERSIST_LAST+1, SDRATTR_END, -//-/ EE_ITEMS_START, EE_ITEMS_END, -//-/ 0, 0); -//-/ -//-/ TakeAttributes(aSet,FALSE,FALSE); -//-/ NbcSetAttributes(aSet,FALSE); -//-/ } } -//-/void SdrAttrObj::CopyAttributes(SdrObject* pDestObj) const -//-/{ -//-/ // ... -//-/} - // ItemPool fuer dieses Objekt wechseln void SdrAttrObj::MigrateItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool) { @@ -1805,17 +1208,6 @@ void SdrAttrObj::MigrateItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool) } } } -//-/ UINT16 nItemSetAnz = GetSetItemCount(); -//-/ for(UINT16 i=0;i<nItemSetAnz;i++) -//-/ { -//-/ const SfxSetItem* pSI = GetSetItem(i); -//-/ if(pSI != NULL) -//-/ { -//-/ const SfxSetItem* pNewAttr = &(const SfxSetItem&)pDestPool->Put(*pSI); -//-/ pSrcPool->Remove(*pSI); -//-/ SetSetItem(i, pNewAttr); -//-/ } -//-/ } } BOOL SdrAttrObj::HasFill() const diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index ef73d2f5b5a1..59fa187bd7a6 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdobj.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: obo $ $Date: 2001-01-16 11:40:41 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -123,6 +123,10 @@ #include <vcl/salbtype.hxx> // FRound #endif +#ifndef _SFX_WHITER_HXX +#include <svtools/whiter.hxx> +#endif + using namespace ::com::sun::star; //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1297,7 +1301,6 @@ void SdrObject::FreeGlobalDrawObjectItemPool() SdrItemPool* SdrObject::GetItemPool() const { -//-/ return pModel==NULL ? NULL : (SdrItemPool*)(&pModel->GetItemPool()); if(pModel) return (SdrItemPool*)(&pModel->GetItemPool()); @@ -1542,9 +1545,6 @@ void SdrObject::CreateLinePoly(PolyPolygon3D& rPolyPolygon, PolyPolygon3D& rPoly TakeXorPoly(aTmpPolyPolygon, TRUE); // get LineStyleParameterPack -//-/ SfxItemSet aSet((SfxItemPool&)(*GetItemPool())); -//-/ TakeAttributes(aSet, FALSE, TRUE); -//-/ LineStyleParameterPack aLineAttr(aSet, bForceHair || bIsLineDraft, rOut); LineStyleParameterPack aLineAttr(GetItemSet(), bForceHair || bIsLineDraft, rOut); LineGeometryCreator aLineCreator(aLineAttr, rPolyPolygon, rPolyLine, bIsLineDraft); @@ -2191,9 +2191,6 @@ void SdrObject::ImpDrawLineGeometry( BOOL SdrObject::LineGeometryUsageIsNecessary() const { -//-/ SfxItemSet aSet((SfxItemPool&)(*GetItemPool())); -//-/ TakeAttributes(aSet, FALSE, TRUE); -//-/ XLineStyle eXLS = (XLineStyle)((const XLineStyleItem&)aSet.Get(XATTR_LINESTYLE)).GetValue(); XLineStyle eXLS = (XLineStyle)((const XLineStyleItem&)GetItem(XATTR_LINESTYLE)).GetValue(); return (eXLS != XLINE_NONE); } @@ -2344,17 +2341,6 @@ void SdrObject::TakeContour( XPolyPolygon& rPoly ) const ExtOutputDevice aXOut( &aBlackHole ); SdrObject* pClone = Clone(); -//-/ SfxItemSet aSet( (SfxItemPool&)( *GetItemPool() ), -//-/ XATTR_LINESTYLE, XATTR_LINESTYLE, -//-/ XATTR_LINECOLOR, XATTR_LINECOLOR, -//-/ XATTR_FILLSTYLE, XATTR_FILLSTYLE, 0 ); -//-/ -//-/ pClone->TakeAttributes( aSet, TRUE, FALSE ); -//-/ -//-/ aSet.Put( XLineStyleItem( XLINE_SOLID ) ); -//-/ aSet.Put( XLineColorItem(String(), Color( COL_BLACK ) ) ); -//-/ aSet.Put( XFillStyleItem( XFILL_NONE ) ); -//-/ pClone->NbcSetAttributes( aSet, FALSE ); pClone->SetItem(XLineStyleItem(XLINE_SOLID)); pClone->SetItem(XLineColorItem(String(), Color(COL_BLACK))); pClone->SetItem(XFillStyleItem(XFILL_NONE)); @@ -3261,28 +3247,7 @@ void SdrObject::SetGeoData(const SdrObjGeoData& rGeo) } //////////////////////////////////////////////////////////////////////////////////////////////////// - -//-/void SdrObject::TakeAttributes(SfxItemSet& rAttr, FASTBOOL bMerge, FASTBOOL bOnlyHardAttr) const -//-/{ -//-/} - -//-/void SdrObject::SetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/} - -//-/void SdrObject::NbcSetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -SfxItemSet* SdrObject::CreateNewItemSet(SfxItemPool& rPool) -{ - DBG_ASSERT(FALSE,"SdrObject::CreateNewItemSet() should never be called, SdrObject has no Items"); - return new SfxItemSet(rPool, SDRATTR_START, SDRATTR_END); - // Basic implementation; Basic object has NO attributes -//-/ return NULL; -} +// ItemSet access SfxItemSet* SdrObject::mpEmptyItemSet = 0L; const SfxItemSet& SdrObject::GetItemSet() const @@ -3290,19 +3255,62 @@ const SfxItemSet& SdrObject::GetItemSet() const if(!mpEmptyItemSet) mpEmptyItemSet = ((SdrObject*)this)->CreateNewItemSet((SfxItemPool&)(*GetItemPool())); DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)"); + DBG_ASSERT(FALSE,"SdrObject::GetItemSet() should never be called, SdrObject has no Items"); return *mpEmptyItemSet; } +SfxItemSet* SdrObject::CreateNewItemSet(SfxItemPool& rPool) +{ + // Basic implementation; Basic object has NO attributes + DBG_ASSERT(FALSE,"SdrObject::CreateNewItemSet() should never be called, SdrObject has no Items"); + return new SfxItemSet(rPool, SDRATTR_START, SDRATTR_END); +} + void SdrObject::SetItem( const SfxPoolItem& rItem ) { + sal_uInt16 nWhichID(rItem.Which()); + + if(AllowItemChange(nWhichID, &rItem)) + { + ItemChange(nWhichID, &rItem); + PostItemChange(nWhichID); + } } -void SdrObject::ClearItem( USHORT nWhich ) +void SdrObject::ClearItem( const sal_uInt16 nWhich ) { + if(AllowItemChange(nWhich)) + { + ItemChange(nWhich); + PostItemChange(nWhich); + } } void SdrObject::SetItemSet( const SfxItemSet& rSet ) { + SfxWhichIter aIter(rSet); + sal_uInt16 nWhich(aIter.FirstWhich()); + const SfxPoolItem *pPoolItem; + List aPostItemChangeList; + + while(nWhich) + { + if(SFX_ITEM_SET == rSet.GetItemState(nWhich, FALSE, &pPoolItem)) + { + if(AllowItemChange(nWhich, pPoolItem)) + { + ItemChange(nWhich, pPoolItem); + aPostItemChangeList.Insert((void*)((sal_uInt32)nWhich), LIST_APPEND); + } + } + nWhich = aIter.NextWhich(); + } + + for(sal_uInt32 a(0); a < aPostItemChangeList.Count(); a++) + { + nWhich = (sal_uInt16)aPostItemChangeList.GetObject(a); + PostItemChange(nWhich); + } } void SdrObject::BroadcastItemChange(const SdrBroadcastItemChange& rChange) @@ -3338,7 +3346,7 @@ void SdrObject::SetItemAndBroadcast(const SfxPoolItem& rItem) BroadcastItemChange(aC); } -void SdrObject::ClearItemAndBroadcast(USHORT nWhich) +void SdrObject::ClearItemAndBroadcast(const sal_uInt16 nWhich) { SdrBroadcastItemChange aC(*this); ClearItem(nWhich); @@ -3352,12 +3360,29 @@ void SdrObject::SetItemSetAndBroadcast(const SfxItemSet& rSet) BroadcastItemChange(aC); } -const SfxPoolItem& SdrObject::GetItem(USHORT nWhich) const +const SfxPoolItem& SdrObject::GetItem(const sal_uInt16 nWhich) const { return GetItemSet().Get(nWhich); } //////////////////////////////////////////////////////////////////////////////////////////////////// +// private support routines for ItemSet access + +BOOL SdrObject::AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem) const +{ + return TRUE; +} + +void SdrObject::ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem) +{ + DBG_ASSERT(FALSE,"SdrObject::ItemChange() should never be called, SdrObject has no Items"); +} + +void SdrObject::PostItemChange(const sal_uInt16 nWhich) +{ +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// // pre- and postprocessing for objects for saving void SdrObject::PreSave() @@ -3755,8 +3780,6 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas // useful when new closed filled polygons are created if(aPolyPoly3D.Count() || (bForceLineDash && aLinePoly3D.Count())) { -//-/ SfxItemSet aSet((SfxItemPool&)(*GetItemPool())); -//-/ pRet->TakeAttributes(aSet, TRUE, FALSE); SfxItemSet aSet(pRet->GetItemSet()); XFillStyle eOldFillStyle = ((const XFillStyleItem&)(aSet.Get(XATTR_FILLSTYLE))).GetValue(); SdrPathObj* aLinePolygonPart = NULL; @@ -3778,7 +3801,6 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas aSet.Put(XLineStyleItem(XLINE_NONE)); aSet.Put(XFillTransparenceItem(nTransLine)); -//-/ aLinePolygonPart->NbcSetAttributes(aSet, FALSE); aLinePolygonPart->SetItemSet(aSet); } @@ -3791,7 +3813,6 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas aSet.Put(XFillStyleItem(XFILL_NONE)); aSet.Put(XLineStyleItem(XLINE_SOLID)); -//-/ aLineLinePart->NbcSetAttributes(aSet, FALSE); aLineLinePart->SetItemSet(aSet); if(aLinePolygonPart) @@ -3815,7 +3836,6 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas aSet.ClearItem(); -//-/ pRet->TakeAttributes(aSet, TRUE, FALSE); aSet.Put(pRet->GetItemSet()); aSet.Put(XLineStyleItem(XLINE_NONE)); @@ -3824,7 +3844,6 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas SdrObject* pClone = pRet->Clone(); pClone->SetModel(pRet->GetModel()); -//-/ pClone->NbcSetAttributes(aSet, FALSE); pClone->SetItemSet(aSet); pGroup->GetSubList()->NbcInsertObject( pClone ); diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index a5a6ca80d9e0..017f69dc248b 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdocapt.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2000-12-11 11:56:32 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -229,7 +229,6 @@ SdrCaptionObj::SdrCaptionObj(): aTailPoly(3), // Default Groesse: 3 Punkte = 2 Linien mbSpecialTextBoxShadow(FALSE) { -//-/ pCaptAttr=NULL; } SdrCaptionObj::SdrCaptionObj(const Rectangle& rRect): @@ -237,7 +236,6 @@ SdrCaptionObj::SdrCaptionObj(const Rectangle& rRect): aTailPoly(3), // Default Groesse: 3 Punkte = 2 Linien mbSpecialTextBoxShadow(FALSE) { -//-/ pCaptAttr=NULL; } SdrCaptionObj::SdrCaptionObj(const Rectangle& rRect, const Point& rTail): @@ -246,13 +244,10 @@ SdrCaptionObj::SdrCaptionObj(const Rectangle& rRect, const Point& rTail): mbSpecialTextBoxShadow(FALSE) { aTailPoly[0]=rTail; -//-/ pCaptAttr=NULL; } SdrCaptionObj::~SdrCaptionObj() { - // Attr entfernen (oder macht das SdrAttrObj noch nicht automatisch) -//-/ pCaptAttr=(SdrCaptionSetItem*)ImpSetNewAttr(pCaptAttr,NULL,FALSE); } FASTBOOL SdrCaptionObj::Paint(ExtOutputDevice& rOut, const SdrPaintInfoRec& rInfoRec) const @@ -268,9 +263,7 @@ FASTBOOL SdrCaptionObj::Paint(ExtOutputDevice& rOut, const SdrPaintInfoRec& rInf sal_uInt16 nTransp = ((SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue(); XFillStyle eStyle = ((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue(); -//-/ XFillAttrSetItem aF(rSet.GetPool()); SfxItemSet aSet(rSet); -//-/ aF.GetItemSet().Put(rSet); if(eStyle == XFILL_HATCH) // #41666# { @@ -356,14 +349,9 @@ 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=0; - -//-/ if(mpObjectItemSet) -//-/ { INT32 nWdt = ((XLineWidthItem&)(GetItem(XATTR_LINEWIDTH))).GetValue(); nWdt++; nWdt /= 2; -//-/ } if (nWdt>nMyTol) nMyTol=nWdt; // Bei dicker Linie keine Toleranz noetig Rectangle aR(rPnt,rPnt); @@ -380,7 +368,6 @@ void SdrCaptionObj::operator=(const SdrObject& rObj) { SdrRectObj::operator=(rObj); aTailPoly=((SdrCaptionObj&)rObj).aTailPoly; -//-/ pCaptAttr=(SdrCaptionSetItem*)ImpSetNewAttr(pCaptAttr,((SdrCaptionObj&)rObj).pCaptAttr); } void SdrCaptionObj::TakeObjNameSingul(XubString& rName) const @@ -561,8 +548,6 @@ void SdrCaptionObj::TakeDragPoly(const SdrDragStat& rDrag, XPolyPolygon& rXPP) c void SdrCaptionObj::ImpGetCaptParams(ImpCaptParams& rPara) const { -//-/ if(mpObjectItemSet) -//-/ { const SfxItemSet& rSet = GetItemSet(); rPara.eType =((SdrCaptionTypeItem&) (rSet.Get(SDRATTR_CAPTIONTYPE ))).GetValue(); rPara.bFixedAngle=((SdrCaptionFixedAngleItem&)(rSet.Get(SDRATTR_CAPTIONANGLE ))).GetValue(); @@ -574,7 +559,6 @@ void SdrCaptionObj::ImpGetCaptParams(ImpCaptParams& rPara) const rPara.nEscAbs =((SdrCaptionEscAbsItem&) (rSet.Get(SDRATTR_CAPTIONESCABS ))).GetValue(); rPara.nLineLen =((SdrCaptionLineLenItem&) (rSet.Get(SDRATTR_CAPTIONLINELEN ))).GetValue(); rPara.bFitLineLen=((SdrCaptionFitLineLenItem&)(rSet.Get(SDRATTR_CAPTIONFITLINELEN))).GetValue(); -//-/ } } void SdrCaptionObj::ImpRecalcTail() @@ -834,48 +818,8 @@ void SdrCaptionObj::SetModel(SdrModel* pNewModel) ImpRecalcTail(); } -//-/void SdrCaptionObj::ForceDefaultAttr(SfxItemPool* pPool) -//-/{ -//-/ FASTBOOL bLineMerk=pLineAttr==NULL; -//-/ SdrRectObj::ForceDefaultAttr(pPool); -//-/ if (pPool!=NULL) { -//-/ if (pCaptAttr==NULL) { -//-/ SdrCaptionSetItem aSetItem(pPool); -//-/ pCaptAttr=(SdrCaptionSetItem*)ImpSetNewAttr(pCaptAttr,&aSetItem,FALSE); -//-/ } -//-/ if (bLineMerk && pLineAttr!=NULL) { -//-/ XLineAttrSetItem aSetItem(*pLineAttr); -//-/ aSetItem.GetItemSet().Put(XLineStyleItem(XLINE_SOLID)); -//-/ pLineAttr=(XLineAttrSetItem*)ImpSetNewAttr(pLineAttr,&aSetItem,FALSE); -//-/ } -//-/ } -//-/} - -//-/void SdrCaptionObj::NbcSetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ SdrRectObj::NbcSetAttributes(rAttr,bReplaceAll); -//-/ ImpRecalcTail(); -//-/} - //////////////////////////////////////////////////////////////////////////////////////////////////// - -void SdrCaptionObj::SetItem( const SfxPoolItem& rItem ) -{ - ImpRecalcTail(); - SdrRectObj::SetItem(rItem); -} - -void SdrCaptionObj::ClearItem( USHORT nWhich ) -{ - ImpRecalcTail(); - SdrRectObj::ClearItem(nWhich); -} - -void SdrCaptionObj::SetItemSet( const SfxItemSet& rSet ) -{ - ImpRecalcTail(); - SdrRectObj::SetItemSet(rSet); -} +// ItemSet access SfxItemSet* SdrCaptionObj::CreateNewItemSet(SfxItemPool& rPool) { @@ -894,6 +838,17 @@ SfxItemSet* SdrCaptionObj::CreateNewItemSet(SfxItemPool& rPool) } //////////////////////////////////////////////////////////////////////////////////////////////////// +// private support routines for ItemSet access +void SdrCaptionObj::PostItemChange(const sal_uInt16 nWhich) +{ + // local changes + ImpRecalcTail(); + + // call parent + SdrRectObj::PostItemChange(nWhich); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// void SdrCaptionObj::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDontRemoveHardAttr) { @@ -907,38 +862,6 @@ void SdrCaptionObj::SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, const ImpRecalcTail(); } -//-/USHORT SdrCaptionObj::GetSetItemCount() const -//-/{ -//-/ return 1+SdrRectObj::GetSetItemCount(); -//-/} - -//-/const SfxSetItem* SdrCaptionObj::GetSetItem(USHORT nNum) const -//-/{ -//-/ if (nNum==0) return pCaptAttr; -//-/ nNum--; -//-/ return SdrRectObj::GetSetItem(nNum); -//-/} - -//-/void SdrCaptionObj::SetSetItem(USHORT nNum, const SfxSetItem* pAttr) -//-/{ -//-/ if (nNum==0) pCaptAttr=(const SdrCaptionSetItem*)pAttr; -//-/ else { -//-/ nNum--; -//-/ SdrRectObj::SetSetItem(nNum,pAttr); -//-/ } -//-/} - -//-/SfxSetItem* SdrCaptionObj::MakeNewSetItem(USHORT nNum, FASTBOOL bClone) const -//-/{ -//-/ if (nNum==0) { -//-/ if (bClone) return new SdrCaptionSetItem(*pCaptAttr); -//-/ else return new SdrCaptionSetItem(GetItemPool()); -//-/ } else { -//-/ nNum--; -//-/ return SdrRectObj::MakeNewSetItem(nNum,bClone); -//-/ } -//-/} - SdrObjGeoData* SdrCaptionObj::NewGeoData() const { return new SdrCaptObjGeoData; @@ -1025,14 +948,6 @@ void SdrCaptionObj::WriteData(SvStream& rOut) const const SfxItemSet& rSet = GetUnmergedItemSet(); pPool->StoreSurrogate(rOut, &rSet.Get(SDRATTRSET_CAPTION)); - - - -//-/ SdrCaptionSetItem aCaptAttr(pPool); -//-/ aCaptAttr.GetItemSet().Put(GetItemSet()); -//-/ const SfxPoolItem& rCaptAttr = pPool->Put(aCaptAttr); -//-/ pPool->StoreSurrogate(rOut, &rCaptAttr); -//-/ pPool->StoreSurrogate(rOut,pCaptAttr); } else { @@ -1063,12 +978,6 @@ void SdrCaptionObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn) const SdrCaptionSetItem* pCaptAttr = (const SdrCaptionSetItem*)pPool->LoadSurrogate(rIn, nSetID, 0); if(pCaptAttr) SetItemSet(pCaptAttr->GetItemSet()); -//-/ pCaptAttr=(const SdrCaptionSetItem*)ImpSetNewAttr(pCaptAttr,NULL); // ggf altes rauswerfen -//-/ USHORT nWhichRef=SDRATTRSET_CAPTION; -//-/ pCaptAttr=(const SdrCaptionSetItem*)pPool->LoadSurrogate(rIn,nWhichRef,0); -//-/ if (pStyleSheet!=NULL && pCaptAttr!=NULL) { -//-/ ((SfxItemSet*)&pCaptAttr->GetItemSet())->SetParent(&pStyleSheet->GetItemSet()); -//-/ } } else { diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index daa0e950231a..cab77f8fbe3f 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdocirc.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: aw $ $Date: 2001-01-18 10:48:47 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -153,7 +153,6 @@ SdrCircObj::SdrCircObj(SdrObjKind eNewKind) nEndWink=36000; eKind=eNewKind; bClosedObj=eNewKind!=OBJ_CARC; -//-/ pCircAttr=NULL; } SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect): @@ -163,7 +162,6 @@ SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect): nEndWink=36000; eKind=eNewKind; bClosedObj=eNewKind!=OBJ_CARC; -//-/ pCircAttr=NULL; } SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect, long nNewStartWink, long nNewEndWink): @@ -175,13 +173,10 @@ SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect, long nNewSta if (nWinkDif==36000) nEndWink+=nWinkDif; // Vollkreis eKind=eNewKind; bClosedObj=eNewKind!=OBJ_CARC; -//-/ pCircAttr=NULL; } SdrCircObj::~SdrCircObj() { - // Attr entfernen (oder macht das SdrAttrObj noch nicht automatisch) -//-/ pCircAttr=(SdrCircSetItem*)ImpSetNewAttr(pCircAttr,NULL,FALSE); } void SdrCircObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const @@ -348,11 +343,8 @@ FASTBOOL SdrCircObj::Paint(ExtOutputDevice& rXOut, const SdrPaintInfoRec& rInfoR // prepare ItemSet of this object const SfxItemSet& rSet = GetItemSet(); -//-/ SfxItemSet aSet((SfxItemPool&)(*GetItemPool())); -//-/ TakeAttributes(aSet, FALSE, TRUE); // perepare ItemSet to avoid old XOut line drawing -//-/ XLineAttrSetItem aXLSet(rSet.GetPool()); SfxItemSet aEmptySet(*rSet.GetPool()); aEmptySet.Put(XLineStyleItem(XLINE_NONE)); aEmptySet.Put(XFillStyleItem(XFILL_NONE)); @@ -632,7 +624,6 @@ void SdrCircObj::operator=(const SdrObject& rObj) nEndWink = ((SdrCircObj&)rObj).nEndWink; aPnt1 = ((SdrCircObj&)rObj).aPnt1; aPnt2 = ((SdrCircObj&)rObj).aPnt2; -//-/ pCircAttr=(SdrCircSetItem*)ImpSetNewAttr(pCircAttr,((SdrCircObj&)rObj).pCircAttr); } void SdrCircObj::TakeXorPoly(XPolyPolygon& rPoly, FASTBOOL bDetail) const @@ -1315,8 +1306,6 @@ void __EXPORT SdrCircObj::SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, void SdrCircObj::ForceDefaultAttr() { -//-/ if(pPool) -//-/ { SdrCircKind eKindA = SDRCIRC_FULL; if(eKind == OBJ_SECT) @@ -1344,58 +1333,8 @@ void SdrCircObj::ForceDefaultAttr() // SdrCircKindItem SdrRectObj::ForceDefaultAttr(); -//-/ } -//-/ if (pPool!=NULL) { -//-/ if (pCircAttr==NULL) { -//-/ SdrCircKind eKindA=SDRCIRC_FULL; -//-/ if (eKind==OBJ_SECT) eKindA=SDRCIRC_SECT; -//-/ else if (eKind==OBJ_CARC) eKindA=SDRCIRC_ARC; -//-/ else if (eKind==OBJ_CCUT) eKindA=SDRCIRC_CUT; -//-/ SdrCircSetItem aSetItem(pPool); -//-/ SfxItemSet& rSet=aSetItem.GetItemSet(); -//-/ if (eKindA!=SDRCIRC_FULL) { -//-/ rSet.Put(SdrCircKindItem(eKindA)); -//-/ if (nStartWink!=0) rSet.Put(SdrCircStartAngleItem(nStartWink)); -//-/ if (nEndWink!=36000) rSet.Put(SdrCircEndAngleItem(nEndWink)); -//-/ } -//-/ pCircAttr=(SdrCircSetItem*)ImpSetNewAttr(pCircAttr,&aSetItem,FALSE); -//-/ } -//-/ } } -//-/USHORT SdrCircObj::GetSetItemCount() const -//-/{ -//-/ return 1+SdrRectObj::GetSetItemCount(); -//-/} - -//-/const SfxSetItem* SdrCircObj::GetSetItem(USHORT nNum) const -//-/{ -//-/ if (nNum==0) return pCircAttr; -//-/ nNum--; -//-/ return SdrRectObj::GetSetItem(nNum); -//-/} - -//-/void SdrCircObj::SetSetItem(USHORT nNum, const SfxSetItem* pAttr) -//-/{ -//-/ if (nNum==0) { -//-/ pCircAttr=(const SdrCircSetItem*)pAttr; -//-/ } else { -//-/ nNum--; -//-/ SdrRectObj::SetSetItem(nNum,pAttr); -//-/ } -//-/} - -//-/SfxSetItem* SdrCircObj::MakeNewSetItem(USHORT nNum, FASTBOOL bClone) const -//-/{ -//-/ if (nNum==0) { -//-/ if (bClone && pCircAttr!=NULL) return new SdrCircSetItem(*pCircAttr); -//-/ else return new SdrCircSetItem(GetItemPool()); -//-/ } else { -//-/ nNum--; -//-/ return SdrRectObj::MakeNewSetItem(nNum,bClone); -//-/ } -//-/} - void SdrCircObj::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDontRemoveHardAttr) { SetXPolyDirty(); @@ -1403,35 +1342,8 @@ void SdrCircObj::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDontR ImpSetAttrToCircInfo(); } -//-/void SdrCircObj::NbcSetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ SetXPolyDirty(); -//-/ SdrRectObj::NbcSetAttributes(rAttr,bReplaceAll); -//-/ ImpSetAttrToCircInfo(); -//-/} - //////////////////////////////////////////////////////////////////////////////////////////////////// - -void SdrCircObj::SetItem(const SfxPoolItem& rItem) -{ - SetXPolyDirty(); - SdrRectObj::SetItem(rItem); - ImpSetAttrToCircInfo(); -} - -void SdrCircObj::ClearItem(USHORT nWhich) -{ - SetXPolyDirty(); - SdrRectObj::ClearItem(nWhich); - ImpSetAttrToCircInfo(); -} - -void SdrCircObj::SetItemSet(const SfxItemSet& rSet) -{ - SetXPolyDirty(); - SdrRectObj::SetItemSet(rSet); - ImpSetAttrToCircInfo(); -} +// ItemSet access SfxItemSet* SdrCircObj::CreateNewItemSet(SfxItemPool& rPool) { @@ -1450,6 +1362,20 @@ SfxItemSet* SdrCircObj::CreateNewItemSet(SfxItemPool& rPool) } //////////////////////////////////////////////////////////////////////////////////////////////////// +// private support routines for ItemSet access +void SdrCircObj::PostItemChange(const sal_uInt16 nWhich) +{ + // local changes + SetXPolyDirty(); + + // call parent + SdrRectObj::PostItemChange(nWhich); + + // local changes + ImpSetAttrToCircInfo(); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// void SdrCircObj::ImpSetAttrToCircInfo() { @@ -1581,14 +1507,6 @@ void SdrCircObj::WriteData(SvStream& rOut) const const SfxItemSet& rSet = GetUnmergedItemSet(); pPool->StoreSurrogate(rOut, &rSet.Get(SDRATTRSET_CIRC)); - - - -//-/ SdrCircSetItem aCircAttr(pPool); -//-/ aCircAttr.GetItemSet().Put(GetItemSet()); -//-/ const SfxPoolItem& rCircAttr = pPool->Put(aCircAttr); -//-/ pPool->StoreSurrogate(rOut, &rCircAttr); -//-/ pPool->StoreSurrogate(rOut,pCircAttr); } else { @@ -1623,12 +1541,6 @@ void SdrCircObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn) const SdrCircSetItem* pCircAttr = (const SdrCircSetItem*)pPool->LoadSurrogate(rIn, nSetID, 0); if(pCircAttr) SetItemSet(pCircAttr->GetItemSet()); -//-/ pCircAttr=(const SdrCircSetItem*)ImpSetNewAttr(pCircAttr,NULL); // ggf altes rauswerfen -//-/ USHORT nWhichRef=SDRATTRSET_CIRC; -//-/ pCircAttr=(const SdrCircSetItem*)pPool->LoadSurrogate(rIn,nWhichRef,0); -//-/ if (pStyleSheet!=NULL && pCircAttr!=NULL) { -//-/ ((SfxItemSet*)&pCircAttr->GetItemSet())->SetParent(&pStyleSheet->GetItemSet()); -//-/ } } else { diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 0f310e1cdedb..81ab737d7c4b 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdoedge.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: aw $ $Date: 2000-12-11 11:56:32 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -315,7 +315,6 @@ SdrEdgeObj::SdrEdgeObj(): bTmpDirtyOnAfterRead=FALSE; nNotifyingCount=0; pEdgeTrack=new XPolygon; -//-/ pEdgeAttr=NULL; } SdrEdgeObj::~SdrEdgeObj() @@ -323,79 +322,10 @@ SdrEdgeObj::~SdrEdgeObj() DisconnectFromNode(TRUE); DisconnectFromNode(FALSE); delete pEdgeTrack; -//-/ pEdgeAttr=(SdrEdgeSetItem*)ImpSetNewAttr(pEdgeAttr,NULL,FALSE); -} - -//-/void SdrEdgeObj::ForceDefaultAttr(SfxItemPool* pPool) -//-/{ -//-/ SdrTextObj::ForceDefaultAttr(pPool); -//-/ if (pPool!=NULL) { -//-/ if (pEdgeAttr==NULL) { -//-/ SdrEdgeSetItem aSetItem(pPool); -//-/ pEdgeAttr=(SdrEdgeSetItem*)ImpSetNewAttr(pEdgeAttr,&aSetItem,FALSE); -//-/ } -//-/ } -//-/} - -//-/USHORT SdrEdgeObj::GetSetItemCount() const -//-/{ -//-/ return 1+SdrTextObj::GetSetItemCount(); -//-/} - -//-/const SfxSetItem* SdrEdgeObj::GetSetItem(USHORT nNum) const -//-/{ -//-/ if (nNum==0) return pEdgeAttr; -//-/ nNum--; -//-/ return SdrTextObj::GetSetItem(nNum); -//-/} - -//-/void SdrEdgeObj::SetSetItem(USHORT nNum, const SfxSetItem* pAttr) -//-/{ -//-/ if (nNum==0) { -//-/ pEdgeAttr=(const SdrEdgeSetItem*)pAttr; -//-/ bEdgeTrackDirty=TRUE; -//-/ } else { -//-/ nNum--; -//-/ SdrTextObj::SetSetItem(nNum,pAttr); -//-/ } -//-/} - -//-/SfxSetItem* SdrEdgeObj::MakeNewSetItem(USHORT nNum, FASTBOOL bClone) const -//-/{ -//-/ if (nNum==0) { -//-/ if (bClone && pEdgeAttr!=NULL) return new SdrEdgeSetItem(*pEdgeAttr); -//-/ else return new SdrEdgeSetItem(GetItemPool()); -//-/ } else { -//-/ nNum--; -//-/ return SdrTextObj::MakeNewSetItem(nNum,bClone); -//-/ } -//-/} - -//-/void SdrEdgeObj::NbcSetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ SdrTextObj::NbcSetAttributes(rAttr,bReplaceAll); -//-/ ImpSetAttrToEdgeInfo(); // Werte vom Pool nach aEdgeInfo kopieren -//-/} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -void SdrEdgeObj::SetItem(const SfxPoolItem& rItem) -{ - SdrTextObj::SetItem(rItem); - ImpSetAttrToEdgeInfo(); -} - -void SdrEdgeObj::ClearItem(USHORT nWhich) -{ - SdrTextObj::ClearItem(nWhich); - ImpSetAttrToEdgeInfo(); } -void SdrEdgeObj::SetItemSet(const SfxItemSet& rSet) -{ - SdrTextObj::SetItemSet(rSet); - ImpSetAttrToEdgeInfo(); -} +//////////////////////////////////////////////////////////////////////////////////////////////////// +// ItemSet access SfxItemSet* SdrEdgeObj::CreateNewItemSet(SfxItemPool& rPool) { @@ -414,6 +344,17 @@ SfxItemSet* SdrEdgeObj::CreateNewItemSet(SfxItemPool& rPool) } //////////////////////////////////////////////////////////////////////////////////////////////////// +// private support routines for ItemSet access +void SdrEdgeObj::PostItemChange(const sal_uInt16 nWhich) +{ + // call parent + SdrTextObj::PostItemChange(nWhich); + + // local changes + ImpSetAttrToEdgeInfo(); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// void SdrEdgeObj::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDontRemoveHardAttr) { @@ -645,11 +586,8 @@ FASTBOOL SdrEdgeObj::Paint(ExtOutputDevice& rXOut, const SdrPaintInfoRec& rInfoR // prepare ItemSet of this object const SfxItemSet& rSet = GetItemSet(); -//-/ GetItemSet aSet((SfxItemPool&)(*GetItemPool())); -//-/ TakeAttributes(aSet, FALSE, TRUE); // perepare ItemSet to avoid old XOut line drawing -//-/ XLineAttrSetItem aXLSet((SfxItemPool*)GetItemPool()); SfxItemSet aEmptySet(*rSet.GetPool()); aEmptySet.Put(XLineStyleItem(XLINE_NONE)); aEmptySet.Put(XFillStyleItem(XFILL_NONE)); @@ -1024,8 +962,6 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& aBoundRect1.Move(rCon1.aObjOfs.X(),rCon1.aObjOfs.Y()); aBewareRect1=aBoundRect1; -//-/ if(mpObjectItemSet) -//-/ { sal_Int32 nH = ((SdrEdgeNode1HorzDistItem&)rSet.Get(SDRATTR_EDGENODE1HORZDIST)).GetValue(); sal_Int32 nV = ((SdrEdgeNode1VertDistItem&)rSet.Get(SDRATTR_EDGENODE1VERTDIST)).GetValue(); @@ -1033,10 +969,6 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& aBewareRect1.Right()+=nH; aBewareRect1.Top()-=nV; aBewareRect1.Bottom()+=nV; -//-/ } else { -//-/ aBewareRect1.Left()-=500; aBewareRect1.Right()+=500; -//-/ aBewareRect1.Top()-=500; aBewareRect1.Bottom()+=500; -//-/ } } else { aBoundRect1=Rectangle(aPt1,aPt1); aBoundRect1.Move(rCon1.aObjOfs.X(),rCon1.aObjOfs.Y()); @@ -1051,8 +983,6 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& aBoundRect2.Move(rCon2.aObjOfs.X(),rCon2.aObjOfs.Y()); aBewareRect2=aBoundRect2; -//-/ if(mpObjectItemSet) -//-/ { sal_Int32 nH = ((SdrEdgeNode2HorzDistItem&)rSet.Get(SDRATTR_EDGENODE2HORZDIST)).GetValue(); sal_Int32 nV = ((SdrEdgeNode2VertDistItem&)rSet.Get(SDRATTR_EDGENODE2VERTDIST)).GetValue(); @@ -1060,10 +990,6 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& aBewareRect2.Right()+=nH; aBewareRect2.Top()-=nV; aBewareRect2.Bottom()+=nV; -//-/ } else { -//-/ aBewareRect2.Left()-=500; aBewareRect2.Right()+=500; -//-/ aBewareRect2.Top()-=500; aBewareRect2.Bottom()+=500; -//-/ } } else { aBoundRect2=Rectangle(aPt2,aPt2); aBoundRect2.Move(rCon2.aObjOfs.X(),rCon2.aObjOfs.Y()); @@ -2562,14 +2488,6 @@ void SdrEdgeObj::WriteData(SvStream& rOut) const const SfxItemSet& rSet = GetUnmergedItemSet(); pPool->StoreSurrogate(rOut, &rSet.Get(SDRATTRSET_EDGE)); - - - -//-/ SdrEdgeSetItem aEdgeAttr(pPool); -//-/ aEdgeAttr.GetItemSet().Put(GetItemSet()); -//-/ const SfxPoolItem& rEdgeAttr = pPool->Put(aEdgeAttr); -//-/ pPool->StoreSurrogate(rOut, &rEdgeAttr); -//-/ pPool->StoreSurrogate(rOut,pEdgeAttr); } else { @@ -2620,12 +2538,6 @@ void SdrEdgeObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn) const SdrEdgeSetItem* pEdgeAttr = (const SdrEdgeSetItem*)pPool->LoadSurrogate(rIn, nSetID, 0); if(pEdgeAttr) SetItemSet(pEdgeAttr->GetItemSet()); -//-/ pEdgeAttr=(const SdrEdgeSetItem*)ImpSetNewAttr(pEdgeAttr,NULL); // ggf altes rauswerfen -//-/ USHORT nWhichRef=SDRATTRSET_EDGE; -//-/ pEdgeAttr=(const SdrEdgeSetItem*)pPool->LoadSurrogate(rIn,nWhichRef,0); -//-/ if (pStyleSheet!=NULL && pEdgeAttr!=NULL) { -//-/ ((SfxItemSet*)&pEdgeAttr->GetItemSet())->SetParent(&pStyleSheet->GetItemSet()); -//-/ } } else { diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 0d0d7702287c..57c5236a30b4 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdograf.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: ka $ $Date: 2000-12-21 17:17:13 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -294,7 +294,6 @@ SdrGrafObj::SdrGrafObj(): nGrafStreamPos = GRAFSTREAMPOS_INVALID; bNoShear = TRUE; bCopyToPoolOnAfterRead = FALSE; -//-/ pGrafAttr = NULL; } // ----------------------------------------------------------------------------- @@ -309,7 +308,6 @@ SdrGrafObj::SdrGrafObj(const Graphic& rGrf, const Rectangle& rRect): nGrafStreamPos = GRAFSTREAMPOS_INVALID; bNoShear = TRUE; bCopyToPoolOnAfterRead = FALSE; -//-/ pGrafAttr = NULL; } // ----------------------------------------------------------------------------- @@ -323,7 +321,6 @@ SdrGrafObj::SdrGrafObj( const Graphic& rGrf ): nGrafStreamPos = GRAFSTREAMPOS_INVALID; bNoShear = TRUE; bCopyToPoolOnAfterRead = FALSE; -//-/ pGrafAttr = NULL; } // ----------------------------------------------------------------------------- @@ -332,7 +329,6 @@ SdrGrafObj::~SdrGrafObj() { delete pGraphic; ImpLinkAbmeldung(); -//-/ pGrafAttr = (SdrGrafSetItem*) ImpSetNewAttr( pGrafAttr, NULL, FALSE ); } // ----------------------------------------------------------------------------- @@ -1133,8 +1129,7 @@ void SdrGrafObj::operator=( const SdrObject& rObj ) if( rGraf.pGraphicLink != NULL) SetGraphicLink( aFileName, aFilterName ); -//-/ if( ( pGrafAttr = (SdrGrafSetItem*) ImpSetNewAttr( pGrafAttr, ( (SdrGrafObj&) rObj ).pGrafAttr ) ) != NULL ) - ImpSetAttrToGrafInfo(); + ImpSetAttrToGrafInfo(); } // ----------------------------------------------------------------------------- @@ -1429,14 +1424,6 @@ void SdrGrafObj::WriteData(SvStream& rOut) const const SfxItemSet& rSet = GetUnmergedItemSet(); pPool->StoreSurrogate(rOut, &rSet.Get(SDRATTRSET_GRAF)); - - - -//-/ SdrGrafSetItem aGrafAttr(pPool); -//-/ aGrafAttr.GetItemSet().Put(GetItemSet()); -//-/ const SfxPoolItem& rGrafAttr = pPool->Put(aGrafAttr); -//-/ pPool->StoreSurrogate(rOut, &rGrafAttr); -//-/ pPool->StoreSurrogate(rOut, pGrafAttr); } else rOut << UINT16( SFX_ITEMS_NULL ); @@ -1597,18 +1584,7 @@ void SdrGrafObj::ReadData( const SdrObjIOHeader& rHead, SvStream& rIn ) const SdrGrafSetItem* pGrafAttr = (const SdrGrafSetItem*)pPool->LoadSurrogate(rIn, nSetID, 0); if(pGrafAttr) SetItemSet(pGrafAttr->GetItemSet()); -//-/ USHORT nWhich = SDRATTRSET_GRAF; -//-/ -//-/ pGrafAttr = (const SdrGrafSetItem*) ImpSetNewAttr( pGrafAttr, NULL ); -//-/ pGrafAttr = (const SdrGrafSetItem*) pPool->LoadSurrogate( rIn, nWhich, 0 ); -//-/ -//-/ if( pGrafAttr ) -//-/ { -//-/ if( pStyleSheet ) -//-/ ( (SfxItemSet*) &pGrafAttr->GetItemSet() )->SetParent( &pStyleSheet->GetItemSet() ); -//-/ ImpSetAttrToGrafInfo(); -//-/ } } else { @@ -1751,17 +1727,6 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(BOOL bBezier) const // Bitmap als Attribut retten if(pRetval) { -//-/ SfxItemSet aSet(GetModel()->GetItemPool()); -//-/ TakeAttributes(aSet, FALSE, TRUE); -//-/ -//-/ // Bitmap als Fuellung holen -//-/ aSet.Put(XFillStyleItem(XFILL_BITMAP)); -//-/ Bitmap aBitmap( GetTransformedGraphic().GetBitmap() ); -//-/ XOBitmap aXBmp(aBitmap, XBITMAP_STRETCH); -//-/ aSet.Put(XFillBitmapItem(String(), aXBmp)); -//-/ aSet.Put(XFillBmpTileItem(FALSE)); -//-/ pRetval->NbcSetAttributes(aSet, FALSE); - // Bitmap als Fuellung holen SfxItemSet aSet(GetItemSet()); @@ -1815,8 +1780,6 @@ void SdrGrafObj::ForceDefaultAttr() { SdrRectObj::ForceDefaultAttr(); -//-/ if(pPool) -//-/ { ImpForceItemSet(); mpObjectItemSet->Put( SdrGrafLuminanceItem( 0 ) ); mpObjectItemSet->Put( SdrGrafContrastItem( 0 ) ); @@ -1828,72 +1791,7 @@ void SdrGrafObj::ForceDefaultAttr() mpObjectItemSet->Put( SdrGrafInvertItem( FALSE ) ); mpObjectItemSet->Put( SdrGrafModeItem( GRAPHICDRAWMODE_STANDARD ) ); mpObjectItemSet->Put( SdrGrafCropItem( 0, 0, 0, 0 ) ); -//-/ } -//-/ if( pPool ) -//-/ { -//-/ if( !pGrafAttr ) -//-/ { -//-/ SdrGrafSetItem aSetItem( pPool ); -//-/ SfxItemSet& rSet = aSetItem.GetItemSet(); -//-/ -//-/ rSet.Put( SdrGrafLuminanceItem( 0 ) ); -//-/ rSet.Put( SdrGrafContrastItem( 0 ) ); -//-/ rSet.Put( SdrGrafRedItem( 0 ) ); -//-/ rSet.Put( SdrGrafGreenItem( 0 ) ); -//-/ rSet.Put( SdrGrafBlueItem( 0 ) ); -//-/ rSet.Put( SdrGrafGamma100Item( 100 ) ); -//-/ rSet.Put( SdrGrafTransparenceItem( 0 ) ); -//-/ rSet.Put( SdrGrafInvertItem( FALSE ) ); -//-/ rSet.Put( SdrGrafModeItem( GRAPHICDRAWMODE_STANDARD ) ); -//-/ rSet.Put( SdrGrafCropItem( 0, 0, 0, 0 ) ); -//-/ -//-/ pGrafAttr = (SdrGrafSetItem*) ImpSetNewAttr( pGrafAttr, &aSetItem, FALSE ); -//-/ } -//-/ } -} - -// ----------------------------------------------------------------------------- - -//-/USHORT SdrGrafObj::GetSetItemCount() const -//-/{ -//-/ return( 1 + SdrRectObj::GetSetItemCount() ); -//-/} - -// ----------------------------------------------------------------------------- - -//-/const SfxSetItem* SdrGrafObj::GetSetItem( USHORT nNum ) const -//-/{ -//-/ return( !nNum ? pGrafAttr : SdrRectObj::GetSetItem( --nNum ) ); -//-/} - -// ----------------------------------------------------------------------------- - -//-/void SdrGrafObj::SetSetItem( USHORT nNum, const SfxSetItem* pAttr ) -//-/{ -//-/ if( !nNum ) -//-/ pGrafAttr = (const SdrGrafSetItem*) pAttr; -//-/ else -//-/ SdrRectObj::SetSetItem( --nNum, pAttr ); -//-/} - -// ----------------------------------------------------------------------------- - -//-/SfxSetItem* SdrGrafObj::MakeNewSetItem( USHORT nNum, FASTBOOL bClone ) const -//-/{ -//-/ SfxSetItem* pRet; -//-/ -//-/ if( !nNum ) -//-/ { -//-/ if( bClone && pGrafAttr ) -//-/ pRet = new SdrGrafSetItem( *pGrafAttr ); -//-/ else -//-/ pRet = new SdrGrafSetItem( GetItemPool() ); -//-/ } -//-/ else -//-/ pRet = SdrRectObj::MakeNewSetItem( --nNum, bClone ); -//-/ -//-/ return pRet; -//-/} +} // ----------------------------------------------------------------------------- @@ -1905,34 +1803,7 @@ void SdrGrafObj::NbcSetStyleSheet( SfxStyleSheet* pNewStyleSheet, FASTBOOL bDont } // ----------------------------------------------------------------------------- - -//-/void SdrGrafObj::NbcSetAttributes( const SfxItemSet& rAttr, FASTBOOL bReplaceAll ) -//-/{ -//-/ SetXPolyDirty(); -//-/ SdrRectObj::NbcSetAttributes( rAttr, bReplaceAll ); -//-/ ImpSetAttrToGrafInfo(); -//-/} - -void SdrGrafObj::SetItem(const SfxPoolItem& rItem) -{ - SetXPolyDirty(); - SdrRectObj::SetItem(rItem); - ImpSetAttrToGrafInfo(); -} - -void SdrGrafObj::ClearItem(USHORT nWhich) -{ - SetXPolyDirty(); - SdrRectObj::ClearItem(nWhich); - ImpSetAttrToGrafInfo(); -} - -void SdrGrafObj::SetItemSet(const SfxItemSet& rSet) -{ - SetXPolyDirty(); - SdrRectObj::SetItemSet(rSet); - ImpSetAttrToGrafInfo(); -} +// ItemSet access SfxItemSet* SdrGrafObj::CreateNewItemSet(SfxItemPool& rPool) { @@ -1950,12 +1821,24 @@ SfxItemSet* SdrGrafObj::CreateNewItemSet(SfxItemPool& rPool) 0, 0); } +//////////////////////////////////////////////////////////////////////////////////////////////////// +// private support routines for ItemSet access +void SdrGrafObj::PostItemChange(const sal_uInt16 nWhich) +{ + // local changes + SetXPolyDirty(); + + // call parent + SdrRectObj::PostItemChange(nWhich); + + // local changes + ImpSetAttrToGrafInfo(); +} + // ----------------------------------------------------------------------------- void SdrGrafObj::ImpSetAttrToGrafInfo() { -//-/ if(mpObjectItemSet) -//-/ { const SfxItemSet& rSet = GetItemSet(); const sal_uInt16 nTrans = ( (SdrGrafTransparenceItem&) rSet.Get( SDRATTR_GRAFTRANSPARENCE ) ).GetValue(); const SdrGrafCropItem& rCrop = (const SdrGrafCropItem&) rSet.Get( SDRATTR_GRAFCROP ); @@ -1973,7 +1856,6 @@ void SdrGrafObj::ImpSetAttrToGrafInfo() SetXPolyDirty(); SetRectsDirty(); -//-/ } } // ----------------------------------------------------------------------------- diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index 019ee8bbbcf7..42031c5b9a77 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdogrp.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: aw $ $Date: 2001-01-12 17:03:53 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1348,64 +1348,7 @@ void SdrObjGroup::SetRelativePos(const Point& rPnt) //////////////////////////////////////////////////////////////////////////////////////////////////// - -//-/void SdrObjGroup::NbcSetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ const SfxItemSet* pAttr=&rAttr; -//-/ // -//-/ //SfxItemSet aSet(rAttr); -//-/ //pAttr=&aSet; -//-/ //for (USHORT nWhich=SDRATTR_NOTPERSIST_FIRST; nWhich<=SDRATTR_NOTPERSIST_LAST; nWhich++) { -//-/ // aSet.InvalidateItem(nWhich); -//-/ //} -//-/ -//-/ if (!IsLinkedGroup()) { -//-/ SdrObjList* pOL=pSub; -//-/ ULONG nObjAnz=pOL->GetObjCount(); -//-/ for (ULONG i=0; i<nObjAnz; i++) { -//-/ pOL->GetObj(i)->NbcSetAttributes(*pAttr,bReplaceAll); -//-/ } -//-/ } -//-/ -//-/ // NbcApplyNotPersistAttr(rAttr); -//-/} - -//-/void SdrObjGroup::SetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ if (!IsLinkedGroup()) { -//-/ SdrObjList* pOL=pSub; -//-/ ULONG nObjAnz=pOL->GetObjCount(); -//-/ for (ULONG i=0; i<nObjAnz; i++) { -//-/ pOL->GetObj(i)->SetAttributes(rAttr,bReplaceAll); -//-/ } -//-/ } -//-/} - -//-/void SdrObjGroup::TakeAttributes(SfxItemSet& rAttr, FASTBOOL bMerge, FASTBOOL bOnlyHardAttr) const -//-/{ -//-/ SdrObjList* pOL=pSub; -//-/ ULONG nObjAnz=pOL->GetObjCount(); -//-/ for (ULONG i=0; i<nObjAnz; i++) { -//-/ pOL->GetObj(i)->TakeAttributes(rAttr,TRUE,bOnlyHardAttr); -//-/ } -//-/ -//-/ //if (bMerge) { -//-/ // NotPersist-Items erstmal mit Put, damit die Werte der Sub-Objekte ueberschrieben werden -//-/ // Todo: Muss mit den urspruenglichen Werten Gemerged werden! -//-/ //} -//-/ // TakeNotPersistAttr(rAttr,FALSE); -//-/} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -// groups may contain 3d objects(?) -//-/SfxItemSet* SdrObjGroup::CreateNewItemSet(SfxItemPool& rPool) -//-/{ -//-/ return new SfxItemSet(rPool, -//-/ SDRATTR_START, SDRATTR_END, -//-/ SID_ATTR_3D_START, SID_ATTR_3D_END, -//-/ 0, 0); -//-/} +// ItemSet access const SfxItemSet& SdrObjGroup::GetItemSet() const { @@ -1441,43 +1384,41 @@ const SfxItemSet& SdrObjGroup::GetItemSet() const return *mpGroupItemSet; } -void SdrObjGroup::SetItem( const SfxPoolItem& rItem ) +SfxItemSet* SdrObjGroup::CreateNewItemSet(SfxItemPool& rPool) { - if(!IsLinkedGroup()) - { - sal_uInt32 nCount(pSub->GetObjCount()); - for(sal_uInt32 a(0); a < nCount; a++) - pSub->GetObj(a)->SetItem( rItem ); - } + // include ALL items + return new SfxItemSet(rPool, SDRATTR_START, SDRATTR_END); } -void SdrObjGroup::ClearItem( USHORT nWhich ) -{ - if(!IsLinkedGroup()) - { - sal_uInt32 nCount(pSub->GetObjCount()); - for(sal_uInt32 a(0); a < nCount; a++) - pSub->GetObj(a)->ClearItem( nWhich ); - } -} +//////////////////////////////////////////////////////////////////////////////////////////////////// +// private support routines for ItemSet access -void SdrObjGroup::SetItemSet( const SfxItemSet& rSet ) +void SdrObjGroup::ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem) { if(!IsLinkedGroup()) { + // ItemChange at all contained objects + List aPostItemChangeList; sal_uInt32 nCount(pSub->GetObjCount()); + for(sal_uInt32 a(0); a < nCount; a++) - pSub->GetObj(a)->SetItemSet( rSet ); - } -} + { + SdrObject* pObj = pSub->GetObj(a); + if(pObj->AllowItemChange(nWhich, pNewItem)) + { + pObj->ItemChange(nWhich, pNewItem); + aPostItemChangeList.Insert((void*)pObj, LIST_APPEND); + } + } -SfxItemSet* SdrObjGroup::CreateNewItemSet(SfxItemPool& rPool) -{ - // include ALL items - return new SfxItemSet(rPool, SDRATTR_START, SDRATTR_END); + for(a = 0; a < aPostItemChangeList.Count(); a++) + { + SdrObject* pObj = (SdrObject*)aPostItemChangeList.GetObject(a); + pObj->PostItemChange(nWhich); + } + } } - //////////////////////////////////////////////////////////////////////////////////////////////////// // pre- and postprocessing for objects for saving @@ -1507,16 +1448,6 @@ void SdrObjGroup::PostSave() } } -//-/void SdrObjGroup::BroadcastItemChange(const SdrBroadcastItemChange& rChange) -//-/{ -//-/ if(!IsLinkedGroup()) -//-/ { -//-/ sal_uInt32 nCount(pSub->GetObjCount()); -//-/ for(sal_uInt32 a(0); a < nCount; a++) -//-/ pSub->GetObj(a)->BroadcastItemChange(rOldRect); -//-/ } -//-/} - //////////////////////////////////////////////////////////////////////////////////////////////////// SfxStyleSheet* SdrObjGroup::GetStyleSheet() const diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index f6bffc22089f..586599b0a587 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdomeas.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: aw $ $Date: 2000-12-11 11:56:32 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -302,14 +302,8 @@ TYPEINIT1(SdrMeasureObj,SdrTextObj); void SdrMeasureObj::ForceDefaultAttr() { -//-/ BOOL bLineMerk(!pLineAttr); -//-/ BOOL bOutlMerk(!pOutlAttr); -//-/ BOOL bMiscMerk(!pMiscAttr); - SdrTextObj::ForceDefaultAttr(); -//-/ if(pPool) -//-/ { //#71958# by default, the show units Bool-Item is set as hard // attribute to TRUE to aviod confusion when copying SdrMeasureObj's // from one application to another @@ -327,75 +321,9 @@ void SdrMeasureObj::ForceDefaultAttr() mpObjectItemSet->Put(XLineEndItem(String(), aXP)); mpObjectItemSet->Put(XLineEndWidthItem(200)); mpObjectItemSet->Put(XLineStyleItem(XLINE_SOLID)); -//-/ if(!pMeasureAttr) -//-/ { -//-/ SdrMeasureSetItem aSetItem(pPool); -//-/ -//-/ //#71958# by default, the show units Bool-Item is set as hard -//-/ // attribute to TRUE to aviod confusion when copying SdrMeasureObj's -//-/ // from one application to another -//-/ aSetItem.GetItemSet().Put(SdrMeasureShowUnitItem(TRUE)); -//-/ -//-/ pMeasureAttr = (SdrMeasureSetItem*)ImpSetNewAttr(pMeasureAttr, &aSetItem, FALSE); -//-/ } -//-/ -//-/ if(bLineMerk && pLineAttr) -//-/ { -//-/ XLineAttrSetItem aSetItem(*pLineAttr); -//-/ -//-/ aSetItem.GetItemSet().Put(XLineStyleItem(XLINE_SOLID)); -//-/ -//-/ XPolygon aXP(4); // [] -//-/ aXP[0] = Point(100,0); // 0,4__[]__2,4 -//-/ aXP[1] = Point(200,400); // \ / -//-/ aXP[2] = Point(0,400); // \ / -//-/ aXP[3] = Point(100,0); // \/1,0 -//-/ -//-/ aSetItem.GetItemSet().Put(XLineStartItem(String(), aXP)); -//-/ aSetItem.GetItemSet().Put(XLineStartWidthItem(200)); -//-/ aSetItem.GetItemSet().Put(XLineEndItem(String(), aXP)); -//-/ aSetItem.GetItemSet().Put(XLineEndWidthItem(200)); -//-/ aSetItem.GetItemSet().Put(XLineStyleItem(XLINE_SOLID)); -//-/ -//-/ pLineAttr=(XLineAttrSetItem*)ImpSetNewAttr(pLineAttr, &aSetItem, FALSE); -//-/ } -//-/ } -} - -//-/USHORT SdrMeasureObj::GetSetItemCount() const -//-/{ -//-/ return 1+SdrTextObj::GetSetItemCount(); -//-/} - -//-/const SfxSetItem* SdrMeasureObj::GetSetItem(USHORT nNum) const -//-/{ -//-/ if (nNum==0) return pMeasureAttr; -//-/ nNum--; -//-/ return SdrTextObj::GetSetItem(nNum); -//-/} - -//-/void SdrMeasureObj::SetSetItem(USHORT nNum, const SfxSetItem* pAttr) -//-/{ -//-/ if (nNum==0) pMeasureAttr=(const SdrMeasureSetItem*)pAttr; -//-/ else { -//-/ nNum--; -//-/ SdrTextObj::SetSetItem(nNum,pAttr); -//-/ } -//-/} - -//-/SfxSetItem* SdrMeasureObj::MakeNewSetItem(USHORT nNum, FASTBOOL bClone) const -//-/{ -//-/ if (nNum==0) { -//-/ if (bClone) return new SdrMeasureSetItem(*pMeasureAttr); -//-/ else return new SdrMeasureSetItem(GetItemPool()); -//-/ } else { -//-/ nNum--; -//-/ return SdrTextObj::MakeNewSetItem(nNum,bClone); -//-/ } -//-/} +} SdrMeasureObj::SdrMeasureObj(): -//-/ pMeasureAttr(NULL), bTextDirty(FALSE) { } @@ -403,15 +331,12 @@ SdrMeasureObj::SdrMeasureObj(): SdrMeasureObj::SdrMeasureObj(const Point& rPt1, const Point& rPt2): aPt1(rPt1), aPt2(rPt2), -//-/ pMeasureAttr(NULL), bTextDirty(FALSE) { } SdrMeasureObj::~SdrMeasureObj() { - // Attr entfernen (macht das SdrAttrObj noch nicht automatisch) -//-/ pMeasureAttr=(SdrMeasureSetItem*)ImpSetNewAttr(pMeasureAttr,NULL,FALSE); } void SdrMeasureObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const @@ -512,8 +437,6 @@ void SdrMeasureObj::ImpTakeAttr(ImpMeasureRec& rRec) const rRec.aPt1 = aPt1; rRec.aPt2 = aPt2; -//-/ if(mpObjectItemSet) -//-/ { const SfxItemSet& rSet = GetItemSet(); rRec.eKind =((SdrMeasureKindItem& )rSet.Get(SDRATTR_MEASUREKIND )).GetValue(); rRec.eWantTextHPos =((SdrMeasureTextHPosItem& )rSet.Get(SDRATTR_MEASURETEXTHPOS )).GetValue(); @@ -535,30 +458,6 @@ void SdrMeasureObj::ImpTakeAttr(ImpMeasureRec& rRec) const rRec.nTextAutoAngleView=((SdrMeasureTextAutoAngleViewItem&)rSet.Get(SDRATTR_MEASURETEXTAUTOANGLEVIEW)).GetValue(); rRec.bTextIsFixedAngle =((SdrMeasureTextIsFixedAngleItem& )rSet.Get(SDRATTR_MEASURETEXTISFIXEDANGLE )).GetValue(); rRec.nTextFixedAngle =((SdrMeasureTextFixedAngleItem& )rSet.Get(SDRATTR_MEASURETEXTFIXEDANGLE )).GetValue(); -//-/ } -//-/ else -//-/ { -//-/ rRec.eKind=SDRMEASURE_STD; -//-/ rRec.eWantTextHPos=SDRMEASURE_TEXTHAUTO; -//-/ rRec.eWantTextVPos=SDRMEASURE_TEXTVAUTO; -//-/ rRec.nLineDist=800; -//-/ rRec.nHelplineOverhang=200; -//-/ rRec.nHelplineDist=100; -//-/ rRec.nHelpline1Len=0; -//-/ rRec.nHelpline2Len=0; -//-/ rRec.bBelowRefEdge=FALSE; -//-/ rRec.bTextRota90=FALSE; -//-/ rRec.bTextUpsideDown=FALSE; -//-/ rRec.nMeasureOverhang=600; -//-/ rRec.eMeasureUnit=FUNIT_NONE; -//-/ rRec.aMeasureScale=Fraction(1,1); -//-/ rRec.bShowUnit=FALSE; -//-/ rRec.aFormatString.Erase(); -//-/ rRec.bTextAutoAngle=TRUE; -//-/ rRec.nTextAutoAngleView=31500; -//-/ rRec.bTextIsFixedAngle=FALSE; -//-/ rRec.nTextFixedAngle=0; -//-/ } } void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol) const @@ -581,8 +480,6 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& long nShortLen=0; FASTBOOL bPfeileAussen=FALSE; -//-/ if(mpObjectItemSet) -//-/ { const SfxItemSet& rSet = GetItemSet(); sal_Int32 nLineWdt = ((XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue(); // Strichstaerke rPol.nLineWdt2 = (nLineWdt + 1) / 2; @@ -607,7 +504,6 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& nArrowNeed=nArrow1Len+nArrow2Len+(nArrow1Wdt+nArrow2Wdt)/2; if (rPol.nLineLen<nArrowNeed) bPfeileAussen=TRUE; nShortLen=(nArrow1Len+nArrow1Wdt + nArrow2Len+nArrow2Wdt) /2; -//-/ } rPol.eUsedTextHPos=rRec.eWantTextHPos; rPol.eUsedTextVPos=rRec.eWantTextVPos; @@ -767,11 +663,8 @@ FASTBOOL SdrMeasureObj::Paint(ExtOutputDevice& rXOut, const SdrPaintInfoRec& rIn // prepare ItemSet of this object const SfxItemSet& rSet = GetItemSet(); -//-/ SfxItemSet aSet((SfxItemPool&)(*GetItemPool())); -//-/ TakeAttributes(aSet, FALSE, TRUE); // perepare ItemSet to avoid old XOut line drawing -//-/ XLineAttrSetItem aXLSet(rSet.GetPool()); SfxItemSet aEmptySet(*rSet.GetPool()); aEmptySet.Put(XLineStyleItem(XLINE_NONE)); @@ -872,10 +765,7 @@ void SdrMeasureObj::UndirtyText() const if(GetStyleSheet()) rOutliner.SetStyleSheet(0, GetStyleSheet()); -//-/ if(mpObjectItemSet) rOutliner.SetParaAttribs(0, GetItemSet()); -//-/ if(pOutlAttr) -//-/ rOutliner.SetParaAttribs(0, pOutlAttr->GetItemSet()); // casting auf nonconst ((SdrMeasureObj*)this)->pOutlinerParaObject=rOutliner.CreateParaObject(); @@ -1019,7 +909,6 @@ void SdrMeasureObj::operator=(const SdrObject& rObj) SdrTextObj::operator=(rObj); aPt1=((SdrMeasureObj&)rObj).aPt1; aPt2=((SdrMeasureObj&)rObj).aPt2; -//-/ pMeasureAttr=(SdrMeasureSetItem*)ImpSetNewAttr(pMeasureAttr,((SdrMeasureObj&)rObj).pMeasureAttr); bTextDirty=((SdrMeasureObj&)rObj).bTextDirty; } @@ -1155,26 +1044,6 @@ FASTBOOL SdrMeasureObj::EndDrag(SdrDragStat& rDrag) } } } -//-/ SdrMeasureSetItem aSI(*pMeasureAttr); -//-/ switch (nHdlNum) { -//-/ case 0: case 1: { -//-/ if (pMR->nHelpline1Len!=aRec0.nHelpline1Len) { -//-/ aSI.GetItemSet().Put(SdrMeasureHelpline1LenItem(pMR->nHelpline1Len)); -//-/ } -//-/ if (pMR->nHelpline2Len!=aRec0.nHelpline2Len) { -//-/ aSI.GetItemSet().Put(SdrMeasureHelpline2LenItem(pMR->nHelpline2Len)); -//-/ } -//-/ } break; -//-/ case 4: case 5: { -//-/ if (pMR->nLineDist!=aRec0.nLineDist) { -//-/ aSI.GetItemSet().Put(SdrMeasureLineDistItem(pMR->nLineDist)); -//-/ } -//-/ if (pMR->bBelowRefEdge!=aRec0.bBelowRefEdge) { -//-/ aSI.GetItemSet().Put(SdrMeasureBelowRefEdgeItem(pMR->bBelowRefEdge)); -//-/ } -//-/ } -//-/ } -//-/ pMeasureAttr=(SdrMeasureSetItem*)ImpSetNewAttr(pMeasureAttr,&aSI); } } // switch SetRectsDirty(); @@ -1504,8 +1373,6 @@ void SdrMeasureObj::CreateLinePoly(PolyPolygon3D& rPolyPolygon, PolyPolygon3D& r TakeXorPoly(aTmpPolyPolygon, TRUE); // get LineStyleParameterPack -//-/ SfxItemSet aSet((SfxItemPool&)(*GetItemPool())); -//-/ TakeAttributes(aSet, FALSE, TRUE); LineStyleParameterPack aLineAttr(GetItemSet(), bForceHair || bIsLineDraft, rOut); LineGeometryCreator aLineCreator(aLineAttr, rPolyPolygon, rPolyLine, bIsLineDraft); UINT16 nCount(aTmpPolyPolygon.Count()); @@ -1572,8 +1439,6 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const TakeXorPoly(aTmpPolyPolygon, TRUE); // get local ItemSet -//-/ SfxItemSet aSet((SfxItemPool&)(*GetItemPool())); -//-/ TakeAttributes(aSet, TRUE, FALSE); SfxItemSet aSet(GetItemSet()); // prepare group @@ -1594,7 +1459,6 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const pPath = new SdrPathObj(OBJ_PATHLINE, aNewPoly); pPath->SetModel(GetModel()); -//-/ pPath->NbcSetAttributes(aSet, FALSE); pPath->SetItemSet(aSet); pGroup->GetSubList()->NbcInsertObject(pPath); @@ -1617,7 +1481,6 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const pPath = new SdrPathObj(OBJ_PATHLINE, aNewPoly); pPath->SetModel(GetModel()); -//-/ pPath->NbcSetAttributes(aSet, FALSE); pPath->SetItemSet(aSet); pGroup->GetSubList()->NbcInsertObject(pPath); @@ -1630,7 +1493,6 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const pPath = new SdrPathObj(OBJ_PATHLINE, aNewPoly); pPath->SetModel(GetModel()); -//-/ pPath->NbcSetAttributes(aSet, FALSE); pPath->SetItemSet(aSet); pGroup->GetSubList()->NbcInsertObject(pPath); @@ -1651,7 +1513,6 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const pPath = new SdrPathObj(OBJ_PATHLINE, aNewPoly); pPath->SetModel(GetModel()); -//-/ pPath->NbcSetAttributes(aSet, FALSE); pPath->SetItemSet(aSet); pGroup->GetSubList()->NbcInsertObject(pPath); @@ -1664,7 +1525,6 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const pPath = new SdrPathObj(OBJ_PATHLINE, aNewPoly); pPath->SetModel(GetModel()); -//-/ pPath->NbcSetAttributes(aSet, FALSE); pPath->SetItemSet(aSet); pGroup->GetSubList()->NbcInsertObject(pPath); @@ -1680,7 +1540,6 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const pPath = new SdrPathObj(OBJ_PATHLINE, aNewPoly); pPath->SetModel(GetModel()); -//-/ pPath->NbcSetAttributes(aSet, FALSE); pPath->SetItemSet(aSet); pGroup->GetSubList()->NbcInsertObject(pPath); @@ -1822,31 +1681,8 @@ void SdrMeasureObj::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDo SdrTextObj::NbcSetStyleSheet(pNewStyleSheet,bDontRemoveHardAttr); } -//-/void SdrMeasureObj::NbcSetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ SetTextDirty(); -//-/ SdrTextObj::NbcSetAttributes(rAttr,bReplaceAll); -//-/} - //////////////////////////////////////////////////////////////////////////////////////////////////// - -void SdrMeasureObj::SetItem(const SfxPoolItem& rItem) -{ - SetTextDirty(); - SdrTextObj::SetItem(rItem); -} - -void SdrMeasureObj::ClearItem(USHORT nWhich) -{ - SetTextDirty(); - SdrTextObj::ClearItem(nWhich); -} - -void SdrMeasureObj::SetItemSet(const SfxItemSet& rSet) -{ - SetTextDirty(); - SdrTextObj::SetItemSet(rSet); -} +// ItemSet access SfxItemSet* SdrMeasureObj::CreateNewItemSet(SfxItemPool& rPool) { @@ -1865,6 +1701,17 @@ SfxItemSet* SdrMeasureObj::CreateNewItemSet(SfxItemPool& rPool) } //////////////////////////////////////////////////////////////////////////////////////////////////// +// private support routines for ItemSet access +void SdrMeasureObj::PostItemChange(const sal_uInt16 nWhich) +{ + // call parent + SdrTextObj::PostItemChange(nWhich); + + // local changes + SetTextDirty(); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// // pre- and postprocessing for objects for saving void SdrMeasureObj::PreSave() @@ -1913,14 +1760,6 @@ void SdrMeasureObj::WriteData(SvStream& rOut) const const SfxItemSet& rSet = GetUnmergedItemSet(); pPool->StoreSurrogate(rOut, &rSet.Get(SDRATTRSET_MEASURE)); - - - -//-/ SdrMeasureSetItem aMeasAttr(pPool); -//-/ aMeasAttr.GetItemSet().Put(GetItemSet()); -//-/ const SfxPoolItem& rMeasAttr = pPool->Put(aMeasAttr); -//-/ pPool->StoreSurrogate(rOut, &rMeasAttr); -//-/ pPool->StoreSurrogate(rOut,pMeasureAttr); } else { @@ -1948,12 +1787,6 @@ void SdrMeasureObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn) const SdrMeasureSetItem* pMeasAttr = (const SdrMeasureSetItem*)pPool->LoadSurrogate(rIn, nSetID, 0); if(pMeasAttr) SetItemSet(pMeasAttr->GetItemSet()); -//-/ pMeasureAttr=(const SdrMeasureSetItem*)ImpSetNewAttr(pMeasureAttr,NULL); // ggf altes rauswerfen -//-/ USHORT nWhichRef=SDRATTRSET_MEASURE; -//-/ pMeasureAttr=(const SdrMeasureSetItem*)pPool->LoadSurrogate(rIn,nWhichRef,0); -//-/ if (pStyleSheet!=NULL && pMeasureAttr!=NULL) { -//-/ ((SfxItemSet*)&pMeasureAttr->GetItemSet())->SetParent(&pStyleSheet->GetItemSet()); -//-/ } } else { diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 86618b225e8d..4e9085eb8c5a 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdopath.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2001-01-11 11:15:29 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -310,11 +310,8 @@ FASTBOOL SdrPathObj::Paint(ExtOutputDevice& rXOut, const SdrPaintInfoRec& rInfoR // prepare ItemSet of this object const SfxItemSet& rSet = GetItemSet(); -//-/ SfxItemSet aSet((SfxItemPool&)(*GetItemPool())); -//-/ TakeAttributes(aSet, FALSE, TRUE); // perepare ItemSet to avoid old XOut line drawing -//-/ XLineAttrSetItem aXLSet(rSet.GetPool()); SfxItemSet aEmptySet(*rSet.GetPool()); aEmptySet.Put(XLineStyleItem(XLINE_NONE)); aEmptySet.Put(XFillStyleItem(XFILL_NONE)); diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index 19a205234045..d59b70d4ca7e 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdorect.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2000-11-10 14:33:30 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -320,11 +320,8 @@ FASTBOOL SdrRectObj::Paint(ExtOutputDevice& rXOut, const SdrPaintInfoRec& rInfoR // prepare ItemSet of this object const SfxItemSet& rSet = GetItemSet(); -//-/ SfxItemSet aSet((SfxItemPool&)(*GetItemPool())); -//-/ TakeAttributes(aSet, FALSE, TRUE); // perepare ItemSet to avoid old XOut line drawing -//-/ XLineAttrSetItem aXLSet(rSet.GetPool()); SfxItemSet aEmptySet(*rSet.GetPool()); aEmptySet.Put(XLineStyleItem(XLINE_NONE)); aEmptySet.Put(XFillStyleItem(XFILL_NONE)); @@ -747,14 +744,9 @@ XubString SdrRectObj::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const SdrGluePoint SdrRectObj::GetVertexGluePoint(USHORT nPosNum) const { -//-/ INT32 nWdt=0; - -//-/ if(mpObjectItemSet) -//-/ { INT32 nWdt = ((XLineWidthItem&)(GetItem(XATTR_LINEWIDTH))).GetValue(); nWdt++; nWdt /= 2; -//-/ } Point aPt; switch (nPosNum) { @@ -773,14 +765,9 @@ SdrGluePoint SdrRectObj::GetVertexGluePoint(USHORT nPosNum) const SdrGluePoint SdrRectObj::GetCornerGluePoint(USHORT nPosNum) const { -//-/ INT32 nWdt=0; - -//-/ if(mpObjectItemSet) -//-/ { INT32 nWdt = ((XLineWidthItem&)(GetItem(XATTR_LINEWIDTH))).GetValue(); nWdt++; nWdt /= 2; -//-/ } Point aPt; switch (nPosNum) { @@ -818,29 +805,14 @@ void SdrRectObj::SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, const Sf SetXPolyDirty(); // wg. Eckenradius } -//-/void SdrRectObj::NbcSetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ SdrTextObj::NbcSetAttributes(rAttr,bReplaceAll); -//-/ SetXPolyDirty(); // wg. Eckenradius -//-/} - //////////////////////////////////////////////////////////////////////////////////////////////////// - -void SdrRectObj::SetItem(const SfxPoolItem& rItem) +// private support routines for ItemSet access +void SdrRectObj::PostItemChange(const sal_uInt16 nWhich) { - SdrTextObj::SetItem(rItem); - SetXPolyDirty(); -} + // call parent + SdrTextObj::PostItemChange(nWhich); -void SdrRectObj::ClearItem(USHORT nWhich) -{ - SdrTextObj::ClearItem(nWhich); - SetXPolyDirty(); -} - -void SdrRectObj::SetItemSet(const SfxItemSet& rSet) -{ - SdrTextObj::SetItemSet(rSet); + // local changes SetXPolyDirty(); } @@ -898,7 +870,6 @@ void SdrRectObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn) aSet.Put(XLineColorItem(String(),Color(COL_BLACK))); // Falls einer auf Solid umschaltet aSet.Put(XLineStyleItem(XLINE_NONE)); -//-/ NbcSetAttributes(aSet,FALSE); SetItemSet(aSet); } } else { diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index b75e3483739a..6dc67df7bade 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdotext.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: cl $ $Date: 2001-01-25 10:56:46 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -331,8 +331,6 @@ FASTBOOL SdrTextObj::IsAutoGrowHeight() const return FALSE; // AutoGrow nur bei TextFrames const SfxItemSet& rSet = GetItemSet(); -//-/ if(mpObjectItemSet) -//-/ { BOOL bRet = ((SdrTextAutoGrowHeightItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue(); if(bRet) @@ -350,8 +348,6 @@ FASTBOOL SdrTextObj::IsAutoGrowHeight() const } } return bRet; -//-/ } -//-/ return TRUE; // default ist TRUE } FASTBOOL SdrTextObj::IsAutoGrowWidth() const @@ -360,8 +356,6 @@ FASTBOOL SdrTextObj::IsAutoGrowWidth() const return FALSE; // AutoGrow nur bei TextFrames const SfxItemSet& rSet = GetItemSet(); -//-/ if(mpObjectItemSet) -//-/ { BOOL bRet = ((SdrTextAutoGrowHeightItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH))).GetValue(); if(bRet) @@ -379,8 +373,6 @@ FASTBOOL SdrTextObj::IsAutoGrowWidth() const } } return bRet; -//-/ } -//-/ return FALSE; // default ist FALSE } SdrTextHorzAdjust SdrTextObj::GetTextHorizontalAdjust() const @@ -389,8 +381,6 @@ SdrTextHorzAdjust SdrTextObj::GetTextHorizontalAdjust() const return SDRTEXTHORZADJUST_BLOCK; const SfxItemSet& rSet = GetItemSet(); -//-/ if(mpObjectItemSet) -//-/ { SdrTextHorzAdjust eRet = ((SdrTextHorzAdjustItem&)(rSet.Get(SDRATTR_TEXT_HORZADJUST))).GetValue(); if(eRet == SDRTEXTHORZADJUST_BLOCK) @@ -408,9 +398,6 @@ SdrTextHorzAdjust SdrTextObj::GetTextHorizontalAdjust() const } } return eRet; -//-/ } -//-/ -//-/ return bTextFrame ? SDRTEXTHORZADJUST_BLOCK : SDRTEXTHORZADJUST_CENTER; } // defaults: BLOCK fuer Textrahmen, CENTER fuer beschriftete Grafikobjekte SdrTextVertAdjust SdrTextObj::GetTextVerticalAdjust() const @@ -418,13 +405,8 @@ SdrTextVertAdjust SdrTextObj::GetTextVerticalAdjust() const if(IsContourTextFrame()) return SDRTEXTVERTADJUST_TOP; -//-/ if(mpObjectItemSet) -//-/ { SdrTextVertAdjust eRet = ((SdrTextVertAdjustItem&)(GetItem(SDRATTR_TEXT_VERTADJUST))).GetValue(); return eRet; -//-/ } - -//-/ return bTextFrame ? SDRTEXTVERTADJUST_TOP : SDRTEXTVERTADJUST_CENTER; } // defaults: TOP fuer Textrahmen, CENTER fuer beschriftete Grafikobjekte void SdrTextObj::ImpJustifyRect(Rectangle& rRect) const @@ -541,11 +523,7 @@ void SdrTextObj::SetModel(SdrModel* pNewModel) // zunaechst das HeightItem festklopfen, damit // 1. Es eben bestehen bleibt und // 2. DoStretchChars vom richtigen Wert ausgeht - //-/ aSI.GetItemSet().Put(SvxFontHeightItem(nOldFontHgt)); SetItem(SvxFontHeightItem(nOldFontHgt)); -//-/ SdrOutlinerSetItem aSI(*pOutlAttr); -//-/ aSI.GetItemSet().Put(SvxFontHeightItem(nOldFontHgt)); -//-/ pOutlAttr=(SdrOutlinerSetItem*)ImpSetNewAttr(pOutlAttr,&aSI); } // erst jetzt den Outliner holen, etc. damit obiges SetAttr auch wirkt SdrOutliner& rOutliner=ImpGetDrawOutliner(); @@ -565,9 +543,6 @@ void SdrTextObj::SetModel(SdrModel* pNewModel) // Und nun noch das Rahmenattribut korregieren nOldFontHgt=BigMulDiv(nOldFontHgt,aMetricFactor.GetNumerator(),aMetricFactor.GetDenominator()); SetItem(SvxFontHeightItem(nOldFontHgt)); -//-/ SdrOutlinerSetItem aSI(*pOutlAttr); -//-/ aSI.GetItemSet().Put(SvxFontHeightItem(nOldFontHgt)); -//-/ pOutlAttr=(SdrOutlinerSetItem*)ImpSetNewAttr(pOutlAttr,&aSI); } } SetOutlinerParaObject(rOutliner.CreateParaObject()); // #34494# @@ -607,12 +582,8 @@ SdrOutliner& SdrTextObj::ImpGetDrawOutliner() const FASTBOOL SdrTextObj::NbcSetEckenradius(long nRad) { -//-/ if(mpObjectItemSet) -//-/ { SetItem(SdrEckenradiusItem(nRad)); return TRUE; -//-/ } -//-/ return FALSE; } FASTBOOL SdrTextObj::NbcSetAutoGrowHeight(FASTBOOL bAuto) @@ -1021,11 +992,6 @@ FASTBOOL SdrTextObj::Paint(ExtOutputDevice& rXOut, const SdrPaintInfoRec& rInfoR rOutliner.SetUpdateMode(TRUE); // hier kann ggf. noch optimiert werden !!! ImpTextPortionHandler aTPHandler(rOutliner,*this); -//-/ rXOut.SetTextAttr(*pTextAttr); -//-/ const SfxItemSet& rSet = GetItemSet(); -//-/ XTextAttrSetItem aTextSetItem(rSet.GetPool()); -//-/ aTextSetItem.GetItemSet().Put(rSet); - // #78478# to have the outline color in XOutputDevice::ImpDrawFormText(...) // SetLineAttr(...) needs to be called if the outline item is set const SfxItemSet& rSet = GetItemSet(); @@ -1238,9 +1204,6 @@ FASTBOOL SdrTextObj::ImpPaintAnimatedText(OutputDevice& rOut, const Point& rOffs SdrOutliner& rOutliner, const Rectangle& rAnchorRect, const Rectangle& rPaintRect, const SdrPaintInfoRec& rInfoRec) const { -//-/ if(!mpObjectItemSet) -//-/ return FALSE; - SdrTextAniKind eAniKind = GetTextAniKind(); FASTBOOL bBlink = eAniKind == SDRTEXTANI_BLINK; const SfxItemSet& rSet = GetItemSet(); @@ -1388,14 +1351,7 @@ void SdrTextObj::ImpAddTextToBoundRect() rOutl.SetUpdateMode(TRUE); ImpTextPortionHandler aTPHandler(rOutl,*this); -//-/ if(mpObjectItemSet) -//-/ { -//-/ const SfxItemSet& rSet = GetItemSet(); -//-/ XTextAttrSetItem aTextSetItem(rSet.GetPool()); -//-/ aTextSetItem.GetItemSet().Put(rSet); aXOut.SetTextAttr(GetItemSet()); -//-/ aXOut.SetTextAttr(*pTextAttr); -//-/ } aTPHandler.DrawTextToPath(aXOut,FALSE); if (pFormTextBoundRect==NULL) pFormTextBoundRect=new Rectangle; @@ -1917,8 +1873,6 @@ void SdrTextObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn) { mpObjectItemSet->Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_CENTER)); mpObjectItemSet->Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER)); -//-/ SdrOutlinerSetItem aOutl(*pOutlAttr); -//-/ aOutl.GetItemSet().Put(SvxAdjustItem(SVX_ADJUST_CENTER)); mpObjectItemSet->Put(SvxAdjustItem(SVX_ADJUST_CENTER)); } diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx index 941f6c232574..3d5d6a7ab619 100644 --- a/svx/source/svdraw/svdotxat.cxx +++ b/svx/source/svdraw/svdotxat.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdotxat.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2000-12-01 18:11:49 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -245,222 +245,15 @@ void SdrTextObj::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDontR } } -//-/void SdrTextObj::NbcSetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ SfxItemSet aAttr( rAttr ); -//-/ -//-/ BOOL bCreateLRSpaceItems = FALSE; -//-/ -//-/ if ( aAttr.GetItemState( EE_PARA_LRSPACE ) == SFX_ITEM_ON ) -//-/ { -//-/ // SvxLRSpaceItem hart gesetzt: SvxNumBulletItem anpassen -//-/ SfxItemSet aSet( *aAttr.GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE, 0 ); -//-/ TakeAttributes( aSet, TRUE, TRUE); -//-/ -//-/ if ( aSet.GetItemState( EE_PARA_LRSPACE ) != SFX_ITEM_ON || -//-/ ((const SvxLRSpaceItem&) aSet.Get( EE_PARA_LRSPACE )) != -//-/ ((const SvxLRSpaceItem&) aAttr.Get( EE_PARA_LRSPACE )) ) -//-/ { -//-/ SvxNumBulletItem* pNumBullet = NULL; -//-/ -//-/ if ( aAttr.GetItemState( EE_PARA_NUMBULLET ) == SFX_ITEM_ON ) -//-/ pNumBullet = new SvxNumBulletItem( (const SvxNumBulletItem&) aAttr.Get(EE_PARA_NUMBULLET) ); -//-/ else -//-/ { -//-/ pNumBullet = new SvxNumBulletItem( (const SvxNumBulletItem&) aSet.Get(EE_PARA_NUMBULLET) ); -//-/ -//-/ if( eTextKind == OBJ_OUTLINETEXT && -//-/ pNumBullet->GetNumRule()->GetNumRuleType() != SVX_RULETYPE_PRESENTATION_NUMBERING ) -//-/ { -//-/ // Das ist das 10er-Item aus den Defaults. -//-/ // Dieses darf bei Gliederungsobjekten nicht verwendet werden! -//-/ // Daher wird das Item aus der Vorlage geholt -//-/ delete pNumBullet; -//-/ pNumBullet = NULL; -//-/ -//-/ if( GetStyleSheet() && -//-/ GetStyleSheet()->GetItemSet().GetItemState( EE_PARA_NUMBULLET ) == SFX_ITEM_ON ) -//-/ pNumBullet = new SvxNumBulletItem( (const SvxNumBulletItem&) GetStyleSheet()->GetItemSet().Get(EE_PARA_NUMBULLET) ); -//-/ } -//-/ } -//-/ -//-/ if( pNumBullet ) -//-/ { -//-/ USHORT nLevel = 0; -//-/ if( pNumBullet->GetNumRule()->GetNumRuleType() == SVX_RULETYPE_PRESENTATION_NUMBERING ) -//-/ nLevel = 1; -//-/ -//-/ EditEngine::ImportBulletItem( *pNumBullet, nLevel, NULL, -//-/ &(const SvxLRSpaceItem&) aAttr.Get( EE_PARA_LRSPACE ) ); -//-/ ( (SfxItemSet&) aAttr).Put( *pNumBullet ); -//-/ -//-/ delete pNumBullet; -//-/ } -//-/ else -//-/ DBG_ASSERT(FALSE, "SdrTextObj::NbcSetAttributes: SvxNumBulletItem nicht angepasst!"); -//-/ } -//-/ } -//-/ else if ( aAttr.GetItemState( EE_PARA_NUMBULLET ) == SFX_ITEM_ON ) -//-/ { -//-/ // SvxNumBulletItem hart gesetzt: SvxLRSpaceItem anpassen -//-/ SfxItemSet aSet( *aAttr.GetPool(), EE_PARA_NUMBULLET, EE_PARA_NUMBULLET, 0 ); -//-/ TakeAttributes( aSet, TRUE, TRUE); -//-/ -//-/ if ( aSet.GetItemState( EE_PARA_NUMBULLET ) != SFX_ITEM_ON || -//-/ ((const SvxNumBulletItem&) aSet.Get( EE_PARA_NUMBULLET )) != -//-/ ((const SvxNumBulletItem&) aAttr.Get( EE_PARA_NUMBULLET )) ) -//-/ { -//-/ SvxLRSpaceItem aLRSpace( (const SvxLRSpaceItem&) aSet.Get(EE_PARA_LRSPACE) ); -//-/ USHORT nLevel = 0; -//-/ if( eTextKind == OBJ_OUTLINETEXT ) -//-/ nLevel = 1; -//-/ -//-/ if ( Outliner::CreateLRSpaceItem( (const SvxNumBulletItem&) aAttr.Get( EE_PARA_NUMBULLET ), nLevel, aLRSpace ) ) -//-/ ( (SfxItemSet&) aAttr).Put( aLRSpace ); -//-/ -//-/ bCreateLRSpaceItems = TRUE; -//-/ } -//-/ } -//-/ -//-/ if ( aAttr.GetItemState( SDRATTR_TEXT_CONTOURFRAME ) == SFX_ITEM_ON ) -//-/ { -//-/ // Extra-Repaint wenn das Layout so radikal geaendert wird (#43139#) -//-/ SendRepaintBroadcast(); -//-/ -//-/ if(IsTextEditActive()) -//-/ { -//-/ // Text wird gerade editiert, zusaetzlich redraw auf EditText -//-/ const EditEngine& rEditEng = pEdtOutl->GetEditEngine(); -//-/ for(UINT16 a=0;a<rEditEng.GetViewCount();a++) -//-/ { -//-/ EditView* pEdView = rEditEng.GetView(a); -//-/ -//-/ if(pEdView) -//-/ { -//-/ pEdView->Invalidate(); -//-/ } -//-/ } -//-/ } -//-/ } -//-/ -//-/ SdrAttrObj::NbcSetAttributes(aAttr,bReplaceAll); -//-/ FASTBOOL bGrowChecked=FALSE; -//-/ // Attribute auf den gesamten Text anwenden -//-/ if (pOutlinerParaObject!=NULL) -//-/ { -//-/ if ((pEdtOutl==NULL || bCreateLRSpaceItems) && !IsLinkedText()) -//-/ { -//-/ // #46762# Sonderbehandlung fuer bReplaceAll -//-/ if (SearchOutlinerItems(aAttr,bReplaceAll)) -//-/ { -//-/ Outliner* pOutliner; -//-/ if(pEdtOutl == NULL) -//-/ { -//-/ pOutliner = &ImpGetDrawOutliner(); -//-/ pOutliner->SetText(*pOutlinerParaObject); -//-/ } -//-/ else -//-/ { -//-/ pOutliner = pEdtOutl; -//-/ } -//-/ USHORT nParaCount=(USHORT)pOutliner->GetParagraphCount(); -//-/ if (nParaCount!=0) -//-/ { -//-/ for (USHORT nPara=0; nPara<nParaCount; nPara++) -//-/ { -//-/ // Neue Attribute mit alten (bereits vorhandenen) mergen -//-/ SfxItemSet aTmpSet(pOutliner->GetParaAttribs(nPara)); -//-/ -//-/ SvxLRSpaceItem aLRSpace( (const SvxLRSpaceItem&) aTmpSet.Get(EE_PARA_LRSPACE) ); -//-/ -//-/ if(pEdtOutl==NULL) -//-/ { -//-/ if(bReplaceAll) -//-/ { -//-/ // #46762#: bReplaceAll beachten -//-/ SfxWhichIter aIter(aAttr); -//-/ USHORT nWh=aIter.FirstWhich(); -//-/ while (nWh!=0) -//-/ { -//-/ if (nWh>=EE_ITEMS_START && nWh<=EE_ITEMS_END) -//-/ { -//-/ SfxItemState eState=aAttr.GetItemState(nWh,FALSE); -//-/ if (eState==SFX_ITEM_DEFAULT) aTmpSet.ClearItem(nWh); -//-/ } -//-/ nWh=aIter.NextWhich(); -//-/ } -//-/ } -//-/ aTmpSet.Put(aAttr,FALSE); // FALSE= InvalidItems nicht als Default, sondern als "Loecher" betrachten -//-/ } -//-/ -//-/ if(bCreateLRSpaceItems) -//-/ { -//-/ const INT16 nLevel = pOutliner->GetDepth( nPara ); -//-/ -//-/ if ( Outliner::CreateLRSpaceItem( (const SvxNumBulletItem&) aAttr.Get( EE_PARA_NUMBULLET ), nLevel, aLRSpace ) ) -//-/ aTmpSet.Put( aLRSpace ); -//-/ } -//-/ -//-/ pOutliner->SetParaAttribs(nPara,aTmpSet); -//-/ -//-/ if(pEdtOutl==NULL) -//-/ { -//-/ // Fuer alle hinzugekommenen Attribute: -//-/ // entsprechende CharAttribs entfernen. -//-/ if (bReplaceAll) -//-/ { -//-/ if( aAttr.Count() == 0 && aTmpSet.Count() == 0 ) -//-/ { -//-/ // Format -> Standard -//-/ pOutliner->QuickRemoveCharAttribs(nPara, 0); -//-/ } -//-/ else -//-/ { -//-/ SfxItemIter aIter( aTmpSet ); -//-/ const SfxPoolItem* pItem = aIter.FirstItem(); -//-/ while ( pItem ) -//-/ { -//-/ if ( !IsInvalidItem(pItem) ) -//-/ { -//-/ USHORT nW = pItem->Which(); -//-/ if ( nW >= EE_CHAR_START && nW <= EE_CHAR_END ) -//-/ pOutliner->QuickRemoveCharAttribs( nPara, nW ); -//-/ } -//-/ -//-/ pItem=aIter.NextItem(); -//-/ } -//-/ } -//-/ } -//-/ } -//-/ } -//-/ if(pEdtOutl == NULL) -//-/ { -//-/ OutlinerParaObject* pTemp=pOutliner->CreateParaObject( 0, nParaCount ); -//-/ pOutliner->Clear(); -//-/ NbcSetOutlinerParaObject(pTemp); -//-/ } -//-/ bGrowChecked=TRUE; -//-/ } -//-/ } -//-/ } -//-/ -//-/ // #36989#: AutoGrow auch bei TextEdit -//-/ if (bTextFrame && !bGrowChecked) -//-/ { -//-/ NbcAdjustTextFrameWidthAndHeight(); -//-/ bGrowChecked=TRUE; -//-/ } -//-/ } -//-/} - //////////////////////////////////////////////////////////////////////////////////////////////////// +// private support routines for ItemSet access -void SdrTextObj::SetItem( const SfxPoolItem& rItem ) +void SdrTextObj::ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem) { // handle outliner attributes if(pOutlinerParaObject) { - if(rItem.Which() >= EE_CHAR_START && rItem.Which() <= EE_CHAR_END) + if(nWhich >= EE_CHAR_START && nWhich <= EE_CHAR_END) { Outliner* pOutliner; @@ -477,67 +270,25 @@ void SdrTextObj::SetItem( const SfxPoolItem& rItem ) sal_uInt16 nParaCount((sal_uInt16)pOutliner->GetParagraphCount()); for(sal_uInt16 nPara(0); nPara < nParaCount; nPara++) { - SfxItemSet aSet(pOutliner->GetParaAttribs(nPara)); - aSet.Put(rItem); - pOutliner->SetParaAttribs(nPara, aSet); - } - - if(!pEdtOutl) - { - if(nParaCount) - { - SfxItemSet aNewSet(pOutliner->GetParaAttribs(0)); - ImpForceItemSet(); - mpObjectItemSet->Put(aNewSet); - } - - OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount); - pOutliner->Clear(); - NbcSetOutlinerParaObject(pTemp); - } - } - } - - // Extra-Repaint wenn das Layout so radikal geaendert wird (#43139#) - if(rItem.Which() == SDRATTR_TEXT_CONTOURFRAME) - SendRepaintBroadcast(); - - // call parent - SdrAttrObj::SetItem(rItem); -} - -void SdrTextObj::ClearItem( USHORT nWhich ) -{ - // handle outliner attributes - if(pOutlinerParaObject) - { - if(!nWhich || (nWhich >= EE_CHAR_START && nWhich <= EE_CHAR_END)) - { - Outliner* pOutliner; - - if(!pEdtOutl) - { - pOutliner = &ImpGetDrawOutliner(); - pOutliner->SetText(*pOutlinerParaObject); - } - else - { - pOutliner = pEdtOutl; - } - - sal_uInt16 nParaCount((sal_uInt16)pOutliner->GetParagraphCount()); - for(sal_uInt16 nPara(0); nPara < nParaCount; nPara++) - { - if(nWhich) + if(pNewItem) { SfxItemSet aSet(pOutliner->GetParaAttribs(nPara)); - aSet.ClearItem(nWhich); + aSet.Put(*pNewItem); pOutliner->SetParaAttribs(nPara, aSet); } else { - pOutliner->SetParaAttribs(nPara, pOutliner->GetEmptyItemSet()); - pOutliner->QuickRemoveCharAttribs(nPara, 0); + if(nWhich) + { + SfxItemSet aSet(pOutliner->GetParaAttribs(nPara)); + aSet.ClearItem(nWhich); + pOutliner->SetParaAttribs(nPara, aSet); + } + else + { + pOutliner->SetParaAttribs(nPara, pOutliner->GetEmptyItemSet()); + pOutliner->QuickRemoveCharAttribs(nPara, 0); + } } } @@ -555,277 +306,19 @@ void SdrTextObj::ClearItem( USHORT nWhich ) NbcSetOutlinerParaObject(pTemp); } } - } - - // call parent - SdrAttrObj::ClearItem(nWhich); -} - -void SdrTextObj::SetItemSet(const SfxItemSet& rSet) -{ - // handle outliner attributes - if(pOutlinerParaObject) - { - Outliner* pOutliner; - - if(!pEdtOutl) - { - pOutliner = &ImpGetDrawOutliner(); - pOutliner->SetText(*pOutlinerParaObject); - } - else - { - pOutliner = pEdtOutl; - } - - sal_uInt16 nParaCount((sal_uInt16)pOutliner->GetParagraphCount()); - for(sal_uInt16 nPara(0); nPara < nParaCount; nPara++) - { - SfxItemSet aSet(pOutliner->GetParaAttribs(nPara)); - aSet.Put(rSet); - pOutliner->SetParaAttribs(nPara, aSet); - } - if(!pEdtOutl) - { - if(nParaCount) - { - SfxItemSet aNewSet(pOutliner->GetParaAttribs(0)); - ImpForceItemSet(); - mpObjectItemSet->Put(aNewSet); - } - - OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount); - pOutliner->Clear(); - NbcSetOutlinerParaObject(pTemp); - } + // Extra-Repaint wenn das Layout so radikal geaendert wird (#43139#) + if(nWhich == SDRATTR_TEXT_CONTOURFRAME) + SendRepaintBroadcast(); } - // Extra-Repaint wenn das Layout so radikal geaendert wird (#43139#) - if(SFX_ITEM_SET == rSet.GetItemState(SDRATTR_TEXT_CONTOURFRAME)) - SendRepaintBroadcast(); - // call parent - SdrAttrObj::SetItemSet(rSet); + SdrAttrObj::ItemChange(nWhich, pNewItem); } -void SdrTextObj::ImpCheckItemSetChanges(const SfxItemSet& rAttr) -{ -/* BOOL bReplaceAll = TRUE; - BOOL bCreateLRSpaceItems(FALSE); - const SfxItemSet& rSet = GetItemSet(); - - if(SFX_ITEM_ON == rAttr.GetItemState(EE_PARA_LRSPACE)) - { - // SvxLRSpaceItem hart gesetzt: SvxNumBulletItem anpassen - if(rSet.GetItemState(EE_PARA_LRSPACE) != SFX_ITEM_ON - || ((const SvxLRSpaceItem&)rSet.Get(EE_PARA_LRSPACE)) - != ((const SvxLRSpaceItem&)rAttr.Get(EE_PARA_LRSPACE))) - { - SvxNumBulletItem* pNumBullet = NULL; - - if(SFX_ITEM_ON == rAttr.GetItemState(EE_PARA_NUMBULLET)) - { - pNumBullet = new SvxNumBulletItem((const SvxNumBulletItem&)rAttr.Get(EE_PARA_NUMBULLET)); - } - else - { - pNumBullet = new SvxNumBulletItem((const SvxNumBulletItem&)rSet.Get(EE_PARA_NUMBULLET)); - - if(OBJ_OUTLINETEXT == eTextKind - && pNumBullet->GetNumRule()->GetNumRuleType() != SVX_RULETYPE_PRESENTATION_NUMBERING) - { - // Das ist das 10er-Item aus den Defaults. - // Dieses darf bei Gliederungsobjekten nicht verwendet werden! - // Daher wird das Item aus der Vorlage geholt - delete pNumBullet; - pNumBullet = NULL; - - if(GetStyleSheet() - && SFX_ITEM_ON == GetStyleSheet()->GetItemSet().GetItemState(EE_PARA_NUMBULLET)) - { - pNumBullet = new SvxNumBulletItem((const SvxNumBulletItem&) - GetStyleSheet()->GetItemSet().Get(EE_PARA_NUMBULLET)); - } - } - } - - if(pNumBullet) - { - sal_uInt16 nLevel(0); - - if(pNumBullet->GetNumRule()->GetNumRuleType() == SVX_RULETYPE_PRESENTATION_NUMBERING) - nLevel = 1; - - EditEngine::ImportBulletItem(*pNumBullet, nLevel, NULL, - &(const SvxLRSpaceItem&)rAttr.Get(EE_PARA_LRSPACE)); - - ((SfxItemSet&)rAttr).Put(*pNumBullet); - - delete pNumBullet; - } - else - DBG_ASSERT(FALSE, "SdrTextObj::NbcSetAttributes: SvxNumBulletItem nicht angepasst!"); - } - } - else if(SFX_ITEM_ON == rAttr.GetItemState(EE_PARA_NUMBULLET)) - { - // SvxNumBulletItem hart gesetzt: SvxLRSpaceItem anpassen - SfxItemSet aSet(*rAttr.GetPool(), - EE_PARA_NUMBULLET, EE_PARA_NUMBULLET, - 0, 0); - aSet.Put(rSet); - - if(SFX_ITEM_ON != aSet.GetItemState(EE_PARA_NUMBULLET) - || ((const SvxNumBulletItem&)aSet.Get(EE_PARA_NUMBULLET)) - != ((const SvxNumBulletItem&) rAttr.Get(EE_PARA_NUMBULLET))) - { - SvxLRSpaceItem aLRSpace((const SvxLRSpaceItem&)aSet.Get(EE_PARA_LRSPACE)); - sal_uInt16 nLevel(0); - - if(eTextKind == OBJ_OUTLINETEXT) - nLevel = 1; - - if(Outliner::CreateLRSpaceItem((const SvxNumBulletItem&)rAttr.Get(EE_PARA_NUMBULLET), nLevel, aLRSpace)) - ((SfxItemSet&)rAttr).Put(aLRSpace); - - bCreateLRSpaceItems = TRUE; - } - } - - if(rAttr.GetItemState(SDRATTR_TEXT_CONTOURFRAME) == SFX_ITEM_ON) - { - // Extra-Repaint wenn das Layout so radikal geaendert wird (#43139#) - SendRepaintBroadcast(); - - if(IsTextEditActive()) - { - // Text wird gerade editiert, zusaetzlich redraw auf EditText - const EditEngine& rEditEng = pEdtOutl->GetEditEngine(); - for(sal_uInt16 a(0); a < rEditEng.GetViewCount(); a++) - { - EditView* pEdView = rEditEng.GetView(a); - if(pEdView) - pEdView->Invalidate(); - } - } - } - - BOOL bGrowChecked(FALSE); - // Attribute auf den gesamten Text anwenden - if(pOutlinerParaObject) - { - if((!pEdtOutl || bCreateLRSpaceItems) && !IsLinkedText()) - { - // #46762# Sonderbehandlung fuer bReplaceAll - if(SearchOutlinerItems(rAttr, bReplaceAll)) - { - Outliner* pOutliner; - - if(!pEdtOutl) - { - pOutliner = &ImpGetDrawOutliner(); - pOutliner->SetText(*pOutlinerParaObject); - } - else - { - pOutliner = pEdtOutl; - } - - sal_uInt16 nParaCount((USHORT)pOutliner->GetParagraphCount()); - - if(nParaCount) - { - for(sal_uInt16 nPara(0); nPara < nParaCount; nPara++) - { - // Neue Attribute mit alten (bereits vorhandenen) mergen - SfxItemSet aTmpSet(pOutliner->GetParaAttribs(nPara)); - SvxLRSpaceItem aLRSpace((const SvxLRSpaceItem&)aTmpSet.Get(EE_PARA_LRSPACE)); - - if(!pEdtOutl) - { - if(bReplaceAll) - { - // #46762#: bReplaceAll beachten - SfxWhichIter aIter(rAttr); - sal_uInt16 nWh(aIter.FirstWhich()); - - while(nWh) - { - if(nWh >= EE_ITEMS_START && nWh <= EE_ITEMS_END) - { - SfxItemState eState = rAttr.GetItemState(nWh, FALSE); - if(eState == SFX_ITEM_DEFAULT) - aTmpSet.ClearItem(nWh); - } - nWh = aIter.NextWhich(); - } - } - aTmpSet.Put(rAttr, FALSE); // FALSE= InvalidItems nicht als Default, sondern als "Loecher" betrachten - } - - if(bCreateLRSpaceItems) - { - const sal_Int16 nLevel(pOutliner->GetDepth(nPara)); - - if( Outliner::CreateLRSpaceItem((const SvxNumBulletItem&)rAttr.Get(EE_PARA_NUMBULLET), nLevel, aLRSpace)) - aTmpSet.Put(aLRSpace); - } - - pOutliner->SetParaAttribs(nPara, aTmpSet); - - if(!pEdtOutl) - { - // Fuer alle hinzugekommenen Attribute: - // entsprechende CharAttribs entfernen. - if(bReplaceAll) - { - if(!rAttr.Count() && !aTmpSet.Count()) - { - // Format -> Standard - pOutliner->QuickRemoveCharAttribs(nPara, 0); - } - else - { - SfxItemIter aIter(aTmpSet); - const SfxPoolItem* pItem = aIter.FirstItem(); - - while(pItem) - { - if (!IsInvalidItem(pItem)) - { - sal_uInt16 nW(pItem->Which()); - - if(nW >= EE_CHAR_START && nW <= EE_CHAR_END) - pOutliner->QuickRemoveCharAttribs(nPara, nW); - } - pItem = aIter.NextItem(); - } - } - } - } - } - - if(!pEdtOutl) - { - OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount); - pOutliner->Clear(); - NbcSetOutlinerParaObject(pTemp); - } - - bGrowChecked = TRUE; - } - } - } - - // #36989#: AutoGrow auch bei TextEdit - if(bTextFrame && !bGrowChecked) - { - NbcAdjustTextFrameWidthAndHeight(); - bGrowChecked = TRUE; - } - }*/ -} +//void SdrTextObj::ImpCheckItemSetChanges(const SfxItemSet& rAttr) +//{ +//} //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1121,8 +614,6 @@ void SdrTextObj::NbcResizeTextAttributes(const Fraction& xFact, const Fraction& if (nY>0xFFFF) nY=0xFFFF; if (nX!=100 || nY!=100) { -//-/ if(mpObjectItemSet) -//-/ { // Rahmenattribute const SfxItemSet& rSet = GetItemSet(); const SvxFontWidthItem& rOldWdt=(SvxFontWidthItem&)rSet.Get(EE_CHAR_FONTWIDTH); @@ -1151,12 +642,6 @@ void SdrTextObj::NbcResizeTextAttributes(const Fraction& xFact, const Fraction& // und nun attributieren SetItem(SvxFontWidthItem((USHORT)nAbsWdt,(USHORT)nRelWdt)); SetItem(SvxFontHeightItem(nAbsHgt,(USHORT)nRelHgt)); -//-/ SdrOutlinerSetItem aNewOI(*pOutlAttr); -//-/ SfxItemSet& rNewSet=aNewOI.GetItemSet(); -//-/ rNewSet.Put(SvxFontWidthItem((USHORT)nAbsWdt,(USHORT)nRelWdt)); -//-/ rNewSet.Put(SvxFontHeightItem(nAbsHgt,(USHORT)nRelHgt)); -//-/ pOutlAttr=(SdrOutlinerSetItem*)ImpSetNewAttr(pOutlAttr,&aNewOI); -//-/ } // Zeichen- und Absatzattribute innerhalb des OutlinerParaObjects Outliner& rOutliner=ImpGetDrawOutliner(); rOutliner.SetPaperSize(Size(LONG_MAX,LONG_MAX)); @@ -1168,4 +653,3 @@ void SdrTextObj::NbcResizeTextAttributes(const Fraction& xFact, const Fraction& } } } - diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 19621dfef1cb..07470bfb47ed 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdotxed.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:11:37 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -137,8 +137,6 @@ FASTBOOL SdrTextObj::BegTextEdit(SdrOutliner& rOutl) // werden, da sonst bei SetParaAttribs() auch alle in diesem // Parent enthaltenen Items hart am Absatz attributiert werden. // -> BugID 22467 -//-/ if(mpObjectItemSet) -//-/ { const SfxItemSet& rSet = GetItemSet(); SdrOutlinerSetItem aOutlSetItem(rSet.GetPool()); aOutlSetItem.GetItemSet().Put(rSet); @@ -147,7 +145,6 @@ FASTBOOL SdrTextObj::BegTextEdit(SdrOutliner& rOutl) ((SfxItemSet*)pTmpSet)->SetParent(NULL); rOutl.SetParaAttribs(0,*pTmpSet); ((SfxItemSet*)pTmpSet)->SetParent(pParentMerk); -//-/ } } } if (bFitToSize) { diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx index 6dcba38b12f9..716ca5e2130b 100644 --- a/svx/source/svdraw/svdotxtr.cxx +++ b/svx/source/svdraw/svdotxtr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdotxtr.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:11:37 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -385,9 +385,6 @@ void SdrTextObj::ImpConvertSetAttrAndLayer(SdrObject* pObj, FASTBOOL bNoSetAttr) if (pModel!=NULL) { pObj->SetModel(pModel); if (!bNoSetAttr) { -//-/ SfxItemSet aItemSet((SfxItemPool&)(*GetItemPool())); -//-/ TakeAttributes(aItemSet,FALSE,TRUE); -//-/ pObj->SetAttributes(aItemSet,TRUE); SdrBroadcastItemChange aItemChange(*pObj); pObj->ClearItem(); pObj->SetItemSet(GetItemSet()); diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index a48a0c4559d4..cda56333c4ed 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdouno.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:11:37 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -335,15 +335,11 @@ FASTBOOL SdrUnoObj::Paint(ExtOutputDevice& rXOut, const SdrPaintInfoRec& rInfoRe const SfxItemSet& rSet = GetItemSet(); // perepare ItemSet to avoid old XOut filling -//-/ XFillAttrSetItem aFillAttrSet(rSet.GetPool()); SfxItemSet aEmptySet(*rSet.GetPool()); aEmptySet.Put(XFillStyleItem(XFILL_NONE)); rXOut.SetFillAttr(aEmptySet); -//-/ if(mpObjectItemSet) -//-/ { rXOut.SetLineAttr(rSet); -//-/ } rXOut.DrawRect( aRect ); } diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index a6aa6e08cee9..c06849754f75 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdovirt.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2000-11-07 12:58:28 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -158,11 +158,6 @@ void SdrVirtObj::RecalcBoundRect() aOutRect+=aAnchor; } -//-/void SdrVirtObj::SendRepaintBroadcast(FASTBOOL bNoPaintNeeded) const -//-/{ -//-/ SdrObject::SendRepaintBroadcast(bNoPaintNeeded); -//-/} - void SdrVirtObj::SetChanged() { SdrObject::SetChanged(); @@ -566,33 +561,24 @@ void SdrVirtObj::SetGeoData(const SdrObjGeoData& rGeo) } //////////////////////////////////////////////////////////////////////////////////////////////////// - -//-/void SdrVirtObj::TakeAttributes(SfxItemSet& rAttr, FASTBOOL bMerge, FASTBOOL bOnlyHardAttr) const -//-/{ -//-/ rRefObj.TakeAttributes(rAttr,bMerge,bOnlyHardAttr); -//-/} - -//-/void SdrVirtObj::NbcSetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ rRefObj.NbcSetAttributes(rAttr,bReplaceAll); -//-/} - -//-/void SdrVirtObj::SetAttributes(const SfxItemSet& rAttr, FASTBOOL bReplaceAll) -//-/{ -//-/ rRefObj.SetAttributes(rAttr,bReplaceAll); -//-/} +// ItemSet access const SfxItemSet& SdrVirtObj::GetItemSet() const { return rRefObj.GetItemSet(); } +SfxItemSet* SdrVirtObj::CreateNewItemSet(SfxItemPool& rPool) +{ + return rRefObj.CreateNewItemSet(rPool); +} + void SdrVirtObj::SetItem( const SfxPoolItem& rItem ) { rRefObj.SetItem(rItem); } -void SdrVirtObj::ClearItem( USHORT nWhich ) +void SdrVirtObj::ClearItem( const sal_uInt16 nWhich ) { rRefObj.ClearItem(nWhich); } @@ -607,9 +593,21 @@ void SdrVirtObj::BroadcastItemChange(const SdrBroadcastItemChange& rChange) rRefObj.BroadcastItemChange(rChange); } -SfxItemSet* SdrVirtObj::CreateNewItemSet(SfxItemPool& rPool) +//////////////////////////////////////////////////////////////////////////////////////////////////// +// private support routines for ItemSet access +BOOL SdrVirtObj::AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem) const { - return rRefObj.CreateNewItemSet(rPool); + return rRefObj.AllowItemChange(nWhich, pNewItem); +} + +void SdrVirtObj::ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem) +{ + rRefObj.ItemChange(nWhich, pNewItem); +} + +void SdrVirtObj::PostItemChange(const sal_uInt16 nWhich) +{ + rRefObj.PostItemChange(nWhich); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index a1ee83f316c9..7849e9678434 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdpage.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: cl $ $Date: 2000-11-26 23:01:36 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -931,8 +931,6 @@ void SdrObjList::RestartAllAnimations(SdrPageView* pPageView) const FASTBOOL SdrObjList::ImpGetFillColor(SdrObject* pObj, Color& rCol) const { -//-/ SfxItemSet aSet(pModel->GetItemPool()); -//-/ pObj->TakeAttributes(aSet,FALSE,FALSE); return GetDraftFillColor(pObj->GetItemSet(),rCol); } diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index 81f5f163f237..0ca7add0777c 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdpagv.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: fs $ $Date: 2001-01-05 16:54:08 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1330,8 +1330,6 @@ FASTBOOL SdrPageView::MasterShouldBeCached(const SdrPage* pPg) const if (!bYes) bYes=pObj->GetSubList()!=NULL; // Und nun Attribute Checken if (!bYes) { -//-/ SfxItemSet aSet(rView.pMod->GetItemPool()); -//-/ pObj->TakeAttributes(aSet,FALSE,FALSE); const SfxItemSet& rSet = pObj->GetItemSet(); XLineStyle eLineStyle=((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue(); XFillStyle eFillStyle=((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue(); diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 01370097aa76..9ca3fa674845 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdundo.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:11:37 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -292,51 +292,62 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, FASTBOOL bStyleSheet1, FASTBO pUndoGroup(NULL), bHaveToTakeRedoSet(TRUE) { - bStyleSheet=bStyleSheet1; - -//-/ pUndoSet=new SfxItemSet(rNewObj.GetModel()->GetUndoItemPool()); -//-/ pRedoSet=new SfxItemSet(rNewObj.GetModel()->GetUndoItemPool()); -//-/ pUndoSet = rNewObj.CreateNewItemSet(rNewObj.GetModel()->GetUndoItemPool()); -//-/ pRedoSet = rNewObj.CreateNewItemSet(rNewObj.GetModel()->GetUndoItemPool()); + bStyleSheet = bStyleSheet1; pUndoSet = rNewObj.CreateNewItemSet(*((SfxItemPool*)SdrObject::GetGlobalDrawObjectItemPool())); pRedoSet = rNewObj.CreateNewItemSet(*((SfxItemPool*)SdrObject::GetGlobalDrawObjectItemPool())); - SdrObjList* pOL=rNewObj.GetSubList(); - if (pOL!=NULL && pOL->GetObjCount()) { // Aha, Gruppenobjekt - pUndoGroup=new SdrUndoGroup(*pObj->GetModel()); - ULONG nObjAnz=pOL->GetObjCount(); - for (ULONG nObjNum=0; nObjNum<nObjAnz; nObjNum++) { - pUndoGroup->AddAction(new SdrUndoAttrObj(*pOL->GetObj(nObjNum),bStyleSheet1)); + SdrObjList* pOL = rNewObj.GetSubList(); + BOOL bIsGroup(pOL!=NULL && pOL->GetObjCount()); + BOOL bIs3DScene(bIsGroup && pObj->ISA(E3dScene)); + + if(bIsGroup) + { + // Aha, Gruppenobjekt + pUndoGroup = new SdrUndoGroup(*pObj->GetModel()); + sal_uInt32 nObjAnz(pOL->GetObjCount()); + + for(sal_uInt32 nObjNum(0); nObjNum < nObjAnz; nObjNum++) + { + pUndoGroup->AddAction( + new SdrUndoAttrObj(*pOL->GetObj(nObjNum), bStyleSheet1)); } } - else + + if(!bIsGroup || bIs3DScene) { -//-/ pObj->TakeAttributes(*pUndoSet,FALSE,TRUE); pUndoSet->Put(pObj->GetItemSet()); - if (bStyleSheet) pUndoStyleSheet=pObj->GetStyleSheet(); - if (bSaveText) { - pTextUndo=pObj->GetOutlinerParaObject(); - if (pTextUndo!=NULL) pTextUndo=pTextUndo->Clone(); + if(bStyleSheet) + pUndoStyleSheet = pObj->GetStyleSheet(); + + if(bSaveText) + { + pTextUndo = pObj->GetOutlinerParaObject(); + if(pTextUndo) + pTextUndo = pTextUndo->Clone(); } } } __EXPORT SdrUndoAttrObj::~SdrUndoAttrObj() { - if (pUndoSet!=NULL) delete pUndoSet; - if (pRedoSet!=NULL) delete pRedoSet; - if (pRepeatSet!=NULL) delete pRepeatSet; - if (pUndoGroup!=NULL) delete pUndoGroup; - if (pTextUndo !=NULL) delete pTextUndo; + if(pUndoSet) + delete pUndoSet; + if(pRedoSet) + delete pRedoSet; + if(pRepeatSet) + delete pRepeatSet; + if(pUndoGroup) + delete pUndoGroup; + if(pTextUndo) + delete pTextUndo; } void SdrUndoAttrObj::SetRepeatAttr(const SfxItemSet& rSet) { - if (pRepeatSet!=NULL) delete pRepeatSet; + if(pRepeatSet) + delete pRepeatSet; -//-/ pRepeatSet=new SfxItemSet(pObj->GetModel()->GetUndoItemPool()); -//-/ pRepeatSet = pObj->CreateNewItemSet(pObj->GetModel()->GetUndoItemPool()); pRepeatSet = pObj->CreateNewItemSet(*((SfxItemPool*)SdrObject::GetGlobalDrawObjectItemPool())); pRepeatSet->Put(rSet); @@ -344,83 +355,107 @@ void SdrUndoAttrObj::SetRepeatAttr(const SfxItemSet& rSet) void __EXPORT SdrUndoAttrObj::Undo() { - if (pUndoGroup!=NULL) { - pUndoGroup->Undo(); - } else { - if (bHaveToTakeRedoSet) { - bHaveToTakeRedoSet=FALSE; + BOOL bIs3DScene(pObj && pObj->ISA(E3dScene)); -//-/ pObj->TakeAttributes(*pRedoSet,FALSE,TRUE); + if(!pUndoGroup || bIs3DScene) + { + if(bHaveToTakeRedoSet) + { + bHaveToTakeRedoSet = FALSE; pRedoSet->Put(pObj->GetItemSet()); - - if (bStyleSheet) pRedoStyleSheet=pObj->GetStyleSheet(); + if(bStyleSheet) + pRedoStyleSheet=pObj->GetStyleSheet(); } - if (bStyleSheet) { - pRedoStyleSheet=pObj->GetStyleSheet(); - pObj->SetStyleSheet(pUndoStyleSheet,TRUE); + + if(bStyleSheet) + { + pRedoStyleSheet = pObj->GetStyleSheet(); + pObj->SetStyleSheet(pUndoStyleSheet, TRUE); } -//-/ pObj->SetAttributes(*pUndoSet,TRUE); SdrBroadcastItemChange aItemChange(*pObj); pObj->ClearItem(); pObj->SetItemSet(*pUndoSet); pObj->BroadcastItemChange(aItemChange); - if (pTextUndo!=NULL) { + if(pTextUndo) + { pObj->SetOutlinerParaObject(pTextUndo->Clone()); } } + + if(pUndoGroup) + { + pUndoGroup->Undo(); + } } void __EXPORT SdrUndoAttrObj::Redo() { - if (pUndoGroup!=NULL) { - pUndoGroup->Redo(); - } else { - if (bStyleSheet) { - pUndoStyleSheet=pObj->GetStyleSheet(); - pObj->SetStyleSheet(pRedoStyleSheet,TRUE); + BOOL bIs3DScene(pObj && pObj->ISA(E3dScene)); + + if(!pUndoGroup || bIs3DScene) + { + if(bStyleSheet) + { + pUndoStyleSheet = pObj->GetStyleSheet(); + pObj->SetStyleSheet(pRedoStyleSheet, TRUE); } -//-/ pObj->SetAttributes(*pRedoSet,TRUE); SdrBroadcastItemChange aItemChange(*pObj); pObj->ClearItem(); pObj->SetItemSet(*pRedoSet); pObj->BroadcastItemChange(aItemChange); } + + if(pUndoGroup) + { + pUndoGroup->Redo(); + } } XubString __EXPORT SdrUndoAttrObj::GetComment() const { XubString aStr; - if (bStyleSheet) { - ImpTakeDescriptionStr(STR_EditSetStylesheet,aStr); - } else { - ImpTakeDescriptionStr(STR_EditSetAttributes,aStr); + + if(bStyleSheet) + { + ImpTakeDescriptionStr(STR_EditSetStylesheet, aStr); + } + else + { + ImpTakeDescriptionStr(STR_EditSetAttributes, aStr); } + return aStr; } void SdrUndoAttrObj::SdrRepeat(SdrView& rView) { - if (pRepeatSet!=NULL) { - rView.SetAttrToMarked(*pRepeatSet,FALSE); + if(pRepeatSet) + { + rView.SetAttrToMarked(*pRepeatSet, FALSE); } } FASTBOOL SdrUndoAttrObj::CanSdrRepeat(SdrView& rView) const { - return pRepeatSet!=NULL && rView.HasMarkedObj(); + return (pRepeatSet!=0L && rView.HasMarkedObj()); } XubString SdrUndoAttrObj::GetSdrRepeatComment(SdrView& rView) const { XubString aStr; - if (bStyleSheet) { - ImpTakeDescriptionStr(STR_EditSetStylesheet,aStr,TRUE); - } else { - ImpTakeDescriptionStr(STR_EditSetAttributes,aStr,TRUE); + + if(bStyleSheet) + { + ImpTakeDescriptionStr(STR_EditSetStylesheet, aStr, TRUE); + } + else + { + ImpTakeDescriptionStr(STR_EditSetAttributes, aStr, TRUE); } + return aStr; } @@ -556,12 +591,10 @@ void SdrUndoObjList::SetOwner(BOOL bNew) // Undo-Managers wechseln if(bNew) { -//-/ pObj->MigrateItemPool(&rMod.GetItemPool(), &rMod.GetUndoItemPool()); pObj->MigrateItemPool(&rMod.GetItemPool(), ((SfxItemPool*)SdrObject::GetGlobalDrawObjectItemPool())); } else { -//-/ pObj->MigrateItemPool(&rMod.GetUndoItemPool(), &rMod.GetItemPool()); pObj->MigrateItemPool(((SfxItemPool*)SdrObject::GetGlobalDrawObjectItemPool()), &rMod.GetItemPool()); pObj->SetStyleSheet(pObj->GetStyleSheet(), TRUE); } @@ -769,12 +802,10 @@ void SdrUndoReplaceObj::SetNewOwner(BOOL bNew) // Undo-Managers wechseln if(bNew) { -//-/ pNewObj->MigrateItemPool(&rMod.GetItemPool(), &rMod.GetUndoItemPool()); pNewObj->MigrateItemPool(&rMod.GetItemPool(), ((SfxItemPool*)SdrObject::GetGlobalDrawObjectItemPool())); } else { -//-/ pNewObj->MigrateItemPool(&rMod.GetUndoItemPool(), &rMod.GetItemPool()); pNewObj->MigrateItemPool(((SfxItemPool*)SdrObject::GetGlobalDrawObjectItemPool()), &rMod.GetItemPool()); } @@ -792,12 +823,10 @@ void SdrUndoReplaceObj::SetOldOwner(BOOL bNew) // Undo-Managers wechseln if(bNew) { -//-/ pObj->MigrateItemPool(&rMod.GetItemPool(), &rMod.GetUndoItemPool()); pObj->MigrateItemPool(&rMod.GetItemPool(), ((SfxItemPool*)SdrObject::GetGlobalDrawObjectItemPool())); } else { -//-/ pObj->MigrateItemPool(&rMod.GetUndoItemPool(), &rMod.GetItemPool()); pObj->MigrateItemPool(((SfxItemPool*)SdrObject::GetGlobalDrawObjectItemPool()), &rMod.GetItemPool()); } diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 7b5a9ae340c1..28c9b5a4be23 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdxcgv.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:11:37 $ + * last change: $Author: aw $ $Date: 2001-01-26 14:08:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -305,14 +305,12 @@ BOOL SdrExchangeView::Paste(const XubString& rStr, const Point& rPos, SdrObjList pObj->NbcSetText(rStr); // #32424# SetText vor SetAttr, weil SetAttr sonst unwirksam! if (pDefaultStyleSheet!=NULL) pObj->NbcSetStyleSheet(pDefaultStyleSheet,FALSE); -//-/ pObj->NbcSetAttributes(aDefaultAttr,FALSE); pObj->SetItemSet(aDefaultAttr); SfxItemSet aTempAttr(pMod->GetItemPool()); // Keine Fuellung oder Linie aTempAttr.Put(XLineStyleItem(XLINE_NONE)); aTempAttr.Put(XFillStyleItem(XFILL_NONE)); -//-/ pObj->NbcSetAttributes(aTempAttr, FALSE); pObj->SetItemSet(aTempAttr); pObj->FitFrameToTextSize(); @@ -351,14 +349,12 @@ BOOL SdrExchangeView::Paste(SvStream& rInput, USHORT eFormat, const Point& rPos, pObj->SetLayer(nLayer); if (pDefaultStyleSheet!=NULL) pObj->NbcSetStyleSheet(pDefaultStyleSheet,FALSE); -//-/ pObj->NbcSetAttributes(aDefaultAttr,FALSE); pObj->SetItemSet(aDefaultAttr); SfxItemSet aTempAttr(pMod->GetItemPool()); // Keine Fuellung oder Linie aTempAttr.Put(XLineStyleItem(XLINE_NONE)); aTempAttr.Put(XFillStyleItem(XFILL_NONE)); -//-/ pObj->NbcSetAttributes(aTempAttr, FALSE); pObj->SetItemSet(aTempAttr); pObj->NbcSetText(rInput,eFormat); |