Bump version to 6.4-15
[LibreOffice.git] / svx / source / sdr / properties / pageproperties.cxx
blob7f5e92e4b3776a5d2e761e7a02ea1a45cb845b21
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 .
20 #include <sal/config.h>
22 #include <sdr/properties/pageproperties.hxx>
23 #include <svl/itemset.hxx>
24 #include <svx/svdobj.hxx>
25 #include <svx/svdpool.hxx>
26 #include <svx/xdef.hxx>
27 #include <vcl/outdev.hxx>
28 #include <tools/debug.hxx>
31 namespace sdr
33 namespace properties
35 // create a new itemset
36 std::unique_ptr<SfxItemSet> PageProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
38 // override to legally return a valid ItemSet
39 return std::make_unique<SfxItemSet>(rPool);
42 PageProperties::PageProperties(SdrObject& rObj)
43 : EmptyProperties(rObj)
47 PageProperties::PageProperties(const PageProperties& /*rProps*/, SdrObject& rObj)
48 : EmptyProperties(rObj)
52 PageProperties::~PageProperties()
56 std::unique_ptr<BaseProperties> PageProperties::Clone(SdrObject& rObj) const
58 return std::unique_ptr<BaseProperties>(new PageProperties(*this, rObj));
61 // get itemset. Override here to allow creating the empty itemset
62 // without asserting
63 const SfxItemSet& PageProperties::GetObjectItemSet() const
65 if(!mpEmptyItemSet)
67 const_cast<PageProperties*>(this)->mpEmptyItemSet = const_cast<PageProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool());
70 DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
72 return *mpEmptyItemSet;
75 void PageProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/)
77 // #86481# simply ignore item setting on page objects
80 SfxStyleSheet* PageProperties::GetStyleSheet() const
82 // override to legally return a 0L pointer here
83 return nullptr;
86 void PageProperties::SetStyleSheet(SfxStyleSheet* /*pStyleSheet*/, bool /*bDontRemoveHardAttr*/)
88 // override to legally ignore the StyleSheet here
91 void PageProperties::PostItemChange(const sal_uInt16 nWhich )
93 if( (nWhich == XATTR_FILLSTYLE) && (mpEmptyItemSet != nullptr) )
94 CleanupFillProperties(*mpEmptyItemSet);
97 void PageProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
99 // simply ignore item clearing on page objects
101 } // end of namespace properties
102 } // end of namespace sdr
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */