LCOV - code coverage report
Current view: top level - oox/source/shape - LockedCanvasContext.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 21 21 100.0 %
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             : 
      10             : #include "LockedCanvasContext.hxx"
      11             : #include <oox/drawingml/shapegroupcontext.hxx>
      12             : 
      13             : using namespace com::sun::star;
      14             : 
      15             : namespace oox
      16             : {
      17             : namespace shape
      18             : {
      19             : 
      20          24 : LockedCanvasContext::LockedCanvasContext(ContextHandler2Helper& rParent)
      21          24 :     : ContextHandler2(rParent)
      22             : {
      23          24 : }
      24             : 
      25          48 : LockedCanvasContext::~LockedCanvasContext()
      26             : {
      27          48 : }
      28             : 
      29          72 : ::oox::core::ContextHandlerRef LockedCanvasContext::onCreateContext(sal_Int32 aElementToken, const ::oox::AttributeList& /*rAttribs*/)
      30             : {
      31          72 :     switch (getBaseToken(aElementToken))
      32             :     {
      33             :     case XML_lockedCanvas:
      34          16 :         break;
      35             :     case XML_nvGrpSpPr:
      36          12 :         break;
      37             :     case XML_grpSpPr:
      38          12 :         break;
      39             :     case XML_sp:
      40             :     {
      41          12 :         oox::drawingml::ShapePtr pMasterShape;
      42          12 :         mpShape.reset(new oox::drawingml::Shape("com.sun.star.drawing.CustomShape"));
      43          12 :         mpShape->setLockedCanvas(true);
      44          12 :         return new oox::drawingml::ShapeContext(*this, pMasterShape, mpShape);
      45             :     }
      46             :     case XML_grpSp:
      47             :     {
      48           6 :         oox::drawingml::ShapePtr pMasterShape;
      49           6 :         mpShape.reset(new oox::drawingml::Shape("com.sun.star.drawing.GroupShape"));
      50           6 :         mpShape->setLockedCanvas(true);
      51           6 :         return new oox::drawingml::ShapeGroupContext(*this, pMasterShape, mpShape);
      52             :     }
      53             :     default:
      54             :         SAL_WARN("oox", "LockedCanvasContext::createFastChildContext: unhandled element:" << getBaseToken(aElementToken));
      55          14 :         break;
      56             :     }
      57          54 :     return 0;
      58             : }
      59             : 
      60             : }
      61         408 : }
      62             : 
      63             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10