LCOV - code coverage report
Current view: top level - svx/source/sdr/properties - captionproperties.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 28 28 100.0 %
Date: 2014-11-03 Functions: 11 11 100.0 %
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/captionproperties.hxx>
      21             : #include <svl/itemset.hxx>
      22             : #include <svl/style.hxx>
      23             : #include <svx/svddef.hxx>
      24             : #include <editeng/eeitem.hxx>
      25             : #include <svx/svdocapt.hxx>
      26             : 
      27             : 
      28             : 
      29             : namespace sdr
      30             : {
      31             :     namespace properties
      32             :     {
      33             :         // create a new itemset
      34         118 :         SfxItemSet& CaptionProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
      35             :         {
      36             :             return *(new SfxItemSet(rPool,
      37             : 
      38             :                 // range from SdrAttrObj
      39             :                 SDRATTR_START, SDRATTR_SHADOW_LAST,
      40             :                 SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
      41             :                 SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
      42             : 
      43             :                 // range from SdrCaptionObj
      44             :                 SDRATTR_CAPTION_FIRST, SDRATTR_CAPTION_LAST,
      45             : 
      46             :                 // range from SdrTextObj
      47             :                 EE_ITEMS_START, EE_ITEMS_END,
      48             : 
      49             :                 // end
      50         118 :                 0, 0));
      51             :         }
      52             : 
      53         118 :         CaptionProperties::CaptionProperties(SdrObject& rObj)
      54         118 :         :   RectangleProperties(rObj)
      55             :         {
      56         118 :         }
      57             : 
      58           6 :         CaptionProperties::CaptionProperties(const CaptionProperties& rProps, SdrObject& rObj)
      59           6 :         :   RectangleProperties(rProps, rObj)
      60             :         {
      61           6 :         }
      62             : 
      63         236 :         CaptionProperties::~CaptionProperties()
      64             :         {
      65         236 :         }
      66             : 
      67           6 :         BaseProperties& CaptionProperties::Clone(SdrObject& rObj) const
      68             :         {
      69           6 :             return *(new CaptionProperties(*this, rObj));
      70             :         }
      71             : 
      72         600 :         void CaptionProperties::ItemSetChanged(const SfxItemSet& rSet)
      73             :         {
      74         600 :             SdrCaptionObj& rObj = static_cast<SdrCaptionObj&>(GetSdrObject());
      75             : 
      76             :             // local changes
      77         600 :             rObj.ImpRecalcTail();
      78             : 
      79             :             // call parent
      80         600 :             RectangleProperties::ItemSetChanged(rSet);
      81         600 :         }
      82             : 
      83         118 :         void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
      84             :         {
      85         118 :             SdrCaptionObj& rObj = static_cast<SdrCaptionObj&>(GetSdrObject());
      86             : 
      87             :             // call parent
      88         118 :             RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
      89             : 
      90             :             // local changes
      91         118 :             rObj.ImpRecalcTail();
      92         118 :         }
      93             : 
      94         118 :         void CaptionProperties::ForceDefaultAttributes()
      95             :         {
      96             :             // call parent
      97         118 :             RectangleProperties::ForceDefaultAttributes();
      98             : 
      99             :             // force ItemSet
     100         118 :             GetObjectItemSet();
     101             : 
     102             :             // this was set by TextProperties::ForceDefaultAttributes(),
     103             :             // retet to default
     104         118 :             mpItemSet->ClearItem(XATTR_LINESTYLE);
     105         118 :         }
     106             :     } // end of namespace properties
     107         651 : } // end of namespace sdr
     108             : 
     109             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10