From fbea669c74f686f5a75aa80384bbfeff98680f8d Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Sun, 7 May 2017 12:54:03 +1000 Subject: tdf#43157: convert desktop module away from OSL_ASSERT to assert Change-Id: I521042a79cf93a51d84b72554d04715b321dd942 --- .../deployment/registry/component/dp_component.cxx | 8 ++++---- .../registry/configuration/dp_configuration.cxx | 4 ++-- .../source/deployment/registry/dp_backenddb.cxx | 14 +++++++------- desktop/source/deployment/registry/dp_registry.cxx | 6 +++--- .../registry/executable/dp_executable.cxx | 6 +++--- .../source/deployment/registry/help/dp_help.cxx | 6 +++--- .../deployment/registry/package/dp_package.cxx | 22 +++++++++++----------- .../deployment/registry/script/dp_script.cxx | 2 +- .../source/deployment/registry/sfwk/dp_sfwk.cxx | 2 +- 9 files changed, 35 insertions(+), 35 deletions(-) (limited to 'desktop/source/deployment/registry') diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index 2b04a5c5c94e..b8fe7478e10a 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -1051,7 +1051,7 @@ Reference raise_uno_process( Reference const & xContext, ::rtl::Reference const & abortChannel ) { - OSL_ASSERT( xContext.is() ); + assert( xContext.is() ); OUString url( util::theMacroExpander::get(xContext)->expandMacros( "$URE_BIN_DIR/uno" ) ); @@ -1095,7 +1095,7 @@ Reference raise_uno_process( // try to terminate process: if ( osl_terminateProcess( hProcess ) != osl_Process_E_None ) { - OSL_ASSERT( false ); + assert( false ); } throw; } @@ -1113,7 +1113,7 @@ void extractComponentData( componentLoader, OUString const & componentUrl) { - OSL_ASSERT( + assert( context.is() && registry.is() && data != nullptr && componentLoader.is()); OUString registryName(registry->getKeyName()); sal_Int32 prefix = registryName.getLength(); @@ -1588,7 +1588,7 @@ BackendImpl::OtherPlatformPackageImpl::impl_createInstance(OUString const& rServ const { Reference const xContext(getMyBackend()->getComponentContext()); - OSL_ASSERT(xContext.is()); + assert(xContext.is()); Reference xService; if (xContext.is()) xService.set(xContext->getServiceManager()->createInstanceWithContext(rService, xContext)); diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index a7906c3694e1..110d3ed87563 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -691,7 +691,7 @@ void BackendImpl::PackageImpl::processPackage_( if (getMyBackend()->activateEntry(getURL())) { ::boost::optional data = that->readDataFromDb(url); - OSL_ASSERT(data); + assert(data); that->addToConfigmgrIni( m_isSchema, false, data->iniEntry, xCmdEnv ); } else @@ -779,7 +779,7 @@ void BackendImpl::PackageImpl::processPackage_( } catch(const Exception&) { - OSL_ASSERT(false); + assert(false); } } #endif diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx index f44b1d7ac2f1..118029d058a5 100644 --- a/desktop/source/deployment/registry/dp_backenddb.cxx +++ b/desktop/source/deployment/registry/dp_backenddb.cxx @@ -140,7 +140,7 @@ void BackendDb::removeElement(OUString const & sXPathExpression) //There must not be any other entry with the same url const Reference nextNode = xpathApi->selectSingleNode(root, sXPathExpression); - OSL_ASSERT(! nextNode.is()); + assert(! nextNode.is()); #endif } catch(const css::uno::Exception &) @@ -277,7 +277,7 @@ void BackendDb::writeVectorOfPair( if (vecPairs.empty()) return; const OUString sNameSpace = getDbNSName(); - OSL_ASSERT(!sNameSpace.isEmpty()); + assert(!sNameSpace.isEmpty()); const OUString sPrefix(getNSPrefix() + ":"); const Reference doc = getDocument(); const Reference root = doc->getFirstChild(); @@ -346,7 +346,7 @@ BackendDb::readVectorOfPair( { try { - OSL_ASSERT(parent.is()); + assert(parent.is()); const OUString sPrefix(getNSPrefix() + ":"); const Reference xpathApi = getXPathAPI(); const OUString sExprPairs( @@ -366,7 +366,7 @@ BackendDb::readVectorOfPair( const OUString sExprSecond(sPrefix + sSecondTagName + "/text()"); const Reference second = xpathApi->selectSingleNode(aPair, sExprSecond); - OSL_ASSERT(first.is() && second.is()); + assert(first.is() && second.is()); retVector.push_back(std::make_pair( first->getNodeValue(), second->getNodeValue())); @@ -484,7 +484,7 @@ Reference BackendDb::writeKeyElement( getXPathAPI()->selectSingleNode(root, sExpression); if (existingNode.is()) { - OSL_ASSERT(false); + assert(false); //replace the existing entry. removeEntry(url); } @@ -539,7 +539,7 @@ std::list< OUString> BackendDb::readList( { try { - OSL_ASSERT(parent.is()); + assert(parent.is()); const OUString sPrefix(getNSPrefix() + ":"); const Reference xpathApi = getXPathAPI(); const OUString sExprList( @@ -635,7 +635,7 @@ void RegisteredDb::addEntry(OUString const & url) sPrefix + ":" + sEntry + "[@url = \"" + url + "\"]"); Reference _extensionNode = getXPathAPI()->selectSingleNode(root, sExpression); - OSL_ASSERT(! _extensionNode.is()); + assert(! _extensionNode.is()); #endif Reference helpElement( doc->createElementNS(sNameSpace, sPrefix + ":" + sEntry)); diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx index d0b4211691ee..27fa7acb75f6 100644 --- a/desktop/source/deployment/registry/dp_registry.cxx +++ b/desktop/source/deployment/registry/dp_registry.cxx @@ -239,7 +239,7 @@ void PackageRegistryImpl::insertBackend( m_mediaType2backend.find( /* media-type of pr. added backend */ ins.first->second ) ); - OSL_ASSERT( + assert( iFind != m_mediaType2backend.end() ); if (iFind != m_mediaType2backend.end()) m_ambiguousBackends.insert( iFind->second ); @@ -358,7 +358,7 @@ Reference PackageRegistryImpl::create( Reference xServiceInfo( extensionBackend, UNO_QUERY_THROW ); - OSL_ASSERT(xServiceInfo.is()); + assert(xServiceInfo.is()); OUString registryCachePath( makeURL( cachePath, ::rtl::Uri::encode( @@ -421,7 +421,7 @@ Reference PackageRegistryImpl::create( } allBackends.insert( that->m_ambiguousBackends.begin(), that->m_ambiguousBackends.end() ); - OSL_ASSERT( allBackends == that->m_allBackends ); + assert( allBackends == that->m_allBackends ); } #endif diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx index a5bac639d480..777469fd8415 100644 --- a/desktop/source/deployment/registry/executable/dp_executable.cxx +++ b/desktop/source/deployment/registry/executable/dp_executable.cxx @@ -228,7 +228,7 @@ void BackendImpl::ExecutablePackageImpl::processPackage_( { if (!isUrlTargetInExtension()) { - OSL_ASSERT(false); + assert(false); return; } sal_uInt64 attributes = 0; @@ -243,7 +243,7 @@ void BackendImpl::ExecutablePackageImpl::processPackage_( else if (!(getMyBackend()->m_context == "bundled")) //Bundled extension are required to be in the properly //installed. That is an executable must have the right flags - OSL_ASSERT(false); + assert(false); //This won't have affect on Windows osl::File::setAttributes( @@ -272,7 +272,7 @@ bool BackendImpl::ExecutablePackageImpl::isUrlTargetInExtension() else if (getMyBackend()->m_context == "bundled") sExtensionDir = dp_misc::expandUnoRcTerm("$BUNDLED_EXTENSIONS"); else - OSL_ASSERT(false); + assert(false); //remove file ellipses if (osl::File::E_None == osl::File::getAbsoluteFileURL(OUString(), sExtensionDir, sExtensionDir)) { diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index 4eba37cf3243..a3bcef271497 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -291,7 +291,7 @@ bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() else { //Error - OSL_ASSERT(false); + assert(false); bCompiled = false; break; } @@ -300,7 +300,7 @@ bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() && errorNext != ::osl::File::E_None) { //Error - OSL_ASSERT(false); + assert(false); bCompiled = false; } } @@ -358,7 +358,7 @@ void BackendImpl::implProcessHelp( Reference const & xCmdEnv) { Reference< deployment::XPackage > xPackage(package); - OSL_ASSERT(xPackage.is()); + assert(xPackage.is()); if (doRegisterPackage) { //revive already processed help if possible diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index cda1f56de4c4..906c8bc60767 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -821,7 +821,7 @@ void BackendImpl::PackageImpl::processPackage_( static_cast(this), exc ) ), cppu::UnoType::get(), xCmdEnv, &approve, &abort )) { - OSL_ASSERT( !approve && !abort ); + assert( !approve && !abort ); if (m_legacyBundle) // default for legacy packages: ignore continue; // no selection at all, so rethrow; @@ -900,7 +900,7 @@ void BackendImpl::PackageImpl::processPackage_( static_cast(this), exc ) ), cppu::UnoType::get(), xCmdEnv, &approve, &abort )) { - OSL_ASSERT( !approve && !abort ); + assert( !approve && !abort ); if (m_legacyBundle) // default for legacy packages: ignore continue; // no selection at all, so rethrow @@ -1080,7 +1080,7 @@ void BackendImpl::PackageImpl::exportTo( { Reference const & xPackage = pbundle[ pos ]; OUString url_( expandUnoRcUrl( xPackage->getURL() ) ); - OSL_ASSERT( url_.getLength() >= baseURLlen ); + assert( url_.getLength() >= baseURLlen ); OUString fullPath; if (url_.getLength() > baseURLlen) fullPath = url_.copy( baseURLlen + 1 ); @@ -1096,7 +1096,7 @@ void BackendImpl::PackageImpl::exportTo( const Reference xPackageType( xPackage->getPackageType() ); OUString mediaType; - OSL_ASSERT( xPackageType.is() ); + assert( xPackageType.is() ); if (xPackageType.is()) mediaType = xPackageType->getMediaType(); else @@ -1252,7 +1252,7 @@ Sequence< Reference > BackendImpl::PackageImpl::getBundle( { const Reference xPackageType( (*iPos)->getPackageType() ); - OSL_ASSERT( xPackageType.is() ); + assert( xPackageType.is() ); if (xPackageType.is()) { const OUString mediaType( xPackageType->getMediaType() ); @@ -1271,7 +1271,7 @@ Sequence< Reference > BackendImpl::PackageImpl::getBundle( pret[ lower_end ] = *iPos; ++lower_end; } - OSL_ASSERT( lower_end == upper_end ); + assert( lower_end == upper_end ); const ::osl::MutexGuard guard( getMutex() ); pBundle = m_pBundle; @@ -1312,7 +1312,7 @@ Reference BackendImpl::PackageImpl::bindBundleItem( try { xPackage.set( getMyBackend()->m_xRootRegistry->bindPackage( url, mediaType, bRemoved, identifier, xCmdEnv ) ); - OSL_ASSERT( xPackage.is() ); + assert( xPackage.is() ); } catch (css::lang::IllegalArgumentException & e) { css::uno::Any exc(cppu::getCaughtException()); throw css::lang::WrappedTargetException( @@ -1340,7 +1340,7 @@ Reference BackendImpl::PackageImpl::bindBundleItem( if (xPackage.is()) { const Reference xPackageType( xPackage->getPackageType() ); - OSL_ASSERT( xPackageType.is() ); + assert( xPackageType.is() ); // ignore any nested bundles: if (xPackageType.is() && isBundle_( xPackageType->getMediaType() )) xPackage.clear(); @@ -1354,7 +1354,7 @@ void BackendImpl::PackageImpl::scanBundle( ::rtl::Reference const & abortChannel, Reference const & xCmdEnv ) { - OSL_ASSERT( !m_legacyBundle ); + assert( !m_legacyBundle ); OUString mfUrl( makeURL( m_url_expanded, "META-INF/manifest.xml" ) ); ::ucbhelper::Content manifestContent; @@ -1540,7 +1540,7 @@ void BackendImpl::PackageImpl::scanLegacyBundle( if (xPackage.is()) { const Reference xPackageType( xPackage->getPackageType() ); - OSL_ASSERT( xPackageType.is() ); + assert( xPackageType.is() ); if (xPackageType.is()) mediaType = xPackageType->getMediaType(); @@ -1588,7 +1588,7 @@ BackendImpl::PackageImpl::getPackagesFromDb( { Reference xExtension = bindBundleItem(i->first, i->second, true, m_identifier, xCmdEnv); - OSL_ASSERT(xExtension.is()); + assert(xExtension.is()); if (xExtension.is()) retVector.push_back(xExtension); } diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx index 3c59f781a049..7424294acab3 100644 --- a/desktop/source/deployment/registry/script/dp_script.cxx +++ b/desktop/source/deployment/registry/script/dp_script.cxx @@ -157,7 +157,7 @@ BackendImpl::BackendImpl( m_typeInfos[ 0 ] = m_xBasicLibTypeInfo; m_typeInfos[ 1 ] = m_xDialogLibTypeInfo; - OSL_ASSERT( ! transientMode() ); + assert( ! transientMode() ); if (!transientMode()) { diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx index 274ee2f827c2..0b6bc0404651 100644 --- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx +++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx @@ -294,7 +294,7 @@ void BackendImpl::PackageImpl:: initPackageHandler() } else { - OSL_ASSERT( false ); + assert( false ); // NOT supported at the moment // TODO } -- cgit