summaryrefslogtreecommitdiff
path: root/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-02-21 07:26:06 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-02-21 14:50:28 +0100
commit9ad252b2e79576119c2d733a1a45fdd9e9f83140 (patch)
tree87fee16145d457b6799a05c389d85270476f7f35 /desktop/source/deployment/misc/dp_descriptioninfoset.cxx
parent3aca35f1505fa552eaa316a2d47a60ef52646525 (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 "&lt;"/"&gt;" 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/deployment/misc/dp_descriptioninfoset.cxx')
-rw-r--r--desktop/source/deployment/misc/dp_descriptioninfoset.cxx30
1 files changed, 15 insertions, 15 deletions
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