LCOV - code coverage report
Current view: top level - editeng/source/items - optitems.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 0 44 0.0 %
Date: 2014-11-03 Functions: 0 22 0.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 <tools/resid.hxx>
      21             : #include <tools/stream.hxx>
      22             : #include <com/sun/star/linguistic2/XSpellChecker1.hpp>
      23             : 
      24             : #include <editeng/optitems.hxx>
      25             : #include <editeng/eerdll.hxx>
      26             : #include <editeng/editrids.hrc>
      27             : 
      28             : using namespace ::com::sun::star::uno;
      29             : using namespace ::com::sun::star::linguistic2;
      30             : 
      31             : // STATIC DATA -----------------------------------------------------------
      32             : 
      33           0 : TYPEINIT1(SfxSpellCheckItem, SfxPoolItem);
      34           0 : TYPEINIT1(SfxHyphenRegionItem, SfxPoolItem);
      35             : 
      36             : // class SfxSpellCheckItem -----------------------------------------------
      37             : 
      38           0 : SfxSpellCheckItem::SfxSpellCheckItem
      39             : (
      40             :     Reference< XSpellChecker1 > &xChecker,
      41             :     sal_uInt16 _nWhich
      42             : ) :
      43             : 
      44           0 :     SfxPoolItem( _nWhich )
      45             : {
      46           0 :     xSpellCheck = xChecker;
      47           0 : }
      48             : 
      49             : 
      50             : 
      51           0 : SfxSpellCheckItem::SfxSpellCheckItem( const SfxSpellCheckItem& rItem ) :
      52             : 
      53             :     SfxPoolItem( rItem ),
      54           0 :     xSpellCheck( rItem.GetXSpellChecker() )
      55             : {
      56           0 : }
      57             : 
      58             : 
      59             : 
      60           0 : bool SfxSpellCheckItem::GetPresentation
      61             : (
      62             :     SfxItemPresentation ,
      63             :     SfxMapUnit          ,
      64             :     SfxMapUnit          ,
      65             :     OUString&           ,
      66             :     const IntlWrapper*
      67             : )   const
      68             : {
      69           0 :     return true;
      70             : }
      71             : 
      72             : 
      73             : 
      74           0 : SfxPoolItem* SfxSpellCheckItem::Clone( SfxItemPool* ) const
      75             : {
      76           0 :     return new SfxSpellCheckItem( *this );
      77             : }
      78             : 
      79             : 
      80             : 
      81           0 : bool SfxSpellCheckItem::operator==( const SfxPoolItem& rItem ) const
      82             : {
      83             :     DBG_ASSERT( SfxPoolItem::operator==(rItem), "unequal types" );
      84           0 :     return ( xSpellCheck == static_cast<const SfxSpellCheckItem&>( rItem ).GetXSpellChecker() );
      85             : }
      86             : 
      87             : // class SfxHyphenRegionItem -----------------------------------------------
      88             : 
      89           0 : SfxHyphenRegionItem::SfxHyphenRegionItem( const sal_uInt16 nId ) :
      90             : 
      91           0 :     SfxPoolItem( nId )
      92             : {
      93           0 :     nMinLead = nMinTrail = 0;
      94           0 : }
      95             : 
      96             : 
      97             : 
      98           0 : SfxHyphenRegionItem::SfxHyphenRegionItem( const SfxHyphenRegionItem& rItem ) :
      99             : 
     100             :     SfxPoolItem ( rItem ),
     101             : 
     102           0 :     nMinLead    ( rItem.GetMinLead() ),
     103           0 :     nMinTrail   ( rItem.GetMinTrail() )
     104             : {
     105           0 : }
     106             : 
     107             : 
     108             : 
     109           0 : bool SfxHyphenRegionItem::operator==( const SfxPoolItem& rAttr ) const
     110             : {
     111             :     DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
     112             : 
     113           0 :     return ( ( static_cast<const SfxHyphenRegionItem&>( rAttr ).nMinLead == nMinLead ) &&
     114           0 :              ( static_cast<const SfxHyphenRegionItem&>( rAttr ).nMinTrail == nMinTrail ) );
     115             : }
     116             : 
     117             : 
     118             : 
     119           0 : SfxPoolItem* SfxHyphenRegionItem::Clone( SfxItemPool* ) const
     120             : {
     121           0 :     return new SfxHyphenRegionItem( *this );
     122             : }
     123             : 
     124             : 
     125             : 
     126           0 : bool SfxHyphenRegionItem::GetPresentation
     127             : (
     128             :     SfxItemPresentation /*ePres*/,
     129             :     SfxMapUnit          ,
     130             :     SfxMapUnit          ,
     131             :     OUString&           rText,
     132             :     const IntlWrapper*
     133             : )   const
     134             : {
     135           0 :     rText = rText +
     136           0 :             EE_RESSTR(RID_SVXITEMS_HYPHEN_MINLEAD).replaceAll("%1", OUString::number(nMinLead)) +
     137           0 :             "," +
     138           0 :             EE_RESSTR(RID_SVXITEMS_HYPHEN_MINTRAIL).replaceAll("%1", OUString::number(nMinTrail));
     139           0 :     return true;
     140             : }
     141             : 
     142             : 
     143             : 
     144           0 : SfxPoolItem* SfxHyphenRegionItem::Create(SvStream& rStrm, sal_uInt16 ) const
     145             : {
     146             :     sal_uInt8 _nMinLead, _nMinTrail;
     147           0 :     rStrm.ReadUChar( _nMinLead ).ReadUChar( _nMinTrail );
     148           0 :     SfxHyphenRegionItem* pAttr = new SfxHyphenRegionItem( Which() );
     149           0 :     pAttr->GetMinLead() = _nMinLead;
     150           0 :     pAttr->GetMinTrail() = _nMinTrail;
     151           0 :     return pAttr;
     152             : }
     153             : 
     154             : 
     155             : 
     156           0 : SvStream& SfxHyphenRegionItem::Store( SvStream& rStrm, sal_uInt16 ) const
     157             : {
     158           0 :     rStrm.WriteUChar( GetMinLead() )
     159           0 :          .WriteUChar( GetMinTrail() );
     160           0 :     return rStrm;
     161             : }
     162             : 
     163             : 
     164             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10