1*f6e50924SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*f6e50924SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*f6e50924SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*f6e50924SAndrew Rist * distributed with this work for additional information 6*f6e50924SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*f6e50924SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*f6e50924SAndrew Rist * "License"); you may not use this file except in compliance 9*f6e50924SAndrew Rist * with the License. You may obtain a copy of the License at 10*f6e50924SAndrew Rist * 11*f6e50924SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*f6e50924SAndrew Rist * 13*f6e50924SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*f6e50924SAndrew Rist * software distributed under the License is distributed on an 15*f6e50924SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*f6e50924SAndrew Rist * KIND, either express or implied. See the License for the 17*f6e50924SAndrew Rist * specific language governing permissions and limitations 18*f6e50924SAndrew Rist * under the License. 19*f6e50924SAndrew Rist * 20*f6e50924SAndrew Rist *************************************************************/ 21*f6e50924SAndrew Rist 22*f6e50924SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_svx.hxx" 26cdf0e10cSrcweir #include <svx/sdr/properties/emptyproperties.hxx> 27cdf0e10cSrcweir #include <tools/debug.hxx> 28cdf0e10cSrcweir #include <svl/itemset.hxx> 29cdf0e10cSrcweir #include <svx/svddef.hxx> 30cdf0e10cSrcweir #include <svx/svdobj.hxx> 31cdf0e10cSrcweir #include <svx/svdpool.hxx> 32cdf0e10cSrcweir 33cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 34cdf0e10cSrcweir 35cdf0e10cSrcweir namespace sdr 36cdf0e10cSrcweir { 37cdf0e10cSrcweir namespace properties 38cdf0e10cSrcweir { 39cdf0e10cSrcweir // create a new itemset CreateObjectSpecificItemSet(SfxItemPool & rPool)40cdf0e10cSrcweir SfxItemSet& EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool) 41cdf0e10cSrcweir { 42cdf0e10cSrcweir // Basic implementation; Basic object has NO attributes 43cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::CreateObjectSpecificItemSet() should never be called"); 44cdf0e10cSrcweir return *(new SfxItemSet(rPool)); 45cdf0e10cSrcweir } 46cdf0e10cSrcweir EmptyProperties(SdrObject & rObj)47cdf0e10cSrcweir EmptyProperties::EmptyProperties(SdrObject& rObj) 48cdf0e10cSrcweir : BaseProperties(rObj), 49cdf0e10cSrcweir mpEmptyItemSet(0L) 50cdf0e10cSrcweir { 51cdf0e10cSrcweir } 52cdf0e10cSrcweir EmptyProperties(const EmptyProperties & rProps,SdrObject & rObj)53cdf0e10cSrcweir EmptyProperties::EmptyProperties(const EmptyProperties& rProps, SdrObject& rObj) 54cdf0e10cSrcweir : BaseProperties(rProps, rObj), 55cdf0e10cSrcweir mpEmptyItemSet(0L) 56cdf0e10cSrcweir { 57cdf0e10cSrcweir // #115593# 58cdf0e10cSrcweir // do not gererate an assert, else derivations like PageProperties will generate an assert 59cdf0e10cSrcweir // using the Clone() operator path. 60cdf0e10cSrcweir } 61cdf0e10cSrcweir ~EmptyProperties()62cdf0e10cSrcweir EmptyProperties::~EmptyProperties() 63cdf0e10cSrcweir { 64cdf0e10cSrcweir if(mpEmptyItemSet) 65cdf0e10cSrcweir { 66cdf0e10cSrcweir delete mpEmptyItemSet; 67cdf0e10cSrcweir mpEmptyItemSet = 0L; 68cdf0e10cSrcweir } 69cdf0e10cSrcweir } 70cdf0e10cSrcweir Clone(SdrObject & rObj) const71cdf0e10cSrcweir BaseProperties& EmptyProperties::Clone(SdrObject& rObj) const 72cdf0e10cSrcweir { 73cdf0e10cSrcweir return *(new EmptyProperties(*this, rObj)); 74cdf0e10cSrcweir } 75cdf0e10cSrcweir GetObjectItemSet() const76cdf0e10cSrcweir const SfxItemSet& EmptyProperties::GetObjectItemSet() const 77cdf0e10cSrcweir { 78cdf0e10cSrcweir if(!mpEmptyItemSet) 79cdf0e10cSrcweir { 80cdf0e10cSrcweir ((EmptyProperties*)this)->mpEmptyItemSet = &(((EmptyProperties*)this)->CreateObjectSpecificItemSet(*GetSdrObject().GetObjectItemPool())); 81cdf0e10cSrcweir } 82cdf0e10cSrcweir 83cdf0e10cSrcweir DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)"); 84cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::GetObjectItemSet() should never be called (!)"); 85cdf0e10cSrcweir 86cdf0e10cSrcweir return *mpEmptyItemSet; 87cdf0e10cSrcweir } 88cdf0e10cSrcweir SetObjectItem(const SfxPoolItem &)89cdf0e10cSrcweir void EmptyProperties::SetObjectItem(const SfxPoolItem& /*rItem*/) 90cdf0e10cSrcweir { 91cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::SetObjectItem() should never be called (!)"); 92cdf0e10cSrcweir } 93cdf0e10cSrcweir SetObjectItemDirect(const SfxPoolItem &)94cdf0e10cSrcweir void EmptyProperties::SetObjectItemDirect(const SfxPoolItem& /*rItem*/) 95cdf0e10cSrcweir { 96cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::SetObjectItemDirect() should never be called (!)"); 97cdf0e10cSrcweir } 98cdf0e10cSrcweir ClearObjectItem(const sal_uInt16)99cdf0e10cSrcweir void EmptyProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/) 100cdf0e10cSrcweir { 101cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::ClearObjectItem() should never be called (!)"); 102cdf0e10cSrcweir } 103cdf0e10cSrcweir ClearObjectItemDirect(const sal_uInt16)104cdf0e10cSrcweir void EmptyProperties::ClearObjectItemDirect(const sal_uInt16 /*nWhich*/) 105cdf0e10cSrcweir { 106cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::ClearObjectItemDirect() should never be called (!)"); 107cdf0e10cSrcweir } 108cdf0e10cSrcweir SetObjectItemSet(const SfxItemSet &)109cdf0e10cSrcweir void EmptyProperties::SetObjectItemSet(const SfxItemSet& /*rSet*/) 110cdf0e10cSrcweir { 111cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::SetObjectItemSet() should never be called (!)"); 112cdf0e10cSrcweir } 113cdf0e10cSrcweir ItemSetChanged(const SfxItemSet &)114cdf0e10cSrcweir void EmptyProperties::ItemSetChanged(const SfxItemSet& /*rSet*/) 115cdf0e10cSrcweir { 116cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::ItemSetChanged() should never be called (!)"); 117cdf0e10cSrcweir } 118cdf0e10cSrcweir AllowItemChange(const sal_uInt16,const SfxPoolItem *) const119cdf0e10cSrcweir sal_Bool EmptyProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const 120cdf0e10cSrcweir { 121cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::AllowItemChange() should never be called (!)"); 122cdf0e10cSrcweir return sal_True; 123cdf0e10cSrcweir } 124cdf0e10cSrcweir ItemChange(const sal_uInt16,const SfxPoolItem *)125cdf0e10cSrcweir void EmptyProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) 126cdf0e10cSrcweir { 127cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::ItemChange() should never be called (!)"); 128cdf0e10cSrcweir } 129cdf0e10cSrcweir PostItemChange(const sal_uInt16)130cdf0e10cSrcweir void EmptyProperties::PostItemChange(const sal_uInt16 /*nWhich*/) 131cdf0e10cSrcweir { 132cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::PostItemChange() should never be called (!)"); 133cdf0e10cSrcweir } 134cdf0e10cSrcweir SetStyleSheet(SfxStyleSheet *,sal_Bool)135cdf0e10cSrcweir void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, sal_Bool /*bDontRemoveHardAttr*/) 136cdf0e10cSrcweir { 137cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::SetStyleSheet() should never be called (!)"); 138cdf0e10cSrcweir } 139cdf0e10cSrcweir GetStyleSheet() const140cdf0e10cSrcweir SfxStyleSheet* EmptyProperties::GetStyleSheet() const 141cdf0e10cSrcweir { 142cdf0e10cSrcweir DBG_ASSERT(sal_False, "EmptyProperties::GetStyleSheet() should never be called (!)"); 143cdf0e10cSrcweir return 0L; 144cdf0e10cSrcweir } 145cdf0e10cSrcweir } // end of namespace properties 146cdf0e10cSrcweir } // end of namespace sdr 147cdf0e10cSrcweir 148cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 149cdf0e10cSrcweir // eof 150