LCOV - code coverage report
Current view: top level - svx/source/svdraw - svdopage.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 43 75 57.3 %
Date: 2014-04-11 Functions: 14 21 66.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/svdopage.hxx>
      22             : #include "svx/svdglob.hxx"
      23             : #include "svx/svdstr.hrc"
      24             : #include <svx/svdtrans.hxx>
      25             : #include <svx/svdetc.hxx>
      26             : #include <svx/svdmodel.hxx>
      27             : #include <svx/svdpage.hxx>
      28             : #include <svx/svdpagv.hxx>
      29             : #include <svx/svdoutl.hxx>
      30             : #include <svtools/colorcfg.hxx>
      31             : #include <svl/itemset.hxx>
      32             : #include <svx/sdr/properties/pageproperties.hxx>
      33             : #include <svx/sdr/contact/viewcontactofpageobj.hxx>
      34             : 
      35             : 
      36             : // BaseProperties section
      37             : 
      38          21 : sdr::properties::BaseProperties* SdrPageObj::CreateObjectSpecificProperties()
      39             : {
      40          21 :     return new sdr::properties::PageProperties(*this);
      41             : }
      42             : 
      43             : 
      44             : // DrawContact section
      45             : 
      46         772 : sdr::contact::ViewContact* SdrPageObj::CreateObjectSpecificViewContact()
      47             : {
      48         772 :     return new sdr::contact::ViewContactOfPageObj(*this);
      49             : }
      50             : 
      51             : 
      52             : // this method is called form the destructor of the referenced page.
      53             : // do all necessary action to forget the page. It is not necessary to call
      54             : // RemovePageUser(), that is done form the destructor.
      55           1 : void SdrPageObj::PageInDestruction(const SdrPage& rPage)
      56             : {
      57           1 :     if(mpShownPage && mpShownPage == &rPage)
      58             :     {
      59             :         // #i58769# Do not call ActionChanged() here, because that would
      60             :         // lead to the construction of a view contact object for a page that
      61             :         // is being destroyed.
      62             : 
      63           1 :         mpShownPage = 0L;
      64             :     }
      65           1 : }
      66             : 
      67             : 
      68             : 
      69       13966 : TYPEINIT1(SdrPageObj,SdrObject);
      70             : 
      71         752 : SdrPageObj::SdrPageObj(SdrPage* pNewPage)
      72         752 : :   mpShownPage(pNewPage)
      73             : {
      74         752 :     if(mpShownPage)
      75             :     {
      76         230 :         mpShownPage->AddPageUser(*this);
      77             :     }
      78         752 : }
      79             : 
      80          20 : SdrPageObj::SdrPageObj(const Rectangle& rRect, SdrPage* pNewPage)
      81          20 : :   mpShownPage(pNewPage)
      82             : {
      83          20 :     if(mpShownPage)
      84             :     {
      85          20 :         mpShownPage->AddPageUser(*this);
      86             :     }
      87             : 
      88          20 :     aOutRect = rRect;
      89          20 : }
      90             : 
      91        2019 : SdrPageObj::~SdrPageObj()
      92             : {
      93         673 :     if(mpShownPage)
      94             :     {
      95         223 :         mpShownPage->RemovePageUser(*this);
      96             :     }
      97        1346 : }
      98             : 
      99          21 : SdrPage* SdrPageObj::GetReferencedPage() const
     100             : {
     101          21 :     return mpShownPage;
     102             : }
     103             : 
     104         619 : void SdrPageObj::SetReferencedPage(SdrPage* pNewPage)
     105             : {
     106         619 :     if(mpShownPage != pNewPage)
     107             :     {
     108          65 :         if(mpShownPage)
     109             :         {
     110          64 :             mpShownPage->RemovePageUser(*this);
     111             :         }
     112             : 
     113          65 :         mpShownPage = pNewPage;
     114             : 
     115          65 :         if(mpShownPage)
     116             :         {
     117          65 :             mpShownPage->AddPageUser(*this);
     118             :         }
     119             : 
     120          65 :         SetChanged();
     121          65 :         BroadcastObjectChange();
     122             :     }
     123         619 : }
     124             : 
     125             : // #i96598#
     126           0 : void SdrPageObj::SetBoundRectDirty()
     127             : {
     128             :     // avoid resetting aOutRect which in case of this object is model data,
     129             :     // not re-creatable view data
     130           0 : }
     131             : 
     132        3262 : sal_uInt16 SdrPageObj::GetObjIdentifier() const
     133             : {
     134        3262 :     return sal_uInt16(OBJ_PAGE);
     135             : }
     136             : 
     137           0 : void SdrPageObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
     138             : {
     139           0 :     rInfo.bRotateFreeAllowed=false;
     140           0 :     rInfo.bRotate90Allowed  =false;
     141           0 :     rInfo.bMirrorFreeAllowed=false;
     142           0 :     rInfo.bMirror45Allowed  =false;
     143           0 :     rInfo.bMirror90Allowed  =false;
     144           0 :     rInfo.bTransparenceAllowed = false;
     145           0 :     rInfo.bGradientAllowed = false;
     146           0 :     rInfo.bShearAllowed     =false;
     147           0 :     rInfo.bEdgeRadiusAllowed=false;
     148           0 :     rInfo.bNoOrthoDesired   =false;
     149           0 :     rInfo.bCanConvToPath    =false;
     150           0 :     rInfo.bCanConvToPoly    =false;
     151           0 :     rInfo.bCanConvToPathLineToArea=false;
     152           0 :     rInfo.bCanConvToPolyLineToArea=false;
     153           0 : }
     154             : 
     155           0 : SdrPageObj* SdrPageObj::Clone() const
     156             : {
     157           0 :     return CloneHelper< SdrPageObj >();
     158             : }
     159             : 
     160           0 : SdrPageObj& SdrPageObj::operator=(const SdrPageObj& rObj)
     161             : {
     162           0 :     if( this == &rObj )
     163           0 :         return *this;
     164           0 :     SdrObject::operator=(rObj);
     165           0 :     SetReferencedPage( rObj.GetReferencedPage());
     166           0 :     return *this;
     167             : }
     168             : 
     169           8 : OUString SdrPageObj::TakeObjNameSingul() const
     170             : {
     171           8 :     OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulPAGE));
     172             : 
     173          16 :     OUString aName(GetName());
     174           8 :     if (!aName.isEmpty())
     175             :     {
     176           0 :         sName.append(' ');
     177           0 :         sName.append('\'');
     178           0 :         sName.append(aName);
     179           0 :         sName.append('\'');
     180             :     }
     181             : 
     182          16 :     return sName.makeStringAndClear();
     183             : }
     184             : 
     185           0 : OUString SdrPageObj::TakeObjNamePlural() const
     186             : {
     187           0 :     return ImpGetResStr(STR_ObjNamePluralPAGE);
     188             : }
     189             : 
     190             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10