bridge.cxx (17fdcdb4) bridge.cxx (0848378b)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 313 unchanged lines hidden (view full) ---

322 OSL_ASSERT(writer_.is());
323 return writer_;
324}
325
326css::uno::UnoInterfaceReference Bridge::registerIncomingInterface(
327 rtl::OUString const & oid, css::uno::TypeDescription const & type)
328{
329 OSL_ASSERT(type.is());
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 313 unchanged lines hidden (view full) ---

322 OSL_ASSERT(writer_.is());
323 return writer_;
324}
325
326css::uno::UnoInterfaceReference Bridge::registerIncomingInterface(
327 rtl::OUString const & oid, css::uno::TypeDescription const & type)
328{
329 OSL_ASSERT(type.is());
330 if (oid.getLength() == 0) {
330 if ( oid.isEmpty() ) {
331 return css::uno::UnoInterfaceReference();
332 }
333 css::uno::UnoInterfaceReference obj(findStub(oid, type));
334 if (!obj.is()) {
335 binaryUno_.get()->pExtEnv->getRegisteredInterface(
336 binaryUno_.get()->pExtEnv,
337 reinterpret_cast< void ** >(&obj.m_pUnoI), oid.pData,
338 reinterpret_cast< typelib_InterfaceTypeDescription * >(type.get()));

--- 66 unchanged lines hidden (view full) ---

405 }
406 }
407 return oid;
408}
409
410css::uno::UnoInterfaceReference Bridge::findStub(
411 rtl::OUString const & oid, css::uno::TypeDescription const & type)
412{
331 return css::uno::UnoInterfaceReference();
332 }
333 css::uno::UnoInterfaceReference obj(findStub(oid, type));
334 if (!obj.is()) {
335 binaryUno_.get()->pExtEnv->getRegisteredInterface(
336 binaryUno_.get()->pExtEnv,
337 reinterpret_cast< void ** >(&obj.m_pUnoI), oid.pData,
338 reinterpret_cast< typelib_InterfaceTypeDescription * >(type.get()));

--- 66 unchanged lines hidden (view full) ---

405 }
406 }
407 return oid;
408}
409
410css::uno::UnoInterfaceReference Bridge::findStub(
411 rtl::OUString const & oid, css::uno::TypeDescription const & type)
412{
413 OSL_ASSERT(oid.getLength() != 0 && type.is());
413 OSL_ASSERT(!oid.isEmpty() && type.is());
414 osl::MutexGuard g(mutex_);
415 Stubs::iterator i(stubs_.find(oid));
416 if (i != stubs_.end()) {
417 Stub::iterator j(i->second.find(type));
418 if (j != i->second.end()) {
419 return j->second.object;
420 }
421 for (j = i->second.begin(); j != i->second.end(); ++j) {

--- 5 unchanged lines hidden (view full) ---

427 }
428 }
429 return css::uno::UnoInterfaceReference();
430}
431
432void Bridge::releaseStub(
433 rtl::OUString const & oid, css::uno::TypeDescription const & type)
434{
414 osl::MutexGuard g(mutex_);
415 Stubs::iterator i(stubs_.find(oid));
416 if (i != stubs_.end()) {
417 Stub::iterator j(i->second.find(type));
418 if (j != i->second.end()) {
419 return j->second.object;
420 }
421 for (j = i->second.begin(); j != i->second.end(); ++j) {

--- 5 unchanged lines hidden (view full) ---

427 }
428 }
429 return css::uno::UnoInterfaceReference();
430}
431
432void Bridge::releaseStub(
433 rtl::OUString const & oid, css::uno::TypeDescription const & type)
434{
435 OSL_ASSERT(oid.getLength() != 0 && type.is());
435 OSL_ASSERT(!oid.isEmpty() && type.is());
436 css::uno::UnoInterfaceReference obj;
437 bool unused;
438 {
439 osl::MutexGuard g(mutex_);
440 Stubs::iterator i(stubs_.find(oid));
441 if (i == stubs_.end()) {
442 throw css::uno::RuntimeException(
443 rtl::OUString(

--- 347 unchanged lines hidden (view full) ---

791 if (threadPool_ != 0) {
792 uno_threadpool_destroy(threadPool_);
793 }
794}
795
796css::uno::Reference< css::uno::XInterface > Bridge::getInstance(
797 rtl::OUString const & sInstanceName) throw (css::uno::RuntimeException)
798{
436 css::uno::UnoInterfaceReference obj;
437 bool unused;
438 {
439 osl::MutexGuard g(mutex_);
440 Stubs::iterator i(stubs_.find(oid));
441 if (i == stubs_.end()) {
442 throw css::uno::RuntimeException(
443 rtl::OUString(

--- 347 unchanged lines hidden (view full) ---

791 if (threadPool_ != 0) {
792 uno_threadpool_destroy(threadPool_);
793 }
794}
795
796css::uno::Reference< css::uno::XInterface > Bridge::getInstance(
797 rtl::OUString const & sInstanceName) throw (css::uno::RuntimeException)
798{
799 if (sInstanceName.getLength() == 0) {
799 if ( sInstanceName.isEmpty() ) {
800 throw css::uno::RuntimeException(
801 rtl::OUString(
802 RTL_CONSTASCII_USTRINGPARAM(
803 "XBridge::getInstance sInstanceName must be non-empty")),
804 static_cast< cppu::OWeakObject * >(this));
805 }
806 for (sal_Int32 i = 0; i != sInstanceName.getLength(); ++i) {
807 if (sInstanceName[i] > 0x7F) {

--- 161 unchanged lines hidden ---
800 throw css::uno::RuntimeException(
801 rtl::OUString(
802 RTL_CONSTASCII_USTRINGPARAM(
803 "XBridge::getInstance sInstanceName must be non-empty")),
804 static_cast< cppu::OWeakObject * >(this));
805 }
806 for (sal_Int32 i = 0; i != sInstanceName.getLength(); ++i) {
807 if (sInstanceName[i] > 0x7F) {

--- 161 unchanged lines hidden ---