bump product version to 6.3.0.0.beta1
[LibreOffice.git] / svx / source / svdraw / svdopage.cxx
blob6dc8dbe1b5aea7ad5fc80d468487f36e77cd9331
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <svx/svdopage.hxx>
22 #include <svx/dialmgr.hxx>
23 #include <svx/strings.hrc>
24 #include <svx/svdtrans.hxx>
25 #include <svx/svdetc.hxx>
26 #include <svx/svdmodel.hxx>
27 #include <svx/svdpage.hxx>
28 #include <svx/svdpagv.hxx>
29 #include <svx/svdoutl.hxx>
30 #include <svtools/colorcfg.hxx>
31 #include <svl/itemset.hxx>
32 #include <sdr/properties/pageproperties.hxx>
33 #include <svx/sdr/contact/viewcontactofpageobj.hxx>
36 // BaseProperties section
38 std::unique_ptr<sdr::properties::BaseProperties> SdrPageObj::CreateObjectSpecificProperties()
40 return std::make_unique<sdr::properties::PageProperties>(*this);
44 // DrawContact section
46 std::unique_ptr<sdr::contact::ViewContact> SdrPageObj::CreateObjectSpecificViewContact()
48 return std::make_unique<sdr::contact::ViewContactOfPageObj>(*this);
52 // this method is called form the destructor of the referenced page.
53 // do all necessary action to forget the page. It is not necessary to call
54 // RemovePageUser(), that is done form the destructor.
55 void SdrPageObj::PageInDestruction(const SdrPage& rPage)
57 if(mpShownPage && mpShownPage == &rPage)
59 // #i58769# Do not call ActionChanged() here, because that would
60 // lead to the construction of a view contact object for a page that
61 // is being destroyed.
63 mpShownPage = nullptr;
67 SdrPageObj::SdrPageObj(
68 SdrModel& rSdrModel,
69 SdrPage* pNewPage)
70 : SdrObject(rSdrModel),
71 mpShownPage(pNewPage)
73 if(mpShownPage)
75 mpShownPage->AddPageUser(*this);
79 SdrPageObj::SdrPageObj(
80 SdrModel& rSdrModel,
81 const tools::Rectangle& rRect,
82 SdrPage* pNewPage)
83 : SdrObject(rSdrModel),
84 mpShownPage(pNewPage)
86 if(mpShownPage)
88 mpShownPage->AddPageUser(*this);
91 aOutRect = rRect;
94 SdrPageObj::~SdrPageObj()
96 if(mpShownPage)
98 mpShownPage->RemovePageUser(*this);
103 void SdrPageObj::SetReferencedPage(SdrPage* pNewPage)
105 if(mpShownPage != pNewPage)
107 if(mpShownPage)
109 mpShownPage->RemovePageUser(*this);
112 mpShownPage = pNewPage;
114 if(mpShownPage)
116 mpShownPage->AddPageUser(*this);
119 SetChanged();
120 BroadcastObjectChange();
124 // #i96598#
125 void SdrPageObj::SetBoundRectDirty()
127 // avoid resetting aOutRect which in case of this object is model data,
128 // not re-creatable view data
131 sal_uInt16 SdrPageObj::GetObjIdentifier() const
133 return sal_uInt16(OBJ_PAGE);
136 void SdrPageObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
138 rInfo.bRotateFreeAllowed=false;
139 rInfo.bRotate90Allowed =false;
140 rInfo.bMirrorFreeAllowed=false;
141 rInfo.bMirror45Allowed =false;
142 rInfo.bMirror90Allowed =false;
143 rInfo.bTransparenceAllowed = false;
144 rInfo.bShearAllowed =false;
145 rInfo.bEdgeRadiusAllowed=false;
146 rInfo.bNoOrthoDesired =false;
147 rInfo.bCanConvToPath =false;
148 rInfo.bCanConvToPoly =false;
149 rInfo.bCanConvToPathLineToArea=false;
150 rInfo.bCanConvToPolyLineToArea=false;
153 SdrPageObj* SdrPageObj::CloneSdrObject(SdrModel& rTargetModel) const
155 return CloneHelper< SdrPageObj >(rTargetModel);
158 SdrPageObj& SdrPageObj::operator=(const SdrPageObj& rObj)
160 if( this == &rObj )
161 return *this;
162 SdrObject::operator=(rObj);
163 SetReferencedPage( rObj.GetReferencedPage());
164 return *this;
167 OUString SdrPageObj::TakeObjNameSingul() const
169 OUStringBuffer sName(SvxResId(STR_ObjNameSingulPAGE));
171 OUString aName(GetName());
172 if (!aName.isEmpty())
174 sName.append(' ');
175 sName.append('\'');
176 sName.append(aName);
177 sName.append('\'');
180 return sName.makeStringAndClear();
183 OUString SdrPageObj::TakeObjNamePlural() const
185 return SvxResId(STR_ObjNamePluralPAGE);
188 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */