LCOV - code coverage report
Current view: top level - svx/source/svdraw - svdobjplusdata.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 25 26 96.2 %
Date: 2015-06-13 12:38:46 Functions: 5 10 50.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             : 
      10             : #include <svdobjplusdata.hxx>
      11             : #include <svdobjuserdatalist.hxx>
      12             : 
      13             : #include <svx/svdglue.hxx>
      14             : 
      15             : #include <svl/SfxBroadcaster.hxx>
      16             : 
      17           0 : TYPEINIT0(SdrObjPlusData);
      18             : 
      19       54642 : SdrObjPlusData::SdrObjPlusData():
      20             :     pBroadcast(NULL),
      21             :     pUserDataList(NULL),
      22       54642 :     pGluePoints(NULL)
      23             : {
      24       54642 : }
      25             : 
      26      161778 : SdrObjPlusData::~SdrObjPlusData()
      27             : {
      28       53926 :     delete pBroadcast;
      29       53926 :     delete pUserDataList;
      30       53926 :     delete pGluePoints;
      31      107852 : }
      32             : 
      33         200 : SdrObjPlusData* SdrObjPlusData::Clone(SdrObject* pObj1) const
      34             : {
      35         200 :     SdrObjPlusData* pNeuPlusData=new SdrObjPlusData;
      36         200 :     if (pUserDataList!=NULL) {
      37           8 :         sal_uInt16 nCount=pUserDataList->GetUserDataCount();
      38           8 :         if (nCount!=0) {
      39           8 :             pNeuPlusData->pUserDataList=new SdrObjUserDataList;
      40          17 :             for (sal_uInt16 i=0; i<nCount; i++) {
      41           9 :                 SdrObjUserData* pNeuUserData=pUserDataList->GetUserData(i)->Clone(pObj1);
      42           9 :                 if (pNeuUserData!=NULL) {
      43           9 :                     pNeuPlusData->pUserDataList->AppendUserData(pNeuUserData);
      44             :                 } else {
      45             :                     OSL_FAIL("SdrObjPlusData::Clone(): UserData.Clone() returns NULL.");
      46             :                 }
      47             :             }
      48             :         }
      49             :     }
      50         200 :     if (pGluePoints!=NULL) pNeuPlusData->pGluePoints=new SdrGluePointList(*pGluePoints);
      51             :     // MtfAnimator isn't copied either
      52             : 
      53             :     // #i68101#
      54             :     // copy object name, title and description
      55         200 :     pNeuPlusData->aObjName = aObjName;
      56         200 :     pNeuPlusData->aObjTitle = aObjTitle;
      57         200 :     pNeuPlusData->aObjDescription = aObjDescription;
      58             : 
      59         200 :     return pNeuPlusData;
      60             : }
      61             : 
      62         123 : void SdrObjPlusData::SetGluePoints(const SdrGluePointList& rPts)
      63             : {
      64         123 :     return *pGluePoints = rPts;
      65             : }
      66             : 
      67             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11