LCOV - code coverage report
Current view: top level - sfx2/source/control - sorgitm.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 1 35 2.9 %
Date: 2014-11-03 Functions: 1 13 7.7 %
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 <sfx2/sfxsids.hrc>
      22             : #include "sorgitm.hxx"
      23             : // STATIC DATA -----------------------------------------------------------
      24             : 
      25         317 : TYPEINIT1_AUTOFACTORY(SfxScriptOrganizerItem, SfxStringItem);
      26             : 
      27             : 
      28             : 
      29           0 : SfxScriptOrganizerItem::SfxScriptOrganizerItem() :
      30             : 
      31           0 :     SfxStringItem()
      32             : 
      33             : {
      34           0 : }
      35             : 
      36             : 
      37             : 
      38           0 : SfxScriptOrganizerItem::SfxScriptOrganizerItem( const SfxScriptOrganizerItem& rItem ) :
      39             : 
      40             :     SfxStringItem( rItem ),
      41             : 
      42           0 :     aLanguage( rItem.aLanguage )
      43             : 
      44             : {
      45           0 : }
      46             : 
      47             : 
      48             : 
      49           0 : SfxScriptOrganizerItem::~SfxScriptOrganizerItem()
      50             : {
      51           0 : }
      52             : 
      53             : 
      54             : 
      55           0 : SfxPoolItem* SfxScriptOrganizerItem::Clone( SfxItemPool * ) const
      56             : {
      57           0 :     return new SfxScriptOrganizerItem( *this );
      58             : }
      59             : 
      60             : 
      61             : 
      62           0 : bool SfxScriptOrganizerItem::operator==( const SfxPoolItem& rItem) const
      63             : {
      64           0 :      return rItem.Type() == Type() &&
      65           0 :          SfxStringItem::operator==(rItem) &&
      66           0 :          aLanguage == static_cast<const SfxScriptOrganizerItem &>(rItem).aLanguage;
      67             : }
      68             : 
      69             : 
      70           0 : bool SfxScriptOrganizerItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
      71             : {
      72           0 :     OUString aValue;
      73           0 :     nMemberId &= ~CONVERT_TWIPS;
      74           0 :     switch ( nMemberId )
      75             :     {
      76             :         case 0:
      77             :         case MID_SCRIPT_ORGANIZER_LANGUAGE:
      78           0 :             aValue = aLanguage;
      79           0 :             break;
      80             :         default:
      81             :             OSL_FAIL("Wrong MemberId!");
      82           0 :                return false;
      83             :      }
      84             : 
      85           0 :     rVal <<= aValue;
      86             : 
      87           0 :     return true;
      88             : }
      89             : 
      90           0 : bool SfxScriptOrganizerItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
      91             : {
      92           0 :     OUString aValue;
      93           0 :     bool bRet = false;
      94           0 :     nMemberId &= ~CONVERT_TWIPS;
      95           0 :     switch ( nMemberId )
      96             :     {
      97             :         case 0:
      98             :         case MID_SCRIPT_ORGANIZER_LANGUAGE:
      99           0 :             bRet = (rVal >>= aValue);
     100           0 :             if ( bRet )
     101           0 :                 aLanguage = aValue;
     102           0 :             break;
     103             :         default:
     104             :             OSL_FAIL("Wrong MemberId!");
     105           0 :             return false;
     106             :     }
     107             : 
     108           0 :     return bRet;
     109             : }
     110             : 
     111             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10