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

Generated by: LCOV version 1.10