summaryrefslogtreecommitdiff
path: root/sfx2
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 /sfx2
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 'sfx2')
-rw-r--r--sfx2/inc/pch/precompiled_sfx.hxx2
-rw-r--r--sfx2/source/appl/newhelp.cxx2
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx2
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx6
-rw-r--r--sfx2/source/view/viewfrm.cxx6
5 files changed, 9 insertions, 9 deletions
diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index bbfd1a63a4dd..87d51ac85d54 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -299,7 +299,7 @@
#include <i18nlangtag/lang.h>
#include <i18nlangtag/languagetag.hxx>
#include <o3tl/cow_wrapper.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <o3tl/safeint.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <officecfg/Office/Common.hxx>
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 7f7ae61767f1..ee9040e0e6f1 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1157,7 +1157,7 @@ void BookmarksBox_Impl::dispose()
for ( sal_Int32 i = 0; i < nCount; ++i )
{
OUString* pURL = static_cast<OUString*>(GetEntryData(i));
- aHistOpt.AppendItem(eHELPBOOKMARKS, *pURL, "", GetEntry(i), o3tl::nullopt);
+ aHistOpt.AppendItem(eHELPBOOKMARKS, *pURL, "", GetEntry(i), std::nullopt);
delete pURL;
}
ListBox::dispose();
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 67b5b1765331..ec32dd038d3d 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -102,7 +102,7 @@ void SfxPickListImpl::AddDocumentToPickList( const SfxObjectShell* pDocSh )
if ( pFilter )
aFilter = pFilter->GetFilterName();
- o3tl::optional<OUString> aThumbnail;
+ std::optional<OUString> aThumbnail;
// generate the thumbnail
//fdo#74834: only generate thumbnail for history if the corresponding option is not disabled in the configuration
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index f995be2c56ee..8c2e577eda67 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -75,7 +75,7 @@
#include <sfx2/docfile.hxx>
#include <sax/tools/converter.hxx>
#include <i18nlangtag/languagetag.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <utility>
#include <vector>
@@ -450,7 +450,7 @@ OUString getNameSpace(const char* i_qname) throw ()
bool
textToDateOrDateTime(css::util::Date & io_rd, css::util::DateTime & io_rdt,
- bool & o_rIsDateTime, o3tl::optional<sal_Int16> & o_rTimeZone,
+ bool & o_rIsDateTime, std::optional<sal_Int16> & o_rTimeZone,
const OUString& i_text) throw ()
{
if (::sax::Converter::parseDateOrDateTime(
@@ -1184,7 +1184,7 @@ void SfxDocumentMetaData::init(
bool isDateTime;
css::util::Date d;
css::util::DateTime dt;
- o3tl::optional<sal_Int16> nTimeZone;
+ std::optional<sal_Int16> nTimeZone;
if (textToDateOrDateTime(d, dt, isDateTime, nTimeZone, text)) {
if (isDateTime) {
if (nTimeZone) {
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 4d697710c0af..3bf812e439a6 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -85,7 +85,7 @@
#include <framework/framelistanalyzer.hxx>
#include <shellimpl.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <unotools/configmgr.hxx>
@@ -450,7 +450,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
bool bOK = false;
bool bRetryIgnoringLock = false;
bool bOpenTemplate = false;
- o3tl::optional<bool> aOrigROVal;
+ std::optional<bool> aOrigROVal;
if (!pVersionItem)
{
auto pRO = pMed->GetItemSet()->GetItem<SfxBoolItem>(SID_DOC_READONLY, false);
@@ -2356,7 +2356,7 @@ void SfxViewFrame::ExecView_Impl
static bool impl_maxOpenDocCountReached()
{
css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- o3tl::optional<sal_Int32> x(officecfg::Office::Common::Misc::MaxOpenDocuments::get(xContext));
+ std::optional<sal_Int32> x(officecfg::Office::Common::Misc::MaxOpenDocuments::get(xContext));
// NIL means: count of allowed documents = infinite !
if (!x)
return false;