Update ooo320-m1
[ooovba.git] / svx / source / svdraw / svdopage.cxx
blob8b6d05ca9e2d383400bbf27ff36988f7c7fc6975
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svdopage.cxx,v $
10 * $Revision: 1.25 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 #include <svx/svdopage.hxx>
35 #include "svdglob.hxx" // Stringcache
36 #include "svdstr.hrc" // Objektname
37 #include <svx/svdtrans.hxx>
38 #include <svx/svdetc.hxx>
39 #include <svx/svdmodel.hxx>
40 #include <svx/svdpage.hxx>
41 #include <svx/svdpagv.hxx>
42 #include <svx/svdoutl.hxx>
43 #include <svtools/colorcfg.hxx>
44 #include <svtools/itemset.hxx>
45 #include <svx/sdr/properties/pageproperties.hxx>
47 // #111111#
48 #include <svx/sdr/contact/viewcontactofpageobj.hxx>
50 ////////////////////////////////////////////////////////////////////////////////////////////////////
51 // BaseProperties section
53 sdr::properties::BaseProperties* SdrPageObj::CreateObjectSpecificProperties()
55 return new sdr::properties::PageProperties(*this);
58 //////////////////////////////////////////////////////////////////////////////
59 // DrawContact section
61 sdr::contact::ViewContact* SdrPageObj::CreateObjectSpecificViewContact()
63 return new sdr::contact::ViewContactOfPageObj(*this);
66 ////////////////////////////////////////////////////////////////////////////////////////////////////
67 // this method is called form the destructor of the referenced page.
68 // do all necessary action to forget the page. It is not necessary to call
69 // RemovePageUser(), that is done form the destructor.
70 void SdrPageObj::PageInDestruction(const SdrPage& rPage)
72 if(mpShownPage && mpShownPage == &rPage)
74 // #i58769# Do not call ActionChanged() here, because that would
75 // lead to the construction of a view contact object for a page that
76 // is being destroyed.
78 mpShownPage = 0L;
82 ////////////////////////////////////////////////////////////////////////////////////////////////////
84 TYPEINIT1(SdrPageObj,SdrObject);
86 SdrPageObj::SdrPageObj(SdrPage* pNewPage)
87 : mpShownPage(pNewPage)
89 if(mpShownPage)
91 mpShownPage->AddPageUser(*this);
95 SdrPageObj::SdrPageObj(const Rectangle& rRect, SdrPage* pNewPage)
96 : mpShownPage(pNewPage)
98 if(mpShownPage)
100 mpShownPage->AddPageUser(*this);
103 aOutRect = rRect;
106 SdrPageObj::~SdrPageObj()
108 // #111111#
109 if(mpShownPage)
111 mpShownPage->RemovePageUser(*this);
115 // #111111#
116 SdrPage* SdrPageObj::GetReferencedPage() const
118 return mpShownPage;
121 // #111111#
122 void SdrPageObj::SetReferencedPage(SdrPage* pNewPage)
124 if(mpShownPage != pNewPage)
126 if(mpShownPage)
128 mpShownPage->RemovePageUser(*this);
131 mpShownPage = pNewPage;
133 if(mpShownPage)
135 mpShownPage->AddPageUser(*this);
138 SetChanged();
139 BroadcastObjectChange();
143 // #i96598#
144 void SdrPageObj::SetBoundRectDirty()
146 // avoid resetting aOutRect which in case of this object is model data,
147 // not re-creatable view data
150 UINT16 SdrPageObj::GetObjIdentifier() const
152 return UINT16(OBJ_PAGE);
155 void SdrPageObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
157 rInfo.bRotateFreeAllowed=FALSE;
158 rInfo.bRotate90Allowed =FALSE;
159 rInfo.bMirrorFreeAllowed=FALSE;
160 rInfo.bMirror45Allowed =FALSE;
161 rInfo.bMirror90Allowed =FALSE;
162 rInfo.bTransparenceAllowed = FALSE;
163 rInfo.bGradientAllowed = FALSE;
164 rInfo.bShearAllowed =FALSE;
165 rInfo.bEdgeRadiusAllowed=FALSE;
166 rInfo.bNoOrthoDesired =FALSE;
167 rInfo.bCanConvToPath =FALSE;
168 rInfo.bCanConvToPoly =FALSE;
169 rInfo.bCanConvToPathLineToArea=FALSE;
170 rInfo.bCanConvToPolyLineToArea=FALSE;
173 void SdrPageObj::operator=(const SdrObject& rObj)
175 SdrObject::operator=(rObj);
176 SetReferencedPage(((const SdrPageObj&)rObj).GetReferencedPage());
179 void SdrPageObj::TakeObjNameSingul(XubString& rName) const
181 rName=ImpGetResStr(STR_ObjNameSingulPAGE);
183 String aName( GetName() );
184 if(aName.Len())
186 rName += sal_Unicode(' ');
187 rName += sal_Unicode('\'');
188 rName += aName;
189 rName += sal_Unicode('\'');
193 void SdrPageObj::TakeObjNamePlural(XubString& rName) const
195 rName=ImpGetResStr(STR_ObjNamePluralPAGE);
198 // eof