summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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 'sd')
-rw-r--r--sd/inc/pch/precompiled_sd.hxx2
-rw-r--r--sd/inc/pch/precompiled_sdui.hxx2
-rw-r--r--sd/source/filter/ppt/pptin.cxx4
-rw-r--r--sd/source/ui/app/sdmod2.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx6
-rw-r--r--sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx10
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx4
7 files changed, 15 insertions, 15 deletions
diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx
index 672fbcd5f8d4..d352ebae06e3 100644
--- a/sd/inc/pch/precompiled_sd.hxx
+++ b/sd/inc/pch/precompiled_sd.hxx
@@ -294,7 +294,7 @@
#include <model/SlsPageEnumerationProvider.hxx>
#include <o3tl/cow_wrapper.hxx>
#include <o3tl/deleter.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <o3tl/safeint.hxx>
#include <o3tl/strong_int.hxx>
#include <o3tl/typed_flags_set.hxx>
diff --git a/sd/inc/pch/precompiled_sdui.hxx b/sd/inc/pch/precompiled_sdui.hxx
index cfdbb0e86e72..d8fec6e26373 100644
--- a/sd/inc/pch/precompiled_sdui.hxx
+++ b/sd/inc/pch/precompiled_sdui.hxx
@@ -334,7 +334,7 @@
#include <o3tl/cow_wrapper.hxx>
#include <o3tl/deleter.hxx>
#include <o3tl/enumarray.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <o3tl/safeint.hxx>
#include <o3tl/sorted_vector.hxx>
#include <o3tl/strong_int.hxx>
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 6aeb33182b31..90c515fb1f85 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -87,7 +87,7 @@
#include <comphelper/string.hxx>
#include <oox/ole/olehelper.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <cassert>
#include <memory>
@@ -583,7 +583,7 @@ bool ImplSdPPTImport::Import()
pPage->SetAutoLayout( AUTOLAYOUT_NOTES, true );
if ( nMasterNum )
{
- o3tl::optional< sal_Int16 > oStartNumbering;
+ std::optional< sal_Int16 > oStartNumbering;
SfxStyleSheet* pSheet;
if ( nMasterNum == 1 )
{
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 5bc72ad5fde9..427228c0a7d5 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -335,7 +335,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void)
}
else if ( dynamic_cast< const SdrMeasureField* >(pField))
{
- pInfo->SetFieldColor(o3tl::optional<Color>()); // clear the field color
+ pInfo->SetFieldColor(std::optional<Color>()); // clear the field color
}
else if ((pCustomPropertyField = dynamic_cast<const editeng::CustomPropertyField*>(pField)) != nullptr)
{
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index 8c4b0979bee9..5ed5359e8655 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -51,7 +51,7 @@
#include <o3tl/deleter.hxx>
#include <sfx2/dispatch.hxx>
#include <vcl/ptrstyle.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <sdmod.hxx>
namespace {
@@ -198,7 +198,7 @@ protected:
virtual bool ProcessDragEvent (SelectionFunction::EventDescriptor& rDescriptor) override;
private:
- ::o3tl::optional<Point> maButtonDownLocation;
+ ::std::optional<Point> maButtonDownLocation;
/** Select all pages between and including the selection anchor and the
specified page.
@@ -1180,7 +1180,7 @@ void NormalModeHandler::RangeSelect (const model::SharedPageDescriptor& rpDescri
void NormalModeHandler::ResetButtonDownLocation()
{
- maButtonDownLocation = ::o3tl::optional<Point>();
+ maButtonDownLocation = ::std::optional<Point>();
}
//===== MultiSelectionModeHandler =============================================
diff --git a/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx b/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx
index 52bc377f4e91..a0f79f984d5e 100644
--- a/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx
@@ -107,7 +107,7 @@ void VisibleAreaManager::MakeVisible()
return;
const Point aCurrentTopLeft (pWindow->PixelToLogic(Point(0,0)));
- const ::o3tl::optional<Point> aNewVisibleTopLeft (GetRequestedTopLeft());
+ const ::std::optional<Point> aNewVisibleTopLeft (GetRequestedTopLeft());
maVisibleRequests.clear();
if ( ! aNewVisibleTopLeft)
return;
@@ -121,11 +121,11 @@ void VisibleAreaManager::MakeVisible()
aAnimation(1.0);
}
-::o3tl::optional<Point> VisibleAreaManager::GetRequestedTopLeft() const
+::std::optional<Point> VisibleAreaManager::GetRequestedTopLeft() const
{
sd::Window *pWindow (mrSlideSorter.GetContentWindow().get());
if ( ! pWindow)
- return ::o3tl::optional<Point>();
+ return ::std::optional<Point>();
// Get the currently visible area and the model area.
const ::tools::Rectangle aVisibleArea (pWindow->PixelToLogic(
@@ -166,9 +166,9 @@ void VisibleAreaManager::MakeVisible()
const Point aRequestedTopLeft (nVisibleLeft, nVisibleTop);
if (aRequestedTopLeft == aVisibleArea.TopLeft())
- return ::o3tl::optional<Point>();
+ return ::std::optional<Point>();
else
- return ::o3tl::optional<Point>(aRequestedTopLeft);
+ return ::std::optional<Point>(aRequestedTopLeft);
}
//===== VisibleAreaManager::TemporaryDisabler =================================
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx
index 8ac72f786ec2..a8e1510a49c6 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx
@@ -21,7 +21,7 @@
#define INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_CONTROLLER_SLSVISIBLEAREAMANAGER_HXX
#include <model/SlsSharedPageDescriptor.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <tools/gen.hxx>
#include <vector>
@@ -81,7 +81,7 @@ private:
int mnDisableCount;
void MakeVisible();
- ::o3tl::optional<Point> GetRequestedTopLeft() const;
+ ::std::optional<Point> GetRequestedTopLeft() const;
};
} } } // end of namespace ::sd::slidesorter::view