LCOV - code coverage report
Current view: top level - include/cppuhelper - proptypehlp.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 58 182 31.9 %
Date: 2015-06-13 12:38:46 Functions: 12 21 57.1 %
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             : #ifndef INCLUDED_CPPUHELPER_PROPTYPEHLP_HXX
      20             : #define INCLUDED_CPPUHELPER_PROPTYPEHLP_HXX
      21             : 
      22             : #include <cppuhelper/proptypehlp.h>
      23             : #include <com/sun/star/lang/IllegalArgumentException.hpp>
      24             : #include <com/sun/star/uno/TypeClass.hpp>
      25             : 
      26             : namespace cppu
      27             : {
      28             : 
      29             : /** Converts the value stored in an any to a concrete C++ type.
      30             :     The function does the same as the operator >>= () at the
      31             :     Any class, except that it throws an IllegalArgumentException in case of
      32             :     failures (the value cannot be extracted without data loss )
      33             : 
      34             :    @exception com::sun::star::lang::IllegalArgumentException when the type could not be converted.
      35             :  */
      36             : template < class target >
      37         394 : inline void SAL_CALL convertPropertyValue( target &value , const  ::com::sun::star::uno::Any & a)
      38             : {
      39             : 
      40         394 :     if( !( a >>= value ) ) {
      41           0 :         throw ::com::sun::star::lang::IllegalArgumentException();
      42             :     }
      43         394 : }
      44             : 
      45             : 
      46             : // This template is needed at least for msci4 compiler
      47             : template < class target >
      48             : inline void SAL_CALL convertPropertyValue( target &value ,  ::com::sun::star::uno::Any & a)
      49             : {
      50             :     convertPropertyValue( value ,  (const ::com::sun::star::uno::Any & )  a );
      51             : }
      52             : 
      53             : /**
      54             :   conversion of basic types
      55             : */
      56        1993 : inline void SAL_CALL convertPropertyValue( sal_Bool & b   , const ::com::sun::star::uno::Any & a )
      57             : {
      58        1993 :     const enum ::com::sun::star::uno::TypeClass tc = a.getValueType().getTypeClass();
      59             : 
      60        1993 :     if( ::com::sun::star::uno::TypeClass_LONG == tc ) {
      61           0 :         sal_Int32 i32 = 0;
      62           0 :         a >>= i32;
      63           0 :         b = i32 != 0;
      64             :     }
      65        1993 :     else if ( ::com::sun::star::uno::TypeClass_CHAR  == tc ) {
      66           0 :         sal_Unicode c = *static_cast<sal_Unicode const *>(a.getValue());
      67           0 :         b = c != 0;
      68             :     }
      69        1993 :     else if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) {
      70          56 :         sal_Int16 i16 = 0;
      71          56 :         a >>= i16;
      72          56 :         b = i16 != 0;
      73             :     }
      74        1937 :     else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
      75        1937 :         b = *static_cast<sal_Bool const *>(a.getValue());
      76             :     }
      77           0 :     else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
      78           0 :         sal_Int8 i8 = 0;
      79           0 :         a >>= i8;
      80           0 :         b = i8 != 0;
      81             :     }
      82           0 :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) {
      83           0 :         sal_uInt16 i16 = 0;
      84           0 :         a >>= i16;
      85           0 :         b = i16 != 0;
      86             :     }
      87           0 :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_LONG == tc ) {
      88           0 :         sal_uInt32 i32 = 0;
      89           0 :         a >>= i32;
      90           0 :         b = i32 != 0;
      91             :     }
      92             :     else {
      93           0 :         throw ::com::sun::star::lang::IllegalArgumentException();
      94             :     }
      95        1993 : }
      96             : 
      97           0 : inline void SAL_CALL convertPropertyValue( sal_Int64 & i  , const ::com::sun::star::uno::Any & a )
      98             : {
      99           0 :     const enum ::com::sun::star::uno::TypeClass tc = a.getValueType().getTypeClass();
     100             : 
     101           0 :     if( ::com::sun::star::uno::TypeClass_HYPER == tc ) {
     102           0 :         a >>= i;
     103             :     }
     104           0 :     else if( ::com::sun::star::uno::TypeClass_UNSIGNED_HYPER == tc ) {
     105           0 :         sal_uInt64 i64 = 0;
     106           0 :         a >>= i64;
     107           0 :         i = ( sal_Int64 ) i64;
     108             :     }
     109           0 :     else if( ::com::sun::star::uno::TypeClass_LONG == tc ) {
     110           0 :         sal_Int32 i32 = 0;
     111           0 :         a >>= i32;
     112           0 :         i = ( sal_Int64 )i32;
     113             :     }
     114           0 :     else if ( ::com::sun::star::uno::TypeClass_CHAR  == tc ) {
     115             :         sal_Unicode c;
     116           0 :         c = *static_cast<sal_Unicode const *>(a.getValue());
     117           0 :         i = ( sal_Int64 ) c;
     118             :     }
     119           0 :     else if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) {
     120           0 :         sal_Int16 i16 = 0;
     121           0 :         a >>= i16;
     122           0 :         i = ( sal_Int64 ) i16;
     123             :     }
     124           0 :     else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
     125             :         bool b;
     126           0 :         b =  *static_cast<sal_Bool const *>(a.getValue());
     127           0 :         i = ( sal_Int64 ) b;
     128             :     }
     129           0 :     else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
     130           0 :         sal_Int8 i8 = 0;
     131           0 :         a >>= i8;
     132           0 :         i = ( sal_Int64 ) i8;
     133             :     }
     134           0 :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) {
     135           0 :         sal_uInt16 i16 = 0;
     136           0 :         a >>= i16;
     137           0 :         i = ( sal_Int64 ) i16;
     138             :     }
     139           0 :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_LONG == tc ) {
     140           0 :         sal_uInt32 i32 = 0;
     141           0 :         a >>= i32;
     142           0 :         i = ( sal_Int64 ) i32;
     143             :     }
     144             :     else {
     145           0 :         throw ::com::sun::star::lang::IllegalArgumentException();
     146             :     }
     147           0 : }
     148             : 
     149             : 
     150             : inline void SAL_CALL convertPropertyValue( sal_uInt64 & i  , const ::com::sun::star::uno::Any & a )
     151             : {
     152             :     const enum ::com::sun::star::uno::TypeClass tc = a.getValueType().getTypeClass();
     153             : 
     154             :     if( ::com::sun::star::uno::TypeClass_UNSIGNED_HYPER == tc ) {
     155             :         a >>= i;
     156             :     }
     157             :     if( ::com::sun::star::uno::TypeClass_HYPER == tc ) {
     158             :         sal_Int64 i64;
     159             :         a >>= i64;
     160             :         i = ( sal_uInt64 ) i64;
     161             :     }
     162             :     else if( ::com::sun::star::uno::TypeClass_LONG == tc ) {
     163             :         sal_Int32 i32;
     164             :         a >>= i32;
     165             :         i = ( sal_uInt64 )i32;
     166             :     }
     167             :     else if ( ::com::sun::star::uno::TypeClass_CHAR  == tc ) {
     168             :         sal_Unicode c;
     169             :         c = *static_cast<sal_Unicode const *>(a.getValue());
     170             :         i = ( sal_uInt64 ) c;
     171             :     }
     172             :     else if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) {
     173             :         sal_Int16 i16;
     174             :         a >>= i16;
     175             :         i = ( sal_uInt64 ) i16;
     176             :     }
     177             :     else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
     178             :         bool b;
     179             :         b =  *static_cast<sal_Bool const *>(a.getValue());
     180             :         i = ( sal_uInt64 ) b;
     181             :     }
     182             :     else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
     183             :         sal_Int8 i8;
     184             :         a >>= i8;
     185             :         i = ( sal_uInt64 ) i8;
     186             :     }
     187             :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) {
     188             :         sal_uInt16 i16;
     189             :         a >>= i16;
     190             :         i = ( sal_uInt64    ) i16;
     191             :     }
     192             :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_LONG == tc ) {
     193             :         sal_uInt32 i32;
     194             :         a >>= i32;
     195             :         i = ( sal_uInt64 ) i32;
     196             :     }
     197             :     else {
     198             :         throw ::com::sun::star::lang::IllegalArgumentException();
     199             :     }
     200             : }
     201             : 
     202             : // the basic types
     203             : // sal_Int32
     204          78 : inline void SAL_CALL convertPropertyValue( sal_Int32 & i  , const ::com::sun::star::uno::Any & a )
     205             : {
     206          78 :     const enum ::com::sun::star::uno::TypeClass tc = a.getValueType().getTypeClass();
     207             : 
     208          78 :     if( ::com::sun::star::uno::TypeClass_LONG == tc ) {
     209          78 :         a >>= i;
     210             :     }
     211           0 :     else if ( ::com::sun::star::uno::TypeClass_CHAR  == tc ) {
     212             :         sal_Unicode c;
     213           0 :         c = *static_cast<sal_Unicode const *>(a.getValue());
     214           0 :         i = ( sal_Int32 ) c;
     215             :     }
     216           0 :     else if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) {
     217           0 :         sal_Int16 i16 = 0;
     218           0 :         a >>= i16;
     219           0 :         i = ( sal_Int32 ) i16;
     220             :     }
     221           0 :     else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
     222             :         bool b;
     223           0 :         b =  *static_cast<sal_Bool const *>(a.getValue());
     224           0 :         i = ( sal_Int32 ) b;
     225             :     }
     226           0 :     else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
     227           0 :         sal_Int8 i8 = 0;
     228           0 :         a >>= i8;
     229           0 :         i = ( sal_Int32 ) i8;
     230             :     }
     231           0 :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) {
     232           0 :         sal_uInt16 i16 = 0;
     233           0 :         a >>= i16;
     234           0 :         i = ( sal_Int32 ) i16;
     235             :     }
     236           0 :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_LONG == tc ) {
     237           0 :         sal_uInt32 i32 = 0;
     238           0 :         a >>= i32;
     239           0 :         i = ( sal_Int32 ) i32;
     240             :     }
     241             :     else {
     242           0 :         throw ::com::sun::star::lang::IllegalArgumentException();
     243             :     }
     244          78 : }
     245             : 
     246             : inline void SAL_CALL convertPropertyValue( sal_uInt32 & i  , const ::com::sun::star::uno::Any & a )
     247             : {
     248             :     const enum ::com::sun::star::uno::TypeClass tc = a.getValueType().getTypeClass();
     249             : 
     250             :     if ( ::com::sun::star::uno::TypeClass_UNSIGNED_LONG == tc ) {
     251             :         a >>= i;
     252             :     }
     253             :     else if( ::com::sun::star::uno::TypeClass_LONG == tc ) {
     254             :         sal_Int32 i32;
     255             :         a >>= i32;
     256             :         i = (sal_uInt32 ) i32;
     257             :     }
     258             :     else if ( ::com::sun::star::uno::TypeClass_CHAR  == tc ) {
     259             :         sal_Unicode c;
     260             :         c = *static_cast<sal_Unicode const *>(a.getValue());
     261             :         i = ( sal_uInt32 ) c;
     262             :     }
     263             :     else if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) {
     264             :         sal_Int16 i16;
     265             :         a >>= i16;
     266             :         i = ( sal_uInt32 ) i16;
     267             :     }
     268             :     else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
     269             :         bool b;
     270             :         b =  *static_cast<sal_Bool const *>(a.getValue());
     271             :         i = ( sal_uInt32 ) b;
     272             :     }
     273             :     else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
     274             :         sal_Int8 i8;
     275             :         a >>= i8;
     276             :         i = ( sal_uInt32 ) i8;
     277             :     }
     278             :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) {
     279             :         sal_uInt16 i16;
     280             :         a >>= i16;
     281             :         i = ( sal_uInt32    ) i16;
     282             :     }
     283             :     else {
     284             :         throw ::com::sun::star::lang::IllegalArgumentException();
     285             :     }
     286             : }
     287             : 
     288             : 
     289        1945 : inline void SAL_CALL convertPropertyValue( sal_Int16 & i  , const ::com::sun::star::uno::Any & a )
     290             : {
     291        1945 :     const enum ::com::sun::star::uno::TypeClass tc = a.getValueType().getTypeClass();
     292             : 
     293        1945 :     if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) {
     294        1944 :         a >>= i;
     295             :     }
     296           1 :     else if ( ::com::sun::star::uno::TypeClass_CHAR  == tc ) {
     297             :         sal_Unicode c;
     298           0 :         c = *static_cast<sal_Unicode const *>(a.getValue());
     299           0 :         i = ( sal_Int16 ) c;
     300             :     }
     301           1 :     else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
     302             :         bool b;
     303           1 :         b =  *static_cast<sal_Bool const *>(a.getValue());
     304           1 :         i = ( sal_Int16 ) b;
     305             :     }
     306           0 :     else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
     307           0 :         sal_Int8 i8 = 0;
     308           0 :         a >>= i8;
     309           0 :         i = ( sal_Int16 ) i8;
     310             :     }
     311           0 :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) {
     312           0 :         sal_uInt16 i16 = 0;
     313           0 :         a >>= i16;
     314           0 :         i = ( sal_Int16 ) i16;
     315             :     }
     316             :     else {
     317           0 :         throw ::com::sun::star::lang::IllegalArgumentException();
     318             :     }
     319        1945 : }
     320             : 
     321         719 : inline void SAL_CALL convertPropertyValue( sal_uInt16 & i  , const ::com::sun::star::uno::Any & a )
     322             : {
     323         719 :     const enum ::com::sun::star::uno::TypeClass tc = a.getValueType().getTypeClass();
     324             : 
     325         719 :     if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) {
     326         584 :         a >>= i;
     327             :     }
     328         135 :     else if ( ::com::sun::star::uno::TypeClass_CHAR  == tc ) {
     329             :         sal_Unicode c;
     330           0 :         c = *static_cast<sal_Unicode const *>(a.getValue());
     331           0 :         i = ( sal_Int16 ) c;
     332             :     }
     333         135 :     else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
     334             :         bool b;
     335           0 :         b =  *static_cast<sal_Bool const *>(a.getValue());
     336           0 :         i = ( sal_Int16 ) b;
     337             :     }
     338         135 :     else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
     339           0 :         sal_Int8 i8 = 0;
     340           0 :         a >>= i8;
     341           0 :         i = ( sal_Int16 ) i8;
     342             :     }
     343         135 :     else if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) {
     344         135 :         sal_Int16 i16 = 0;
     345         135 :         a >>= i16;
     346         135 :         i = ( sal_Int16 ) i16;
     347             :     }
     348             :     else {
     349           0 :         throw ::com::sun::star::lang::IllegalArgumentException();
     350             :     }
     351         719 : }
     352             : 
     353             : inline void SAL_CALL convertPropertyValue( sal_Int8 & i  , const ::com::sun::star::uno::Any & a )
     354             : {
     355             :     const enum ::com::sun::star::uno::TypeClass tc = a.getValueType().getTypeClass();
     356             : 
     357             :     if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
     358             :         a >>= i;
     359             :     }
     360             :     else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
     361             :         bool b;
     362             :         b =  *static_cast<sal_Bool const *>(a.getValue());
     363             :         i = ( sal_Int8 ) b;
     364             :     }
     365             :     else {
     366             :         throw ::com::sun::star::lang::IllegalArgumentException();
     367             :     }
     368             : }
     369             : 
     370          37 : inline void SAL_CALL convertPropertyValue( float &f , const ::com::sun::star::uno::Any &a )
     371             : {
     372          37 :     const enum ::com::sun::star::uno::TypeClass tc = a.getValueType().getTypeClass();
     373             : 
     374          37 :     if ( ::com::sun::star::uno::TypeClass_FLOAT == tc ) {
     375          34 :         a >>= f;
     376             :     }
     377           3 :     else if( ::com::sun::star::uno::TypeClass_DOUBLE == tc ) {
     378           0 :          double d = 0;
     379           0 :          a >>= d;
     380           0 :          f = ( float ) d;
     381             :     }
     382           3 :     else if( ::com::sun::star::uno::TypeClass_HYPER == tc ) {
     383           0 :         sal_Int64 i64 = 0;
     384           0 :         a >>= i64;
     385           0 :         f = ( float ) i64;
     386             :     }
     387             :     // msci 4 does not support this conversion
     388             : /*  else if( ::com::sun::star::uno::TypeClass_UNSIGNED_HYPER == tc ) {
     389             :         sal_uInt64 i64;
     390             :         a >>= i64;
     391             :         f = ( float ) i64;
     392             :     }
     393           3 : */  else if( ::com::sun::star::uno::TypeClass_LONG == tc ) {
     394           0 :         sal_Int32 i32 = 0;
     395           0 :         a >>= i32;
     396           0 :         f = ( float )i32;
     397             :     }
     398           3 :     else if ( ::com::sun::star::uno::TypeClass_CHAR  == tc ) {
     399             :         sal_Unicode c;
     400           0 :         c = *static_cast<sal_Unicode const *>(a.getValue());
     401           0 :         f = ( float ) c;
     402             :     }
     403           3 :     else if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) {
     404           3 :         sal_Int16 i16 = 0;
     405           3 :         a >>= i16;
     406           3 :         f = ( float ) i16;
     407             :     }
     408           0 :     else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
     409             :         bool b;
     410           0 :         b =  *static_cast<sal_Bool const *>(a.getValue());
     411           0 :         f = ( float ) b;
     412             :     }
     413           0 :     else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
     414           0 :         sal_Int8 i8 = 0;
     415           0 :         a >>= i8;
     416           0 :         f = ( float ) i8;
     417             :     }
     418           0 :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) {
     419           0 :         sal_uInt16 i16 = 0;
     420           0 :         a >>= i16;
     421           0 :         f = ( float ) i16;
     422             :     }
     423           0 :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_LONG == tc ) {
     424           0 :         sal_uInt32 i32 = 0;
     425           0 :         a >>= i32;
     426           0 :         f = ( float ) i32;
     427             :     }
     428             :     else {
     429           0 :         throw ::com::sun::star::lang::IllegalArgumentException();
     430             :     }
     431          37 : }
     432             : 
     433             : 
     434             : inline void SAL_CALL convertPropertyValue( double &d , const ::com::sun::star::uno::Any &a )
     435             : {
     436             :     const enum ::com::sun::star::uno::TypeClass tc = a.getValueType().getTypeClass();
     437             : 
     438             :     if( ::com::sun::star::uno::TypeClass_DOUBLE == tc ) {
     439             :          float f;
     440             :          a >>= f;
     441             :          d = ( double ) f;
     442             :     }
     443             :     else if ( ::com::sun::star::uno::TypeClass_FLOAT == tc ) {
     444             :         float f;
     445             :         a >>= f;
     446             :         d = (double) f;
     447             :     }
     448             :     else if( ::com::sun::star::uno::TypeClass_HYPER == tc ) {
     449             :         sal_Int64 i64;
     450             :         a >>= i64;
     451             :         d = (double) i64;
     452             :     }
     453             :     // msci 4 does not support this
     454             : /*  else if( ::com::sun::star::uno::TypeClass_UNSIGNED_HYPER == tc ) {
     455             :         sal_uInt64 i64;
     456             :         a >>= i64;
     457             :         d = (double) i64;
     458             :     }
     459             : */  else if( ::com::sun::star::uno::TypeClass_LONG == tc ) {
     460             :         sal_Int32 i32;
     461             :         a >>= i32;
     462             :         d = (double)i32;
     463             :     }
     464             :     else if ( ::com::sun::star::uno::TypeClass_CHAR  == tc ) {
     465             :         sal_Unicode c;
     466             :         c = *static_cast<sal_Unicode const *>(a.getValue());
     467             :         d = (double) c;
     468             :     }
     469             :     else if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) {
     470             :         sal_Int16 i16;
     471             :         a >>= i16;
     472             :         d = (double) i16;
     473             :     }
     474             :     else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
     475             :         bool b;
     476             :         b =  *static_cast<sal_Bool const *>(a.getValue());
     477             :         d = (double) b;
     478             :     }
     479             :     else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
     480             :         sal_Int8 i8;
     481             :         a >>= i8;
     482             :         d = (double) i8;
     483             :     }
     484             :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) {
     485             :         sal_uInt16 i16;
     486             :         a >>= i16;
     487             :         d = (double) i16;
     488             :     }
     489             :     else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_LONG == tc ) {
     490             :         sal_uInt32 i32;
     491             :         a >>= i32;
     492             :         d = (double) i32;
     493             :     }
     494             :     else {
     495             :         throw ::com::sun::star::lang::IllegalArgumentException();
     496             :     }
     497             : }
     498             : 
     499        3907 : inline void SAL_CALL convertPropertyValue( ::rtl::OUString &ow , const ::com::sun::star::uno::Any &a )
     500             : {
     501        3907 :     if( ::com::sun::star::uno::TypeClass_STRING == a.getValueType().getTypeClass() ) {
     502        3905 :         a >>= ow;
     503             :     }
     504             :     else {
     505           2 :         throw ::com::sun::star::lang::IllegalArgumentException();
     506             :     }
     507        3905 : }
     508             : 
     509             : }     // end namespace cppu
     510             : 
     511             : #endif
     512             : 
     513             : 
     514             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11