LibreOffice Module svx (master)  1
emptyproperties.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 
26 
27 namespace sdr::properties
28 {
29  // create a new itemset
30  std::unique_ptr<SfxItemSet> EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
31  {
32  // Basic implementation; Basic object has NO attributes
33  assert(!"EmptyProperties::CreateObjectSpecificItemSet() should never be called");
34  return std::make_unique<SfxItemSet>(rPool);
35  }
36 
38  : BaseProperties(rObj)
39  {
40  }
41 
42  std::unique_ptr<BaseProperties> EmptyProperties::Clone(SdrObject& rObj) const
43  {
44  return std::unique_ptr<BaseProperties>(new EmptyProperties(rObj));
45  }
46 
48  {
49  if(!mpEmptyItemSet)
50  {
51  const_cast<EmptyProperties*>(this)->mpEmptyItemSet = const_cast<EmptyProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool());
52  }
53 
55  assert(!"EmptyProperties::GetObjectItemSet() should never be called");
56 
57  return *mpEmptyItemSet;
58  }
59 
61  {
62  assert(!"EmptyProperties::SetObjectItem() should never be called");
63  }
64 
66  {
67  assert(!"EmptyProperties::SetObjectItemDirect() should never be called");
68  }
69 
70  void EmptyProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
71  {
72  assert(!"EmptyProperties::ClearObjectItem() should never be called");
73  }
74 
75  void EmptyProperties::ClearObjectItemDirect(const sal_uInt16 /*nWhich*/)
76  {
77  assert(!"EmptyProperties::ClearObjectItemDirect() should never be called");
78  }
79 
81  {
82  assert(!"EmptyProperties::SetObjectItemSet() should never be called");
83  }
84 
86  {
87  assert(!"EmptyProperties::ItemSetChanged() should never be called");
88  }
89 
90  bool EmptyProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const
91  {
92  assert(!"EmptyProperties::AllowItemChange() should never be called");
93  return true;
94  }
95 
96  void EmptyProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/)
97  {
98  assert(!"EmptyProperties::ItemChange() should never be called");
99  }
100 
101  void EmptyProperties::PostItemChange(const sal_uInt16 /*nWhich*/)
102  {
103  assert(!"EmptyProperties::PostItemChange() should never be called");
104  }
105 
106  void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, bool /*bDontRemoveHardAttr*/)
107  {
108  assert(!"EmptyProperties::SetStyleSheet() should never be called");
109  }
110 
112  {
113  assert(!"EmptyProperties::GetStyleSheet() should never be called");
114  return nullptr;
115  }
116 } // end of namespace
117 
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
virtual SfxStyleSheet * GetStyleSheet() const override
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) override
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) override
virtual void PostItemChange(const sal_uInt16 nWhich) override
virtual std::unique_ptr< SfxItemSet > CreateObjectSpecificItemSet(SfxItemPool &rPool) override
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual void ItemSetChanged(const SfxItemSet &rSet) override
std::unique_ptr< SfxItemSet > mpEmptyItemSet
virtual void SetObjectItem(const SfxPoolItem &rItem) override
Abstract DrawObject.
Definition: svdobj.hxx:313
virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) const override
virtual void ClearObjectItem(const sal_uInt16 nWhich=0) override
virtual const SfxItemSet & GetObjectItemSet() const override
virtual void SetObjectItemDirect(const SfxPoolItem &rItem) override
virtual void ClearObjectItemDirect(const sal_uInt16 nWhich) override
const SdrObject & GetSdrObject() const
Definition: properties.cxx:59
virtual void SetObjectItemSet(const SfxItemSet &rSet) override