summaryrefslogtreecommitdiff
path: root/cli_ure
diff options
context:
space:
mode:
authorPeter Foley <pefoley2@verizon.net>2012-08-25 13:51:40 -0400
committerDavid Tardon <dtardon@redhat.com>2012-10-07 10:42:11 +0200
commita4df4e9147019337fda07982c510a85d6f4c4062 (patch)
treef2dfb918dcbc59fd7bfc905739404872303328b7 /cli_ure
parent1eec5566b24227e592f827c5e788ae3e45e0e127 (diff)
convert cli_ure/source/native to new syntax
Change-Id: I7dbb065c8b1b2fef85e6e7f42ef80991102785e0
Diffstat (limited to 'cli_ure')
-rw-r--r--cli_ure/Library_cli_cppuhelper_native.mk2
-rw-r--r--cli_ure/source/native/assembly.cxx2
-rw-r--r--cli_ure/source/native/native_bootstrap.cxx42
-rw-r--r--cli_ure/source/native/native_share.h22
4 files changed, 32 insertions, 36 deletions
diff --git a/cli_ure/Library_cli_cppuhelper_native.mk b/cli_ure/Library_cli_cppuhelper_native.mk
index 745c69c9480c..5582e770b91e 100644
--- a/cli_ure/Library_cli_cppuhelper_native.mk
+++ b/cli_ure/Library_cli_cppuhelper_native.mk
@@ -13,7 +13,7 @@ $(eval $(call gb_Library_Library,cli_cppuhelper_native))
# in CLR meta-data - use of this type may lead to a runtime exception":
$(eval $(call gb_Library_add_cxxflags,cli_cppuhelper_native,\
-AI $(gb_Helper_OUTDIRLIBDIR) \
- -clr:oldSyntax \
+ -clr \
-wd4339 \
))
diff --git a/cli_ure/source/native/assembly.cxx b/cli_ure/source/native/assembly.cxx
index 5e808122aab1..73345b94b895 100644
--- a/cli_ure/source/native/assembly.cxx
+++ b/cli_ure/source/native/assembly.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#using <mscorlib.dll>
-
[assembly:System::Reflection::AssemblyProduct( "CLI-UNO Language Binding" )];
[assembly:System::Reflection::AssemblyDescription( "CLI-UNO Helper Library" )];
[assembly:System::Reflection::AssemblyDelaySign(true)];
diff --git a/cli_ure/source/native/native_bootstrap.cxx b/cli_ure/source/native/native_bootstrap.cxx
index f760a1a191bc..0a22d7bb5e63 100644
--- a/cli_ure/source/native/native_bootstrap.cxx
+++ b/cli_ure/source/native/native_bootstrap.cxx
@@ -315,7 +315,7 @@ namespace util
These contain a named value UREINSTALLLOCATION which holds a path to the URE
installation folder.
*/
-public __sealed __gc class Bootstrap
+public ref class Bootstrap sealed
{
inline Bootstrap() {}
@@ -325,7 +325,7 @@ public:
@see cppuhelper/bootstrap.hxx:defaultBootstrap_InitialComponentContext()
*/
- static ::unoidl::com::sun::star::uno::XComponentContext *
+ static ::unoidl::com::sun::star::uno::XComponentContext ^
defaultBootstrap_InitialComponentContext();
/** Bootstraps the initial component context from a native UNO installation.
@@ -338,37 +338,37 @@ public:
@see cppuhelper/bootstrap.hxx:defaultBootstrap_InitialComponentContext()
*/
- static ::unoidl::com::sun::star::uno::XComponentContext *
+ static ::unoidl::com::sun::star::uno::XComponentContext ^
defaultBootstrap_InitialComponentContext(
- ::System::String * ini_file,
- ::System::Collections::IDictionaryEnumerator *
+ ::System::String ^ ini_file,
+ ::System::Collections::IDictionaryEnumerator ^
bootstrap_parameters );
/** Bootstraps the initial component context from a native UNO installation.
@see cppuhelper/bootstrap.hxx:bootstrap()
*/
- static ::unoidl::com::sun::star::uno::XComponentContext *
+ static ::unoidl::com::sun::star::uno::XComponentContext ^
bootstrap();
};
//______________________________________________________________________________
-::unoidl::com::sun::star::uno::XComponentContext *
+::unoidl::com::sun::star::uno::XComponentContext ^
Bootstrap::defaultBootstrap_InitialComponentContext(
- ::System::String * ini_file,
- ::System::Collections::IDictionaryEnumerator * bootstrap_parameters )
+ ::System::String ^ ini_file,
+ ::System::Collections::IDictionaryEnumerator ^ bootstrap_parameters )
{
- if (0 != bootstrap_parameters)
+ if (nullptr != bootstrap_parameters)
{
bootstrap_parameters->Reset();
while (bootstrap_parameters->MoveNext())
{
OUString key(
- String_to_ustring( __try_cast< ::System::String * >(
- bootstrap_parameters->get_Key() ) ) );
+ String_to_ustring( safe_cast< ::System::String ^ >(
+ bootstrap_parameters->Key ) ) );
OUString value(
- String_to_ustring( __try_cast< ::System::String * >(
- bootstrap_parameters->get_Value() ) ) );
+ String_to_ustring( safe_cast< ::System::String ^ >(
+ bootstrap_parameters->Value ) ) );
::rtl::Bootstrap::set( key, value );
}
@@ -376,31 +376,31 @@ Bootstrap::defaultBootstrap_InitialComponentContext(
// bootstrap native uno
Reference< XComponentContext > xContext;
- if (0 == ini_file)
+ if (nullptr == ini_file)
{
xContext = ::cppu::defaultBootstrap_InitialComponentContext();
}
else
{
xContext = ::cppu::defaultBootstrap_InitialComponentContext(
- String_to_ustring( __try_cast< ::System::String * >( ini_file ) ) );
+ String_to_ustring( safe_cast< ::System::String ^ >( ini_file ) ) );
}
- return __try_cast< ::unoidl::com::sun::star::uno::XComponentContext * >(
+ return safe_cast< ::unoidl::com::sun::star::uno::XComponentContext ^ >(
to_cli( xContext ) );
}
//______________________________________________________________________________
-::unoidl::com::sun::star::uno::XComponentContext *
+::unoidl::com::sun::star::uno::XComponentContext ^
Bootstrap::defaultBootstrap_InitialComponentContext()
{
- return defaultBootstrap_InitialComponentContext( 0, 0 );
+ return defaultBootstrap_InitialComponentContext( nullptr, nullptr );
}
-::unoidl::com::sun::star::uno::XComponentContext * Bootstrap::bootstrap()
+::unoidl::com::sun::star::uno::XComponentContext ^ Bootstrap::bootstrap()
{
Reference<XComponentContext> xContext = ::cppu::bootstrap();
- return __try_cast< ::unoidl::com::sun::star::uno::XComponentContext * >(
+ return safe_cast< ::unoidl::com::sun::star::uno::XComponentContext ^ >(
to_cli( xContext ) );
}
diff --git a/cli_ure/source/native/native_share.h b/cli_ure/source/native/native_share.h
index 8b24e1f5bbf6..23977dfb0f00 100644
--- a/cli_ure/source/native/native_share.h
+++ b/cli_ure/source/native/native_share.h
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#using <mscorlib.dll>
#using "cli_ure.dll"
#using "cli_uretypes.dll"
@@ -35,20 +34,20 @@ namespace util
{
//------------------------------------------------------------------------------
-inline ::System::String * ustring_to_String( ::rtl::OUString const & ustr )
+inline ::System::String ^ ustring_to_String( ::rtl::OUString const & ustr )
{
- return new ::System::String( ustr.getStr(), 0, ustr.getLength() );
+ return gcnew ::System::String( ustr.getStr(), 0, ustr.getLength() );
}
//------------------------------------------------------------------------------
-inline ::rtl::OUString String_to_ustring( ::System::String * str )
+inline ::rtl::OUString String_to_ustring( ::System::String ^ str )
{
OSL_ASSERT( sizeof (wchar_t) == sizeof (sal_Unicode) );
- wchar_t const __pin * chars = PtrToStringChars( str );
- return ::rtl::OUString( chars, str->get_Length() );
+ pin_ptr<wchar_t const> chars = PtrToStringChars( str );
+ return ::rtl::OUString( chars, str->Length );
}
template< typename T >
-inline ::System::Object * to_cli(
+inline ::System::Object ^ to_cli(
::com::sun::star::uno::Reference< T > const & x )
{
::com::sun::star::uno::Mapping mapping(
@@ -65,16 +64,15 @@ inline ::System::Object * to_cli(
intptr_t intptr =
reinterpret_cast< intptr_t >(
mapping.mapInterface( x.get(), ::getCppuType( &x ) ) );
- ::System::Runtime::InteropServices::GCHandle handle(
- ::System::Runtime::InteropServices::GCHandle::op_Explicit( intptr ) );
- ::System::Object * ret = handle.get_Target();
- handle.Free();
+ ::System::Runtime::InteropServices::GCHandle ^ handle = (::System::Runtime::InteropServices::GCHandle ^)(gcnew ::System::IntPtr(intptr));
+ ::System::Object ^ ret = handle->Target;
+ handle->Free();
return ret;
}
template< typename T >
inline void to_uno(
- ::com::sun::star::uno::Reference< T > * pRet, ::System::Object * x )
+ ::com::sun::star::uno::Reference< T > * pRet, ::System::Object ^ x )
{
::com::sun::star::uno::Mapping mapping(
OUSTR(UNO_LB_CLI), OUSTR(CPPU_CURRENT_LANGUAGE_BINDING_NAME) );