1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 #include <svx/sdr/properties/pageproperties.hxx>
27 #include <svl/itemset.hxx>
28 #include <svx/svdobj.hxx>
29 #include <svx/svdpool.hxx>
30 
31 //////////////////////////////////////////////////////////////////////////////
32 
33 namespace sdr
34 {
35 	namespace properties
36 	{
37 		// create a new itemset
CreateObjectSpecificItemSet(SfxItemPool & rPool)38 		SfxItemSet& PageProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
39 		{
40 			// overloaded to legally return a valid ItemSet
41 			return *(new SfxItemSet(rPool));
42 		}
43 
PageProperties(SdrObject & rObj)44 		PageProperties::PageProperties(SdrObject& rObj)
45 		:	EmptyProperties(rObj)
46 		{
47 		}
48 
PageProperties(const PageProperties & rProps,SdrObject & rObj)49 		PageProperties::PageProperties(const PageProperties& rProps, SdrObject& rObj)
50 		:	EmptyProperties(rProps, rObj)
51 		{
52 		}
53 
~PageProperties()54 		PageProperties::~PageProperties()
55 		{
56 		}
57 
Clone(SdrObject & rObj) const58 		BaseProperties& PageProperties::Clone(SdrObject& rObj) const
59 		{
60 			return *(new PageProperties(*this, rObj));
61 		}
62 
63 		// get itemset. Overloaded here to allow creating the empty itemset
64 		// without asserting
GetObjectItemSet() const65 		const SfxItemSet& PageProperties::GetObjectItemSet() const
66 		{
67 			if(!mpEmptyItemSet)
68 			{
69 				((PageProperties*)this)->mpEmptyItemSet = &(((PageProperties*)this)->CreateObjectSpecificItemSet(*GetSdrObject().GetObjectItemPool()));
70 			}
71 
72 			DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
73 
74 			return *mpEmptyItemSet;
75 		}
76 
ItemChange(const sal_uInt16,const SfxPoolItem *)77 		void PageProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/)
78 		{
79 			// #86481# simply ignore item setting on page objects
80 		}
81 
GetStyleSheet() const82 		SfxStyleSheet* PageProperties::GetStyleSheet() const
83 		{
84 			// overloaded to legally return a 0L pointer here
85 			return 0L;
86 		}
87 
PostItemChange(const sal_uInt16 nWhich)88 		void PageProperties::PostItemChange(const sal_uInt16 nWhich )
89 		{
90 			if( (nWhich == XATTR_FILLSTYLE) && (mpEmptyItemSet != NULL) )
91 				CleanupFillProperties(*mpEmptyItemSet);
92 		}
93 
ClearObjectItem(const sal_uInt16)94         void PageProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
95 		{
96 			// simply ignore item clearing on page objects
97 		}
98 	} // end of namespace properties
99 } // end of namespace sdr
100 
101 ////////////////////////////////////////////////////////////////////////////////////////////////////
102 
103 // eof
104