diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-02-21 07:26:06 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-02-21 14:50:28 +0100 |
commit | 9ad252b2e79576119c2d733a1a45fdd9e9f83140 (patch) | |
tree | 87fee16145d457b6799a05c389d85270476f7f35 /desktop/source | |
parent | 3aca35f1505fa552eaa316a2d47a60ef52646525 (diff) |
Drop o3tl::optional wrapper
...now that macOS builds are guaranteed to have std::optional since
358146bbbd1b9775c12770fb5e497b6ec5adfc51 "Bump macOS build baseline to
Xcode 11.3 and macOS 10.14.4".
The change is done mostly mechanically with
> for i in $(git grep -Fl optional); do
> sed -i -e 's:<o3tl/optional\.hxx>\|\"o3tl/optional\.hxx\":<optional>:' \
> -e 's/\<o3tl::optional\>/std::optional/g' \
> -e 's/\<o3tl::make_optional\>/std::make_optional/g' "$i"
> done
> for i in $(git grep -Flw o3tl::nullopt); do
> sed -i -e 's/\<o3tl::nullopt\>/std::nullopt/g' "$i"
> done
(though that causes some of the resulting
#include <optional>
to appear at different places relative to other includes than if they had been
added manually), plus a few manual modifications:
* adapt bin/find-unneeded-includes
* adapt desktop/IwyuFilter_desktop.yaml
* remove include/o3tl/optional.hxx
* quote resulting "<"/">" as "<"/">" in officecfg/registry/cppheader.xsl
* and then solenv/clang-format/reformat-formatted-files
Change-Id: I68833d9f7945e57aa2bc703349cbc5a56b342273
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89165
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'desktop/source')
25 files changed, 84 insertions, 84 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 16f62e9f64a5..6d0fe6e0cb48 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2201,7 +2201,7 @@ void Desktop::OpenDefault() OUString GetURL_Impl( - const OUString& rName, o3tl::optional< OUString > const & cwdUrl ) + const OUString& rName, std::optional< OUString > const & cwdUrl ) { // if rName is a vnd.sun.star.script URL do not attempt to parse it // as INetURLObj does not handle URLs there diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 8169f541840f..e58ee2f6e2e4 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -82,7 +82,7 @@ public: } } - virtual o3tl::optional< OUString > getCwdUrl() override { return m_cwdUrl; } + virtual std::optional< OUString > getCwdUrl() override { return m_cwdUrl; } virtual bool next(OUString * argument) override { OSL_ASSERT(argument != nullptr); @@ -95,7 +95,7 @@ public: } private: - o3tl::optional< OUString > m_cwdUrl; + std::optional< OUString > m_cwdUrl; sal_uInt32 m_count; sal_uInt32 m_index; }; diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx index 6c18bda3572d..577b50e1af3a 100644 --- a/desktop/source/app/cmdlineargs.hxx +++ b/desktop/source/app/cmdlineargs.hxx @@ -25,7 +25,7 @@ #include <vector> #include <rtl/ustring.hxx> -#include <o3tl/optional.hxx> +#include <optional> namespace desktop { @@ -46,7 +46,7 @@ class CommandLineArgs }; virtual ~Supplier(); - virtual o3tl::optional< OUString > getCwdUrl() = 0; + virtual std::optional< OUString > getCwdUrl() = 0; virtual bool next(OUString * argument) = 0; }; @@ -56,7 +56,7 @@ class CommandLineArgs CommandLineArgs(const CommandLineArgs&) = delete; const CommandLineArgs& operator=(const CommandLineArgs&) = delete; - const o3tl::optional< OUString >& getCwdUrl() const { return m_cwdUrl; } + const std::optional< OUString >& getCwdUrl() const { return m_cwdUrl; } // Access to bool parameters bool IsMinimized() const { return m_minimized;} @@ -127,7 +127,7 @@ class CommandLineArgs void ParseCommandLine_Impl( Supplier& supplier ); void InitParamValues(); - o3tl::optional< OUString > m_cwdUrl; + std::optional< OUString > m_cwdUrl; bool m_minimized; bool m_invisible; diff --git a/desktop/source/app/dispatchwatcher.hxx b/desktop/source/app/dispatchwatcher.hxx index a2bb5d6b1ff0..ca66d33bf8ed 100644 --- a/desktop/source/app/dispatchwatcher.hxx +++ b/desktop/source/app/dispatchwatcher.hxx @@ -22,7 +22,7 @@ #include <cppuhelper/implbase.hxx> #include <com/sun/star/frame/XDispatchResultListener.hpp> -#include <o3tl/optional.hxx> +#include <optional> #include <vector> @@ -59,7 +59,7 @@ class DispatchWatcher : public ::cppu::WeakImplHelper< css::frame::XDispatchResu { RequestType aRequestType; OUString aURL; - o3tl::optional< OUString > aCwdUrl; + std::optional< OUString > aCwdUrl; OUString aPrinterName; // also conversion params OUString aPreselectedFactory; }; diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 0c3296ebad4f..b1674138c5cd 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -138,7 +138,7 @@ public: } } - virtual o3tl::optional< OUString > getCwdUrl() override { return m_cwdUrl; } + virtual std::optional< OUString > getCwdUrl() override { return m_cwdUrl; } virtual bool next(OUString * argument) override { return next(argument, true); } @@ -192,7 +192,7 @@ private: } } - o3tl::optional< OUString > m_cwdUrl; + std::optional< OUString > m_cwdUrl; OString m_input; sal_Int32 m_index; }; @@ -668,7 +668,7 @@ void RequestHandler::EnableRequests() pGlobal->mState = State::RequestsEnabled; } // hit the compiler over the head - ProcessDocumentsRequest aEmptyReq { o3tl::optional< OUString >() }; + ProcessDocumentsRequest aEmptyReq { std::optional< OUString >() }; // trigger already queued requests RequestHandler::ExecuteCmdLineRequests(aEmptyReq, true); } @@ -1221,7 +1221,7 @@ void PipeIpcThread::execute() static void AddToDispatchList( std::vector<DispatchWatcher::DispatchRequest>& rDispatchList, - o3tl::optional< OUString > const & cwdUrl, + std::optional< OUString > const & cwdUrl, std::vector< OUString > const & aRequestList, DispatchWatcher::RequestType nType, const OUString& aParam, @@ -1235,7 +1235,7 @@ static void AddToDispatchList( static void AddConversionsToDispatchList( std::vector<DispatchWatcher::DispatchRequest>& rDispatchList, - o3tl::optional< OUString > const & cwdUrl, + std::optional< OUString > const & cwdUrl, std::vector< OUString > const & rRequestList, const OUString& rParam, const OUString& rPrinterName, diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx index d0faf6a84e06..e4f3edaf9673 100644 --- a/desktop/source/app/officeipcthread.hxx +++ b/desktop/source/app/officeipcthread.hxx @@ -32,7 +32,7 @@ #include <salhelper/simplereferenceobject.hxx> #include <cppuhelper/implbase.hxx> #include <osl/conditn.hxx> -#include <o3tl/optional.hxx> +#include <optional> namespace desktop { @@ -43,10 +43,10 @@ oslSignalAction SalMainPipeExchangeSignal_impl(void* /*pData*/, oslSignalInfo* p // that was given by command line or by IPC pipe communication. struct ProcessDocumentsRequest { - explicit ProcessDocumentsRequest(o3tl::optional< OUString > const & cwdUrl): + explicit ProcessDocumentsRequest(std::optional< OUString > const & cwdUrl): aCwdUrl(cwdUrl), pcProcessed( nullptr ), bTextCat( false ), bScriptCat( false ) {} - o3tl::optional< OUString > aCwdUrl; + std::optional< OUString > aCwdUrl; OUString aModule; std::vector< OUString > aOpenList; // Documents that should be opened in the default way std::vector< OUString > aViewList; // Documents that should be opened in viewmode diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx index a3bd0c0ed844..8acfdc5a32f1 100644 --- a/desktop/source/deployment/gui/dp_gui_service.cxx +++ b/desktop/source/deployment/gui/dp_gui_service.cxx @@ -32,7 +32,7 @@ #include <com/sun/star/task/XJobExecutor.hpp> #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp> -#include <o3tl/optional.hxx> +#include <optional> #include "license_dialog.hxx" #include "dp_gui_dialog2.hxx" #include "dp_gui_extensioncmdqueue.hxx" @@ -111,8 +111,8 @@ class ServiceImpl task::XJobExecutor> { Reference<XComponentContext> const m_xComponentContext; - o3tl::optional< Reference<awt::XWindow> > /* const */ m_parent; - o3tl::optional<OUString> m_extensionURL; + std::optional< Reference<awt::XWindow> > /* const */ m_parent; + std::optional<OUString> m_extensionURL; OUString m_initialTitle; bool m_bShowUpdateOnly; @@ -137,8 +137,8 @@ ServiceImpl::ServiceImpl( Sequence<Any> const& args, m_bShowUpdateOnly( false ) { /* if true then this service is running in a unopkg process and not in an office process */ - o3tl::optional<sal_Bool> unopkg; - o3tl::optional<OUString> view; + std::optional<sal_Bool> unopkg; + std::optional<OUString> view; try { comphelper::unwrapArgs( args, m_parent, view, unopkg ); return; diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 3214ac098fb0..4c5269499f19 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -24,7 +24,7 @@ #include <vector> -#include <o3tl/optional.hxx> +#include <optional> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -380,7 +380,7 @@ void UpdateDialog::Thread::prepareUpdateData( out_du.unsatisfiedDependencies[i] = dp_misc::Dependencies::getErrorText(ds[i]); } - const ::o3tl::optional< OUString> updateWebsiteURL(infoset.getLocalizedUpdateWebsiteURL()); + const ::std::optional< OUString> updateWebsiteURL(infoset.getLocalizedUpdateWebsiteURL()); out_du.name = getUpdateDisplayString(out_data, infoset.getVersion()); @@ -809,7 +809,7 @@ bool UpdateDialog::isIgnoredUpdate( UpdateDialog::Index * index ) { DisabledUpdate &rData = m_disabledUpdates[ index->m_nIndex ]; dp_misc::DescriptionInfoset aInfoset( m_context, rData.aUpdateInfo ); - ::o3tl::optional< OUString > aID( aInfoset.getIdentifier() ); + ::std::optional< OUString > aID( aInfoset.getIdentifier() ); if ( aID ) aExtensionID = *aID; aVersion = aInfoset.getVersion(); diff --git a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx index 03a5ededfeca..03990c9405b2 100644 --- a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx +++ b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx @@ -22,7 +22,7 @@ #include <sal/config.h> -#include <o3tl/optional.hxx> +#include <optional> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <sal/types.h> @@ -83,7 +83,7 @@ public: @return the identifier, or an empty <code>optional</code> if none is specified */ - ::o3tl::optional< OUString > getIdentifier() const; + ::std::optional< OUString > getIdentifier() const; /** Return the textual version representation. @@ -135,7 +135,7 @@ public: As long as there is a simple-license element, the function will return the structure. If it does not exist, then the optional object is uninitialized. */ - ::o3tl::optional<SimpleLicenseAttributes> getSimpleLicenseAttributes() const; + ::std::optional<SimpleLicenseAttributes> getSimpleLicenseAttributes() const; /** returns the localized display name of the extensions. @@ -162,7 +162,7 @@ public: the download website URL, or an empty <code>optional</code> if none is specified */ - ::o3tl::optional< OUString > getLocalizedUpdateWebsiteURL() const; + ::std::optional< OUString > getLocalizedUpdateWebsiteURL() const; /** returns the relative URL to the description. @@ -206,7 +206,7 @@ public: bool hasDescription() const; private: - SAL_DLLPRIVATE ::o3tl::optional< OUString > getOptionalValue( + SAL_DLLPRIVATE ::std::optional< OUString > getOptionalValue( OUString const & expression) const; SAL_DLLPRIVATE css::uno::Sequence< OUString > getUrls( diff --git a/desktop/source/deployment/inc/dp_identifier.hxx b/desktop/source/deployment/inc/dp_identifier.hxx index a7ce629f42ff..a3eb0681bb1e 100644 --- a/desktop/source/deployment/inc/dp_identifier.hxx +++ b/desktop/source/deployment/inc/dp_identifier.hxx @@ -22,7 +22,7 @@ #include <sal/config.h> -#include <o3tl/optional.hxx> +#include <optional> #include <com/sun/star/uno/Reference.hxx> #include "dp_misc_api.hxx" @@ -47,7 +47,7 @@ namespace dp_misc { on the given file name */ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString generateIdentifier( - ::o3tl::optional< OUString > const & optional, + ::std::optional< OUString > const & optional, OUString const & fileName); /** diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index a82060d2c39d..708c40215fa5 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -553,7 +553,7 @@ bool ExtensionManager::doChecksForAddExtension( ExtensionProperties props(OUString(), properties, Reference<ucb::XCommandEnvironment>(), m_xContext); dp_misc::DescriptionInfoset info(dp_misc::getDescriptionInfoset(xTmpExtension->getURL())); - const ::o3tl::optional<dp_misc::SimpleLicenseAttributes> licenseAttributes = + const ::std::optional<dp_misc::SimpleLicenseAttributes> licenseAttributes = info.getSimpleLicenseAttributes(); if (licenseAttributes && licenseAttributes->suppressIfRequired diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 3e36d77eb29d..33d8e6468159 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -1380,7 +1380,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions( // shall the license be suppressed? DescriptionInfoset info = dp_misc::getDescriptionInfoset(url); - ::o3tl::optional<dp_misc::SimpleLicenseAttributes> + ::std::optional<dp_misc::SimpleLicenseAttributes> attr = info.getSimpleLicenseAttributes(); ExtensionProperties props(url, xCmdEnv, m_xComponentContext); bool bNoLicense = false; diff --git a/desktop/source/deployment/manager/dp_properties.hxx b/desktop/source/deployment/manager/dp_properties.hxx index aface6bb7f89..2d72d8cd874f 100644 --- a/desktop/source/deployment/manager/dp_properties.hxx +++ b/desktop/source/deployment/manager/dp_properties.hxx @@ -24,7 +24,7 @@ #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <o3tl/optional.hxx> +#include <optional> namespace dp_manager { @@ -35,8 +35,8 @@ class ExtensionProperties final OUString m_propFileUrl; const css::uno::Reference<css::ucb::XCommandEnvironment> m_xCmdEnv; const css::uno::Reference<css::uno::XComponentContext> m_xContext; - ::o3tl::optional< OUString> m_prop_suppress_license; - ::o3tl::optional< OUString> m_prop_extension_update; + ::std::optional< OUString> m_prop_suppress_license; + ::std::optional< OUString> m_prop_extension_update; static OUString getPropertyValue(css::beans::NamedValue const & v); public: diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx index 735e7373dd01..86e8c4508d9a 100644 --- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx +++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx @@ -25,7 +25,7 @@ #include <comphelper/sequence.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/deployment/DeploymentException.hpp> @@ -325,7 +325,7 @@ DescriptionInfoset::DescriptionInfoset( DescriptionInfoset::~DescriptionInfoset() {} -::o3tl::optional< OUString > DescriptionInfoset::getIdentifier() const { +::std::optional< OUString > DescriptionInfoset::getIdentifier() const { return getOptionalValue("desc:identifier/@value"); } @@ -345,7 +345,7 @@ OUString DescriptionInfoset::getNodeValueFromExpression(OUString const & express void DescriptionInfoset::checkBlacklist() const { if (m_element.is()) { - o3tl::optional< OUString > id(getIdentifier()); + std::optional< OUString > id(getIdentifier()); if (!id) return; // nothing to check OUString currentversion(getVersion()); @@ -519,20 +519,20 @@ OUString DescriptionInfoset::getIconURL( bool bHighContrast ) const return OUString(); } -::o3tl::optional< OUString > DescriptionInfoset::getLocalizedUpdateWebsiteURL() +::std::optional< OUString > DescriptionInfoset::getLocalizedUpdateWebsiteURL() const { bool bParentExists = false; const OUString sURL (getLocalizedHREFAttrFromChild("/desc:description/desc:update-website", &bParentExists )); if (!sURL.isEmpty()) - return ::o3tl::optional< OUString >(sURL); + return ::std::optional< OUString >(sURL); else - return bParentExists ? ::o3tl::optional< OUString >(OUString()) : - ::o3tl::optional< OUString >(); + return bParentExists ? ::std::optional< OUString >(OUString()) : + ::std::optional< OUString >(); } -::o3tl::optional< OUString > DescriptionInfoset::getOptionalValue( +::std::optional< OUString > DescriptionInfoset::getOptionalValue( OUString const & expression) const { css::uno::Reference< css::xml::dom::XNode > n; @@ -544,8 +544,8 @@ OUString DescriptionInfoset::getIconURL( bool bHighContrast ) const } } return n.is() - ? ::o3tl::optional< OUString >(getNodeValue(n)) - : ::o3tl::optional< OUString >(); + ? ::std::optional< OUString >(getNodeValue(n)) + : ::std::optional< OUString >(); } css::uno::Sequence< OUString > DescriptionInfoset::getUrls( @@ -630,7 +630,7 @@ OUString DescriptionInfoset::getLocalizedLicenseURL() const } -::o3tl::optional<SimpleLicenseAttributes> +::std::optional<SimpleLicenseAttributes> DescriptionInfoset::getSimpleLicenseAttributes() const { //Check if the node exist @@ -647,22 +647,22 @@ DescriptionInfoset::getSimpleLicenseAttributes() const attributes.acceptBy = getNodeValueFromExpression("/desc:description/desc:registration/desc:simple-license/@accept-by"); - ::o3tl::optional< OUString > suppressOnUpdate = getOptionalValue("/desc:description/desc:registration/desc:simple-license/@suppress-on-update"); + ::std::optional< OUString > suppressOnUpdate = getOptionalValue("/desc:description/desc:registration/desc:simple-license/@suppress-on-update"); if (suppressOnUpdate) attributes.suppressOnUpdate = (*suppressOnUpdate).trim().equalsIgnoreAsciiCase("true"); else attributes.suppressOnUpdate = false; - ::o3tl::optional< OUString > suppressIfRequired = getOptionalValue("/desc:description/desc:registration/desc:simple-license/@suppress-if-required"); + ::std::optional< OUString > suppressIfRequired = getOptionalValue("/desc:description/desc:registration/desc:simple-license/@suppress-if-required"); if (suppressIfRequired) attributes.suppressIfRequired = (*suppressIfRequired).trim().equalsIgnoreAsciiCase("true"); else attributes.suppressIfRequired = false; - return ::o3tl::optional<SimpleLicenseAttributes>(attributes); + return ::std::optional<SimpleLicenseAttributes>(attributes); } } - return ::o3tl::optional<SimpleLicenseAttributes>(); + return ::std::optional<SimpleLicenseAttributes>(); } OUString DescriptionInfoset::getLocalizedDescriptionURL() const diff --git a/desktop/source/deployment/misc/dp_identifier.cxx b/desktop/source/deployment/misc/dp_identifier.cxx index 30a02890918b..350f9a1f0541 100644 --- a/desktop/source/deployment/misc/dp_identifier.cxx +++ b/desktop/source/deployment/misc/dp_identifier.cxx @@ -20,7 +20,7 @@ #include <sal/config.h> -#include <o3tl/optional.hxx> +#include <optional> #include <com/sun/star/beans/Optional.hpp> #include <com/sun/star/deployment/XPackage.hpp> #include <com/sun/star/uno/Reference.hxx> @@ -32,7 +32,7 @@ namespace dp_misc { OUString generateIdentifier( - ::o3tl::optional< OUString > const & optional, + ::std::optional< OUString > const & optional, OUString const & fileName) { return optional ? *optional : generateLegacyIdentifier(fileName); diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx index 1387ad015ae6..0d6f4acdee45 100644 --- a/desktop/source/deployment/misc/dp_update.cxx +++ b/desktop/source/deployment/misc/dp_update.cxx @@ -112,7 +112,7 @@ void getOwnUpdateInfos( Reference< xml::dom::XNode >(infos[j], UNO_QUERY_THROW)); if (!infoset.hasDescription()) continue; - o3tl::optional< OUString > result_id(infoset.getIdentifier()); + std::optional< OUString > result_id(infoset.getIdentifier()); if (!result_id) continue; SAL_INFO( "extensions.update", " found version " @@ -153,7 +153,7 @@ void getDefaultUpdateInfos( { Reference< xml::dom::XNode > node(infos[i], UNO_QUERY_THROW); dp_misc::DescriptionInfoset infoset(xContext, node); - o3tl::optional< OUString > id(infoset.getIdentifier()); + std::optional< OUString > id(infoset.getIdentifier()); if (!id) { continue; } diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 68f11e41ea3b..ca11affbca7c 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -130,7 +130,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend Reference<XCommandEnvironment> const & xCmdEnv ); #endif void addDataToDb(OUString const & url, ConfigurationBackendDb::Data const & data); - ::o3tl::optional<ConfigurationBackendDb::Data> readDataFromDb(OUString const & url); + ::std::optional<ConfigurationBackendDb::Data> readDataFromDb(OUString const & url); void revokeEntryFromDb(OUString const & url); bool hasActiveEntry(OUString const & url); bool activateEntry(OUString const & url); @@ -240,10 +240,10 @@ void BackendImpl::addDataToDb( m_backendDb->addEntry(url, data); } -::o3tl::optional<ConfigurationBackendDb::Data> BackendImpl::readDataFromDb( +::std::optional<ConfigurationBackendDb::Data> BackendImpl::readDataFromDb( OUString const & url) { - ::o3tl::optional<ConfigurationBackendDb::Data> data; + ::std::optional<ConfigurationBackendDb::Data> data; if (m_backendDb) data = m_backendDb->getEntry(url); return data; @@ -488,7 +488,7 @@ bool BackendImpl::removeFromConfigmgrIni( //url to the file in the user installation (e.g. $BUNDLED_EXTENSIONS_USER) //However, m_url (getURL()) contains the URL for the file in the actual //extension installation. - ::o3tl::optional<ConfigurationBackendDb::Data> data = readDataFromDb(url_); + ::std::optional<ConfigurationBackendDb::Data> data = readDataFromDb(url_); if (data) i = std::find(rSet.begin(), rSet.end(), data->iniEntry); } @@ -680,7 +680,7 @@ void BackendImpl::PackageImpl::processPackage_( { if (getMyBackend()->activateEntry(getURL())) { - ::o3tl::optional<ConfigurationBackendDb::Data> data = that->readDataFromDb(url); + ::std::optional<ConfigurationBackendDb::Data> data = that->readDataFromDb(url); OSL_ASSERT(data); that->addToConfigmgrIni( m_isSchema, false, data->iniEntry, xCmdEnv ); } @@ -772,7 +772,7 @@ void BackendImpl::PackageImpl::processPackage_( } } #endif - ::o3tl::optional<ConfigurationBackendDb::Data> data = that->readDataFromDb(url); + ::std::optional<ConfigurationBackendDb::Data> data = that->readDataFromDb(url); //If an xcu file was life deployed then always a data entry is written. //If the xcu file was already in the configmr.ini then there is also //a data entry diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx index eb8775be9efa..fd5d3b3c4833 100644 --- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx @@ -90,7 +90,7 @@ void ConfigurationBackendDb::addEntry(OUString const & url, Data const & data) } -::o3tl::optional<ConfigurationBackendDb::Data> +::std::optional<ConfigurationBackendDb::Data> ConfigurationBackendDb::getEntry(OUString const & url) { try @@ -104,9 +104,9 @@ ConfigurationBackendDb::getEntry(OUString const & url) } else { - return ::o3tl::optional<Data>(); + return ::std::optional<Data>(); } - return ::o3tl::optional<Data>(retData); + return ::std::optional<Data>(retData); } catch ( const css::deployment::DeploymentException& ) { diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx index 0e0d4c4899cf..264030c0ef79 100644 --- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx +++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx @@ -23,7 +23,7 @@ #include <rtl/ustring.hxx> #include <rtl/string.hxx> #include <vector> -#include <o3tl/optional.hxx> +#include <optional> #include <dp_backenddb.hxx> namespace com { namespace sun { namespace star { @@ -69,7 +69,7 @@ public: void addEntry(OUString const & url, Data const & data); - ::o3tl::optional<Data> getEntry(OUString const & url); + ::std::optional<Data> getEntry(OUString const & url); std::vector< OUString> getAllDataUrls(); }; diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 428b74d2fce1..0dab3ad8d69b 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -43,7 +43,7 @@ #include <com/sun/star/sdbc/XRow.hpp> #include <tools/diagnose_ex.h> #include <unotools/tempfile.hxx> -#include <o3tl/optional.hxx> +#include <optional> using namespace ::dp_misc; using namespace ::com::sun::star; @@ -79,8 +79,8 @@ PackageRegistryBackend::PackageRegistryBackend( m_eContext( Context::Unknown ) { assert(xContext.is()); - o3tl::optional<OUString> cachePath; - o3tl::optional<bool> readOnly; + std::optional<OUString> cachePath; + std::optional<bool> readOnly; comphelper::unwrapArgs( args, m_context, cachePath, readOnly ); if (cachePath) m_cachePath = *cachePath; diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index 013c0648a49e..27cf615eb41b 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -40,7 +40,7 @@ #include <com/sun/star/deployment/ExtensionRemovedException.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <com/sun/star/util/XMacroExpander.hpp> -#include <o3tl/optional.hxx> +#include <optional> using namespace ::dp_misc; using namespace ::com::sun::star; @@ -95,7 +95,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend void implCollectXhpFiles( const OUString& aDir, std::vector< OUString >& o_rXhpFileVector ); - ::o3tl::optional<HelpBackendDb::Data> readDataFromDb(OUString const & url); + ::std::optional<HelpBackendDb::Data> readDataFromDb(OUString const & url); bool hasActiveEntry(OUString const & url); bool activateEntry(OUString const & url); @@ -200,10 +200,10 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( static_cast<sal_Int16>(-1) ); } -::o3tl::optional<HelpBackendDb::Data> BackendImpl::readDataFromDb( +::std::optional<HelpBackendDb::Data> BackendImpl::readDataFromDb( OUString const & url) { - ::o3tl::optional<HelpBackendDb::Data> data; + ::std::optional<HelpBackendDb::Data> data; if (m_backendDb) data = m_backendDb->getEntry(url); return data; @@ -333,7 +333,7 @@ beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL() if (m_bRemoved) throw deployment::ExtensionRemovedException(); - ::o3tl::optional<HelpBackendDb::Data> data = + ::std::optional<HelpBackendDb::Data> data = getMyBackend()->readDataFromDb(getURL()); if (data && getMyBackend()->hasActiveEntry(getURL())) diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx index cd8f65b749c0..73b7279d13de 100644 --- a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx +++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx @@ -87,7 +87,7 @@ void HelpBackendDb::addEntry(OUString const & url, Data const & data) } -::o3tl::optional<HelpBackendDb::Data> +::std::optional<HelpBackendDb::Data> HelpBackendDb::getEntry(OUString const & url) { try @@ -100,9 +100,9 @@ HelpBackendDb::getEntry(OUString const & url) } else { - return ::o3tl::optional<Data>(); + return ::std::optional<Data>(); } - return ::o3tl::optional<Data>(retData); + return ::std::optional<Data>(retData); } catch ( const css::deployment::DeploymentException& ) { diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx index 1a9eabc861aa..1f072f7429df 100644 --- a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx +++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx @@ -21,7 +21,7 @@ #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_REGISTRY_HELP_DP_HELPBACKENDDB_HXX #include <rtl/ustring.hxx> -#include <o3tl/optional.hxx> +#include <optional> #include <dp_backenddb.hxx> namespace com { namespace sun { namespace star { @@ -64,7 +64,7 @@ public: void addEntry(OUString const & url, Data const & data); - ::o3tl::optional<Data> getEntry(OUString const & url); + ::std::optional<Data> getEntry(OUString const & url); //must also return the data urls for entries with @active="false". That is, //those are currently revoked. std::vector< OUString> getAllDataUrls(); diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 013955e0f168..9cc78c7e6bc3 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -65,7 +65,7 @@ #include <com/sun/star/deployment/LicenseException.hpp> #include <com/sun/star/deployment/PlatformException.hpp> #include <com/sun/star/deployment/Prerequisites.hpp> -#include <o3tl/optional.hxx> +#include <optional> #include <tools/diagnose_ex.h> #include <algorithm> @@ -623,7 +623,7 @@ bool BackendImpl::PackageImpl::checkLicense( { try { - ::o3tl::optional<SimpleLicenseAttributes> simplLicAttr + ::std::optional<SimpleLicenseAttributes> simplLicAttr = info.getSimpleLicenseAttributes(); if (! simplLicAttr) return true; @@ -946,7 +946,7 @@ OUString BackendImpl::PackageImpl::getLicenseText() OUString sLicense; DescriptionInfoset aInfo = getDescriptionInfoset(); - ::o3tl::optional< SimpleLicenseAttributes > aSimplLicAttr = aInfo.getSimpleLicenseAttributes(); + ::std::optional< SimpleLicenseAttributes > aSimplLicAttr = aInfo.getSimpleLicenseAttributes(); if ( aSimplLicAttr ) { OUString aLicenseURL = aInfo.getLocalizedLicenseURL(); diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx index a6de29ffb0b2..3f2cfed20a2e 100644 --- a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx +++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx @@ -22,7 +22,7 @@ #include <rtl/ustring.hxx> #include <dp_backenddb.hxx> -#include <o3tl/optional.hxx> +#include <optional> namespace com { namespace sun { namespace star { namespace uno { |