Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <svx/sdr/properties/pageproperties.hxx>
30 : : #include <svl/itemset.hxx>
31 : : #include <svx/svdobj.hxx>
32 : : #include <svx/svdpool.hxx>
33 : :
34 : : //////////////////////////////////////////////////////////////////////////////
35 : :
36 : : namespace sdr
37 : : {
38 : : namespace properties
39 : : {
40 : : // create a new itemset
41 : 87 : SfxItemSet& PageProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
42 : : {
43 : : // overloaded to legally return a valid ItemSet
44 [ + - ]: 87 : return *(new SfxItemSet(rPool));
45 : : }
46 : :
47 : 87 : PageProperties::PageProperties(SdrObject& rObj)
48 : 87 : : EmptyProperties(rObj)
49 : : {
50 : 87 : }
51 : :
52 : 0 : PageProperties::PageProperties(const PageProperties& rProps, SdrObject& rObj)
53 : 0 : : EmptyProperties(rProps, rObj)
54 : : {
55 : 0 : }
56 : :
57 : 84 : PageProperties::~PageProperties()
58 : : {
59 [ - + ]: 168 : }
60 : :
61 : 0 : BaseProperties& PageProperties::Clone(SdrObject& rObj) const
62 : : {
63 [ # # ]: 0 : return *(new PageProperties(*this, rObj));
64 : : }
65 : :
66 : : // get itemset. Overloaded here to allow creating the empty itemset
67 : : // without asserting
68 : 174 : const SfxItemSet& PageProperties::GetObjectItemSet() const
69 : : {
70 [ + + ]: 174 : if(!mpEmptyItemSet)
71 : : {
72 : 87 : ((PageProperties*)this)->mpEmptyItemSet = &(((PageProperties*)this)->CreateObjectSpecificItemSet(*GetSdrObject().GetObjectItemPool()));
73 : : }
74 : :
75 : : DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
76 : :
77 : 174 : return *mpEmptyItemSet;
78 : : }
79 : :
80 : 0 : void PageProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/)
81 : : {
82 : : // #86481# simply ignore item setting on page objects
83 : 0 : }
84 : :
85 : 28 : SfxStyleSheet* PageProperties::GetStyleSheet() const
86 : : {
87 : : // overloaded to legally return a 0L pointer here
88 : 28 : return 0L;
89 : : }
90 : :
91 : 0 : void PageProperties::PostItemChange(const sal_uInt16 nWhich )
92 : : {
93 [ # # ][ # # ]: 0 : if( (nWhich == XATTR_FILLSTYLE) && (mpEmptyItemSet != NULL) )
94 : 0 : CleanupFillProperties(*mpEmptyItemSet);
95 : 0 : }
96 : :
97 : 0 : void PageProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
98 : : {
99 : : // simply ignore item clearing on page objects
100 : 0 : }
101 : : } // end of namespace properties
102 : : } // end of namespace sdr
103 : :
104 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|