LCOV - code coverage report
Current view: top level - svx/source/sdr/properties - pageproperties.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 13 26 50.0 %
Date: 2015-06-13 12:38:46 Functions: 6 11 54.5 %
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/pageproperties.hxx>
      21             : #include <svl/itemset.hxx>
      22             : #include <svx/svdobj.hxx>
      23             : #include <svx/svdpool.hxx>
      24             : 
      25             : 
      26             : 
      27             : namespace sdr
      28             : {
      29             :     namespace properties
      30             :     {
      31             :         // create a new itemset
      32           5 :         SfxItemSet* PageProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
      33             :         {
      34             :             // override to legally return a valid ItemSet
      35           5 :             return new SfxItemSet(rPool);
      36             :         }
      37             : 
      38          56 :         PageProperties::PageProperties(SdrObject& rObj)
      39          56 :         :   EmptyProperties(rObj)
      40             :         {
      41          56 :         }
      42             : 
      43           0 :         PageProperties::PageProperties(const PageProperties& rProps, SdrObject& rObj)
      44           0 :         :   EmptyProperties(rProps, rObj)
      45             :         {
      46           0 :         }
      47             : 
      48         112 :         PageProperties::~PageProperties()
      49             :         {
      50         112 :         }
      51             : 
      52           0 :         BaseProperties& PageProperties::Clone(SdrObject& rObj) const
      53             :         {
      54           0 :             return *(new PageProperties(*this, rObj));
      55             :         }
      56             : 
      57             :         // get itemset. Override here to allow creating the empty itemset
      58             :         // without asserting
      59           5 :         const SfxItemSet& PageProperties::GetObjectItemSet() const
      60             :         {
      61           5 :             if(!mpEmptyItemSet)
      62             :             {
      63           5 :                 const_cast<PageProperties*>(this)->mpEmptyItemSet = const_cast<PageProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool());
      64             :             }
      65             : 
      66             :             DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
      67             : 
      68           5 :             return *mpEmptyItemSet;
      69             :         }
      70             : 
      71           0 :         void PageProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/)
      72             :         {
      73             :             // #86481# simply ignore item setting on page objects
      74           0 :         }
      75             : 
      76          51 :         SfxStyleSheet* PageProperties::GetStyleSheet() const
      77             :         {
      78             :             // override to legally return a 0L pointer here
      79          51 :             return 0L;
      80             :         }
      81             : 
      82           0 :         void PageProperties::PostItemChange(const sal_uInt16 nWhich )
      83             :         {
      84           0 :             if( (nWhich == XATTR_FILLSTYLE) && (mpEmptyItemSet != NULL) )
      85           0 :                 CleanupFillProperties(*mpEmptyItemSet);
      86           0 :         }
      87             : 
      88           0 :         void PageProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
      89             :         {
      90             :             // simply ignore item clearing on page objects
      91           0 :         }
      92             :     } // end of namespace properties
      93             : } // end of namespace sdr
      94             : 
      95             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11