diff options
Diffstat (limited to 'desktop/source')
40 files changed, 159 insertions, 159 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index e3eabd7a2d68..a897fd521b5a 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -812,7 +812,7 @@ OUString Desktop::CreateErrorMsgString( case ::utl::Bootstrap::NO_FAILURE: { - OSL_ASSERT(false); + assert(false); } break; } @@ -892,7 +892,7 @@ void Desktop::HandleBootstrapErrors( case ::utl::Bootstrap::NO_FAILURE: { - OSL_ASSERT(false); + assert(false); } break; } @@ -1320,7 +1320,7 @@ void Desktop::Exception(ExceptionCategory nCategory) } } - OSL_ASSERT(false); // unreachable + assert(false); // unreachable } void Desktop::AppEvent( const ApplicationEvent& rAppEvent ) diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx index a0d6093f6762..33aa938fb5c5 100644 --- a/desktop/source/app/check_ext_deps.cxx +++ b/desktop/source/app/check_ext_deps.cxx @@ -152,7 +152,7 @@ void SilentCommandEnv::handle( Reference< task::XInteractionRequest> const & xRe bApprove = true; else { - OSL_ASSERT(false); + assert(false); } } diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index b86fe45d3b80..9a50a3487ef5 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -87,7 +87,7 @@ public: virtual boost::optional< OUString > getCwdUrl() override { return m_cwdUrl; } virtual bool next(OUString * argument) override { - OSL_ASSERT(argument != nullptr); + assert(argument != nullptr); if (m_index < m_count) { rtl_getAppCommandArg(m_index++, &argument->pData); return true; diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 7e712bc3fdd5..dbcb1e337e56 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -146,7 +146,7 @@ public: private: bool next(OUString * argument, bool prefix) { - OSL_ASSERT(argument != nullptr); + assert(argument != nullptr); if (m_index < m_input.getLength()) { if (prefix) { if (m_input[m_index] != ',') { diff --git a/desktop/source/deployment/dp_log.cxx b/desktop/source/deployment/dp_log.cxx index ee814f312b7b..7d05c4bb15f9 100644 --- a/desktop/source/deployment/dp_log.cxx +++ b/desktop/source/deployment/dp_log.cxx @@ -149,7 +149,7 @@ void ProgressLogImpl::log_write( OString const & text ) void ProgressLogImpl::push( Any const & Status ) { update( Status ); - OSL_ASSERT( m_log_level >= 0 ); + assert( m_log_level >= 0 ); ++m_log_level; } @@ -160,7 +160,7 @@ void ProgressLogImpl::update( Any const & Status ) return; OUStringBuffer buf; - OSL_ASSERT( m_log_level >= 0 ); + assert( m_log_level >= 0 ); for ( sal_Int32 n = 0; n < m_log_level; ++n ) buf.append( ' ' ); @@ -180,7 +180,7 @@ void ProgressLogImpl::update( Any const & Status ) void ProgressLogImpl::pop() { - OSL_ASSERT( m_log_level > 0 ); + assert( m_log_level > 0 ); --m_log_level; } diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx index 78f5b42d0824..93673c977246 100644 --- a/desktop/source/deployment/dp_persmap.cxx +++ b/desktop/source/deployment/dp_persmap.cxx @@ -120,13 +120,13 @@ static OString decodeString( const sal_Char* pEncChars, int nLen) if( c == '%') { --i; - OSL_ASSERT( i >= 0); + assert( i >= 0); c = *(pChar++); if( ('0' <= c) && (c <= '9')) c -= '0'; else { - OSL_ASSERT( ('A' <= c) && (c <= 'F')); + assert( ('A' <= c) && (c <= 'F')); c -= ('A'-10); } } @@ -165,7 +165,7 @@ void PersistentMap::readAll() char aHeaderBytes[ sizeof(PmapMagic)]; sal_uInt64 nBytesRead = 0; m_MapFile.read( aHeaderBytes, sizeof(aHeaderBytes), nBytesRead); - OSL_ASSERT( nBytesRead == sizeof(aHeaderBytes)); + assert( nBytesRead == sizeof(aHeaderBytes)); if( nBytesRead != sizeof(aHeaderBytes)) return; // check header magic @@ -229,13 +229,13 @@ void PersistentMap::flush() const OString aKeyString = encodeString( (*it).first); const sal_Int32 nKeyLen = aKeyString.getLength(); m_MapFile.write( aKeyString.getStr(), nKeyLen, nBytesWritten); - OSL_ASSERT( nKeyLen == (sal_Int32)nBytesWritten); + assert( nKeyLen == (sal_Int32)nBytesWritten); m_MapFile.write( "\n", 1, nBytesWritten); // write line for value const OString& rValString = encodeString( (*it).second); const sal_Int32 nValLen = rValString.getLength(); m_MapFile.write( rValString.getStr(), nValLen, nBytesWritten); - OSL_ASSERT( nValLen == (sal_Int32)nBytesWritten); + assert( nValLen == (sal_Int32)nBytesWritten); m_MapFile.write( "\n", 1, nBytesWritten); } diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 676e94283661..17da1e5b1238 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -91,7 +91,7 @@ struct StrAllFiles : public rtl::StaticWithInit< OUString, StrAllFiles > const OUString operator () () { const SolarMutexGuard guard; std::unique_ptr< ResMgr > const resmgr( ResMgr::CreateResMgr( "fps_office" ) ); - OSL_ASSERT( resmgr.get() != nullptr ); + assert( resmgr.get() != nullptr ); return ResId(STR_FILTERNAME_ALL, *resmgr.get()).toString(); } }; @@ -649,7 +649,7 @@ bool ExtMgrDialog::updatePackage( const uno::Reference< deployment::XPackage > & dp_misc::getIdentifier(xPackage), xPackage->getName(), uno::Reference<ucb::XCommandEnvironment>()); uno::Reference<deployment::XPackage> extension = dp_misc::getExtensionWithHighestVersion(seqExtensions); - OSL_ASSERT(extension.is()); + assert(extension.is()); std::vector< css::uno::Reference< css::deployment::XPackage > > vEntries; vEntries.push_back(extension); @@ -732,7 +732,7 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker() m_sLastFolderURL = xFilePicker->getDisplayDirectory(); uno::Sequence< OUString > files( xFilePicker->getSelectedFiles() ); - OSL_ASSERT( files.getLength() > 0 ); + assert( files.getLength() > 0 ); return files; } diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index a7970b81297e..e6d9b79a1725 100644 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx @@ -321,7 +321,7 @@ uno::Reference< ucb::XProgressHandler > ProgressCmdEnv::getProgressHandler() void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & xRequest ) { uno::Any request( xRequest->getRequest() ); - OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + assert( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); dp_misc::TRACE( "[dp_gui_cmdenv.cxx] incoming request:\n" + ::comphelper::anyToString(request) + "\n"); @@ -355,11 +355,11 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & // ignore intermediate errors of legacy packages, i.e. // former pkgchk behaviour: const uno::Reference< deployment::XPackage > xPackage( wtExc.Context, uno::UNO_QUERY ); - OSL_ASSERT( xPackage.is() ); + assert( xPackage.is() ); if ( xPackage.is() ) { const uno::Reference< deployment::XPackageTypeInfo > xPackageType( xPackage->getPackageType() ); - OSL_ASSERT( xPackageType.is() ); + assert( xPackageType.is() ); if (xPackageType.is()) { approve = ( xPackage->isBundle() && @@ -400,7 +400,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & approve = true; else { - OSL_ASSERT(false); + assert(false); } } else if (request >>= verExc) @@ -419,7 +419,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & id = RID_STR_WARNING_VERSION_GREATER; break; } - OSL_ASSERT( verExc.Deployed.is() ); + assert( verExc.Deployed.is() ); bool bEqualNames = verExc.NewDisplayName.equals( verExc.Deployed->getDisplayName()); { @@ -579,7 +579,7 @@ ExtensionCmdQueue::Thread::Thread( DialogHelper *pDialogHelper, m_bStopped( false ), m_bWorking( false ) { - OSL_ASSERT( pDialogHelper ); + assert( pDialogHelper ); } diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 4cd3d38587f6..1d0520032cee 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -274,7 +274,7 @@ sal_Int32 ExtensionBox_Impl::getSelIndex() const { if ( m_bHasActive ) { - OSL_ASSERT( m_nActive >= -1); + assert( m_nActive >= -1); return static_cast< sal_Int32 >( m_nActive ); } else diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx index 62cb6e8fb10e..151ec49c5e5c 100644 --- a/desktop/source/deployment/gui/dp_gui_service.cxx +++ b/desktop/source/deployment/gui/dp_gui_service.cxx @@ -223,7 +223,7 @@ void ServiceImpl::startExecuteModal( } if (! bOfficePipePresent) { - OSL_ASSERT( ! bAppUp ); + assert( ! bAppUp ); app.reset( new MyApp ); if (! InitVCL() ) throw RuntimeException( "Cannot initialize VCL!", diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx index 3170f8192d14..cbf6268e4811 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx @@ -214,7 +214,7 @@ void TheExtensionManager::checkUpdates( bool /* bShowUpdateOnly */, bool /*bPare for ( sal_Int32 i = 0; i < xAllPackages.getLength(); ++i ) { uno::Reference< deployment::XPackage > xPackage = dp_misc::getExtensionWithHighestVersion(xAllPackages[i]); - OSL_ASSERT(xPackage.is()); + assert(xPackage.is()); if ( xPackage.is() ) { vEntries.push_back( xPackage ); @@ -373,7 +373,7 @@ bool TheExtensionManager::supportsOptions( const uno::Reference< deployment::XPa beans::Optional< OUString > aId = xPackage->getIdentifier(); //a bundle must always have an id - OSL_ASSERT( aId.IsPresent ); + assert( aId.IsPresent ); //iterate over all available nodes uno::Sequence< OUString > seqNames = m_xNameAccessNodes->getElementNames(); diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 9769a8b3b452..4090ea05638e 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -314,13 +314,13 @@ void UpdateDialog::Thread::execute() dp_misc::getIdentifier(info.extension), info.extension->getName(), uno::Reference<ucb::XCommandEnvironment>()); } catch ( const lang::IllegalArgumentException& ) { - OSL_ASSERT(false); + assert(false); continue; } catch ( const css::ucb::CommandFailedException& ) { - OSL_ASSERT(false); + assert(false); continue; } - OSL_ASSERT(extensions.getLength() == 3); + assert(extensions.getLength() == 3); if (extensions[0].is() ) sVersionUser = extensions[0]->getVersion(); if (extensions[1].is() ) @@ -393,7 +393,7 @@ void UpdateDialog::Thread::handleSpecificError( OUString UpdateDialog::Thread::getUpdateDisplayString( dp_gui::UpdateData const & data, OUString const & version) const { - OSL_ASSERT(data.aInstalledPackage.is()); + assert(data.aInstalledPackage.is()); OUStringBuffer b(data.aInstalledPackage->getDisplayName()); b.append(' '); { @@ -429,7 +429,7 @@ void UpdateDialog::Thread::prepareUpdateData( if (!updateInfo.is()) return; dp_misc::DescriptionInfoset infoset(m_context, updateInfo); - OSL_ASSERT(!infoset.getVersion().isEmpty()); + assert(!infoset.getVersion().isEmpty()); uno::Sequence< uno::Reference< xml::dom::XElement > > ds( dp_misc::Dependencies::check(infoset)); @@ -526,7 +526,7 @@ UpdateDialog::UpdateDialog( get(m_pOk, "INSTALL"); get(m_pClose, "gtk-close"); get(m_pHelp, "gtk-help"); - OSL_ASSERT(updateData != nullptr); + assert(updateData != nullptr); m_xExtensionManager = deployment::ExtensionManager::get( context ); @@ -609,7 +609,7 @@ UpdateDialog::CheckListBox::CheckListBox( vcl::Window* pParent, UpdateDialog & d sal_uInt16 UpdateDialog::CheckListBox::getItemCount() const { sal_uLong i = GetEntryCount(); - OSL_ASSERT(i <= std::numeric_limits< sal_uInt16 >::max()); + assert(i <= std::numeric_limits< sal_uInt16 >::max()); return sal::static_int_cast< sal_uInt16 >(i); } @@ -704,7 +704,7 @@ sal_uInt16 UpdateDialog::insertItem( UpdateDialog::Index *pEntry, SvLBoxButtonKi if ( p == pEntry ) return i; } - OSL_ASSERT(false); + assert(false); return 0; } @@ -933,7 +933,7 @@ bool UpdateDialog::showDescription(uno::Reference< xml::dom::XNode > const & aUp bool UpdateDialog::showDescription(uno::Reference< deployment::XPackage > const & aExtension) { - OSL_ASSERT(aExtension.is()); + assert(aExtension.is()); beans::StringPair pubInfo = aExtension->getPublisherInfo(); return showDescription(std::make_pair(pubInfo.First, pubInfo.Second), ""); @@ -1219,7 +1219,7 @@ IMPL_LINK_NOARG(UpdateDialog, selectionHandler, SvTreeListBox*, void) break; } default: - OSL_ASSERT(false); + assert(false); break; } } @@ -1279,7 +1279,7 @@ IMPL_LINK_NOARG(UpdateDialog, okHandler, Button*, void) typedef std::vector<UpdateData>::const_iterator CIT; for (CIT i = m_enabledUpdates.begin(); i < m_enabledUpdates.end(); ++i) { - OSL_ASSERT(i->aInstalledPackage.is()); + assert(i->aInstalledPackage.is()); //If the user has no write access to the shared folder then the update //for a shared extension is disable, that is it cannot be in m_enabledUpdates } diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx index 8f18c13c8060..8f66a8ce49a0 100644 --- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx @@ -290,7 +290,7 @@ void UpdateInstallDialog::setError(INSTALL_ERROR err, OUString const & sExtensio break; default: - OSL_ASSERT(false); + assert(false); } OUString sMsg(m_pMle_info->GetText()); @@ -362,7 +362,7 @@ void UpdateInstallDialog::Thread::downloadExtensions() continue; //We assume that m_aVecUpdateData contains only information about extensions which //can be downloaded directly. - OSL_ASSERT(curData.sWebsiteURL.isEmpty()); + assert(curData.sWebsiteURL.isEmpty()); //update the name of the extension which is to be downloaded { @@ -495,7 +495,7 @@ void UpdateInstallDialog::Thread::installExtensions() } else if (curData.aUpdateSource.is()) { - OSL_ASSERT(curData.aUpdateSource.is()); + assert(curData.aUpdateSource.is()); //I am not sure if we should obtain the install properties and pass them into //add extension. Currently it contains only "SUPPRESS_LICENSE". So it could happen //that a license is displayed when updating from the shared repository, although the @@ -581,7 +581,7 @@ bool UpdateInstallDialog::Thread::download(OUString const & sDownloadURL, Update } } - OSL_ASSERT(m_sDownloadFolder.getLength()); + assert(m_sDownloadFolder.getLength()); OUString destFolder, tempEntry; if (::osl::File::createTempFile( &m_sDownloadFolder, @@ -644,7 +644,7 @@ void UpdateCommandEnv::handle( cssu::Reference< css::task::XInteractionRequest> const & xRequest ) { cssu::Any request( xRequest->getRequest() ); - OSL_ASSERT( request.getValueTypeClass() == cssu::TypeClass_EXCEPTION ); + assert( request.getValueTypeClass() == cssu::TypeClass_EXCEPTION ); dp_misc::TRACE("[dp_gui_cmdenv.cxx] incoming request:\n" + ::comphelper::anyToString(request) + "\n\n"); diff --git a/desktop/source/deployment/manager/dp_activepackages.cxx b/desktop/source/deployment/manager/dp_activepackages.cxx index 410c0aab528a..e1263bec3b5f 100644 --- a/desktop/source/deployment/manager/dp_activepackages.cxx +++ b/desktop/source/deployment/manager/dp_activepackages.cxx @@ -66,7 +66,7 @@ OString newKey(OUString const & id) { { ::dp_manager::ActivePackages::Data d; sal_Int32 i = value.indexOf(';'); - OSL_ASSERT(i >= 0); + assert(i >= 0); d.temporaryName = OUString(value.getStr(), i, RTL_TEXTENCODING_UTF8); d.fileName = fileName; d.mediaType = OUString( @@ -78,11 +78,11 @@ OString newKey(OUString const & id) { ::dp_manager::ActivePackages::Data decodeNewData(OString const & value) { ::dp_manager::ActivePackages::Data d; sal_Int32 i1 = value.indexOf(separator); - OSL_ASSERT(i1 >= 0); + assert(i1 >= 0); d.temporaryName = OUString( value.getStr(), i1, RTL_TEXTENCODING_UTF8); sal_Int32 i2 = value.indexOf(separator, i1 + 1); - OSL_ASSERT(i2 >= 0); + assert(i2 >= 0); d.fileName = OUString( value.getStr() + i1 + 1, i2 - i1 - 1, RTL_TEXTENCODING_UTF8); sal_Int32 i3 = value.indexOf(separator, i2 + 1); diff --git a/desktop/source/deployment/manager/dp_commandenvironments.cxx b/desktop/source/deployment/manager/dp_commandenvironments.cxx index cd93931e6de0..67a6fdd55d8e 100644 --- a/desktop/source/deployment/manager/dp_commandenvironments.cxx +++ b/desktop/source/deployment/manager/dp_commandenvironments.cxx @@ -143,7 +143,7 @@ void TmpRepositoryCommandEnv::handle( Reference< task::XInteractionRequest> const & xRequest ) { uno::Any request( xRequest->getRequest() ); - OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + assert( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); deployment::VersionException verExc; deployment::LicenseException licExc; @@ -176,7 +176,7 @@ void LicenseCommandEnv::handle( Reference< task::XInteractionRequest> const & xRequest ) { uno::Any request( xRequest->getRequest() ); - OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + assert( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); deployment::LicenseException licExc; @@ -211,7 +211,7 @@ void NoLicenseCommandEnv::handle( Reference< task::XInteractionRequest> const & xRequest ) { uno::Any request( xRequest->getRequest() ); - OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + assert( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); deployment::LicenseException licExc; @@ -233,7 +233,7 @@ void SilentCheckPrerequisitesCommandEnv::handle( Reference< task::XInteractionRequest> const & xRequest ) { uno::Any request( xRequest->getRequest() ); - OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + assert( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); deployment::LicenseException licExc; deployment::PlatformException platformExc; diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index e5d31af7c1a3..6282a838b687 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -86,7 +86,7 @@ struct CompIdentifiers OUString CompIdentifiers::getName(std::vector<Reference<css::deployment::XPackage> > const & a) { - OSL_ASSERT(a.size() == 3); + assert(a.size() == 3); //get the first non-null reference Reference<css::deployment::XPackage> extension; std::vector<Reference<css::deployment::XPackage> >::const_iterator it = a.begin(); @@ -98,7 +98,7 @@ OUString CompIdentifiers::getName(std::vector<Reference<css::deployment::XPackag break; } } - OSL_ASSERT(extension.is()); + assert(extension.is()); return extension->getDisplayName(); } @@ -146,14 +146,14 @@ public: ExtensionRemoveGuard::~ExtensionRemoveGuard() { try { - OSL_ASSERT(!(m_extension.is() && !m_xPackageManager.is())); + assert(!(m_extension.is() && !m_xPackageManager.is())); if (m_xPackageManager.is() && m_extension.is()) m_xPackageManager->removePackage( dp_misc::getIdentifier(m_extension), OUString(), css::uno::Reference<css::task::XAbortChannel>(), css::uno::Reference<css::ucb::XCommandEnvironment>()); } catch (...) { - OSL_ASSERT(false); + assert(false); } } @@ -167,7 +167,7 @@ ExtensionManager::ExtensionManager( Reference< uno::XComponentContext > const& x , m_xContext(xContext) { m_xPackageManagerFactory = css::deployment::thePackageManagerFactory::get(m_xContext); - OSL_ASSERT(m_xPackageManagerFactory.is()); + assert(m_xPackageManagerFactory.is()); m_repositoryNames.push_back("user"); m_repositoryNames.push_back("shared"); @@ -301,7 +301,7 @@ std::list<Reference<css::deployment::XPackage> > } extensionList.push_back(xPackage); } - OSL_ASSERT(extensionList.size() == 3); + assert(extensionList.size() == 3); return extensionList; } @@ -359,7 +359,7 @@ bool ExtensionManager::isUserDisabled( listExtensions = getExtensionsWithSameId(identifier, fileName); } catch ( const lang::IllegalArgumentException & ) { } - OSL_ASSERT(listExtensions.size() == 3); + assert(listExtensions.size() == 3); return isUserDisabled( ::comphelper::containerToSequence(listExtensions) ); } @@ -367,7 +367,7 @@ bool ExtensionManager::isUserDisabled( bool ExtensionManager::isUserDisabled( uno::Sequence<Reference<css::deployment::XPackage> > const & seqExtSameId) { - OSL_ASSERT(seqExtSameId.getLength() == 3); + assert(seqExtSameId.getLength() == 3); Reference<css::deployment::XPackage> const & userExtension = seqExtSameId[0]; if (userExtension.is()) { @@ -411,7 +411,7 @@ void ExtensionManager::activateExtension( listExtensions = getExtensionsWithSameId(identifier, fileName); } catch (const lang::IllegalArgumentException &) { } - OSL_ASSERT(listExtensions.size() == 3); + assert(listExtensions.size() == 3); activateExtension( ::comphelper::containerToSequence(listExtensions), @@ -1171,7 +1171,7 @@ void ExtensionManager::reinstallDeployedExtensions( registered.Value.Value)) { const OUString id = dp_misc::getIdentifier(extensions[ pos ]); - OSL_ASSERT(!id.isEmpty()); + assert(!id.isEmpty()); disabledExts.insert(id); } } @@ -1196,7 +1196,7 @@ void ExtensionManager::reinstallDeployedExtensions( { const OUString id = dp_misc::getIdentifier(extensions[ pos ]); const OUString fileName = extensions[ pos ]->getName(); - OSL_ASSERT(!id.isEmpty()); + assert(!id.isEmpty()); activateExtension( id, fileName, disabledExts.find(id) != disabledExts.end(), true, xAbortChannel, xCmdEnv ); @@ -1313,7 +1313,7 @@ void ExtensionManager::checkInstall( request, cppu::UnoType<task::XInteractionApprove>::get(), cmdEnv, &approve, &abort )) { - OSL_ASSERT( !approve && !abort ); + assert( !approve && !abort ); throw css::deployment::DeploymentException( dp_misc::getResourceString(RID_STR_ERROR_WHILE_ADDING) + displayName, static_cast<OWeakObject *>(this), request ); @@ -1345,7 +1345,7 @@ void ExtensionManager::checkUpdate( if (! dp_misc::interactContinuation( request, cppu::UnoType<task::XInteractionApprove>::get(), xCmdEnv, &replace, &abort )) { - OSL_ASSERT( !replace && !abort ); + assert( !replace && !abort ); throw css::deployment::DeploymentException( dp_misc::getResourceString( RID_STR_ERROR_WHILE_ADDING) + newDisplayName, diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx index a19a5c728516..9f99a483cc3a 100644 --- a/desktop/source/deployment/manager/dp_informationprovider.cxx +++ b/desktop/source/deployment/manager/dp_informationprovider.cxx @@ -163,7 +163,7 @@ PackageInformationProvider::isUpdateAvailable( const OUString& _sExtensionId ) if (!extMgr.is()) { - OSL_ASSERT(false); + assert(false); return aList; } std::vector<std::pair<uno::Reference<deployment::XPackage>, uno::Any > > errors; @@ -181,7 +181,7 @@ PackageInformationProvider::isUpdateAvailable( const OUString& _sExtensionId ) } catch (lang::IllegalArgumentException &) { - OSL_ASSERT(false); + assert(false); } updateInfoMap = dp_misc::getOnlineUpdateInfos( mxContext, extMgr, mxUpdateInformation, &vecExtensions, errors); @@ -222,7 +222,7 @@ PackageInformationProvider::isUpdateAvailable( const OUString& _sExtensionId ) "ignoring IllegalArgumentException \"" << e.Message << "\""); continue; } - OSL_ASSERT(extensions.getLength() == 3); + assert(extensions.getLength() == 3); if (extensions[0].is() ) sVersionUser = extensions[0]->getVersion(); if (extensions[1].is() ) @@ -289,7 +289,7 @@ uno::Sequence< uno::Sequence< OUString > > SAL_CALL PackageInformationProvider:: const uno::Sequence< uno::Reference< deployment::XPackage > > & seqExtension = allExt[i]; sal_Int32 cExt = seqExtension.getLength(); - OSL_ASSERT(cExt == 3); + assert(cExt == 3); for (sal_Int32 j = 0; j < cExt; j++) { //ToDo according to the old code the first found extension is used diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index df1431c449a2..9f57fe73a9f2 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -114,7 +114,7 @@ void PackageManagerImpl::initActivationLayer( { if (m_activePackages.isEmpty()) { - OSL_ASSERT( m_registryCache.isEmpty() ); + assert( m_registryCache.isEmpty() ); // documents temp activation: m_activePackagesDB.reset( new ActivePackages ); ::ucbhelper::Content ucbContent; @@ -161,7 +161,7 @@ void PackageManagerImpl::initActivationLayer( else { // user|share: - OSL_ASSERT( !m_activePackages.isEmpty() ); + assert( !m_activePackages.isEmpty() ); m_activePackages_expanded = expandUnoRcUrl( m_activePackages ); m_registrationData_expanded = expandUnoRcUrl(m_registrationData); if (!m_readOnly) @@ -523,7 +523,7 @@ OUString PackageManagerImpl::getContext() Sequence< Reference<deployment::XPackageTypeInfo> > PackageManagerImpl::getSupportedPackageTypes() { - OSL_ASSERT( m_xRegistry.is() ); + assert( m_xRegistry.is() ); return m_xRegistry->getSupportedPackageTypes(); } @@ -575,7 +575,7 @@ OUString PackageManagerImpl::detectMediaType( url, OUString(), false, OUString(), ucbContent.getCommandEnvironment() ) ); const Reference<deployment::XPackageTypeInfo> xPackageType( xPackage->getPackageType() ); - OSL_ASSERT( xPackageType.is() ); + assert( xPackageType.is() ); if (xPackageType.is()) mediaType = xPackageType->getMediaType(); } @@ -644,7 +644,7 @@ OUString PackageManagerImpl::insertToActivationLayer( // write to DB: //bundled extensions should only be added by the synchronizeAddedExtensions //functions. Moreover, there is no "temporary folder" for bundled extensions. - OSL_ASSERT(!(m_context == "bundled")); + assert(!(m_context == "bundled")); OUString sFolderUrl = makeURLAppendSysPathSegment(destFolderContent.getURL(), title); DescriptionInfoset info = dp_misc::getDescriptionInfoset(sFolderUrl); @@ -780,7 +780,7 @@ Reference<deployment::XPackage> PackageManagerImpl::addPackage( xPackage = m_xRegistry->bindPackage( makeURL( destFolder, title_enc ), mediaType, false, OUString(), xCmdEnv ); - OSL_ASSERT( xPackage.is() ); + assert( xPackage.is() ); if (xPackage.is()) { bool install = false; @@ -888,7 +888,7 @@ void PackageManagerImpl::removePackage( { ActivePackages::Data val; m_activePackagesDB->get( & val, id, fileName); - OSL_ASSERT(!val.temporaryName.isEmpty()); + assert(!val.temporaryName.isEmpty()); OUString url(makeURL(m_activePackages_expanded, val.temporaryName + "removed")); ::ucbhelper::Content contentRemoved(url, xCmdEnv, m_xComponentContext); @@ -1194,7 +1194,7 @@ bool PackageManagerImpl::synchronizeRemovedExtensions( //find all which are in the extension data base but which //are removed already. - OSL_ASSERT(!(m_context == "user")); + assert(!(m_context == "user")); bool bModified = false; ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() ); @@ -1261,7 +1261,7 @@ bool PackageManagerImpl::synchronizeRemovedExtensions( { Reference<deployment::XPackage> xPackage = m_xRegistry->bindPackage( url, i->second.mediaType, true, i->first, xCmdEnv ); - OSL_ASSERT(xPackage.is()); //Even if the files are removed, we must get the object. + assert(xPackage.is()); //Even if the files are removed, we must get the object. xPackage->revokePackage(true, xAbortChannel, xCmdEnv); removePackage(xPackage->getIdentifier().Value, xPackage->getName(), xAbortChannel, xCmdEnv); @@ -1282,7 +1282,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions( Reference<css::ucb::XCommandEnvironment> const & xCmdEnv) { bool bModified = false; - OSL_ASSERT(!(m_context == "user")); + assert(!(m_context == "user")); ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() ); //check if the folder exist at all. The shared extension folder @@ -1320,7 +1320,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions( bool bShared = (m_context == "shared"); if (bShared) { - OSL_ASSERT(title2.endsWith("_")); + assert(title2.endsWith("_")); title2 = title2.copy(0, title2.getLength() -1); } OUString titleEncoded = ::rtl::Uri::encode( @@ -1378,7 +1378,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions( //showing a license if simple-license/@accept-by = "admin" //It will also prevent showing the license for bundled extensions //which is not supported. - OSL_ASSERT(!(m_context == "user")); + assert(!(m_context == "user")); // shall the license be suppressed? DescriptionInfoset info = diff --git a/desktop/source/deployment/manager/dp_managerfac.cxx b/desktop/source/deployment/manager/dp_managerfac.cxx index b2e9fc418d8e..9ec153b93d3f 100644 --- a/desktop/source/deployment/manager/dp_managerfac.cxx +++ b/desktop/source/deployment/manager/dp_managerfac.cxx @@ -132,7 +132,7 @@ PackageManagerFactoryImpl::getPackageManager( OUString const & context ) m_managers.insert( t_string2weakref::value_type( context, xRet ) ) ); if (insertion.second) { - OSL_ASSERT( insertion.first->second.get() == xRet ); + assert( insertion.first->second.get() == xRet ); // hold user, shared mgrs for whole process: live deployment if ( context == "user" ) m_xUserMgr = xRet; diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx index 10d10f292765..48ab6f6a78d7 100644 --- a/desktop/source/deployment/misc/dp_dependencies.cxx +++ b/desktop/source/deployment/misc/dp_dependencies.cxx @@ -152,7 +152,7 @@ check(dp_misc::DescriptionInfoset const & infoset) { OUString getErrorText( css::uno::Reference< css::xml::dom::XElement > const & dependency) { - OSL_ASSERT(dependency.is()); + assert(dependency.is()); if ( dependency->getNamespaceURI() == namespaceOpenOfficeOrg && dependency->getTagName() == minimalVersionOpenOfficeOrg ) { return produceErrorText( diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx index b1762ab7fd87..470e7726393c 100644 --- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx +++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx @@ -88,7 +88,7 @@ css::uno::Reference< css::xml::dom::XNode > EmptyNodeList::item(::sal_Int32) OUString getNodeValue( css::uno::Reference< css::xml::dom::XNode > const & node) { - OSL_ASSERT(node.is()); + assert(node.is()); try { return node->getNodeValue(); } catch (const css::xml::dom::DOMException & e) { @@ -583,7 +583,7 @@ std::pair< OUString, OUString > DescriptionInfoset::getLocalizedPublisherNameAnd } catch (const css::xml::xpath::XPathException &) { // ignore } - OSL_ASSERT(xPathName.is()); + assert(xPathName.is()); if (xPathName.is()) sPublisherName = xPathName->getNodeValue(); @@ -594,7 +594,7 @@ std::pair< OUString, OUString > DescriptionInfoset::getLocalizedPublisherNameAnd } catch (const css::xml::xpath::XPathException &) { // ignore } - OSL_ASSERT(xURL.is()); + assert(xURL.is()); if (xURL.is()) sURL = xURL->getNodeValue(); } @@ -711,7 +711,7 @@ css::uno::Reference<css::xml::dom::XNode> DescriptionInfoset::matchLanguageTag( css::uno::Reference< css::xml::dom::XNode > const & xParent, OUString const & rTag) const { - OSL_ASSERT(xParent.is()); + assert(xParent.is()); css::uno::Reference<css::xml::dom::XNode> nodeMatch; //first try exact match for lang @@ -741,7 +741,7 @@ css::uno::Reference<css::xml::dom::XNode> DescriptionInfoset::getChildWithDefaultLocale(css::uno::Reference< css::xml::dom::XNode > const & xParent) const { - OSL_ASSERT(xParent.is()); + assert(xParent.is()); if ( xParent->getNodeName() == "simple-license" ) { css::uno::Reference<css::xml::dom::XNode> nodeDefault; @@ -792,7 +792,7 @@ OUString DescriptionInfoset::getLocalizedHREFAttrFromChild( } catch (const css::xml::xpath::XPathException &) { // ignore } - OSL_ASSERT(xURL.is()); + assert(xURL.is()); if (xURL.is()) sURL = xURL->getNodeValue(); } diff --git a/desktop/source/deployment/misc/dp_identifier.cxx b/desktop/source/deployment/misc/dp_identifier.cxx index a0b922c008b1..9977d91b2a4c 100644 --- a/desktop/source/deployment/misc/dp_identifier.cxx +++ b/desktop/source/deployment/misc/dp_identifier.cxx @@ -43,7 +43,7 @@ OUString generateIdentifier( OUString getIdentifier( css::uno::Reference< css::deployment::XPackage > const & package) { - OSL_ASSERT(package.is()); + assert(package.is()); css::beans::Optional< OUString > id(package->getIdentifier()); return id.IsPresent ? id.Value : generateLegacyIdentifier(package->getName()); diff --git a/desktop/source/deployment/misc/dp_interact.cxx b/desktop/source/deployment/misc/dp_interact.cxx index 0eda61153da6..9887d258b327 100644 --- a/desktop/source/deployment/misc/dp_interact.cxx +++ b/desktop/source/deployment/misc/dp_interact.cxx @@ -46,7 +46,7 @@ public: InteractionContinuationImpl( Type const & type, bool * pselect ) : m_type( type ), m_pselect( pselect ) - { OSL_ASSERT( + { assert( cppu::UnoType<task::XInteractionContinuation>::get().isAssignableFrom(m_type) ); } // XInterface @@ -97,7 +97,7 @@ bool interactContinuation( Any const & request, Reference<XCommandEnvironment> const & xCmdEnv, bool * pcont, bool * pabort ) { - OSL_ASSERT( + assert( cppu::UnoType<task::XInteractionContinuation>::get().isAssignableFrom( continuation ) ); if (xCmdEnv.is()) { diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index 2083075a608e..1d2ddabbb4ed 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -81,7 +81,7 @@ struct UnoRc : public rtl::StaticWithInit< ::rtl::Bootstrap::expandMacros( unorc ); std::shared_ptr< ::rtl::Bootstrap > ret( new ::rtl::Bootstrap( unorc ) ); - OSL_ASSERT( ret->getHandle() != nullptr ); + assert( ret->getHandle() != nullptr ); return ret; } }; @@ -198,13 +198,13 @@ bool compareExtensionFolderWithLastSynchronizedFile( } else { - OSL_ASSERT(false); + assert(false); bNeedsSync = true; } } else { - OSL_ASSERT(false); + assert(false); bNeedsSync = true; } @@ -227,7 +227,7 @@ bool needToSyncRepository(OUString const & name) } else { - OSL_ASSERT(false); + assert(false); return true; } ::rtl::Bootstrap::expandMacros(folder); @@ -296,7 +296,7 @@ OUString makeURL( OUString const & baseURL, OUString const & relPath_ ) OUString makeURLAppendSysPathSegment( OUString const & baseURL, OUString const & segment ) { - OSL_ASSERT(segment.indexOf(u'/') == -1); + assert(segment.indexOf(u'/') == -1); ::rtl::Uri::encode( segment, rtl_UriCharClassPchar, rtl_UriEncodeIgnoreEscapes, @@ -314,7 +314,7 @@ OUString expandUnoRcTerm( OUString const & term_ ) OUString makeRcTerm( OUString const & url ) { - OSL_ASSERT( url.match( "vnd.sun.star.expand:" )); + assert( url.match( "vnd.sun.star.expand:" )); if (url.match( "vnd.sun.star.expand:" )) { // cut protocol: OUString rcterm( url.copy( sizeof ("vnd.sun.star.expand:") - 1 ) ); @@ -508,7 +508,7 @@ OUString readConsole() //unopkg.com feeds unopkg.exe with wchar_t|s if (ReadFile( GetStdHandle(STD_INPUT_HANDLE), &aBuffer, sizeof(aBuffer), &dwRead, nullptr ) ) { - OSL_ASSERT((dwRead % 2) == 0); + assert((dwRead % 2) == 0); OUString value( aBuffer, dwRead / 2); return value.trim(); } diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx index f20da27e0d5a..2a9459453204 100644 --- a/desktop/source/deployment/misc/dp_update.cxx +++ b/desktop/source/deployment/misc/dp_update.cxx @@ -90,7 +90,7 @@ void getOwnUpdateInfos( bool bAllHaveOwnUpdateInformation = true; for (UpdateInfoMap::iterator i = inout_map.begin(); i != inout_map.end(); ++i) { - OSL_ASSERT(i->second.extension.is()); + assert(i->second.extension.is()); Sequence<OUString> urls(i->second.extension->getUpdateInformationURLs()); if (urls.getLength()) { @@ -113,7 +113,7 @@ void getOwnUpdateInfos( boost::optional< OUString > id2(infoset.getIdentifier()); if (!id2) continue; - OSL_ASSERT(*id2 == id); + assert(*id2 == id); if (*id2 == id) { i->second.version = infoset.getVersion(); @@ -137,7 +137,7 @@ void getDefaultUpdateInfos( std::vector<std::pair<Reference<deployment::XPackage>, uno::Any> > & out_errors) { const OUString sDefaultURL(dp_misc::getExtensionDefaultUpdateURL()); - OSL_ASSERT(!sDefaultURL.isEmpty()); + assert(!sDefaultURL.isEmpty()); Any anyError; Sequence< Reference< xml::dom::XElement > > @@ -175,7 +175,7 @@ void getDefaultUpdateInfos( bool containsBundledOnly(Sequence<Reference<deployment::XPackage> > const & sameIdExtensions) { - OSL_ASSERT(sameIdExtensions.getLength() == 3); + assert(sameIdExtensions.getLength() == 3); return !sameIdExtensions[0].is() && !sameIdExtensions[1].is() && sameIdExtensions[2].is(); } @@ -187,7 +187,7 @@ bool onlyBundledExtensions( Reference<deployment::XExtensionManager> const & xExtMgr, std::vector< Reference<deployment::XPackage > > const * extensionList) { - OSL_ASSERT(xExtMgr.is()); + assert(xExtMgr.is()); bool bOnlyBundled = true; if (extensionList) { @@ -341,7 +341,7 @@ UpdateInfoMap getOnlineUpdateInfos( std::vector<Reference<deployment::XPackage > > const * extensionList, std::vector<std::pair< Reference<deployment::XPackage>, uno::Any> > & out_errors) { - OSL_ASSERT(xExtMgr.is()); + assert(xExtMgr.is()); UpdateInfoMap infoMap; if (!xExtMgr.is() || onlyBundledExtensions(xExtMgr, extensionList)) return infoMap; @@ -357,12 +357,12 @@ UpdateInfoMap getOnlineUpdateInfos( uno::Sequence<Reference<deployment::XPackage> > const & seqExt = seqAllExt[pos]; Reference<deployment::XPackage> extension = getExtensionWithHighestVersion(seqExt); - OSL_ASSERT(extension.is()); + assert(extension.is()); std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert( UpdateInfoMap::value_type( dp_misc::getIdentifier(extension), UpdateInfo(extension))); - OSL_ASSERT(insertRet.second); + assert(insertRet.second); (void)insertRet; } } @@ -371,11 +371,11 @@ UpdateInfoMap getOnlineUpdateInfos( typedef std::vector<Reference<deployment::XPackage > >::const_iterator CIT; for (CIT i = extensionList->begin(); i != extensionList->end(); ++i) { - OSL_ASSERT(i->is()); + assert(i->is()); std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert( UpdateInfoMap::value_type( dp_misc::getIdentifier(*i), UpdateInfo(*i))); - OSL_ASSERT(insertRet.second); + assert(insertRet.second); (void)insertRet; } } @@ -402,7 +402,7 @@ OUString getHighestVersion( case 1: return sharedVersion; case 2: return bundledVersion; case 3: return onlineVersion; - default: OSL_ASSERT(false); + default: assert(false); } return OUString(); 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<XComponentContext> raise_uno_process( Reference<XComponentContext> const & xContext, ::rtl::Reference<AbortChannel> 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<XComponentContext> 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<XComponentContext> const xContext(getMyBackend()->getComponentContext()); - OSL_ASSERT(xContext.is()); + assert(xContext.is()); Reference<XInterface> 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<ConfigurationBackendDb::Data> 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<css::xml::dom::XNode> 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<css::xml::dom::XDocument> doc = getDocument(); const Reference<css::xml::dom::XNode> root = doc->getFirstChild(); @@ -346,7 +346,7 @@ BackendDb::readVectorOfPair( { try { - OSL_ASSERT(parent.is()); + assert(parent.is()); const OUString sPrefix(getNSPrefix() + ":"); const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI(); const OUString sExprPairs( @@ -366,7 +366,7 @@ BackendDb::readVectorOfPair( const OUString sExprSecond(sPrefix + sSecondTagName + "/text()"); const Reference<css::xml::dom::XNode> 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<css::xml::dom::XNode> 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<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI(); const OUString sExprList( @@ -635,7 +635,7 @@ void RegisteredDb::addEntry(OUString const & url) sPrefix + ":" + sEntry + "[@url = \"" + url + "\"]"); Reference<css::xml::dom::XNode> _extensionNode = getXPathAPI()->selectSingleNode(root, sExpression); - OSL_ASSERT(! _extensionNode.is()); + assert(! _extensionNode.is()); #endif Reference<css::xml::dom::XElement> 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<deployment::XPackageRegistry> PackageRegistryImpl::create( Reference<lang::XServiceInfo> xServiceInfo( extensionBackend, UNO_QUERY_THROW ); - OSL_ASSERT(xServiceInfo.is()); + assert(xServiceInfo.is()); OUString registryCachePath( makeURL( cachePath, ::rtl::Uri::encode( @@ -421,7 +421,7 @@ Reference<deployment::XPackageRegistry> 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<ucb::XCommandEnvironment> 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<OWeakObject *>(this), exc ) ), cppu::UnoType<task::XInteractionApprove>::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<OWeakObject *>(this), exc ) ), cppu::UnoType<task::XInteractionApprove>::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<deployment::XPackage> 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<deployment::XPackageTypeInfo> 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<deployment::XPackage> > BackendImpl::PackageImpl::getBundle( { const Reference<deployment::XPackageTypeInfo> xPackageType( (*iPos)->getPackageType() ); - OSL_ASSERT( xPackageType.is() ); + assert( xPackageType.is() ); if (xPackageType.is()) { const OUString mediaType( xPackageType->getMediaType() ); @@ -1271,7 +1271,7 @@ Sequence< Reference<deployment::XPackage> > 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<deployment::XPackage> 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<deployment::XPackage> BackendImpl::PackageImpl::bindBundleItem( if (xPackage.is()) { const Reference<deployment::XPackageTypeInfo> 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<AbortChannel> const & abortChannel, Reference<ucb::XCommandEnvironment> 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<deployment::XPackageTypeInfo> xPackageType( xPackage->getPackageType() ); - OSL_ASSERT( xPackageType.is() ); + assert( xPackageType.is() ); if (xPackageType.is()) mediaType = xPackageType->getMediaType(); @@ -1588,7 +1588,7 @@ BackendImpl::PackageImpl::getPackagesFromDb( { Reference<deployment::XPackage> 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 } diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 7a1b917ab363..4fd14f88366c 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -693,7 +693,7 @@ typedef std::map< OUString, componentParts > Components; bool getComponent(OUString const & path, OUString * component) { - OSL_ASSERT(component != nullptr); + assert(component != nullptr); if (path.isEmpty() || path[0] != '/') { SAL_INFO( "desktop.migration", "configuration migration in/exclude path " << path << " ignored (does not start with slash)" ); return false; diff --git a/desktop/source/migration/services/jvmfwk.cxx b/desktop/source/migration/services/jvmfwk.cxx index fc858ec3a039..8342745ec3ea 100644 --- a/desktop/source/migration/services/jvmfwk.cxx +++ b/desktop/source/migration/services/jvmfwk.cxx @@ -142,7 +142,7 @@ private: JavaMigration::~JavaMigration() { - OSL_ASSERT(m_aStack.empty()); + assert(m_aStack.empty()); } OUString jvmfwk_getImplementationName() @@ -346,7 +346,7 @@ void SAL_CALL JavaMigration::setPropertyValue( break; } default: - OSL_ASSERT(false); + assert(false); } } } diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index 7645e13926a4..f3cb45862abf 100644 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -399,7 +399,7 @@ uno::Reference< ucb::XProgressHandler > TmpRepositoryCommandEnv::getProgressHand void TmpRepositoryCommandEnv::handle( uno::Reference< task::XInteractionRequest> const & xRequest ) { - OSL_ASSERT( xRequest->getRequest().getValueTypeClass() == uno::TypeClass_EXCEPTION ); + assert( xRequest->getRequest().getValueTypeClass() == uno::TypeClass_EXCEPTION ); bool approve = true; diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 31a93cecea8a..fa1f270b31e7 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -334,7 +334,7 @@ extern "C" int unopkg_main() else if (repository == "bundled") extensionUnorc = "$BUNDLED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc"; else - OSL_ASSERT(false); + assert(false); ::rtl::Bootstrap::expandMacros(extensionUnorc); oslFileError e = osl_removeFile(extensionUnorc.pData); diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx index 80ed1bcec910..238cbb444e36 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx @@ -204,7 +204,7 @@ void CommandEnvironmentImpl::handle( Reference<task::XInteractionRequest> const & xRequest ) { Any request( xRequest->getRequest() ); - OSL_ASSERT( request.getValueTypeClass() == TypeClass_EXCEPTION ); + assert( request.getValueTypeClass() == TypeClass_EXCEPTION ); dp_misc::TRACE("[unopkg_cmdenv.cxx] incoming request:\n" + ::comphelper::anyToString(request) + "\n\n"); @@ -224,11 +224,11 @@ void CommandEnvironmentImpl::handle( // former pkgchk behaviour: const Reference<deployment::XPackage> xPackage( wtExc.Context, UNO_QUERY ); - OSL_ASSERT( xPackage.is() ); + assert( xPackage.is() ); if (xPackage.is()) { const Reference<deployment::XPackageTypeInfo> xPackageType( xPackage->getPackageType() ); - OSL_ASSERT( xPackageType.is() ); + assert( xPackageType.is() ); if (xPackageType.is()) { approve = (xPackage->isBundle() && xPackageType->getMediaType().match( @@ -319,7 +319,7 @@ void CommandEnvironmentImpl::handle( void CommandEnvironmentImpl::push( Any const & Status ) { update_( Status ); - OSL_ASSERT( m_logLevel >= 0 ); + assert( m_logLevel >= 0 ); ++m_logLevel; if (m_xLogFile.is()) m_xLogFile->push( Status ); @@ -351,7 +351,7 @@ void CommandEnvironmentImpl::update_( Any const & Status ) msg = buf.makeStringAndClear(); bUseErr = true; } - OSL_ASSERT( m_logLevel >= 0 ); + assert( m_logLevel >= 0 ); for ( sal_Int32 n = 0; n < m_logLevel; ++n ) { if (bUseErr) @@ -377,7 +377,7 @@ void CommandEnvironmentImpl::update( Any const & Status ) void CommandEnvironmentImpl::pop() { - OSL_ASSERT( m_logLevel > 0 ); + assert( m_logLevel > 0 ); --m_logLevel; if (m_xLogFile.is()) m_xLogFile->pop(); diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index c74d9e0d98aa..1615b22006b9 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -124,7 +124,7 @@ bool isOption( OptionInfo const * option_info, sal_uInt32 * pIndex ) bool isBootstrapVariable(sal_uInt32 * pIndex) { - OSL_ASSERT(osl_getCommandArgCount() >= *pIndex); + assert(osl_getCommandArgCount() >= *pIndex); OUString arg; osl_getCommandArg(*pIndex, &arg.pData); @@ -144,7 +144,7 @@ bool readArgument( { if (*pIndex < osl_getCommandArgCount()) { - OSL_ASSERT( pValue != nullptr ); + assert( pValue != nullptr ); osl_getCommandArg( *pIndex, &pValue->pData ); dp_misc::TRACE(__FILE__ ": argument value: " + *pValue + "\n"); @@ -273,7 +273,7 @@ void printf_package( const Reference<deployment::XPackageTypeInfo> xPackageType( xPackage->getPackageType() ); - OSL_ASSERT( xPackageType.is() ); + assert( xPackageType.is() ); if (xPackageType.is()) { printf_line( "Media-Type", xPackageType->getMediaType(), level + 1 ); } @@ -310,7 +310,7 @@ void printf_packages( std::vector<bool> const & vecUnaccepted, Reference<XCommandEnvironment> const & xCmdEnv, sal_Int32 level ) { - OSL_ASSERT(allExtensions.size() == vecUnaccepted.size()); + assert(allExtensions.size() == vecUnaccepted.size()); if (allExtensions.empty()) { @@ -383,7 +383,7 @@ Reference<XComponentContext> connectToOffice( if (verbose) dp_misc::writeConsole("OK. Connecting..."); - OSL_ASSERT( buf.isEmpty() ); + assert( buf.isEmpty() ); buf.append( "uno:pipe,name=" ); buf.append( pipeId ); buf.append( ";urp;StarOffice.ComponentContext" ); |