LCOV - code coverage report
Current view: top level - svx/source/svdraw - svdoattr.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 33 39 84.6 %
Date: 2014-04-11 Functions: 8 15 53.3 %
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             : 
      21             : #include <svx/svdoattr.hxx>
      22             : #include <svx/xpool.hxx>
      23             : #include <svx/svdmodel.hxx>
      24             : #include <svx/svdpage.hxx>
      25             : #include <svx/svdattr.hxx>
      26             : #include <svx/svdpool.hxx>
      27             : #include <svx/svdotext.hxx>
      28             : #include <svx/svdocapt.hxx>
      29             : #include <svx/svdograf.hxx>
      30             : #include <svx/svdoole2.hxx>
      31             : #include <svx/svdorect.hxx>
      32             : #include <svx/svdocirc.hxx>
      33             : #include <svx/svdomeas.hxx>
      34             : #include <svl/smplhint.hxx>
      35             : #include <svl/itemiter.hxx>
      36             : #include <svx/xenum.hxx>
      37             : #include <svx/xlineit0.hxx>
      38             : #include <svx/xlnstwit.hxx>
      39             : #include <svx/xlnedwit.hxx>
      40             : #include <svx/xfillit0.hxx>
      41             : #include <svx/xflbmtit.hxx>
      42             : #include <svx/xtextit0.hxx>
      43             : #include <svx/xflbstit.hxx>
      44             : #include <svx/xflbtoxy.hxx>
      45             : #include <svx/xftshit.hxx>
      46             : 
      47             : #include <editeng/editdata.hxx>
      48             : #include <editeng/colritem.hxx>
      49             : #include "editeng/fontitem.hxx"
      50             : #include <editeng/fhgtitem.hxx>
      51             : 
      52             : #include <svx/xlnstcit.hxx>
      53             : #include <svx/xlnwtit.hxx>
      54             : #include <svl/style.hxx>
      55             : #include <svl/whiter.hxx>
      56             : #include <svx/xlnclit.hxx>
      57             : #include <svx/xflclit.hxx>
      58             : #include <svx/xlntrit.hxx>
      59             : #include <svx/xfltrit.hxx>
      60             : #include <svx/xlnedcit.hxx>
      61             : #include <editeng/adjustitem.hxx>
      62             : #include <svx/xflbckit.hxx>
      63             : #include <svx/xtable.hxx>
      64             : #include <svx/xbtmpit.hxx>
      65             : #include <svx/xlndsit.hxx>
      66             : #include <svx/xlnedit.hxx>
      67             : #include <svx/xflgrit.hxx>
      68             : #include <svx/xflftrit.hxx>
      69             : #include <svx/xflhtit.hxx>
      70             : #include <svx/xlnstit.hxx>
      71             : #include <svx/sdr/properties/attributeproperties.hxx>
      72             : #include <basegfx/polygon/b2dpolygon.hxx>
      73             : #include "svx/xlinjoit.hxx"
      74             : 
      75             : 
      76             : 
      77           0 : sdr::properties::BaseProperties* SdrAttrObj::CreateObjectSpecificProperties()
      78             : {
      79           0 :     return new sdr::properties::AttributeProperties(*this);
      80             : }
      81             : 
      82             : 
      83             : 
      84     1847462 : TYPEINIT1(SdrAttrObj,SdrObject);
      85             : 
      86       42609 : SdrAttrObj::SdrAttrObj()
      87             : {
      88       42609 : }
      89             : 
      90       37295 : SdrAttrObj::~SdrAttrObj()
      91             : {
      92       37295 : }
      93             : 
      94      413165 : const Rectangle& SdrAttrObj::GetSnapRect() const
      95             : {
      96      413165 :     if(bSnapRectDirty)
      97             :     {
      98       70686 :         ((SdrAttrObj*)this)->RecalcSnapRect();
      99       70686 :         ((SdrAttrObj*)this)->bSnapRectDirty = false;
     100             :     }
     101             : 
     102      413165 :     return maSnapRect;
     103             : }
     104             : 
     105       74470 : void SdrAttrObj::SetModel(SdrModel* pNewModel)
     106             : {
     107       74470 :     SdrModel* pOldModel = pModel;
     108             : 
     109             :     // test for correct pool in ItemSet; move to new pool if necessary
     110       74470 :     if(pNewModel && GetObjectItemPool() && GetObjectItemPool() != &pNewModel->GetItemPool())
     111             :     {
     112       39820 :         MigrateItemPool(GetObjectItemPool(), &pNewModel->GetItemPool(), pNewModel);
     113             :     }
     114             : 
     115             :     // call parent
     116       74470 :     SdrObject::SetModel(pNewModel);
     117             : 
     118             :     // modify properties
     119       74470 :     GetProperties().SetModel(pOldModel, pNewModel);
     120       74470 : }
     121             : 
     122             : 
     123             : // syntactical sugar for ItemSet accesses
     124             : 
     125       47862 : void SdrAttrObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
     126             : {
     127       47862 :     SfxSimpleHint *pSimple = PTR_CAST(SfxSimpleHint, &rHint);
     128       47862 :     bool bDataChg(pSimple && SFX_HINT_DATACHANGED == pSimple->GetId());
     129             : 
     130       47862 :     if(bDataChg)
     131             :     {
     132       34280 :         Rectangle aBoundRect = GetLastBoundRect();
     133       34280 :         SetBoundRectDirty();
     134       34280 :         SetRectsDirty(true);
     135             : 
     136             :         // This may have led to object change
     137       34280 :         SetChanged();
     138       34280 :         BroadcastObjectChange();
     139       34280 :         SendUserCall(SDRUSERCALL_CHGATTR, aBoundRect);
     140             :     }
     141       47862 : }
     142             : 
     143         228 : sal_Int32 SdrAttrObj::ImpGetLineWdt() const
     144             : {
     145         228 :     sal_Int32 nRetval(0);
     146             : 
     147         228 :     if(XLINE_NONE != ((XLineStyleItem&)(GetObjectItem(XATTR_LINESTYLE))).GetValue())
     148             :     {
     149          20 :         nRetval = ((XLineWidthItem&)(GetObjectItem(XATTR_LINEWIDTH))).GetValue();
     150             :     }
     151             : 
     152         228 :     return nRetval;
     153             : }
     154             : 
     155           0 : bool SdrAttrObj::HasFill() const
     156             : {
     157           0 :     return bClosedObj && ((XFillStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_FILLSTYLE))).GetValue()!=XFILL_NONE;
     158             : }
     159             : 
     160           0 : bool SdrAttrObj::HasLine() const
     161             : {
     162           0 :     return ((XLineStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_LINESTYLE))).GetValue()!=XLINE_NONE;
     163             : }
     164             : 
     165             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10