diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-03-19 09:22:44 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-03-19 09:00:26 +0000 |
commit | 8b27d78b4afaa9c47ca0fda144c8060f2f14046b (patch) | |
tree | 2dbddceebf0f96492adc5652697e8efce8a8ba06 /stoc/source/typeconv | |
parent | fe8eba5faa59ddf9ee82f3eb009daac72a0ec846 (diff) |
automated removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStrings
Done with a perl regex:
s/OUString\s*\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/OUString\($1\)/gms
Change-Id: Idf28320817cdcbea6d0f7ec06a9bf51bd2c3b3ec
Reviewed-on: https://gerrit.libreoffice.org/2832
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
Diffstat (limited to 'stoc/source/typeconv')
-rw-r--r-- | stoc/source/typeconv/convert.cxx | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index e9564768cc1a..125f50bf5ce2 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -370,7 +370,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6 return nRet; } throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("UNSIGNED HYPER out of range!") ), + OUString("UNSIGNED HYPER out of range!"), Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } @@ -384,7 +384,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6 return nRet; } throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("FLOAT out of range!") ), + OUString("FLOAT out of range!"), Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } case TypeClass_DOUBLE: @@ -396,7 +396,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6 return nRet; } throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("DOUBLE out of range!") ), + OUString("DOUBLE out of range!"), Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } @@ -407,27 +407,27 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6 if (! getHyperValue( fVal, *(OUString const *)rAny.getValue() )) { throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("invalid STRING value!") ), + OUString("invalid STRING value!"), Reference<XInterface>(), aDestinationClass, FailReason::IS_NOT_NUMBER, 0 ); } nRet = (fVal > SAL_INT64_MAX ? (sal_Int64)(sal_uInt64)fVal : (sal_Int64)fVal); if (fVal >= min && (fVal < 0 || ((sal_uInt64)fVal) <= max)) return nRet; throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("STRING value out of range!") ), + OUString("STRING value out of range!"), Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } default: throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("TYPE is not supported!") ), + OUString("TYPE is not supported!"), Reference<XInterface>(), aDestinationClass, FailReason::TYPE_NOT_SUPPORTED, 0 ); } if (nRet >= min && (nRet < 0 || (sal_uInt64)nRet <= max)) return nRet; throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("VALUE is out of range!") ), + OUString("VALUE is out of range!"), Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } @@ -493,7 +493,7 @@ double TypeConverter_Impl::toDouble( const Any& rAny, double min, double max ) c if (! getNumericValue( fRet, *(OUString *)rAny.getValue() )) { throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("invalid STRING value!") ), + OUString("invalid STRING value!"), Reference<XInterface>(), aDestinationClass, FailReason::IS_NOT_NUMBER, 0 ); } break; @@ -501,14 +501,14 @@ double TypeConverter_Impl::toDouble( const Any& rAny, double min, double max ) c default: throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("TYPE is not supported!") ), + OUString("TYPE is not supported!"), Reference< XInterface >(), aDestinationClass, FailReason::TYPE_NOT_SUPPORTED, 0 ); } if (fRet >= min && fRet <= max) return fRet; throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("VALUE is out of range!") ), + OUString("VALUE is out of range!"), Reference< XInterface >(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 ); } @@ -550,7 +550,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy else { throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("value is not of same or derived type!") ), + OUString("value is not of same or derived type!"), Reference< XInterface >(), aDestinationClass, FailReason::SOURCE_IS_NO_DERIVED_TYPE, 0 ); } @@ -571,14 +571,14 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy !*(XInterface * const *)rVal.getValue()) { throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("value is no interface!") ), + OUString("value is no interface!"), Reference< XInterface >(), aDestinationClass, FailReason::NO_SUCH_INTERFACE, 0 ); } if (! (aRet = (*(XInterface * const *)rVal.getValue())->queryInterface( aDestType )).hasValue()) { throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("value has no such interface!") ), + OUString("value has no such interface!"), Reference< XInterface >(), aDestinationClass, FailReason::NO_SUCH_INTERFACE, 0 ); } break; @@ -681,8 +681,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy else { throw CannotConvertException( - OUString( - RTL_CONSTASCII_USTRINGPARAM("value cannot be converted to demanded ENUM!") ), + OUString("value cannot be converted to demanded ENUM!"), Reference< XInterface >(), aDestinationClass, FailReason::IS_NOT_ENUM, 0 ); } break; @@ -704,7 +703,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy return aRet; throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("conversion not possible!") ), + OUString("conversion not possible!"), Reference< XInterface >(), aDestinationClass, FailReason::INVALID, 0 ); } @@ -727,7 +726,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina case TypeClass_UNKNOWN: case TypeClass_MODULE: throw IllegalArgumentException( - OUString( RTL_CONSTASCII_USTRINGPARAM("destination type is not simple!") ), + OUString("destination type is not simple!"), Reference< XInterface >(), (sal_Int16) 1 ); default: break; @@ -766,12 +765,12 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina case TypeClass_STRING: { const OUString & aStr = *(const OUString *)rVal.getValue(); - if ( aStr == "0" || aStr.equalsIgnoreAsciiCase( OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) )) + if ( aStr == "0" || aStr.equalsIgnoreAsciiCase( OUString("false") )) { sal_Bool bFalse = sal_False; aRet.setValue( &bFalse, getCppuBooleanType() ); } - else if ( aStr == "1" || aStr.equalsIgnoreAsciiCase( OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) )) + else if ( aStr == "1" || aStr.equalsIgnoreAsciiCase( OUString("true") )) { sal_Bool bTrue = sal_True; aRet.setValue( &bTrue, getCppuBooleanType() ); @@ -779,7 +778,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina else { throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("STRING has no boolean value!") ), + OUString("STRING has no boolean value!"), Reference< XInterface >(), aDestinationClass, FailReason::IS_NOT_BOOL, 0 ); } } @@ -862,7 +861,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina else { throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("value is not ENUM!") ), + OUString("value is not ENUM!"), Reference< XInterface >(), aDestinationClass, FailReason::IS_NOT_ENUM, 0 ); } break; @@ -870,8 +869,8 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina case TypeClass_BOOLEAN: aRet <<= (*(sal_Bool *)rVal.getValue()) ? - OUString(RTL_CONSTASCII_USTRINGPARAM("true")) : - OUString(RTL_CONSTASCII_USTRINGPARAM("false")); + OUString("true") : + OUString("false"); break; case TypeClass_CHAR: aRet <<= OUString( (sal_Unicode *)rVal.getValue(), 1 ); @@ -914,7 +913,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina return aRet; throw CannotConvertException( - OUString( RTL_CONSTASCII_USTRINGPARAM("conversion not possible!") ), + OUString("conversion not possible!"), Reference< XInterface >(), aDestinationClass, FailReason::INVALID, 0 ); } } |