LCOV - code coverage report
Current view: top level - svx/source/engine3d - objfac3d.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 19 25 76.0 %
Date: 2014-04-11 Functions: 4 4 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         382 : E3dObjFactory::E3dObjFactory()
      34             : {
      35         382 :     if ( !bInit )
      36             :     {
      37          74 :         SdrObjFactory::InsertMakeObjectHdl(LINK(this, E3dObjFactory, MakeObject));
      38          74 :         bInit = true;
      39             :     }
      40         382 : }
      41             : 
      42         378 : E3dObjFactory::~E3dObjFactory()
      43             : {
      44         378 : }
      45             : 
      46             : // Generate chart internal objects
      47             : 
      48        2958 : IMPL_LINK( E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
      49             : {
      50        1479 :     if ( pObjFactory->nInventor == E3dInventor )
      51             :     {
      52        1479 :         switch ( pObjFactory->nIdentifier )
      53             :         {
      54             :             case E3D_POLYSCENE_ID:
      55         344 :                 pObjFactory->pNewObj = new E3dPolyScene();
      56         344 :                 break;
      57             :             case E3D_POLYGONOBJ_ID  :
      58         154 :                 pObjFactory->pNewObj = new E3dPolygonObj();
      59         154 :                 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         933 :                 pObjFactory->pNewObj = new E3dExtrudeObj();
      73         933 :                 break;
      74             :             case E3D_LATHEOBJ_ID:
      75          48 :                 pObjFactory->pNewObj = new E3dLatheObj();
      76          48 :                 break;
      77             :             case E3D_COMPOUNDOBJ_ID:
      78           0 :                 pObjFactory->pNewObj = new E3dCompoundObject();
      79           0 :                 break;
      80             :         }
      81             :     }
      82        1479 :     return 0;
      83             : }
      84             : 
      85             : 
      86             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10