LCOV - code coverage report
Current view: top level - forms/source/component - FixedText.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 35 35 100.0 %
Date: 2014-04-11 Functions: 11 11 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 "FixedText.hxx"
      21             : #include "services.hxx"
      22             : #include "property.hrc"
      23             : #include "property.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          65 : InterfaceRef SAL_CALL OFixedTextModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
      44             : {
      45          65 :     return *(new OFixedTextModel( comphelper::getComponentContext(_rxFactory) ));
      46             : }
      47             : 
      48             : 
      49             : 
      50          65 : OFixedTextModel::OFixedTextModel( const Reference<XComponentContext>& _rxFactory )
      51          65 :         :OControlModel(_rxFactory, VCL_CONTROLMODEL_FIXEDTEXT)
      52             : 
      53             : {
      54          65 :     m_nClassId = FormComponentType::FIXEDTEXT;
      55          65 : }
      56             : 
      57             : 
      58           1 : OFixedTextModel::OFixedTextModel( const OFixedTextModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
      59           1 :     :OControlModel( _pOriginal, _rxFactory )
      60             : 
      61             : {
      62           1 : }
      63             : 
      64             : 
      65         132 : OFixedTextModel::~OFixedTextModel( )
      66             : {
      67         132 : }
      68             : 
      69             : 
      70           1 : IMPLEMENT_DEFAULT_CLONING( OFixedTextModel )
      71             : 
      72             : 
      73           4 : StringSequence SAL_CALL OFixedTextModel::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException, std::exception)
      74             : {
      75           4 :     StringSequence aSupported = OControlModel::getSupportedServiceNames();
      76           4 :     aSupported.realloc(aSupported.getLength() + 1);
      77             : 
      78           4 :     OUString* pArray = aSupported.getArray();
      79           4 :     pArray[aSupported.getLength()-1] = FRM_SUN_COMPONENT_FIXEDTEXT;
      80           4 :     return aSupported;
      81             : }
      82             : 
      83             : 
      84          66 : void OFixedTextModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const
      85             : {
      86          66 :     OControlModel::describeAggregateProperties( _rAggregateProps );
      87          66 :     RemoveProperty( _rAggregateProps, PROPERTY_TABSTOP );
      88          66 : }
      89             : 
      90             : 
      91           1 : OUString SAL_CALL OFixedTextModel::getServiceName() throw(RuntimeException, std::exception)
      92             : {
      93           1 :     return OUString(FRM_COMPONENT_FIXEDTEXT); // old (non-sun) name for compatibility !
      94             : }
      95             : 
      96             : 
      97           1 : void SAL_CALL OFixedTextModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
      98             :     throw(IOException, RuntimeException, std::exception)
      99             : {
     100           1 :     OControlModel::write(_rxOutStream);
     101             : 
     102             :     // Version
     103           1 :     _rxOutStream->writeShort(0x0002);
     104           1 :     writeHelpTextCompatibly(_rxOutStream);
     105           1 : }
     106             : 
     107             : 
     108           1 : void SAL_CALL OFixedTextModel::read(const Reference<XObjectInputStream>& _rxInStream) throw(IOException, RuntimeException, std::exception)
     109             : {
     110           1 :     OControlModel::read(_rxInStream);
     111             : 
     112             :     // Version
     113           1 :     sal_Int16 nVersion = _rxInStream->readShort();
     114           1 :     if (nVersion > 1)
     115           1 :         readHelpTextCompatibly(_rxInStream);
     116           1 : }
     117             : 
     118             : 
     119             : }
     120             : 
     121             : 
     122             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10