LCOV - code coverage report
Current view: top level - forms/source/component - GroupBox.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 40 46 87.0 %
Date: 2014-04-11 Functions: 13 14 92.9 %
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 "GroupBox.hxx"
      21             : #include "property.hxx"
      22             : #include "property.hrc"
      23             : #include "services.hxx"
      24             : #include <tools/debug.hxx>
      25             : #include <comphelper/processfactory.hxx>
      26             : 
      27             : 
      28             : namespace frm
      29             : {
      30             : using namespace ::com::sun::star::uno;
      31             : using namespace ::com::sun::star::sdb;
      32             : using namespace ::com::sun::star::sdbc;
      33             : using namespace ::com::sun::star::sdbcx;
      34             : using namespace ::com::sun::star::beans;
      35             : using namespace ::com::sun::star::container;
      36             : using namespace ::com::sun::star::form;
      37             : using namespace ::com::sun::star::awt;
      38             : using namespace ::com::sun::star::io;
      39             : using namespace ::com::sun::star::lang;
      40             : using namespace ::com::sun::star::util;
      41             : 
      42             : 
      43             : // OGroupBoxModel
      44             : 
      45             : 
      46             : 
      47          15 : InterfaceRef SAL_CALL OGroupBoxModel_CreateInstance(const Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
      48             : {
      49          15 :     return *(new OGroupBoxModel( comphelper::getComponentContext(_rxFactory) ));
      50             : }
      51             : 
      52             : 
      53             : 
      54          15 : OGroupBoxModel::OGroupBoxModel(const Reference<XComponentContext>& _rxFactory)
      55          15 :     :OControlModel(_rxFactory, VCL_CONTROLMODEL_GROUPBOX, VCL_CONTROL_GROUPBOX)
      56             : {
      57          15 :     m_nClassId = FormComponentType::GROUPBOX;
      58          15 : }
      59             : 
      60             : 
      61           1 : OGroupBoxModel::OGroupBoxModel( const OGroupBoxModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
      62           1 :     :OControlModel( _pOriginal, _rxFactory )
      63             : {
      64           1 : }
      65             : 
      66             : // XServiceInfo
      67             : 
      68           5 : StringSequence SAL_CALL OGroupBoxModel::getSupportedServiceNames() throw(RuntimeException, std::exception)
      69             : {
      70           5 :     StringSequence aSupported = OControlModel::getSupportedServiceNames();
      71           5 :     aSupported.realloc(aSupported.getLength() + 1);
      72             : 
      73           5 :     OUString* pArray = aSupported.getArray();
      74           5 :     pArray[aSupported.getLength()-1] = FRM_SUN_COMPONENT_GROUPBOX;
      75           5 :     return aSupported;
      76             : }
      77             : 
      78             : 
      79          32 : OGroupBoxModel::~OGroupBoxModel()
      80             : {
      81          32 : }
      82             : 
      83             : 
      84           1 : IMPLEMENT_DEFAULT_CLONING( OGroupBoxModel )
      85             : 
      86             : 
      87          16 : void OGroupBoxModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const
      88             : {
      89          16 :     OControlModel::describeAggregateProperties( _rAggregateProps );
      90             :     // don't want to have the TabStop property
      91          16 :     RemoveProperty(_rAggregateProps, PROPERTY_TABSTOP);
      92          16 : }
      93             : 
      94             : 
      95           1 : OUString SAL_CALL OGroupBoxModel::getServiceName() throw(RuntimeException, std::exception)
      96             : {
      97           1 :     return OUString(FRM_COMPONENT_GROUPBOX);  // old (non-sun) name for compatibility !
      98             : }
      99             : 
     100             : 
     101           1 : void SAL_CALL OGroupBoxModel::write(const Reference< XObjectOutputStream>& _rxOutStream)
     102             :     throw(IOException, RuntimeException, std::exception)
     103             : {
     104           1 :     OControlModel::write(_rxOutStream);
     105             : 
     106             :     // Version
     107           1 :     _rxOutStream->writeShort(0x0002);
     108           1 :     writeHelpTextCompatibly(_rxOutStream);
     109           1 : }
     110             : 
     111             : 
     112           1 : void SAL_CALL OGroupBoxModel::read(const Reference< XObjectInputStream>& _rxInStream) throw(IOException, RuntimeException, std::exception)
     113             : {
     114           1 :     OControlModel::read( _rxInStream );
     115             : 
     116             :     // Version
     117           1 :     sal_uInt16 nVersion = _rxInStream->readShort();
     118             :     DBG_ASSERT(nVersion > 0, "OGroupBoxModel::read : version 0 ? this should never have been written !");
     119             :         // ups, ist das Englisch richtig ? ;)
     120             : 
     121           1 :     if (nVersion == 2)
     122           1 :         readHelpTextCompatibly(_rxInStream);
     123             : 
     124             :     if (nVersion > 0x0002)
     125             :     {
     126             :         OSL_FAIL("OGroupBoxModel::read : unknown version !");
     127             :     }
     128           1 : };
     129             : 
     130             : 
     131             : // OGroupBoxControl
     132             : 
     133             : 
     134             : 
     135          12 : InterfaceRef SAL_CALL OGroupBoxControl_CreateInstance(const Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
     136             : {
     137          12 :     return *(new OGroupBoxControl( comphelper::getComponentContext(_rxFactory) ));
     138             : }
     139             : 
     140             : 
     141          12 : OGroupBoxControl::OGroupBoxControl(const Reference<XComponentContext>& _rxFactory)
     142          12 :                    :OControl(_rxFactory, VCL_CONTROL_GROUPBOX)
     143             : {
     144          12 : }
     145             : 
     146             : 
     147           0 : StringSequence SAL_CALL OGroupBoxControl::getSupportedServiceNames() throw(RuntimeException, std::exception)
     148             : {
     149           0 :     StringSequence aSupported = OControl::getSupportedServiceNames();
     150           0 :     aSupported.realloc(aSupported.getLength() + 1);
     151             : 
     152           0 :     OUString* pArray = aSupported.getArray();
     153           0 :     pArray[aSupported.getLength()-1] = FRM_SUN_CONTROL_GROUPBOX;
     154           0 :     return aSupported;
     155             : }
     156             : 
     157             : 
     158             : }
     159             : 
     160             : 
     161             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10