LibreOffice Module svx (master) 1
pageproperties.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <sal/config.h>
21
23#include <svl/itemset.hxx>
24#include <svx/svdobj.hxx>
25#include <tools/debug.hxx>
26
27
28namespace sdr::properties
29{
31 : BaseProperties(rObj)
32 {
33 }
34
36 : BaseProperties(rObj)
37 {
38 }
39
41 {
42 }
43
44 std::unique_ptr<BaseProperties> PageProperties::Clone(SdrObject& rObj) const
45 {
46 return std::unique_ptr<BaseProperties>(new PageProperties(*this, rObj));
47 }
48
50 {
51 return SfxItemSet(rPool);
52 }
53
54 // get itemset. Override here to allow creating the empty itemset
55 // without asserting
57 {
59 {
60 mxEmptyItemSet.emplace(GetSdrObject().GetObjectItemPool());
61 }
62
63 DBG_ASSERT(mxEmptyItemSet, "Could not create an SfxItemSet(!)");
64
65 return *mxEmptyItemSet;
66 }
67
69 {
70 // override to legally return a 0L pointer here
71 return nullptr;
72 }
73
74 void PageProperties::SetStyleSheet(SfxStyleSheet* /*pStyleSheet*/, bool /*bDontRemoveHardAttr*/,
75 bool /*bBroadcast*/)
76 {
77 // override to legally ignore the StyleSheet here
78 }
79
80 void PageProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
81 {
82 // simply ignore item clearing on page objects
83 }
84
86 {
87 assert(!"PageProperties::SetObjectItem() should never be called");
88 }
89
91 {
92 assert(!"PageProperties::SetObjectItemDirect() should never be called");
93 }
94
95 void PageProperties::ClearObjectItemDirect(const sal_uInt16 /*nWhich*/)
96 {
97 assert(!"PageProperties::ClearObjectItemDirect() should never be called");
98 }
99
101 {
102 assert(!"PageProperties::SetObjectItemSet() should never be called");
103 }
104} // end of namespace
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Abstract DrawObject.
Definition: svdobj.hxx:260
const SdrObject & GetSdrObject() const
Definition: properties.cxx:43
virtual void SetObjectItemSet(const SfxItemSet &rSet) override
virtual ~PageProperties() override
std::optional< SfxItemSet > mxEmptyItemSet
virtual void SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast) override
virtual void SetObjectItem(const SfxPoolItem &rItem) override
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
virtual void ClearObjectItem(const sal_uInt16 nWhich=0) override
virtual void SetObjectItemDirect(const SfxPoolItem &rItem) override
virtual void ClearObjectItemDirect(const sal_uInt16 nWhich) override
virtual SfxStyleSheet * GetStyleSheet() const override
virtual const SfxItemSet & GetObjectItemSet() const override
virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool &pPool) override
#define DBG_ASSERT(sCon, aError)