Kaydet (Commit) 99661d3f authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Deprecate getCppuType et al in favor of cppu::UnoType

...which doesn't suffer from the sal_uInt16 vs. sal_Unicode ambiguity.

Change-Id: I4de265145e720615652e88b6a68e03903ad8cba2
üst 42c848c5
...@@ -357,7 +357,7 @@ void CppuType::dumpGetCppuTypePostamble(FileStream & out) { ...@@ -357,7 +357,7 @@ void CppuType::dumpGetCppuTypePostamble(FileStream & out) {
} }
} }
dumpTemplateHead(out); dumpTemplateHead(out);
out << ("inline ::css::uno::Type const & SAL_CALL" out << ("SAL_DEPRECATED(\"use cppu::UnoType\") inline ::css::uno::Type const & SAL_CALL"
" getCppuType(SAL_UNUSED_PARAMETER "); " getCppuType(SAL_UNUSED_PARAMETER ");
dumpType(out, name_); dumpType(out, name_);
dumpTemplateParameters(out); dumpTemplateParameters(out);
...@@ -560,7 +560,7 @@ void CppuType::dumpHFileContent( ...@@ -560,7 +560,7 @@ void CppuType::dumpHFileContent(
} }
out << "\n"; out << "\n";
dumpTemplateHead(out); dumpTemplateHead(out);
out << "inline ::css::uno::Type const & SAL_CALL getCppuType("; out << "SAL_DEPRECATED(\"use cppu::UnoType\") inline ::css::uno::Type const & SAL_CALL getCppuType(";
dumpType(out, name_, true); dumpType(out, name_, true);
dumpTemplateParameters(out); dumpTemplateParameters(out);
out << " *);\n\n#endif\n"; out << " *);\n\n#endif\n";
...@@ -569,7 +569,7 @@ void CppuType::dumpHFileContent( ...@@ -569,7 +569,7 @@ void CppuType::dumpHFileContent(
void CppuType::dumpGetCppuType(FileStream & out) { void CppuType::dumpGetCppuType(FileStream & out) {
if (name_ == "com.sun.star.uno.XInterface") { if (name_ == "com.sun.star.uno.XInterface") {
out << indent() out << indent()
<< ("inline ::css::uno::Type const & SAL_CALL" << ("SAL_DEPRECATED(\"use cppu::UnoType\") inline ::css::uno::Type const & SAL_CALL"
" getCppuType(SAL_UNUSED_PARAMETER "); " getCppuType(SAL_UNUSED_PARAMETER ");
dumpType(out, name_, true); dumpType(out, name_, true);
out << " *) {\n"; out << " *) {\n";
...@@ -581,7 +581,7 @@ void CppuType::dumpGetCppuType(FileStream & out) { ...@@ -581,7 +581,7 @@ void CppuType::dumpGetCppuType(FileStream & out) {
out << indent() << "}\n"; out << indent() << "}\n";
} else if (name_ == "com.sun.star.uno.Exception") { } else if (name_ == "com.sun.star.uno.Exception") {
out << indent() out << indent()
<< ("inline ::css::uno::Type const & SAL_CALL" << ("SAL_DEPRECATED(\"use cppu::UnoType\") inline ::css::uno::Type const & SAL_CALL"
" getCppuType(SAL_UNUSED_PARAMETER "); " getCppuType(SAL_UNUSED_PARAMETER ");
dumpType(out, name_, true); dumpType(out, name_, true);
out << " *) {\n"; out << " *) {\n";
...@@ -1110,9 +1110,9 @@ void InterfaceType::dumpHxxFile( ...@@ -1110,9 +1110,9 @@ void InterfaceType::dumpHxxFile(
<< codemaker::cpp::scopedCppName(u2b(name_)) << codemaker::cpp::scopedCppName(u2b(name_))
<< "::static_type(SAL_UNUSED_PARAMETER void *) {\n"; << "::static_type(SAL_UNUSED_PARAMETER void *) {\n";
inc(); inc();
out << indent() << "return ::getCppuType(static_cast< "; out << indent() << "return ::cppu::UnoType< ";
dumpType(out, name_); dumpType(out, name_, false, false, true);
out << " * >(0));\n"; out << " >::get();\n";
dec(); dec();
out << "}\n\n#endif // "<< headerDefine << "\n"; out << "}\n\n#endif // "<< headerDefine << "\n";
} }
......
...@@ -376,7 +376,11 @@ inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value ...@@ -376,7 +376,11 @@ inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type any @return type of IDL type any
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const ::com::sun::star::uno::Any * ) inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const ::com::sun::star::uno::Any * )
{ {
return ::cppu::UnoType< ::com::sun::star::uno::Any >::get(); return ::cppu::UnoType< ::com::sun::star::uno::Any >::get();
......
...@@ -281,8 +281,11 @@ inline ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL toUnoSequence( ...@@ -281,8 +281,11 @@ inline ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL toUnoSequence(
@tparam E element type of sequence @tparam E element type of sequence
@return type of IDL sequence @return type of IDL sequence
@deprecated
Use cppu::UnoType instead.
*/ */
template< class E > template< class E > SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & inline const ::com::sun::star::uno::Type &
SAL_CALL getCppuType( const ::com::sun::star::uno::Sequence< E > * ); SAL_CALL getCppuType( const ::com::sun::star::uno::Sequence< E > * );
...@@ -295,8 +298,11 @@ SAL_CALL getCppuType( const ::com::sun::star::uno::Sequence< E > * ); ...@@ -295,8 +298,11 @@ SAL_CALL getCppuType( const ::com::sun::star::uno::Sequence< E > * );
@tparam E element type of sequence @tparam E element type of sequence
@param rElementType element type of sequence @param rElementType element type of sequence
@return type of IDL sequence @return type of IDL sequence
@deprecated
Use cppu::UnoType instead.
*/ */
template< class E > template< class E > SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & inline const ::com::sun::star::uno::Type &
SAL_CALL getCppuSequenceType( const ::com::sun::star::uno::Type & rElementType ); SAL_CALL getCppuSequenceType( const ::com::sun::star::uno::Type & rElementType );
...@@ -306,7 +312,11 @@ SAL_CALL getCppuSequenceType( const ::com::sun::star::uno::Type & rElementType ) ...@@ -306,7 +312,11 @@ SAL_CALL getCppuSequenceType( const ::com::sun::star::uno::Type & rElementType )
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL sequence< char > @return type of IDL sequence< char >
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & inline const ::com::sun::star::uno::Type &
SAL_CALL getCharSequenceCppuType(); SAL_CALL getCharSequenceCppuType();
......
...@@ -210,28 +210,48 @@ public: ...@@ -210,28 +210,48 @@ public:
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type "type" @return type of IDL type "type"
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::com::sun::star::uno::Type * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::com::sun::star::uno::Type * );
/** Gets the meta type of IDL type void. /** Gets the meta type of IDL type void.
@return type of IDL type void @return type of IDL type void
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuVoidType(); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuVoidType();
/** Gets the meta type of IDL type void. /** Gets the meta type of IDL type void.
@return type of IDL type void @return type of IDL type void
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getVoidCppuType(); inline const ::com::sun::star::uno::Type & SAL_CALL getVoidCppuType();
/** Gets the meta type of IDL type boolean. /** Gets the meta type of IDL type boolean.
@return type of IDL type boolean @return type of IDL type boolean
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuBooleanType(); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuBooleanType();
/** Gets the meta type of IDL type boolean. /** Gets the meta type of IDL type boolean.
@return type of IDL type boolean @return type of IDL type boolean
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getBooleanCppuType(); inline const ::com::sun::star::uno::Type & SAL_CALL getBooleanCppuType();
/** Gets the meta type of IDL type boolean. /** Gets the meta type of IDL type boolean.
...@@ -241,7 +261,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getBooleanCppuType(); ...@@ -241,7 +261,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getBooleanCppuType();
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type boolean @return type of IDL type boolean
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Bool * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Bool * );
/** Gets the meta type of IDL type boolean. /** Gets the meta type of IDL type boolean.
...@@ -251,19 +275,31 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Bool ...@@ -251,19 +275,31 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Bool
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type boolean @return type of IDL type boolean
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType(
bool const * ); bool const * );
/** Gets the meta type of IDL type char. /** Gets the meta type of IDL type char.
@return type of IDL type char @return type of IDL type char
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCharCppuType(); inline const ::com::sun::star::uno::Type & SAL_CALL getCharCppuType();
/** Gets the meta type of IDL type char. /** Gets the meta type of IDL type char.
@return type of IDL type char @return type of IDL type char
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuCharType(); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuCharType();
/** Gets the meta type of IDL type byte. /** Gets the meta type of IDL type byte.
...@@ -274,7 +310,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuCharType(); ...@@ -274,7 +310,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuCharType();
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type byte @return type of IDL type byte
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int8 * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int8 * );
/** Gets the meta type of IDL type string. /** Gets the meta type of IDL type string.
...@@ -285,7 +325,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int8 ...@@ -285,7 +325,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int8
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type string @return type of IDL type string
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::rtl::OUString * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::rtl::OUString * );
/** Gets the meta type of IDL type short. /** Gets the meta type of IDL type short.
...@@ -296,7 +340,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::rtl::OU ...@@ -296,7 +340,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::rtl::OU
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type short @return type of IDL type short
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int16 * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int16 * );
/** Gets the meta type of IDL type unsigned short. /** Gets the meta type of IDL type unsigned short.
...@@ -307,7 +355,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int16 ...@@ -307,7 +355,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int16
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type unsigned short @return type of IDL type unsigned short
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt16 * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt16 * );
/** Gets the meta type of IDL type long. /** Gets the meta type of IDL type long.
...@@ -318,7 +370,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt1 ...@@ -318,7 +370,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt1
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type long @return type of IDL type long
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int32 * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int32 * );
/** Gets the meta type of IDL type unsigned long. /** Gets the meta type of IDL type unsigned long.
...@@ -329,7 +385,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int32 ...@@ -329,7 +385,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int32
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type unsigned long @return type of IDL type unsigned long
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt32 * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt32 * );
/** Gets the meta type of IDL type hyper. /** Gets the meta type of IDL type hyper.
...@@ -340,7 +400,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt3 ...@@ -340,7 +400,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt3
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type hyper @return type of IDL type hyper
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int64 * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int64 * );
/** Gets the meta type of IDL type unsigned hyper. /** Gets the meta type of IDL type unsigned hyper.
...@@ -351,7 +415,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int64 ...@@ -351,7 +415,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int64
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type unsigned hyper @return type of IDL type unsigned hyper
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt64 * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt64 * );
/** Gets the meta type of IDL type float. /** Gets the meta type of IDL type float.
...@@ -362,7 +430,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt6 ...@@ -362,7 +430,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt6
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type float @return type of IDL type float
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const float * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const float * );
/** Gets the meta type of IDL type double. /** Gets the meta type of IDL type double.
...@@ -373,7 +445,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const float * ) ...@@ -373,7 +445,11 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const float * )
The dummy parameter is just a typed pointer for function signature. The dummy parameter is just a typed pointer for function signature.
@return type of IDL type double @return type of IDL type double
@deprecated
Use cppu::UnoType instead.
*/ */
SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const double * ); inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const double * );
/** Gets the meta type of an IDL type. /** Gets the meta type of an IDL type.
...@@ -394,7 +470,8 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const double * ...@@ -394,7 +470,8 @@ inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const double *
@since UDK 3.2.0 @since UDK 3.2.0
*/ */
template< typename T > inline const ::com::sun::star::uno::Type & SAL_CALL template< typename T > SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL
getCppuType(); getCppuType();
/** Gets the meta type of IDL type char. /** Gets the meta type of IDL type char.
...@@ -408,7 +485,8 @@ getCppuType(); ...@@ -408,7 +485,8 @@ getCppuType();
@since UDK 3.2.0 @since UDK 3.2.0
*/ */
template<> inline const ::com::sun::star::uno::Type & SAL_CALL template<> SAL_DEPRECATED("use cppu::UnoType")
inline const ::com::sun::star::uno::Type & SAL_CALL
getCppuType< sal_Unicode >(); getCppuType< sal_Unicode >();
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment