LCOV - code coverage report
Current view: top level - libreoffice/svx/source/unodraw - unodtabl.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 11 19 57.9 %
Date: 2012-12-27 Functions: 5 8 62.5 %
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 <com/sun/star/drawing/LineDash.hpp>
      21             : #include <svl/itempool.hxx>
      22             : #include <svl/itemset.hxx>
      23             : 
      24             : #include <vector>
      25             : #include "UnoNameItemTable.hxx"
      26             : #include <svx/xlndsit.hxx>
      27             : #include <svx/unomid.hxx>
      28             : 
      29             : #include <svx/xdash.hxx>
      30             : #include <svx/svdmodel.hxx>
      31             : #include "svx/unofill.hxx"
      32             : 
      33             : using namespace ::com::sun::star;
      34             : using namespace ::rtl;
      35             : using namespace ::cppu;
      36             : 
      37             : class SvxUnoDashTable : public SvxUnoNameItemTable
      38             : {
      39             : public:
      40             :     SvxUnoDashTable( SdrModel* pModel ) throw();
      41             :     virtual ~SvxUnoDashTable() throw();
      42             : 
      43             :     virtual NameOrIndex* createItem() const throw();
      44             : 
      45             :     // XServiceInfo
      46             :     virtual OUString SAL_CALL getImplementationName(  ) throw( uno::RuntimeException );
      47             :     virtual uno::Sequence<  OUString > SAL_CALL getSupportedServiceNames(  ) throw( uno::RuntimeException);
      48             : 
      49             :     // XElementAccess
      50             :     virtual uno::Type SAL_CALL getElementType(  ) throw( uno::RuntimeException);
      51             : };
      52             : 
      53          47 : SvxUnoDashTable::SvxUnoDashTable( SdrModel* pModel ) throw()
      54          47 : : SvxUnoNameItemTable( pModel, XATTR_LINEDASH, MID_LINEDASH )
      55             : {
      56          47 : }
      57             : 
      58          94 : SvxUnoDashTable::~SvxUnoDashTable() throw()
      59             : {
      60          94 : }
      61             : 
      62           0 : OUString SAL_CALL SvxUnoDashTable::getImplementationName() throw( uno::RuntimeException )
      63             : {
      64           0 :     return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoDashTable") );
      65             : }
      66             : 
      67           0 : uno::Sequence< OUString > SAL_CALL SvxUnoDashTable::getSupportedServiceNames(  )
      68             :     throw( uno::RuntimeException )
      69             : {
      70           0 :     uno::Sequence< OUString > aSNS( 1 );
      71           0 :     aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DashTable" ));
      72           0 :     return aSNS;
      73             : }
      74             : 
      75           1 : NameOrIndex* SvxUnoDashTable::createItem() const throw()
      76             : {
      77           1 :     XLineDashItem* pNewItem = new XLineDashItem();
      78           1 :     pNewItem->SetWhich( XATTR_LINEDASH ); // set which id for pooling
      79           1 :     return pNewItem;
      80             : }
      81             : 
      82             : // XElementAccess
      83           0 : uno::Type SAL_CALL SvxUnoDashTable::getElementType(  )
      84             :     throw( uno::RuntimeException )
      85             : {
      86           0 :     return ::getCppuType((const struct drawing::LineDash*)0);
      87             : }
      88             : 
      89             : /**
      90             :  * Create a gradienttable
      91             :  */
      92          47 : uno::Reference< uno::XInterface > SAL_CALL SvxUnoDashTable_createInstance( SdrModel* pModel )
      93             : {
      94          47 :     return *new SvxUnoDashTable(pModel);
      95             : }
      96             : 
      97             : 
      98             : 
      99             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10