LCOV - code coverage report
Current view: top level - svx/source/engine3d - objfac3d.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 20 26 76.9 %
Date: 2014-11-03 Functions: 6 6 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 <svx/svdpage.hxx>
      21             : #include "svx/globl3d.hxx"
      22             : #include <svx/polysc3d.hxx>
      23             : #include <svx/cube3d.hxx>
      24             : #include <svx/sphere3d.hxx>
      25             : #include <svx/extrud3d.hxx>
      26             : #include <svx/lathe3d.hxx>
      27             : #include <svx/polygn3d.hxx>
      28             : #include "svx/objfac3d.hxx"
      29             : #include <svx/svdobj.hxx>
      30             : 
      31             : static bool bInit = false;
      32             : 
      33         960 : E3dObjFactory::E3dObjFactory()
      34             : {
      35         960 :     if ( !bInit )
      36             :     {
      37         170 :         SdrObjFactory::InsertMakeObjectHdl(LINK(this, E3dObjFactory, MakeObject));
      38         170 :         bInit = true;
      39             :     }
      40         960 : }
      41             : 
      42         958 : E3dObjFactory::~E3dObjFactory()
      43             : {
      44         958 : }
      45             : 
      46             : // Generate chart internal objects
      47             : 
      48       11008 : IMPL_LINK( E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
      49             : {
      50        5504 :     if ( pObjFactory->nInventor == E3dInventor )
      51             :     {
      52        5504 :         switch ( pObjFactory->nIdentifier )
      53             :         {
      54             :             case E3D_POLYSCENE_ID:
      55        1406 :                 pObjFactory->pNewObj = new E3dPolyScene();
      56        1406 :                 break;
      57             :             case E3D_POLYGONOBJ_ID  :
      58         745 :                 pObjFactory->pNewObj = new E3dPolygonObj();
      59         745 :                 break;
      60             :             case E3D_CUBEOBJ_ID :
      61           0 :                 pObjFactory->pNewObj = new E3dCubeObj();
      62           0 :                 break;
      63             :             case E3D_SPHEREOBJ_ID:
      64             :                 // Gets the dummy constructor, as this is only called when
      65             :                 // loading documents. The actual number of segments is however
      66             :                 // determined only after loading the members. This will result
      67             :                 // in that the first sphere will be immediately destroyed,
      68             :                 // although it was never used.
      69           0 :                 pObjFactory->pNewObj = new E3dSphereObj(123);
      70           0 :                 break;
      71             :             case E3D_EXTRUDEOBJ_ID:
      72        3257 :                 pObjFactory->pNewObj = new E3dExtrudeObj();
      73        3257 :                 break;
      74             :             case E3D_LATHEOBJ_ID:
      75          96 :                 pObjFactory->pNewObj = new E3dLatheObj();
      76          96 :                 break;
      77             :             case E3D_COMPOUNDOBJ_ID:
      78           0 :                 pObjFactory->pNewObj = new E3dCompoundObject();
      79           0 :                 break;
      80             :         }
      81             :     }
      82        5504 :     return 0;
      83         651 : }
      84             : 
      85             : 
      86             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10