xref: /AOO41X/main/svx/source/sdr/properties/pageproperties.cxx (revision 83137a03adbb58b5b3bdafefefa1e93de35e0011)
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
38         SfxItemSet& PageProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
39         {
40             // overloaded to legally return a valid ItemSet
41             return *(new SfxItemSet(rPool));
42         }
43 
44         PageProperties::PageProperties(SdrObject& rObj)
45         :   EmptyProperties(rObj)
46         {
47         }
48 
49         PageProperties::PageProperties(const PageProperties& rProps, SdrObject& rObj)
50         :   EmptyProperties(rProps, rObj)
51         {
52         }
53 
54         PageProperties::~PageProperties()
55         {
56         }
57 
58         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
65         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 
77         void PageProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/)
78         {
79             // #86481# simply ignore item setting on page objects
80         }
81 
82         SfxStyleSheet* PageProperties::GetStyleSheet() const
83         {
84             // overloaded to legally return a 0L pointer here
85             return 0L;
86         }
87 
88         void PageProperties::PostItemChange(const sal_uInt16 nWhich )
89         {
90             if( (nWhich == XATTR_FILLSTYLE) && (mpEmptyItemSet != NULL) )
91                 CleanupFillProperties(*mpEmptyItemSet);
92         }
93 
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