LCOV - code coverage report
Current view: top level - toolkit/source/controls - unocontrolcontainermodel.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 31 31 100.0 %
Date: 2014-04-11 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             : 
      21             : #include <toolkit/controls/unocontrolcontainermodel.hxx>
      22             : #include <toolkit/helper/property.hxx>
      23             : #include <toolkit/helper/servicenames.hxx>
      24             : #include <toolkit/helper/unopropertyarrayhelper.hxx>
      25             : 
      26             : 
      27             : //  class UnoControlContainerModel
      28             : 
      29         774 : UnoControlContainerModel::UnoControlContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory )
      30         774 :     :UnoControlModel( i_factory )
      31             : {
      32         774 :     ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
      33         774 :     ImplRegisterProperty( BASEPROPERTY_BORDER );
      34         774 :     ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
      35         774 :     ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
      36         774 :     ImplRegisterProperty( BASEPROPERTY_ENABLED );
      37         774 :     ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
      38         774 :     ImplRegisterProperty( BASEPROPERTY_HELPURL );
      39         774 :     ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
      40         774 :     ImplRegisterProperty( BASEPROPERTY_TEXT );
      41         774 : }
      42             : 
      43         776 : OUString UnoControlContainerModel::getServiceName() throw(::com::sun::star::uno::RuntimeException, std::exception)
      44             : {
      45         776 :     return OUString::createFromAscii( szServiceName_UnoControlContainerModel );
      46             : }
      47             : 
      48        6975 : ::com::sun::star::uno::Any UnoControlContainerModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
      49             : {
      50        6975 :     ::com::sun::star::uno::Any aDefault;
      51        6975 :     if ( nPropId == BASEPROPERTY_BORDER )
      52         775 :         aDefault <<= (sal_Int16) 0;
      53             :     else
      54        6200 :         aDefault <<= UnoControlModel::ImplGetDefaultValue( nPropId );
      55        6975 :     return aDefault;
      56             : }
      57             : 
      58             : 
      59        1556 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > UnoControlContainerModel::getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException, std::exception)
      60             : {
      61        1556 :     static ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
      62        1556 :     return xInfo;
      63             : }
      64             : 
      65         313 : ::cppu::IPropertyArrayHelper& UnoControlContainerModel::getInfoHelper()
      66             : {
      67         313 :     ::osl::Guard< ::osl::Mutex > aGuard( ((UnoControlContainerModel*)this)->GetMutex() );
      68             : 
      69             :     static UnoPropertyArrayHelper* pHelper = NULL;
      70         313 :     if ( !pHelper )
      71             :     {
      72          44 :         ::com::sun::star::uno::Sequence<sal_Int32>  aIDs = ImplGetPropertyIds();
      73          44 :         pHelper = new UnoPropertyArrayHelper( aIDs );
      74             :     }
      75         313 :     return *pHelper;
      76             : }
      77             : 
      78             : extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
      79         231 : stardiv_Toolkit_UnoControlContainerModel_get_implementation(
      80             :     css::uno::XComponentContext *context,
      81             :     css::uno::Sequence<css::uno::Any> const &)
      82             : {
      83         231 :     return cppu::acquire(new UnoControlContainerModel(context));
      84             : }
      85             : 
      86             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10