LCOV - code coverage report
Current view: top level - linguistic/source - lngopt.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 150 198 75.8 %
Date: 2015-06-13 12:38:46 Functions: 24 31 77.4 %
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 <sal/macros.h>
      22             : #include "lngopt.hxx"
      23             : #include "lngreg.hxx"
      24             : #include "linguistic/lngprops.hxx"
      25             : #include "linguistic/misc.hxx"
      26             : #include <tools/debug.hxx>
      27             : #include <unotools/lingucfg.hxx>
      28             : 
      29             : #include <cppuhelper/implbase1.hxx>
      30             : 
      31             : #include <cppuhelper/factory.hxx>
      32             : #include <cppuhelper/supportsservice.hxx>
      33             : #include <com/sun/star/container/XNameAccess.hpp>
      34             : #include <com/sun/star/registry/XSimpleRegistry.hpp>
      35             : #include <com/sun/star/registry/XRegistryKey.hpp>
      36             : #include <com/sun/star/lang/Locale.hpp>
      37             : #include <com/sun/star/i18n/ScriptType.hpp>
      38             : #include <i18nlangtag/mslangid.hxx>
      39             : 
      40             : using namespace utl;
      41             : using namespace osl;
      42             : using namespace com::sun::star;
      43             : using namespace com::sun::star::container;
      44             : using namespace com::sun::star::beans;
      45             : using namespace com::sun::star::lang;
      46             : using namespace com::sun::star::uno;
      47             : using namespace com::sun::star::linguistic2;
      48             : using namespace linguistic;
      49             : 
      50             : using namespace com::sun::star::registry;
      51             : 
      52             : 
      53             : 
      54             : 
      55             : // static member intialization
      56             : SvtLinguOptions *   LinguOptions::pData = NULL;
      57             : oslInterlockedCount LinguOptions::nRefCount;
      58             : 
      59             : 
      60         112 : LinguOptions::LinguOptions()
      61             : {
      62         112 :     if (!pData)
      63             :     {
      64          64 :         pData = new SvtLinguOptions;
      65          64 :         SvtLinguConfig aLinguCfg;
      66          64 :         aLinguCfg.GetOptions( *pData );
      67             :     }
      68             : 
      69         112 :     osl_atomic_increment( &nRefCount );
      70         112 : }
      71             : 
      72             : 
      73           0 : LinguOptions::LinguOptions(const LinguOptions & /*rOpt*/)
      74             : {
      75             :     DBG_ASSERT( pData, "lng : data missing" );
      76           0 :     osl_atomic_increment( &nRefCount );
      77           0 : }
      78             : 
      79             : 
      80         101 : LinguOptions::~LinguOptions()
      81             : {
      82         101 :     MutexGuard  aGuard( GetLinguMutex() );
      83             : 
      84         101 :     if ( osl_atomic_decrement( &nRefCount ) == 0 )
      85             :     {
      86          57 :         delete pData;   pData  = NULL;
      87         101 :     }
      88         101 : }
      89             : 
      90             : struct WID_Name
      91             : {
      92             :     sal_Int32        nWID;
      93             :     const char  *pPropertyName;
      94             : };
      95             : 
      96             : //! order of entries is import (see LinguOptions::GetName)
      97             : //! since the WID is used as index in this table!
      98             : WID_Name aWID_Name[] =
      99             : {
     100             :     { 0,                                  0 },
     101             :     { WID_IS_USE_DICTIONARY_LIST,         UPN_IS_USE_DICTIONARY_LIST },
     102             :     { WID_IS_IGNORE_CONTROL_CHARACTERS,   UPN_IS_IGNORE_CONTROL_CHARACTERS },
     103             :     { WID_IS_SPELL_UPPER_CASE,            UPN_IS_SPELL_UPPER_CASE },
     104             :     { WID_IS_SPELL_WITH_DIGITS,           UPN_IS_SPELL_WITH_DIGITS },
     105             :     { WID_IS_SPELL_CAPITALIZATION,        UPN_IS_SPELL_CAPITALIZATION },
     106             :     { WID_HYPH_MIN_LEADING,               UPN_HYPH_MIN_LEADING },
     107             :     { WID_HYPH_MIN_TRAILING,              UPN_HYPH_MIN_TRAILING },
     108             :     { WID_HYPH_MIN_WORD_LENGTH,           UPN_HYPH_MIN_WORD_LENGTH },
     109             :     { WID_DEFAULT_LOCALE,                 UPN_DEFAULT_LOCALE },
     110             :     { WID_IS_SPELL_AUTO,                  UPN_IS_SPELL_AUTO },
     111             :     { 0,                                  0 },
     112             :     { 0,                                  0 },
     113             :     { WID_IS_SPELL_SPECIAL,               UPN_IS_SPELL_SPECIAL },
     114             :     { WID_IS_HYPH_AUTO,                   UPN_IS_HYPH_AUTO },
     115             :     { WID_IS_HYPH_SPECIAL,                UPN_IS_HYPH_SPECIAL },
     116             :     { WID_IS_WRAP_REVERSE,                UPN_IS_WRAP_REVERSE },
     117             :     { 0,                                  0 },
     118             :     { 0,                                  0 },
     119             :     { 0,                                  0 },
     120             :     { 0,                                  0 },
     121             :     { WID_DEFAULT_LANGUAGE,               UPN_DEFAULT_LANGUAGE },
     122             :     { WID_DEFAULT_LOCALE_CJK,             UPN_DEFAULT_LOCALE_CJK },
     123             :     { WID_DEFAULT_LOCALE_CTL,             UPN_DEFAULT_LOCALE_CTL }
     124             : };
     125             : 
     126             : 
     127          31 : OUString LinguOptions::GetName( sal_Int32 nWID )
     128             : {
     129          31 :     MutexGuard  aGuard( GetLinguMutex() );
     130             : 
     131          31 :     OUString aRes;
     132             : 
     133          31 :     sal_Int32 nLen = sizeof (aWID_Name) / sizeof (aWID_Name[0]);
     134          31 :     if (0 <= nWID && nWID < nLen && aWID_Name[ nWID ].nWID == nWID)
     135          31 :         aRes = OUString::createFromAscii(aWID_Name[nWID].pPropertyName);
     136             :     else
     137             :         OSL_FAIL("lng : unknown WID");
     138             : 
     139          31 :     return aRes;
     140             : }
     141             : 
     142             : 
     143             : 
     144             : //! map must be sorted by first entry in alphabetical increasing order.
     145          54 : static const SfxItemPropertyMapEntry* lcl_GetLinguProps()
     146             : {
     147             :     static const SfxItemPropertyMapEntry aLinguProps[] =
     148             :     {
     149             :         { OUString(UPN_DEFAULT_LANGUAGE),           WID_DEFAULT_LANGUAGE,
     150          54 :                 ::cppu::UnoType<sal_Int16>::get(),    0, 0 },
     151             :         { OUString(UPN_DEFAULT_LOCALE),             WID_DEFAULT_LOCALE,
     152          54 :                 ::cppu::UnoType<Locale>::get(),       0, 0 },
     153             :         { OUString(UPN_DEFAULT_LOCALE_CJK),         WID_DEFAULT_LOCALE_CJK,
     154          54 :                 ::cppu::UnoType<Locale>::get(),       0, 0 },
     155             :         { OUString(UPN_DEFAULT_LOCALE_CTL),         WID_DEFAULT_LOCALE_CTL,
     156          54 :                 ::cppu::UnoType<Locale>::get(),       0, 0 },
     157             :         { OUString(UPN_HYPH_MIN_LEADING),           WID_HYPH_MIN_LEADING,
     158          54 :                 ::cppu::UnoType<sal_Int16>::get(),    0, 0 },
     159             :         { OUString(UPN_HYPH_MIN_TRAILING),          WID_HYPH_MIN_TRAILING,
     160          54 :                 ::cppu::UnoType<sal_Int16>::get(),    0, 0 },
     161             :         { OUString(UPN_HYPH_MIN_WORD_LENGTH),       WID_HYPH_MIN_WORD_LENGTH,
     162          54 :                 ::cppu::UnoType<sal_Int16>::get(),    0, 0 },
     163             :         { OUString(UPN_IS_GERMAN_PRE_REFORM),       WID_IS_GERMAN_PRE_REFORM,       /*! deprecated !*/
     164          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     165             :         { OUString(UPN_IS_HYPH_AUTO),               WID_IS_HYPH_AUTO,
     166          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     167             :         { OUString(UPN_IS_HYPH_SPECIAL),            WID_IS_HYPH_SPECIAL,
     168          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     169             :         { OUString(UPN_IS_IGNORE_CONTROL_CHARACTERS),   WID_IS_IGNORE_CONTROL_CHARACTERS,
     170          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     171             :         { OUString(UPN_IS_SPELL_AUTO),              WID_IS_SPELL_AUTO,
     172          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     173             :         { OUString(UPN_IS_SPELL_CAPITALIZATION),    WID_IS_SPELL_CAPITALIZATION,
     174          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     175             :         { OUString(UPN_IS_SPELL_HIDE),              WID_IS_SPELL_HIDE,              /*! deprecated !*/
     176          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     177             :         { OUString(UPN_IS_SPELL_IN_ALL_LANGUAGES),  WID_IS_SPELL_IN_ALL_LANGUAGES,  /*! deprecated !*/
     178          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     179             :         { OUString(UPN_IS_SPELL_SPECIAL),           WID_IS_SPELL_SPECIAL,
     180          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     181             :         { OUString(UPN_IS_SPELL_UPPER_CASE),        WID_IS_SPELL_UPPER_CASE,
     182          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     183             :         { OUString(UPN_IS_SPELL_WITH_DIGITS),       WID_IS_SPELL_WITH_DIGITS,
     184          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     185             :         { OUString(UPN_IS_USE_DICTIONARY_LIST),     WID_IS_USE_DICTIONARY_LIST,
     186          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     187             :         { OUString(UPN_IS_WRAP_REVERSE),            WID_IS_WRAP_REVERSE,
     188          54 :                 cppu::UnoType<bool>::get(),            0, 0 },
     189             :         { OUString(), 0, css::uno::Type(), 0, 0 }
     190        1188 :     };
     191          54 :     return aLinguProps;
     192             : }
     193          54 : LinguProps::LinguProps() :
     194          54 :     aEvtListeners   (GetLinguMutex()),
     195          54 :     aPropListeners  (GetLinguMutex()),
     196         162 :     aPropertyMap(lcl_GetLinguProps())
     197             : {
     198          54 :     bDisposing = false;
     199          54 : }
     200             : 
     201          63 : void LinguProps::launchEvent( const PropertyChangeEvent &rEvt ) const
     202             : {
     203             :     cppu::OInterfaceContainerHelper *pContainer =
     204          63 :             aPropListeners.getContainer( rEvt.PropertyHandle );
     205          63 :     if (pContainer)
     206             :     {
     207           0 :         cppu::OInterfaceIteratorHelper aIt( *pContainer );
     208           0 :         while (aIt.hasMoreElements())
     209             :         {
     210           0 :             Reference< XPropertyChangeListener > xRef( aIt.next(), UNO_QUERY );
     211           0 :             if (xRef.is())
     212           0 :                 xRef->propertyChange( rEvt );
     213           0 :         }
     214             :     }
     215          63 : }
     216             : 
     217          54 : Reference< XInterface > SAL_CALL LinguProps_CreateInstance(
     218             :             const Reference< XMultiServiceFactory > & /*rSMgr*/ )
     219             :         throw(Exception)
     220             : {
     221          54 :     Reference< XInterface > xService = static_cast<cppu::OWeakObject*>(new LinguProps);
     222          54 :     return xService;
     223             : }
     224             : 
     225           3 : Reference< XPropertySetInfo > SAL_CALL LinguProps::getPropertySetInfo()
     226             :         throw(RuntimeException, std::exception)
     227             : {
     228           3 :     MutexGuard  aGuard( GetLinguMutex() );
     229             : 
     230             :     static Reference< XPropertySetInfo > aRef =
     231           3 :             new SfxItemPropertySetInfo( aPropertyMap );
     232           3 :     return aRef;
     233             : }
     234             : 
     235          34 : void SAL_CALL LinguProps::setPropertyValue(
     236             :             const OUString& rPropertyName, const Any& rValue )
     237             :         throw(UnknownPropertyException, PropertyVetoException,
     238             :               IllegalArgumentException, WrappedTargetException, RuntimeException, std::exception)
     239             : {
     240          34 :     MutexGuard  aGuard( GetLinguMutex() );
     241             : 
     242          34 :     const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName );
     243          34 :     if (pCur)
     244             :     {
     245          34 :         Any aOld( aConfig.GetProperty( pCur->nWID ) );
     246          34 :         if (aOld != rValue && aConfig.SetProperty( pCur->nWID, rValue ))
     247             :         {
     248             :             PropertyChangeEvent aChgEvt( static_cast<XPropertySet *>(this), rPropertyName,
     249          32 :                     sal_False, pCur->nWID, aOld, rValue );
     250          32 :             launchEvent( aChgEvt );
     251          34 :         }
     252          34 :     }
     253          34 : }
     254             : 
     255         500 : Any SAL_CALL LinguProps::getPropertyValue( const OUString& rPropertyName )
     256             :         throw(UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception)
     257             : {
     258         500 :     MutexGuard  aGuard( GetLinguMutex() );
     259             : 
     260         500 :     Any aRet;
     261             : 
     262         500 :     const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName );
     263         500 :     if(pCur)
     264             :     {
     265         500 :         aRet = aConfig.GetProperty( pCur->nWID );
     266             :     }
     267             : 
     268         500 :     return aRet;
     269             : }
     270             : 
     271         322 : void SAL_CALL LinguProps::addPropertyChangeListener(
     272             :             const OUString& rPropertyName,
     273             :             const Reference< XPropertyChangeListener >& rxListener )
     274             :         throw(UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception)
     275             : {
     276         322 :     MutexGuard  aGuard( GetLinguMutex() );
     277             : 
     278         322 :     if (!bDisposing && rxListener.is())
     279             :     {
     280         322 :         const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName );
     281         322 :         if(pCur)
     282         295 :             aPropListeners.addInterface( pCur->nWID, rxListener );
     283         322 :     }
     284         322 : }
     285             : 
     286         322 : void SAL_CALL LinguProps::removePropertyChangeListener(
     287             :             const OUString& rPropertyName,
     288             :             const Reference< XPropertyChangeListener >& rxListener )
     289             :         throw(UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception)
     290             : {
     291         322 :     MutexGuard  aGuard( GetLinguMutex() );
     292             : 
     293         322 :     if (!bDisposing && rxListener.is())
     294             :     {
     295         304 :         const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName );
     296         304 :         if(pCur)
     297         280 :             aPropListeners.removeInterface( pCur->nWID, rxListener );
     298         322 :     }
     299         322 : }
     300             : 
     301           0 : void SAL_CALL LinguProps::addVetoableChangeListener(
     302             :             const OUString& /*rPropertyName*/,
     303             :             const Reference< XVetoableChangeListener >& /*xListener*/ )
     304             :         throw(UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception)
     305             : {
     306           0 : }
     307             : 
     308           0 : void SAL_CALL LinguProps::removeVetoableChangeListener(
     309             :             const OUString& /*rPropertyName*/,
     310             :             const Reference< XVetoableChangeListener >& /*xListener*/ )
     311             :         throw(UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception)
     312             : {
     313           0 : }
     314             : 
     315             : 
     316          35 : void SAL_CALL LinguProps::setFastPropertyValue( sal_Int32 nHandle, const Any& rValue )
     317             :         throw(UnknownPropertyException, PropertyVetoException,
     318             :               IllegalArgumentException, WrappedTargetException, RuntimeException, std::exception)
     319             : {
     320          35 :     MutexGuard  aGuard( GetLinguMutex() );
     321             : 
     322          70 :     Any aOld( aConfig.GetProperty( nHandle ) );
     323          35 :     if (aOld != rValue && aConfig.SetProperty( nHandle, rValue ))
     324             :     {
     325             :         PropertyChangeEvent aChgEvt( static_cast<XPropertySet *>(this),
     326          31 :                 LinguOptions::GetName( nHandle ), sal_False, nHandle, aOld, rValue );
     327          31 :         launchEvent( aChgEvt );
     328          35 :     }
     329          35 : }
     330             : 
     331             : 
     332   170765139 : Any SAL_CALL LinguProps::getFastPropertyValue( sal_Int32 nHandle )
     333             :         throw(UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception)
     334             : {
     335   170765139 :     MutexGuard  aGuard( GetLinguMutex() );
     336             : 
     337   170765139 :     Any aRes( aConfig.GetProperty( nHandle ) );
     338   170765139 :     return aRes;
     339             : }
     340             : 
     341             : 
     342             : Sequence< PropertyValue > SAL_CALL
     343           0 :     LinguProps::getPropertyValues()
     344             :         throw(RuntimeException, std::exception)
     345             : {
     346           0 :     MutexGuard  aGuard( GetLinguMutex() );
     347             : 
     348           0 :     sal_Int32 nLen = aPropertyMap.getSize();
     349           0 :     Sequence< PropertyValue > aProps( nLen );
     350           0 :     PropertyValue *pProp = aProps.getArray();
     351           0 :     PropertyEntryVector_t aPropEntries = aPropertyMap.getPropertyEntries();
     352           0 :     PropertyEntryVector_t::const_iterator aIt = aPropEntries.begin();
     353           0 :     for (sal_Int32 i = 0;  i < nLen;  ++i, ++aIt)
     354             :     {
     355           0 :         PropertyValue &rVal = pProp[i];
     356           0 :         Any aAny( aConfig.GetProperty( aIt->nWID ) );
     357             : 
     358           0 :         rVal.Name   = aIt->sName;
     359           0 :         rVal.Handle = aIt->nWID;
     360           0 :         rVal.Value  = aAny;
     361           0 :         rVal.State  = PropertyState_DIRECT_VALUE ;
     362           0 :     }
     363           0 :     return aProps;
     364             : }
     365             : 
     366             : void SAL_CALL
     367           0 :     LinguProps::setPropertyValues( const Sequence< PropertyValue >& rProps )
     368             :         throw(UnknownPropertyException, PropertyVetoException,
     369             :               IllegalArgumentException, WrappedTargetException, RuntimeException, std::exception)
     370             : {
     371           0 :     MutexGuard  aGuard( GetLinguMutex() );
     372             : 
     373           0 :     sal_Int32 nLen = rProps.getLength();
     374           0 :     const PropertyValue *pVal = rProps.getConstArray();
     375           0 :     for (sal_Int32 i = 0;  i < nLen;  ++i)
     376             :     {
     377           0 :         const PropertyValue &rVal = pVal[i];
     378           0 :         setPropertyValue( rVal.Name, rVal.Value );
     379           0 :     }
     380           0 : }
     381             : 
     382             : void SAL_CALL
     383          56 :     LinguProps::dispose()
     384             :         throw(RuntimeException, std::exception)
     385             : {
     386          56 :     MutexGuard  aGuard( GetLinguMutex() );
     387             : 
     388          56 :     if (!bDisposing)
     389             :     {
     390          54 :         bDisposing = true;
     391             : 
     392             :         //! its too late to save the options here!
     393             :         // (see AppExitListener for saving)
     394             :         //aOpt.Save();  // save (possible) changes before exiting
     395             : 
     396          54 :         EventObject aEvtObj( static_cast<XPropertySet *>(this) );
     397          54 :         aEvtListeners.disposeAndClear( aEvtObj );
     398          54 :         aPropListeners.disposeAndClear( aEvtObj );
     399          56 :     }
     400          56 : }
     401             : 
     402             : void SAL_CALL
     403           2 :     LinguProps::addEventListener( const Reference< XEventListener >& rxListener )
     404             :         throw(RuntimeException, std::exception)
     405             : {
     406           2 :     MutexGuard  aGuard( GetLinguMutex() );
     407             : 
     408           2 :     if (!bDisposing && rxListener.is())
     409           2 :         aEvtListeners.addInterface( rxListener );
     410           2 : }
     411             : 
     412             : void SAL_CALL
     413           1 :     LinguProps::removeEventListener( const Reference< XEventListener >& rxListener )
     414             :         throw(RuntimeException, std::exception)
     415             : {
     416           1 :     MutexGuard  aGuard( GetLinguMutex() );
     417             : 
     418           1 :     if (!bDisposing && rxListener.is())
     419           1 :         aEvtListeners.removeInterface( rxListener );
     420           1 : }
     421             : 
     422             : 
     423             : // Service specific part
     424             : 
     425             : // XServiceInfo
     426           4 : OUString SAL_CALL LinguProps::getImplementationName()
     427             :         throw(RuntimeException, std::exception)
     428             : {
     429           4 :     MutexGuard  aGuard( GetLinguMutex() );
     430           4 :     return getImplementationName_Static();
     431             : }
     432             : 
     433             : // XServiceInfo
     434           1 : sal_Bool SAL_CALL LinguProps::supportsService( const OUString& ServiceName )
     435             :         throw(RuntimeException, std::exception)
     436             : {
     437           1 :     return cppu::supportsService(this, ServiceName);
     438             : }
     439             : 
     440             : // XServiceInfo
     441           4 : uno::Sequence< OUString > SAL_CALL LinguProps::getSupportedServiceNames()
     442             :         throw(RuntimeException, std::exception)
     443             : {
     444           4 :     MutexGuard  aGuard( GetLinguMutex() );
     445           4 :     return getSupportedServiceNames_Static();
     446             : }
     447             : 
     448             : // ORegistryServiceManager_Static
     449          58 : uno::Sequence< OUString > LinguProps::getSupportedServiceNames_Static()
     450             :         throw()
     451             : {
     452          58 :     MutexGuard  aGuard( GetLinguMutex() );
     453             : 
     454          58 :     uno::Sequence< OUString > aSNS( 1 );    // more than 1 service possible
     455          58 :     aSNS.getArray()[0] = "com.sun.star.linguistic2.LinguProperties";
     456          58 :     return aSNS;
     457             : }
     458             : 
     459         252 : bool LinguProps::getPropertyBool(const OUString& aPropertyName) throw (css::uno::RuntimeException)
     460             : {
     461         252 :    uno::Any any = getPropertyValue(aPropertyName);
     462         252 :    bool b = false;
     463         252 :    any >>= b;
     464         252 :    return b;
     465             : }
     466             : 
     467           0 : sal_Int16 LinguProps::getPropertyInt16(const OUString& aPropertyName) throw (css::uno::RuntimeException)
     468             : {
     469           0 :    uno::Any any = getPropertyValue(aPropertyName);
     470           0 :    sal_Int16 b = 0;
     471           0 :    any >>= b;
     472           0 :    return b;
     473             : }
     474             : 
     475           0 : Locale LinguProps::getPropertyLocale(const OUString& aPropertyName) throw (css::uno::RuntimeException)
     476             : {
     477           0 :    uno::Any any = getPropertyValue(aPropertyName);
     478           0 :    css::lang::Locale b;
     479           0 :    any >>= b;
     480           0 :    return b;
     481             : }
     482             : 
     483         113 : void * SAL_CALL LinguProps_getFactory( const sal_Char * pImplName,
     484             :             XMultiServiceFactory *pServiceManager, void * )
     485             : {
     486         113 :     void * pRet = 0;
     487         113 :     if ( LinguProps::getImplementationName_Static().equalsAscii( pImplName ) )
     488             :     {
     489             :         Reference< XSingleServiceFactory > xFactory =
     490             :             cppu::createOneInstanceFactory(
     491             :                 pServiceManager,
     492             :                 LinguProps::getImplementationName_Static(),
     493             :                 LinguProps_CreateInstance,
     494          54 :                 LinguProps::getSupportedServiceNames_Static());
     495             :         // acquire, because we return an interface pointer instead of a reference
     496          54 :         xFactory->acquire();
     497          54 :         pRet = xFactory.get();
     498             :     }
     499         113 :     return pRet;
     500             : }
     501             : 
     502             : 
     503             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11