LCOV - code coverage report
Current view: top level - svx/source/sdr/properties - emptyproperties.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 8 41 19.5 %
Date: 2015-06-13 12:38:46 Functions: 2 18 11.1 %
Legend: Lines: hit not hit

          Line data    Source code
       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 <sdr/properties/emptyproperties.hxx>
      21             : #include <tools/debug.hxx>
      22             : #include <svl/itemset.hxx>
      23             : #include <svx/svddef.hxx>
      24             : #include <svx/svdobj.hxx>
      25             : #include <svx/svdpool.hxx>
      26             : 
      27             : 
      28             : 
      29             : namespace sdr
      30             : {
      31             :     namespace properties
      32             :     {
      33             :         // create a new itemset
      34           0 :         SfxItemSet* EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
      35             :         {
      36             :             // Basic implementation; Basic object has NO attributes
      37             :             DBG_ASSERT(false, "EmptyProperties::CreateObjectSpecificItemSet() should never be called");
      38           0 :             return new SfxItemSet(rPool);
      39             :         }
      40             : 
      41          56 :         EmptyProperties::EmptyProperties(SdrObject& rObj)
      42             :         :   BaseProperties(rObj),
      43          56 :             mpEmptyItemSet(0L)
      44             :         {
      45          56 :         }
      46             : 
      47           0 :         EmptyProperties::EmptyProperties(const EmptyProperties& rProps, SdrObject& rObj)
      48             :         :   BaseProperties(rProps, rObj),
      49           0 :             mpEmptyItemSet(0L)
      50             :         {
      51             :             // #115593#
      52             :             // do not gererate an assert, else derivations like PageProperties will generate an assert
      53             :             // using the Clone() operator path.
      54           0 :         }
      55             : 
      56         112 :         EmptyProperties::~EmptyProperties()
      57             :         {
      58          56 :             if(mpEmptyItemSet)
      59             :             {
      60           5 :                 delete mpEmptyItemSet;
      61           5 :                 mpEmptyItemSet = 0L;
      62             :             }
      63          56 :         }
      64             : 
      65           0 :         BaseProperties& EmptyProperties::Clone(SdrObject& rObj) const
      66             :         {
      67           0 :             return *(new EmptyProperties(*this, rObj));
      68             :         }
      69             : 
      70           0 :         const SfxItemSet& EmptyProperties::GetObjectItemSet() const
      71             :         {
      72           0 :             if(!mpEmptyItemSet)
      73             :             {
      74           0 :                 const_cast<EmptyProperties*>(this)->mpEmptyItemSet = const_cast<EmptyProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool());
      75             :             }
      76             : 
      77             :             DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
      78             :             DBG_ASSERT(false, "EmptyProperties::GetObjectItemSet() should never be called (!)");
      79             : 
      80           0 :             return *mpEmptyItemSet;
      81             :         }
      82             : 
      83           0 :         void EmptyProperties::SetObjectItem(const SfxPoolItem& /*rItem*/)
      84             :         {
      85             :             DBG_ASSERT(false, "EmptyProperties::SetObjectItem() should never be called (!)");
      86           0 :         }
      87             : 
      88           0 :         void EmptyProperties::SetObjectItemDirect(const SfxPoolItem& /*rItem*/)
      89             :         {
      90             :             DBG_ASSERT(false, "EmptyProperties::SetObjectItemDirect() should never be called (!)");
      91           0 :         }
      92             : 
      93           0 :         void EmptyProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
      94             :         {
      95             :             DBG_ASSERT(false, "EmptyProperties::ClearObjectItem() should never be called (!)");
      96           0 :         }
      97             : 
      98           0 :         void EmptyProperties::ClearObjectItemDirect(const sal_uInt16 /*nWhich*/)
      99             :         {
     100             :             DBG_ASSERT(false, "EmptyProperties::ClearObjectItemDirect() should never be called (!)");
     101           0 :         }
     102             : 
     103           0 :         void EmptyProperties::SetObjectItemSet(const SfxItemSet& /*rSet*/)
     104             :         {
     105             :             DBG_ASSERT(false, "EmptyProperties::SetObjectItemSet() should never be called (!)");
     106           0 :         }
     107             : 
     108           0 :         void EmptyProperties::ItemSetChanged(const SfxItemSet& /*rSet*/)
     109             :         {
     110             :             DBG_ASSERT(false, "EmptyProperties::ItemSetChanged() should never be called (!)");
     111           0 :         }
     112             : 
     113           0 :         bool EmptyProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const
     114             :         {
     115             :             DBG_ASSERT(false, "EmptyProperties::AllowItemChange() should never be called (!)");
     116           0 :             return true;
     117             :         }
     118             : 
     119           0 :         void EmptyProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/)
     120             :         {
     121             :             DBG_ASSERT(false, "EmptyProperties::ItemChange() should never be called (!)");
     122           0 :         }
     123             : 
     124           0 :         void EmptyProperties::PostItemChange(const sal_uInt16 /*nWhich*/)
     125             :         {
     126             :             DBG_ASSERT(false, "EmptyProperties::PostItemChange() should never be called (!)");
     127           0 :         }
     128             : 
     129           0 :         void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, bool /*bDontRemoveHardAttr*/)
     130             :         {
     131             :             DBG_ASSERT(false, "EmptyProperties::SetStyleSheet() should never be called (!)");
     132           0 :         }
     133             : 
     134           0 :         SfxStyleSheet* EmptyProperties::GetStyleSheet() const
     135             :         {
     136             :             DBG_ASSERT(false, "EmptyProperties::GetStyleSheet() should never be called (!)");
     137           0 :             return 0L;
     138             :         }
     139             :     } // end of namespace properties
     140             : } // end of namespace sdr
     141             : 
     142             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11