diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2017-05-07 17:03:35 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2017-05-07 17:03:35 +1000 |
commit | 97eb00c75e173d4c8d0b483a7941ad3d2f23783e (patch) | |
tree | 7974a8b9423c56982646366b0859dfb2a1a88d50 /desktop/source/deployment | |
parent | d0a99cc2ed76be220f7e868e332ba19f6e48a440 (diff) |
revert OSL_ASSERT changes
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
Diffstat (limited to 'desktop/source/deployment')
30 files changed, 137 insertions, 137 deletions
diff --git a/desktop/source/deployment/dp_log.cxx b/desktop/source/deployment/dp_log.cxx index 7d05c4bb15f9..ee814f312b7b 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 ); - assert( m_log_level >= 0 ); + OSL_ASSERT( m_log_level >= 0 ); ++m_log_level; } @@ -160,7 +160,7 @@ void ProgressLogImpl::update( Any const & Status ) return; OUStringBuffer buf; - assert( m_log_level >= 0 ); + OSL_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() { - assert( m_log_level > 0 ); + OSL_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 93673c977246..78f5b42d0824 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; - assert( i >= 0); + OSL_ASSERT( i >= 0); c = *(pChar++); if( ('0' <= c) && (c <= '9')) c -= '0'; else { - assert( ('A' <= c) && (c <= 'F')); + OSL_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); - assert( nBytesRead == sizeof(aHeaderBytes)); + OSL_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); - assert( nKeyLen == (sal_Int32)nBytesWritten); + OSL_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); - assert( nValLen == (sal_Int32)nBytesWritten); + OSL_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 17da1e5b1238..676e94283661 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" ) ); - assert( resmgr.get() != nullptr ); + OSL_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); - assert(extension.is()); + OSL_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() ); - assert( files.getLength() > 0 ); + OSL_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 e6d9b79a1725..a7970b81297e 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() ); - assert( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + OSL_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 ); - assert( xPackage.is() ); + OSL_ASSERT( xPackage.is() ); if ( xPackage.is() ) { const uno::Reference< deployment::XPackageTypeInfo > xPackageType( xPackage->getPackageType() ); - assert( xPackageType.is() ); + OSL_ASSERT( xPackageType.is() ); if (xPackageType.is()) { approve = ( xPackage->isBundle() && @@ -400,7 +400,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & approve = true; else { - assert(false); + OSL_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; } - assert( verExc.Deployed.is() ); + OSL_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 ) { - assert( pDialogHelper ); + OSL_ASSERT( pDialogHelper ); } diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 1d0520032cee..4cd3d38587f6 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 ) { - assert( m_nActive >= -1); + OSL_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 151ec49c5e5c..62cb6e8fb10e 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) { - assert( ! bAppUp ); + OSL_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 cbf6268e4811..3170f8192d14 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]); - assert(xPackage.is()); + OSL_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 - assert( aId.IsPresent ); + OSL_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 4090ea05638e..9769a8b3b452 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& ) { - assert(false); + OSL_ASSERT(false); continue; } catch ( const css::ucb::CommandFailedException& ) { - assert(false); + OSL_ASSERT(false); continue; } - assert(extensions.getLength() == 3); + OSL_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 { - assert(data.aInstalledPackage.is()); + OSL_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); - assert(!infoset.getVersion().isEmpty()); + OSL_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"); - assert(updateData != nullptr); + OSL_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(); - assert(i <= std::numeric_limits< sal_uInt16 >::max()); + OSL_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; } - assert(false); + OSL_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) { - assert(aExtension.is()); + OSL_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: - assert(false); + OSL_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) { - assert(i->aInstalledPackage.is()); + OSL_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 8f66a8ce49a0..8f18c13c8060 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: - assert(false); + OSL_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. - assert(curData.sWebsiteURL.isEmpty()); + OSL_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()) { - assert(curData.aUpdateSource.is()); + OSL_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 } } - assert(m_sDownloadFolder.getLength()); + OSL_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() ); - assert( request.getValueTypeClass() == cssu::TypeClass_EXCEPTION ); + OSL_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 e1263bec3b5f..410c0aab528a 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(';'); - assert(i >= 0); + OSL_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); - assert(i1 >= 0); + OSL_ASSERT(i1 >= 0); d.temporaryName = OUString( value.getStr(), i1, RTL_TEXTENCODING_UTF8); sal_Int32 i2 = value.indexOf(separator, i1 + 1); - assert(i2 >= 0); + OSL_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 67a6fdd55d8e..cd93931e6de0 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() ); - assert( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + OSL_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() ); - assert( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + OSL_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() ); - assert( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + OSL_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() ); - assert( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + OSL_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 6282a838b687..e5d31af7c1a3 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) { - assert(a.size() == 3); + OSL_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; } } - assert(extension.is()); + OSL_ASSERT(extension.is()); return extension->getDisplayName(); } @@ -146,14 +146,14 @@ public: ExtensionRemoveGuard::~ExtensionRemoveGuard() { try { - assert(!(m_extension.is() && !m_xPackageManager.is())); + OSL_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 (...) { - assert(false); + OSL_ASSERT(false); } } @@ -167,7 +167,7 @@ ExtensionManager::ExtensionManager( Reference< uno::XComponentContext > const& x , m_xContext(xContext) { m_xPackageManagerFactory = css::deployment::thePackageManagerFactory::get(m_xContext); - assert(m_xPackageManagerFactory.is()); + OSL_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); } - assert(extensionList.size() == 3); + OSL_ASSERT(extensionList.size() == 3); return extensionList; } @@ -359,7 +359,7 @@ bool ExtensionManager::isUserDisabled( listExtensions = getExtensionsWithSameId(identifier, fileName); } catch ( const lang::IllegalArgumentException & ) { } - assert(listExtensions.size() == 3); + OSL_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) { - assert(seqExtSameId.getLength() == 3); + OSL_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 &) { } - assert(listExtensions.size() == 3); + OSL_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 ]); - assert(!id.isEmpty()); + OSL_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(); - assert(!id.isEmpty()); + OSL_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 )) { - assert( !approve && !abort ); + OSL_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 )) { - assert( !replace && !abort ); + OSL_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 9f99a483cc3a..a19a5c728516 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()) { - assert(false); + OSL_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 &) { - assert(false); + OSL_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; } - assert(extensions.getLength() == 3); + OSL_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(); - assert(cExt == 3); + OSL_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 9f57fe73a9f2..df1431c449a2 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()) { - assert( m_registryCache.isEmpty() ); + OSL_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: - assert( !m_activePackages.isEmpty() ); + OSL_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() { - assert( m_xRegistry.is() ); + OSL_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() ); - assert( xPackageType.is() ); + OSL_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. - assert(!(m_context == "bundled")); + OSL_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 ); - assert( xPackage.is() ); + OSL_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); - assert(!val.temporaryName.isEmpty()); + OSL_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. - assert(!(m_context == "user")); + OSL_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 ); - assert(xPackage.is()); //Even if the files are removed, we must get the object. + OSL_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; - assert(!(m_context == "user")); + OSL_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) { - assert(title2.endsWith("_")); + OSL_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. - assert(!(m_context == "user")); + OSL_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 9ec153b93d3f..b2e9fc418d8e 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) { - assert( insertion.first->second.get() == xRet ); + OSL_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 48ab6f6a78d7..10d10f292765 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) { - assert(dependency.is()); + OSL_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 470e7726393c..b1762ab7fd87 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) { - assert(node.is()); + OSL_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 } - assert(xPathName.is()); + OSL_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 } - assert(xURL.is()); + OSL_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 { - assert(xParent.is()); + OSL_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 { - assert(xParent.is()); + OSL_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 } - assert(xURL.is()); + OSL_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 9977d91b2a4c..a0b922c008b1 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) { - assert(package.is()); + OSL_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 9887d258b327..0eda61153da6 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 ) - { assert( + { OSL_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 ) { - assert( + OSL_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 1d2ddabbb4ed..2083075a608e 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 ) ); - assert( ret->getHandle() != nullptr ); + OSL_ASSERT( ret->getHandle() != nullptr ); return ret; } }; @@ -198,13 +198,13 @@ bool compareExtensionFolderWithLastSynchronizedFile( } else { - assert(false); + OSL_ASSERT(false); bNeedsSync = true; } } else { - assert(false); + OSL_ASSERT(false); bNeedsSync = true; } @@ -227,7 +227,7 @@ bool needToSyncRepository(OUString const & name) } else { - assert(false); + OSL_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 ) { - assert(segment.indexOf(u'/') == -1); + OSL_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 ) { - assert( url.match( "vnd.sun.star.expand:" )); + OSL_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 ) ) { - assert((dwRead % 2) == 0); + OSL_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 2a9459453204..f20da27e0d5a 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) { - assert(i->second.extension.is()); + OSL_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; - assert(*id2 == id); + OSL_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()); - assert(!sDefaultURL.isEmpty()); + OSL_ASSERT(!sDefaultURL.isEmpty()); Any anyError; Sequence< Reference< xml::dom::XElement > > @@ -175,7 +175,7 @@ void getDefaultUpdateInfos( bool containsBundledOnly(Sequence<Reference<deployment::XPackage> > const & sameIdExtensions) { - assert(sameIdExtensions.getLength() == 3); + OSL_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) { - assert(xExtMgr.is()); + OSL_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) { - assert(xExtMgr.is()); + OSL_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); - assert(extension.is()); + OSL_ASSERT(extension.is()); std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert( UpdateInfoMap::value_type( dp_misc::getIdentifier(extension), UpdateInfo(extension))); - assert(insertRet.second); + OSL_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) { - assert(i->is()); + OSL_ASSERT(i->is()); std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert( UpdateInfoMap::value_type( dp_misc::getIdentifier(*i), UpdateInfo(*i))); - assert(insertRet.second); + OSL_ASSERT(insertRet.second); (void)insertRet; } } @@ -402,7 +402,7 @@ OUString getHighestVersion( case 1: return sharedVersion; case 2: return bundledVersion; case 3: return onlineVersion; - default: assert(false); + default: OSL_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 b8fe7478e10a..2b04a5c5c94e 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 ) { - assert( xContext.is() ); + OSL_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 ) { - assert( false ); + OSL_ASSERT( false ); } throw; } @@ -1113,7 +1113,7 @@ void extractComponentData( componentLoader, OUString const & componentUrl) { - assert( + OSL_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()); - assert(xContext.is()); + OSL_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 110d3ed87563..a7906c3694e1 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); - assert(data); + OSL_ASSERT(data); that->addToConfigmgrIni( m_isSchema, false, data->iniEntry, xCmdEnv ); } else @@ -779,7 +779,7 @@ void BackendImpl::PackageImpl::processPackage_( } catch(const Exception&) { - assert(false); + OSL_ASSERT(false); } } #endif diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx index 118029d058a5..f44b1d7ac2f1 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); - assert(! nextNode.is()); + OSL_ASSERT(! nextNode.is()); #endif } catch(const css::uno::Exception &) @@ -277,7 +277,7 @@ void BackendDb::writeVectorOfPair( if (vecPairs.empty()) return; const OUString sNameSpace = getDbNSName(); - assert(!sNameSpace.isEmpty()); + OSL_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 { - assert(parent.is()); + OSL_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); - assert(first.is() && second.is()); + OSL_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()) { - assert(false); + OSL_ASSERT(false); //replace the existing entry. removeEntry(url); } @@ -539,7 +539,7 @@ std::list< OUString> BackendDb::readList( { try { - assert(parent.is()); + OSL_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); - assert(! _extensionNode.is()); + OSL_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 27fa7acb75f6..d0b4211691ee 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 ) ); - assert( + OSL_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 ); - assert(xServiceInfo.is()); + OSL_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() ); - assert( allBackends == that->m_allBackends ); + OSL_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 777469fd8415..a5bac639d480 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()) { - assert(false); + OSL_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 - assert(false); + OSL_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 - assert(false); + OSL_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 a3bcef271497..4eba37cf3243 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 - assert(false); + OSL_ASSERT(false); bCompiled = false; break; } @@ -300,7 +300,7 @@ bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() && errorNext != ::osl::File::E_None) { //Error - assert(false); + OSL_ASSERT(false); bCompiled = false; } } @@ -358,7 +358,7 @@ void BackendImpl::implProcessHelp( Reference<ucb::XCommandEnvironment> const & xCmdEnv) { Reference< deployment::XPackage > xPackage(package); - assert(xPackage.is()); + OSL_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 906c8bc60767..cda1f56de4c4 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 )) { - assert( !approve && !abort ); + OSL_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 )) { - assert( !approve && !abort ); + OSL_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() ) ); - assert( url_.getLength() >= baseURLlen ); + OSL_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; - assert( xPackageType.is() ); + OSL_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() ); - assert( xPackageType.is() ); + OSL_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; } - assert( lower_end == upper_end ); + OSL_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 ) ); - assert( xPackage.is() ); + OSL_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() ); - assert( xPackageType.is() ); + OSL_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 ) { - assert( !m_legacyBundle ); + OSL_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() ); - assert( xPackageType.is() ); + OSL_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); - assert(xExtension.is()); + OSL_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 7424294acab3..3c59f781a049 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; - assert( ! transientMode() ); + OSL_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 0b6bc0404651..274ee2f827c2 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 { - assert( false ); + OSL_ASSERT( false ); // NOT supported at the moment // TODO } |