diff options
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/makefile.mk | 2 | ||||
-rw-r--r-- | svx/source/svdraw/sdrmasterpagedescriptor.cxx | 47 | ||||
-rw-r--r-- | svx/source/svdraw/svdcrtmt.hxx | 32 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 57 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv.cxx | 97 | ||||
-rw-r--r-- | svx/source/svdraw/svdhdl.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 72 | ||||
-rw-r--r-- | svx/source/svdraw/svdocapt.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdogrp.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdoimp.cxx | 33 | ||||
-rw-r--r-- | svx/source/svdraw/svdoole2.cxx | 9 | ||||
-rw-r--r-- | svx/source/svdraw/svdopath.cxx | 12 | ||||
-rw-r--r-- | svx/source/svdraw/svdorect.cxx | 79 | ||||
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 1 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextpathdecomposition.cxx | 78 | ||||
-rw-r--r-- | svx/source/svdraw/svdpage.cxx | 215 | ||||
-rwxr-xr-x[-rw-r--r--] | svx/source/svdraw/svdpntv.cxx | 20 | ||||
-rw-r--r-- | svx/source/svdraw/svdscrol.cxx | 33 | ||||
-rw-r--r-- | svx/source/svdraw/svdscrol.hxx | 31 |
19 files changed, 424 insertions, 408 deletions
diff --git a/svx/source/svdraw/makefile.mk b/svx/source/svdraw/makefile.mk index 0108615b10dd..514c5b6d2cbc 100644 --- a/svx/source/svdraw/makefile.mk +++ b/svx/source/svdraw/makefile.mk @@ -113,8 +113,6 @@ LIB1OBJFILES= \ LIB2TARGET= $(SLB)$/$(TARGET).lib LIB2OBJFILES= \ - $(SLO)$/svdoimp.obj \ - $(SLO)$/svdscrol.obj \ $(SLO)$/ActionDescriptionProvider.obj \ $(SLO)$/impgrfll.obj diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx index 0ba4df9bf2be..6bcdd8f55856 100644 --- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx +++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx @@ -33,6 +33,8 @@ // #i42075# #include <svx/svdobj.hxx> +#include <svx/xfillit0.hxx> +#include <svl/itemset.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -73,7 +75,8 @@ namespace sdr { if(!mpViewContact) { - ((MasterPageDescriptor*)this)->mpViewContact = ((MasterPageDescriptor*)this)->CreateObjectSpecificViewContact(); + const_cast< MasterPageDescriptor* >(this)->mpViewContact = + const_cast< MasterPageDescriptor* >(this)->CreateObjectSpecificViewContact(); } return *mpViewContact; @@ -93,14 +96,6 @@ namespace sdr { maVisibleLayers = rNew; GetViewContact().ActionChanged(); - - // #i42075# For AFs convenience, do a change notify at the MasterPageBackgroundObject, too - SdrObject* pObject = GetBackgroundObject(); - - if(pObject) - { - pObject->BroadcastObjectChange(); - } } } @@ -119,40 +114,16 @@ namespace sdr || maVisibleLayers != rCandidate.maVisibleLayers); } - // #i42075# Get the correct BackgroundObject - SdrObject* MasterPageDescriptor::GetBackgroundObject() const + const SfxItemSet& MasterPageDescriptor::getCorrectFillAttributes() const { - SdrObject* pRetval = 0L; - const SdrPage& rMasterPage = GetUsedPage(); - - // Here i will rely on old knowledge about the 0'st element of a masterpage - // being the PageBackgroundObject. This will be removed again when that definition - // will be changed. -#ifdef DBG_UTIL - const sal_uInt32 nMasterPageObjectCount(rMasterPage.GetObjCount()); - DBG_ASSERT(1 <= nMasterPageObjectCount, - "MasterPageDescriptor::GetBackgroundObject(): MasterPageBackgroundObject missing (!)"); -#endif - pRetval = rMasterPage.GetObj(0L); - - // Test if it's really what we need. There are known problems where - // the 0th object is not the MasterPageBackgroundObject at all. - if(pRetval && !pRetval->IsMasterPageBackgroundObject()) - { - pRetval = 0L; - } - - // Get the evtl. existing page background object from the using page and use it - // preferred to the MasterPageBackgroundObject - const SdrPage& rOwnerPage = GetOwnerPage(); - SdrObject* pCandidate = rOwnerPage.GetBackgroundObj(); + const SfxItemSet& rOwnerPageAtributes = GetOwnerPage().getSdrPageProperties().GetItemSet(); - if(pCandidate) + if(XFILL_NONE != ((const XFillStyleItem&)rOwnerPageAtributes.Get(XATTR_FILLSTYLE)).GetValue()) { - pRetval = pCandidate; + return rOwnerPageAtributes; } - return pRetval; + return GetUsedPage().getSdrPageProperties().GetItemSet(); } } // end of namespace sdr diff --git a/svx/source/svdraw/svdcrtmt.hxx b/svx/source/svdraw/svdcrtmt.hxx deleted file mode 100644 index 0cf7642bf110..000000000000 --- a/svx/source/svdraw/svdcrtmt.hxx +++ /dev/null @@ -1,32 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVDCRTMT_HXX -#define _SVDCRTMT_HXX - -#endif //_SVDCRTMT_HXX - diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 9a0be80c50dc..d04bf8851795 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -66,7 +66,7 @@ #include <svx/sdr/contact/viewcontact.hxx> #include <svx/sdr/contact/displayinfo.hxx> #include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx> -#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx> +#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <svx/sdr/contact/objectcontact.hxx> #include "svditer.hxx" #include <svx/svdopath.hxx> @@ -75,13 +75,14 @@ #include <drawinglayer/primitive2d/transformprimitive2d.hxx> #include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx> #include <svx/sdr/primitive2d/sdrattributecreator.hxx> -#include <drawinglayer/attribute/sdrattribute.hxx> #include <svx/sdr/primitive2d/sdrdecompositiontools.hxx> #include <svx/svdoole2.hxx> #include <svx/svdovirt.hxx> #include <svx/svdouno.hxx> #include <svx/sdr/primitive2d/sdrprimitivetools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> +#include <drawinglayer/attribute/sdrlinestartendattribute.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -674,7 +675,7 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay createSdrDragEntries(); } - // if there are entries, derive OverlayObjects fromthe entries, including + // if there are entries, derive OverlayObjects from the entries, including // modification from current interactive state if(maSdrDragEntries.size()) { @@ -723,8 +724,8 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay if(aResultTransparent.hasElements()) { - drawinglayer::primitive2d::Primitive2DReference aUnifiedAlphaPrimitive2D(new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aResultTransparent, 0.5)); - aResultTransparent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlphaPrimitive2D, 1); + drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aResultTransparent, 0.5)); + aResultTransparent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparencePrimitive2D, 1); sdr::overlay::OverlayObject* pNewOverlayObject = new sdr::overlay::OverlayPrimitive2DSequenceObject(aResultTransparent); rOverlayManager.add(*pNewOverlayObject); @@ -819,38 +820,36 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverla // this polygon is a temporary calculated connector path, so it is not possible to fetch // the needed primitives directly from the pEdge object which does not get changed. If full // drag is on, use the SdrObjects ItemSet to create a adequate representation - if(getSolidDraggingActive()) - { - const SfxItemSet& rItemSet = pEdge->GetMergedItemSet(); - drawinglayer::attribute::SdrLineAttribute* pLine = drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet); - drawinglayer::attribute::SdrLineStartEndAttribute* pLineStartEnd = 0; + bool bUseSolidDragging(getSolidDraggingActive()); - if(pLine && !pLine->isVisible()) + if(bUseSolidDragging) + { + // switch off solid dragging if connector is not visible + if(!pEdge->HasLineStyle()) { - delete pLine; - pLine = 0; + bUseSolidDragging = false; } + } - if(pLine) - { - pLineStartEnd = drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(rItemSet, pLine->getWidth()); + if(bUseSolidDragging) + { + const SfxItemSet& rItemSet = pEdge->GetMergedItemSet(); + const drawinglayer::attribute::SdrLineAttribute aLine( + drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet)); - if(pLineStartEnd && !pLineStartEnd->isVisible()) - { - delete pLineStartEnd; - pLineStartEnd = 0; - } + if(!aLine.isDefault()) + { + const drawinglayer::attribute::SdrLineStartEndAttribute aLineStartEnd( + drawinglayer::primitive2d::createNewSdrLineStartEndAttribute( + rItemSet, + aLine.getWidth())); drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence( aRetval, drawinglayer::primitive2d::createPolygonLinePrimitive( - aEdgePolygon, basegfx::B2DHomMatrix(), *pLine, pLineStartEnd)); - - if(pLineStartEnd) - { - delete pLineStartEnd; - } - - delete pLine; + aEdgePolygon, + basegfx::B2DHomMatrix(), + aLine, + aLineStartEnd)); } } else diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index effddf73fd51..3b878ce93138 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -805,16 +805,101 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark) void SdrEditView::DeleteMarkedObj() { - if (GetMarkedObjectCount()) { - BrkAction(); - //HMHHideMarkHdl(); - BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE); + // moved breaking action and undo start outside loop + BrkAction(); + BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE); + + // remove as long as something is selected. This allows to schedule objects for + // removal for a next run as needed + while(GetMarkedObjectCount()) + { + // vector to remember the parents which may be empty after object removal + std::vector< SdrObject* > aParents; + + { + const SdrMarkList& rMarkList = GetMarkedObjectList(); + const sal_uInt32 nCount(rMarkList.GetMarkCount()); + sal_uInt32 a(0); + + for(a = 0; a < nCount; a++) + { + // in the first run, add all found parents, but only once + SdrMark* pMark = rMarkList.GetMark(a); + SdrObject* pObject = pMark->GetMarkedSdrObj(); + SdrObject* pParent = pObject->GetObjList()->GetOwnerObj(); + + if(pParent) + { + if(aParents.size()) + { + std::vector< SdrObject* >::iterator aFindResult = + std::find(aParents.begin(), aParents.end(), pParent); + + if(aFindResult == aParents.end()) + { + aParents.push_back(pParent); + } + } + else + { + aParents.push_back(pParent); + } + } + } + + if(aParents.size()) + { + // in a 2nd run, remove all objects which may already be scheduled for + // removal. I am not sure if this can happen, but theoretically + // a to-be-removed object may already be the group/3DScene itself + for(a = 0; a < nCount; a++) + { + SdrMark* pMark = rMarkList.GetMark(a); + SdrObject* pObject = pMark->GetMarkedSdrObj(); + + std::vector< SdrObject* >::iterator aFindResult = + std::find(aParents.begin(), aParents.end(), pObject); + + if(aFindResult != aParents.end()) + { + aParents.erase(aFindResult); + } + } + } + } + + // original stuff: remove selected objects. Handle clear will + // do something only once DeleteMarkedList(GetMarkedObjectList()); GetMarkedObjectListWriteAccess().Clear(); aHdl.Clear(); - EndUndo(); - MarkListHasChanged(); + + while(aParents.size() && !GetMarkedObjectCount()) + { + // iterate over remembered parents + SdrObject* pParent = aParents.back(); + aParents.pop_back(); + + if(pParent->GetSubList() && 0 == pParent->GetSubList()->GetObjCount()) + { + // we detected an empty parent, a candidate to leave group/3DScene + // if entered + if(GetSdrPageView()->GetAktGroup() + && GetSdrPageView()->GetAktGroup() == pParent) + { + GetSdrPageView()->LeaveOneGroup(); + } + + // schedule empty parent for removal + GetMarkedObjectListWriteAccess().InsertEntry( + SdrMark(pParent, GetSdrPageView())); + } + } } + + // end undo and change messaging moved at the end + EndUndo(); + MarkListHasChanged(); } void SdrEditView::CopyMarkedObj() diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 46bd31768c93..3d90eae6d68c 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -281,13 +281,13 @@ SdrHdlBitmapSet& getSimpleSet() SdrHdlBitmapSet& getModernSet() { - static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_MARKERS)); + static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_FINE_MARKERS)); return *aModernSet.get(); } SdrHdlBitmapSet& getHighContrastSet() { - static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_MARKERS)); + static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_ACCESSIBILITY_MARKERS)); return *aHighContrastSet.get(); } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index d44b44210ca0..1c534fbcbe98 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -47,7 +47,6 @@ #include <svx/svdpage.hxx> #include <svx/svdovirt.hxx> // Fuer Add/Del Ref #include <svx/svdview.hxx> // fuer Dragging (Ortho abfragen) -#include "svdscrol.hxx" #include "svdglob.hxx" // StringCache #include "svdstr.hrc" // Objektname #include <svx/svdogrp.hxx> // Factory @@ -326,7 +325,8 @@ sdr::properties::BaseProperties& SdrObject::GetProperties() const { if(!mpProperties) { - ((SdrObject*)this)->mpProperties = ((SdrObject*)this)->CreateObjectSpecificProperties(); + const_cast< SdrObject* >(this)->mpProperties = + const_cast< SdrObject* >(this)->CreateObjectSpecificProperties(); } return *mpProperties; @@ -361,7 +361,8 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const { if(!mpViewContact) { - ((SdrObject*)this)->mpViewContact = ((SdrObject*)this)->CreateObjectSpecificViewContact(); + const_cast< SdrObject* >(this)->mpViewContact = + const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact(); } return *mpViewContact; @@ -370,51 +371,6 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const // DrawContact support: Methods for handling Object changes void SdrObject::ActionChanged() const { - // Forward change call to MasterPageDescriptor if BackgroundObject was changed - const SdrPage* pObjectsPage = GetPage(); - - if(pObjectsPage) - { - // do the necessary ActionChange() forwards when a MasterPageBackgroundObject - // gets changed. This can be removed as soon as the MasterPageBackgroundObject - // handling is replaced with the proper ItemSet handling at the SdrPages. The - // needed ActionChanged calls will then be triggered by changing those ItemSets. - if(pObjectsPage->IsMasterPage()) - { - if(IsMasterPageBackgroundObject()) - { - SdrModel* pObjectsModel = GetModel(); - - if(pObjectsModel) - { - const sal_uInt16 nCount(pObjectsModel->GetPageCount()); - - for(sal_uInt16 a(0); a < nCount; a++) - { - const SdrPage* pUserPage = pObjectsModel->GetPage(a); - - if(pUserPage && pUserPage->TRG_HasMasterPage()) - { - SdrPage& rUsedMasterPage = pUserPage->TRG_GetMasterPage(); - - if(&rUsedMasterPage == pObjectsPage) - { - pUserPage->TRG_GetMasterPageDescriptorViewContact().ActionChanged(); - } - } - } - } - } - } - else - { - if(pObjectsPage->TRG_HasMasterPage() && pObjectsPage->GetBackgroundObj() == this) - { - pObjectsPage->TRG_GetMasterPageDescriptorViewContact().ActionChanged(); - } - } - } - // Do necessary ViewContact actions GetViewContact().ActionChanged(); } @@ -3112,26 +3068,6 @@ void SdrObject::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const ba SetSnapRect(aBaseRect); } -// #111111# -// Needed again and again i will now add a test for finding out if -// this object is the BackgroundObject of the page. -sal_Bool SdrObject::IsMasterPageBackgroundObject() const -{ - if(pObjList - && pObjList == pPage - && pPage->IsMasterPage() - && pObjList->GetObj(0) == this - && 1L == (pPage->GetPageNum() % 2)) - { - // 0'th object, directly on page, page is MasterPage, - // MasterPagePageNum is 1,3,5,... - // --> It's the background object (!) - return sal_True; - } - - return sal_False; -} - // #116168# // Give info if object is in destruction sal_Bool SdrObject::IsInDestruction() const diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 861ca038fd89..b92157823081 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -843,7 +843,7 @@ void SdrCaptionObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons } // geometry access -::basegfx::B2DPolygon SdrCaptionObj::getTailPolygon() const +basegfx::B2DPolygon SdrCaptionObj::getTailPolygon() const { return aTailPoly.getB2DPolygon(); } diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index adf3379a0330..4060369f8016 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -80,7 +80,7 @@ sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties() { - return new sdr::properties::GroupProperties((SdrObject&)(*this)); + return new sdr::properties::GroupProperties(*this); } ////////////////////////////////////////////////////////////////////////////// @@ -163,6 +163,12 @@ void SdrObjGroup::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const } +void SdrObjGroup::SetBoundRectDirty() +{ + // avoid resetting aOutRect which in case of this object is model data, + // not re-creatable view data +} + UINT16 SdrObjGroup::GetObjIdentifier() const { return UINT16(OBJ_GRUP); diff --git a/svx/source/svdraw/svdoimp.cxx b/svx/source/svdraw/svdoimp.cxx deleted file mode 100644 index 7b7fa2652017..000000000000 --- a/svx/source/svdraw/svdoimp.cxx +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" -#include <svdoimp.hxx> - -/////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index efafebc62759..88d9aba87673 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -85,6 +85,7 @@ #include <svtools/chartprettypainter.hxx> #include <svx/sdr/contact/viewcontactofsdrole2obj.hxx> #include <svx/svdograf.hxx> +#include <svx/sdr/properties/oleproperties.hxx> // #i100710# #include <svx/xlnclit.hxx> @@ -732,6 +733,14 @@ static bool ImplIsMathObj( const uno::Reference < embed::XEmbeddedObject >& rObj } ////////////////////////////////////////////////////////////////////////////// +// BaseProperties section + +sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties() +{ + return new sdr::properties::OleProperties(*this); +} + +////////////////////////////////////////////////////////////////////////////// // DrawContact section sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact() diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 3278b93a6338..2b495725c006 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -76,6 +76,7 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); } #include <svx/sdr/attribute/sdrtextattribute.hxx> #include <svx/sdr/primitive2d/sdrattributecreator.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <svx/sdr/attribute/sdrformtextattribute.hxx> using namespace sdr; @@ -2741,13 +2742,10 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index) SdrObject* SdrPathObj::DoConvertToPolyObj(BOOL bBezier) const { // #i89784# check for FontWork with activated HideContour - bool bHideContour(false); - - { - drawinglayer::attribute::SdrTextAttribute* pText = drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0)); - bHideContour = pText && pText->getSdrFormTextAttribute() && pText->isHideContour(); - delete pText; - } + const drawinglayer::attribute::SdrTextAttribute aText( + drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0))); + const bool bHideContour( + !aText.isDefault() && !aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour()); SdrObject* pRet = bHideContour ? 0 : diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index 1c9075d46886..b03dbf5b903a 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -316,50 +316,67 @@ void SdrRectObj::NbcSetLogicRect(const Rectangle& rRect) sal_uInt32 SdrRectObj::GetHdlCount() const { - return 9L; + return IsTextFrame() ? 10 : 9; } SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const { - SdrHdl* pH=NULL; + SdrHdl* pH = NULL; Point aPnt; - SdrHdlKind eKind=HDL_MOVE; - if( IsTextFrame() && !nHdlNum ) + SdrHdlKind eKind = HDL_MOVE; + + if(!IsTextFrame()) { - pH=new ImpTextframeHdl(aRect); - pH->SetObj((SdrObject*)this); - pH->SetDrehWink(aGeo.nDrehWink); - return pH; + nHdlNum++; } - else + + switch(nHdlNum) { - switch (nHdlNum) { - case 0: { - long a=GetEckenradius(); - long b=Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert - if (a>b) a=b; - if (a<0) a=0; - aPnt=aRect.TopLeft(); - aPnt.X()+=a; - eKind=HDL_CIRC; - } break; // Eckenradius - case 1: aPnt=aRect.TopLeft(); eKind=HDL_UPLFT; break; // Oben links - case 2: aPnt=aRect.TopCenter(); eKind=HDL_UPPER; break; // Oben - case 3: aPnt=aRect.TopRight(); eKind=HDL_UPRGT; break; // Oben rechts - case 4: aPnt=aRect.LeftCenter(); eKind=HDL_LEFT ; break; // Links - case 5: aPnt=aRect.RightCenter(); eKind=HDL_RIGHT; break; // Rechts - case 6: aPnt=aRect.BottomLeft(); eKind=HDL_LWLFT; break; // Unten links - case 7: aPnt=aRect.BottomCenter(); eKind=HDL_LOWER; break; // Unten - case 8: aPnt=aRect.BottomRight(); eKind=HDL_LWRGT; break; // Unten rechts + case 0: + { + pH = new ImpTextframeHdl(aRect); + pH->SetObj((SdrObject*)this); + pH->SetDrehWink(aGeo.nDrehWink); + break; + } + case 1: + { + long a = GetEckenradius(); + long b = Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert + if (a>b) a=b; + if (a<0) a=0; + aPnt=aRect.TopLeft(); + aPnt.X()+=a; + eKind = HDL_CIRC; + break; } + case 2: aPnt=aRect.TopLeft(); eKind = HDL_UPLFT; break; // Oben links + case 3: aPnt=aRect.TopCenter(); eKind = HDL_UPPER; break; // Oben + case 4: aPnt=aRect.TopRight(); eKind = HDL_UPRGT; break; // Oben rechts + case 5: aPnt=aRect.LeftCenter(); eKind = HDL_LEFT ; break; // Links + case 6: aPnt=aRect.RightCenter(); eKind = HDL_RIGHT; break; // Rechts + case 7: aPnt=aRect.BottomLeft(); eKind = HDL_LWLFT; break; // Unten links + case 8: aPnt=aRect.BottomCenter(); eKind = HDL_LOWER; break; // Unten + case 9: aPnt=aRect.BottomRight(); eKind = HDL_LWRGT; break; // Unten rechts } - if (aGeo.nShearWink!=0) ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan); - if (aGeo.nDrehWink!=0) RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos); - if (eKind!=HDL_MOVE) { - pH=new SdrHdl(aPnt,eKind); + + if(!pH) + { + if(aGeo.nShearWink) + { + ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan); + } + + if(aGeo.nDrehWink) + { + RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos); + } + + pH = new SdrHdl(aPnt,eKind); pH->SetObj((SdrObject*)this); pH->SetDrehWink(aGeo.nDrehWink); } + return pH; } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index a2b7e8c0490c..6a79359e1a00 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -35,7 +35,6 @@ #include <svx/svdpage.hxx> // und fuer AnimationHandler (Laufschrift) #include <svx/svdetc.hxx> #include <svx/svdoutl.hxx> -#include "svdscrol.hxx" // fuer Laufschrift #include <svx/svdmodel.hxx> // OutlinerDefaults #include "svdglob.hxx" // Stringcache #include "svdstr.hrc" // Objektname diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index 9ac4534b329e..f6780bd7c90d 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -62,7 +62,7 @@ #include <svx/xlinjoit.hxx> #include <svx/xlndsit.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> -#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx> +#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <editeng/editstat.hxx> #include <unoapi.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> @@ -226,7 +226,7 @@ namespace { class impPolygonParagraphHandler { - const drawinglayer::attribute::SdrFormTextAttribute& mrSdrFormTextAttribute; // FormText parameters + const drawinglayer::attribute::SdrFormTextAttribute maSdrFormTextAttribute; // FormText parameters std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrDecomposition; // destination primitive list std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrShadowDecomposition; // destination primitive list for shadow Reference < com::sun::star::i18n::XBreakIterator > mxBreak; // break iterator @@ -269,7 +269,7 @@ namespace const drawinglayer::attribute::SdrFormTextAttribute& rSdrFormTextAttribute, std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rDecomposition, std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rShadowDecomposition) - : mrSdrFormTextAttribute(rSdrFormTextAttribute), + : maSdrFormTextAttribute(rSdrFormTextAttribute), mrDecomposition(rDecomposition), mrShadowDecomposition(rShadowDecomposition) { @@ -293,18 +293,18 @@ namespace double fPolyStart(0.0); double fScaleFactor(1.0); - if(mrSdrFormTextAttribute.getFormTextMirror()) + if(maSdrFormTextAttribute.getFormTextMirror()) { aPolygonCandidate.flip(); } - if(mrSdrFormTextAttribute.getFormTextStart() - && (XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust() - || XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust())) + if(maSdrFormTextAttribute.getFormTextStart() + && (XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust() + || XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust())) { - if(XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust()) + if(XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust()) { - fPolyStart += mrSdrFormTextAttribute.getFormTextStart(); + fPolyStart += maSdrFormTextAttribute.getFormTextStart(); if(fPolyStart > fPolyEnd) { @@ -313,7 +313,7 @@ namespace } else { - fPolyEnd -= mrSdrFormTextAttribute.getFormTextStart(); + fPolyEnd -= maSdrFormTextAttribute.getFormTextStart(); if(fPolyEnd < fPolyStart) { @@ -322,7 +322,7 @@ namespace } } - if(XFT_LEFT != mrSdrFormTextAttribute.getFormTextAdjust()) + if(XFT_LEFT != maSdrFormTextAttribute.getFormTextAdjust()) { // calculate total text length of this paragraph, some layout needs to be done const double fParagraphTextLength(getParagraphTextLength(rTextPortions)); @@ -331,7 +331,7 @@ namespace // but still take care of XFT_AUTOSIZE in that case const bool bTextTooLong(fParagraphTextLength > (fPolyEnd - fPolyStart)); - if(XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust()) + if(XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust()) { if(!bTextTooLong) { @@ -339,7 +339,7 @@ namespace fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength); } } - else if(XFT_CENTER == mrSdrFormTextAttribute.getFormTextAdjust()) + else if(XFT_CENTER == maSdrFormTextAttribute.getFormTextAdjust()) { if(!bTextTooLong) { @@ -347,7 +347,7 @@ namespace fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength) / 2.0; } } - else if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) + else if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust()) { // if scale, prepare scale factor between curve length and text length if(0.0 != fParagraphTextLength) @@ -382,7 +382,7 @@ namespace // prepare portion length. Takes RTL sections into account. double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen)); - if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) + if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust()) { // when scaling, expand portion length fPortionLength *= fScaleFactor; @@ -397,27 +397,27 @@ namespace aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY()); // prepare scaling of text primitive - if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust()) + if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust()) { // when scaling, expand text primitive scaling aNewTransformA.scale(fScaleFactor, fScaleFactor); } // eventually create shadow primitives from aDecomposition and add to rDecomposition - const bool bShadow(XFTSHADOW_NONE != mrSdrFormTextAttribute.getFormTextShadow()); + const bool bShadow(XFTSHADOW_NONE != maSdrFormTextAttribute.getFormTextShadow()); if(bShadow) { - if(XFTSHADOW_NORMAL == mrSdrFormTextAttribute.getFormTextShadow()) + if(XFTSHADOW_NORMAL == maSdrFormTextAttribute.getFormTextShadow()) { aNewShadowTransform.translate( - mrSdrFormTextAttribute.getFormTextShdwXVal(), - -mrSdrFormTextAttribute.getFormTextShdwYVal()); + maSdrFormTextAttribute.getFormTextShdwXVal(), + -maSdrFormTextAttribute.getFormTextShdwYVal()); } else // XFTSHADOW_SLANT { - double fScaleValue(mrSdrFormTextAttribute.getFormTextShdwYVal() / 100.0); - double fShearValue(-mrSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800); + double fScaleValue(maSdrFormTextAttribute.getFormTextShdwYVal() / 100.0); + double fShearValue(-maSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800); aNewShadowTransform.scale(1.0, fScaleValue); aNewShadowTransform.shearX(sin(fShearValue)); @@ -425,7 +425,7 @@ namespace } } - switch(mrSdrFormTextAttribute.getFormTextStyle()) + switch(maSdrFormTextAttribute.getFormTextStyle()) { case XFT_ROTATE : { @@ -483,7 +483,7 @@ namespace } // distance from path? - if(mrSdrFormTextAttribute.getFormTextDistance()) + if(maSdrFormTextAttribute.getFormTextDistance()) { if(aEndPos.equal(aStartPos)) { @@ -493,7 +493,7 @@ namespace // use back vector (aStartPos - aEndPos) here to get mirrored perpendicular as in old stuff const basegfx::B2DVector aPerpendicular( basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) * - mrSdrFormTextAttribute.getFormTextDistance()); + maSdrFormTextAttribute.getFormTextDistance()); aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY()); } @@ -502,7 +502,7 @@ namespace { if(pCandidate->getText().Len() && nNextGlyphLen) { - const Color aShadowColor(mrSdrFormTextAttribute.getFormTextShdwColor()); + const Color aShadowColor(maSdrFormTextAttribute.getFormTextShdwColor()); const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen)); const ::std::vector< double > aNewDXArray( @@ -623,7 +623,7 @@ namespace { if(rOutlineAttribute.getTransparence()) { - // create UnifiedAlphaPrimitive2D + // create UnifiedTransparencePrimitive2D drawinglayer::primitive2d::Primitive2DSequence aStrokePrimitiveSequence(nStrokeCount); for(sal_uInt32 b(0L); b < nStrokeCount; b++) @@ -631,8 +631,8 @@ namespace aStrokePrimitiveSequence[b] = drawinglayer::primitive2d::Primitive2DReference(aStrokePrimitives[b]); } - drawinglayer::primitive2d::UnifiedAlphaPrimitive2D* pNew2 = - new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D( + drawinglayer::primitive2d::UnifiedTransparencePrimitive2D* pNew2 = + new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( aStrokePrimitiveSequence, (double)rOutlineAttribute.getTransparence() / 100.0); aNewPrimitives.push_back(pNew2); @@ -712,7 +712,9 @@ void SdrTextObj::impDecomposePathTextPrimitive( std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aRegularDecomposition; std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aShadowDecomposition; impPolygonParagraphHandler aPolygonParagraphHandler( - rFormTextAttribute, aRegularDecomposition, aShadowDecomposition); + rFormTextAttribute, + aRegularDecomposition, + aShadowDecomposition); sal_uInt32 a; for(a = 0L; a < nLoopCount; a++) @@ -751,10 +753,14 @@ void SdrTextObj::impDecomposePathTextPrimitive( } // evtl. add shadow outlines - if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getShadowOutline()) + if(rFormTextAttribute.getFormTextOutline() + && !rFormTextAttribute.getShadowOutline().isDefault()) { const drawinglayer::primitive2d::Primitive2DSequence aOutlines( - impAddPathTextOutlines(aShadowDecomposition, *rFormTextAttribute.getShadowOutline())); + impAddPathTextOutlines( + aShadowDecomposition, + rFormTextAttribute.getShadowOutline())); + drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalA, aOutlines); } } @@ -770,10 +776,14 @@ void SdrTextObj::impDecomposePathTextPrimitive( } // evtl. add outlines - if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getOutline()) + if(rFormTextAttribute.getFormTextOutline() + && !rFormTextAttribute.getOutline().isDefault()) { const drawinglayer::primitive2d::Primitive2DSequence aOutlines( - impAddPathTextOutlines(aRegularDecomposition, *rFormTextAttribute.getOutline())); + impAddPathTextOutlines( + aRegularDecomposition, + rFormTextAttribute.getOutline())); + drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalB, aOutlines); } } diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index e9eeb1428ba8..6dd816d429da 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -66,6 +66,7 @@ #include <svx/sdr/contact/viewobjectcontact.hxx> #include <svx/sdr/contact/displayinfo.hxx> #include <algorithm> +#include <svl/smplhint.hxx> using namespace ::com::sun::star; @@ -1165,7 +1166,8 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const { if(!mpViewContact) { - ((SdrPage*)this)->mpViewContact = ((SdrPage*)this)->CreateObjectSpecificViewContact(); + const_cast< SdrPage* >(this)->mpViewContact = + const_cast< SdrPage* >(this)->CreateObjectSpecificViewContact(); } return *mpViewContact; @@ -1173,6 +1175,140 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const //////////////////////////////////////////////////////////////////////////////////////////////////// +void SdrPageProperties::ImpRemoveStyleSheet() +{ + if(mpStyleSheet) + { + EndListening(*mpStyleSheet); + mpProperties->SetParent(0); + mpStyleSheet = 0; + } +} + +void SdrPageProperties::ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet) +{ + if(mpStyleSheet != &rNewStyleSheet) + { + ImpRemoveStyleSheet(); + mpStyleSheet = &rNewStyleSheet; + StartListening(rNewStyleSheet); + mpProperties->SetParent(&rNewStyleSheet.GetItemSet()); + } +} + +void ImpPageChange(SdrPage& rSdrPage) +{ + rSdrPage.ActionChanged(); + + if(rSdrPage.GetModel()) + { + rSdrPage.GetModel()->SetChanged(true); + SdrHint aHint(HINT_PAGEORDERCHG); + aHint.SetPage(&rSdrPage); + rSdrPage.GetModel()->Broadcast(aHint); + } +} + +SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage) +: SfxListener(), + mpSdrPage(&rSdrPage), + mpStyleSheet(0), + mpProperties(new SfxItemSet(mpSdrPage->GetModel()->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST)) +{ + if(!rSdrPage.IsMasterPage()) + { + mpProperties->Put(XFillStyleItem(XFILL_NONE)); + } +} + +SdrPageProperties::SdrPageProperties(const SdrPageProperties& rCandidate) +: SfxListener(), + mpSdrPage(rCandidate.mpSdrPage), + mpStyleSheet(0), + mpProperties(new SfxItemSet(*rCandidate.mpProperties)) +{ + if(rCandidate.GetStyleSheet()) + { + ImpAddStyleSheet(*rCandidate.GetStyleSheet()); + } +} + +SdrPageProperties::~SdrPageProperties() +{ + ImpRemoveStyleSheet(); + delete mpProperties; +} + +void SdrPageProperties::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) +{ + const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint); + + if(pSimpleHint) + { + switch(pSimpleHint->GetId()) + { + case SFX_HINT_DATACHANGED : + { + // notify change, broadcast + ImpPageChange(*mpSdrPage); + break; + } + case SFX_HINT_DYING : + { + // Style needs to be forgotten + ImpRemoveStyleSheet(); + break; + } + } + } +} + +const SfxItemSet& SdrPageProperties::GetItemSet() const +{ + return *mpProperties; +} + +void SdrPageProperties::PutItemSet(const SfxItemSet& rSet) +{ + OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)"); + mpProperties->Put(rSet); + ImpPageChange(*mpSdrPage); +} + +void SdrPageProperties::PutItem(const SfxPoolItem& rItem) +{ + OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)"); + mpProperties->Put(rItem); + ImpPageChange(*mpSdrPage); +} + +void SdrPageProperties::ClearItem(const sal_uInt16 nWhich) +{ + mpProperties->ClearItem(nWhich); + ImpPageChange(*mpSdrPage); +} + +void SdrPageProperties::SetStyleSheet(SfxStyleSheet* pStyleSheet) +{ + if(pStyleSheet) + { + ImpAddStyleSheet(*pStyleSheet); + } + else + { + ImpRemoveStyleSheet(); + } + + ImpPageChange(*mpSdrPage); +} + +SfxStyleSheet* SdrPageProperties::GetStyleSheet() const +{ + return mpStyleSheet; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// + TYPEINIT1(SdrPage,SdrObjList); DBG_NAME(SdrPage) SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage) @@ -1185,7 +1321,7 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage) nBordRgt(0L), nBordLwr(0L), pLayerAdmin(new SdrLayerAdmin(&rNewModel.GetLayerAdmin())), - pBackgroundObj(0L), + mpSdrPageProperties(0), mpMasterPageDescriptor(0L), nPageNum(0L), mbMaster(bMasterPage), @@ -1197,6 +1333,8 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage) DBG_CTOR(SdrPage,NULL); aPrefVisiLayers.SetAll(); eListKind = (bMasterPage) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE; + + mpSdrPageProperties = new SdrPageProperties(*this); } SdrPage::SdrPage(const SdrPage& rSrcPage) @@ -1210,7 +1348,7 @@ SdrPage::SdrPage(const SdrPage& rSrcPage) nBordRgt(rSrcPage.nBordRgt), nBordLwr(rSrcPage.nBordLwr), pLayerAdmin(new SdrLayerAdmin(rSrcPage.pModel->GetLayerAdmin())), - pBackgroundObj(0L), + mpSdrPageProperties(0), mpMasterPageDescriptor(0L), nPageNum(rSrcPage.nPageNum), mbMaster(rSrcPage.mbMaster), @@ -1244,6 +1382,8 @@ SdrPage::SdrPage(const SdrPage& rSrcPage) mxUnoPage = NULL; xComponent->dispose(); } + + mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties()); } SdrPage::~SdrPage() @@ -1277,7 +1417,6 @@ SdrPage::~SdrPage() // when they get called from PageInDestruction(). maPageUsers.clear(); - SdrObject::Free( pBackgroundObj ); delete pLayerAdmin; TRG_ClearMasterPage(); @@ -1289,6 +1428,11 @@ SdrPage::~SdrPage() mpViewContact = 0L; } + { + delete mpSdrPageProperties; + mpSdrPageProperties = 0; + } + DBG_DTOR(SdrPage,NULL); } @@ -1300,8 +1444,6 @@ void SdrPage::operator=(const SdrPage& rSrcPage) mpViewContact = 0L; } - SdrObject::Free( pBackgroundObj ); - // Joe also sets some parameters for the class this one // is derived from. SdrObjList does the same bad handling of // copy constructor and operator=, so i better let it stand here. @@ -1335,14 +1477,9 @@ void SdrPage::operator=(const SdrPage& rSrcPage) mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent; - if(rSrcPage.pBackgroundObj) { - pBackgroundObj = rSrcPage.pBackgroundObj->Clone(); - pBackgroundObj->SetPage( this ); - pBackgroundObj->SetModel( pModel ); - - // #i62000# for single-page MPBGO, force no line - pBackgroundObj->SetMergedItem(XLineStyleItem(XLINE_NONE)); + delete mpSdrPageProperties; + mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties()); } // Now copy the contained obejcts (by cloning them) @@ -1522,8 +1659,9 @@ void SdrPage::SetModel(SdrModel* pNewModel) } pLayerAdmin->SetModel(pNewModel); - if( pBackgroundObj ) - pBackgroundObj->SetModel( pNewModel ); + SdrPageProperties *pNew = new SdrPageProperties(getSdrPageProperties()); + delete mpSdrPageProperties; + mpSdrPageProperties = pNew; } // update listeners at possible api wrapper object @@ -1657,22 +1795,6 @@ XubString SdrPage::GetLayoutName() const return String(); } -void SdrPage::SetBackgroundObj( SdrObject* pObj ) -{ - if ( pObj ) - { - pObj->SetPage( this ); - pObj->SetModel( pModel ); - pObj->SetLayer( 1 ); // Nothing known about the backgroundlayer... - - // #i62000# for single-page MPBGO, force no line - pObj->SetMergedItem(XLineStyleItem(XLINE_NONE)); - } - - SdrObject::Free( pBackgroundObj ); - pBackgroundObj = pObj; -} - void SdrPage::SetInserted( bool bIns ) { if( mbInserted != bIns ) @@ -1746,38 +1868,17 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay ) aColor = pView->GetApplicationDocumentColor(); } - // first, see if we have a background object - SdrObject* pBackgroundObj2 = NULL; - + const SfxItemSet* pBackgroundFill = &getSdrPageProperties().GetItemSet(); - if( IsMasterPage() ) - { - if( GetObjCount() ) - pBackgroundObj2 = GetObj( 0 ); - } - else + if(!IsMasterPage() && TRG_HasMasterPage()) { - pBackgroundObj2 = GetBackgroundObj(); - if( NULL == pBackgroundObj2 ) + if(XFILL_NONE == ((const XFillStyleItem&)pBackgroundFill->Get(XATTR_FILLSTYLE)).GetValue()) { - // if not, see if we have a masterpage and get that background object - if(TRG_HasMasterPage()) - { - SdrPage& rMasterPage = TRG_GetMasterPage(); - - if(rMasterPage.GetObjCount()) - { - pBackgroundObj2 = rMasterPage.GetObj( 0 ); - } - } + pBackgroundFill = &TRG_GetMasterPage().getSdrPageProperties().GetItemSet(); } } - if( pBackgroundObj2 ) - { - const SfxItemSet& rSet = pBackgroundObj2->GetMergedItemSet(); - GetDraftFillColor( rSet, aColor ); - } + GetDraftFillColor(*pBackgroundFill, aColor); return aColor; } diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index fb47734b1091..998c687608fc 100644..100755 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -294,6 +294,9 @@ SdrPaintView::SdrPaintView(SdrModel* pModel1, OutputDevice* pOut) SdrPaintView::~SdrPaintView() { DBG_DTOR(SdrPaintView,NULL); + if (pDefaultStyleSheet) + EndListening(*pDefaultStyleSheet); + maColorConfig.RemoveListener(this); ClearPageView(); @@ -317,8 +320,16 @@ SdrPaintView::~SdrPaintView() //////////////////////////////////////////////////////////////////////////////////////////////////// -void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) +void __EXPORT SdrPaintView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) { + //If the stylesheet has been destroyed + if (&rBC == pDefaultStyleSheet) + { + if (rHint.ISA(SfxSimpleHint) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING) + pDefaultStyleSheet = NULL; + return; + } + BOOL bObjChg=!bSomeObjChgdFlag; // TRUE= auswerten fuer ComeBack-Timer if (bObjChg) { SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint); @@ -333,7 +344,7 @@ void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint if (eKind==HINT_PAGEORDERCHG) { const SdrPage* pPg=pSdrHint->GetPage(); - if(!pPg->IsInserted()) + if(pPg && !pPg->IsInserted()) { if(mpPageView && mpPageView->GetPage() == pPg) { @@ -1238,7 +1249,12 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, BOOL bReplaceAll) void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, BOOL bDontRemoveHardAttr) { + if (pDefaultStyleSheet) + EndListening(*pDefaultStyleSheet); pDefaultStyleSheet=pStyleSheet; + if (pDefaultStyleSheet) + StartListening(*pDefaultStyleSheet); + if (pStyleSheet!=NULL && !bDontRemoveHardAttr) { SfxWhichIter aIter(pStyleSheet->GetItemSet()); USHORT nWhich=aIter.FirstWhich(); diff --git a/svx/source/svdraw/svdscrol.cxx b/svx/source/svdraw/svdscrol.cxx deleted file mode 100644 index ce1d4e32bf32..000000000000 --- a/svx/source/svdraw/svdscrol.cxx +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" - -#include "svdscrol.hxx" - -// eof diff --git a/svx/source/svdraw/svdscrol.hxx b/svx/source/svdraw/svdscrol.hxx deleted file mode 100644 index f44cf3d81c65..000000000000 --- a/svx/source/svdraw/svdscrol.hxx +++ /dev/null @@ -1,31 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVDSCROL_HXX -#define _SVDSCROL_HXX - -#endif //_SVDSCROL_HXX |