summaryrefslogtreecommitdiff
path: root/vcl
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 /vcl
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 'vcl')
-rw-r--r--vcl/inc/bitmapwriteaccess.hxx6
-rw-r--r--vcl/inc/fontinstance.hxx4
-rw-r--r--vcl/inc/pch/precompiled_vcl.hxx2
-rw-r--r--vcl/inc/sft.hxx4
-rw-r--r--vcl/inc/svdata.hxx8
-rw-r--r--vcl/inc/unx/screensaverinhibitor.hxx14
-rw-r--r--vcl/inc/wall2.hxx4
-rw-r--r--vcl/inc/window.h14
-rw-r--r--vcl/qt5/Qt5Frame.cxx4
-rw-r--r--vcl/source/app/settings.cxx6
-rw-r--r--vcl/source/control/quickselectionengine.cxx4
-rw-r--r--vcl/source/fontsubset/sft.cxx4
-rw-r--r--vcl/source/outdev/text.cxx4
-rw-r--r--vcl/unx/generic/window/salframe.cxx2
-rw-r--r--vcl/unx/generic/window/screensaverinhibitor.cxx4
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx4
-rw-r--r--vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx2
-rw-r--r--vcl/unx/kf5/KF5SalFrame.cxx2
-rw-r--r--vcl/win/gdi/salnativewidgets-luna.cxx2
-rw-r--r--vcl/win/window/salframe.cxx2
20 files changed, 48 insertions, 48 deletions
diff --git a/vcl/inc/bitmapwriteaccess.hxx b/vcl/inc/bitmapwriteaccess.hxx
index 0cb7fbf3a653..89a3dc22a73b 100644
--- a/vcl/inc/bitmapwriteaccess.hxx
+++ b/vcl/inc/bitmapwriteaccess.hxx
@@ -14,7 +14,7 @@
#include <vcl/alpha.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/bitmapaccess.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
typedef vcl::ScopedBitmapAccess<BitmapWriteAccess, Bitmap, &Bitmap::AcquireWriteAccess>
BitmapScopedWriteAccess;
@@ -83,8 +83,8 @@ public:
void DrawRect(const tools::Rectangle& rRect);
private:
- o3tl::optional<BitmapColor> mpLineColor;
- o3tl::optional<BitmapColor> mpFillColor;
+ std::optional<BitmapColor> mpLineColor;
+ std::optional<BitmapColor> mpFillColor;
BitmapWriteAccess() = delete;
BitmapWriteAccess(const BitmapWriteAccess&) = delete;
diff --git a/vcl/inc/fontinstance.hxx b/vcl/inc/fontinstance.hxx
index 03663e025b6d..365ce74d1099 100644
--- a/vcl/inc/fontinstance.hxx
+++ b/vcl/inc/fontinstance.hxx
@@ -30,7 +30,7 @@
#include <tools/fontenum.hxx>
#include <vcl/glyphitem.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <unordered_map>
#include <memory>
@@ -103,7 +103,7 @@ private:
hb_font_t* m_pHbFont;
double m_nAveWidthFactor;
rtl::Reference<PhysicalFontFace> m_pFontFace;
- o3tl::optional<bool> m_xbIsGraphiteFont;
+ std::optional<bool> m_xbIsGraphiteFont;
};
inline hb_font_t* LogicalFontInstance::GetHbFont()
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx
index 9c68ef68ce76..61bf59d444d2 100644
--- a/vcl/inc/pch/precompiled_vcl.hxx
+++ b/vcl/inc/pch/precompiled_vcl.hxx
@@ -183,7 +183,7 @@
#include <i18nlangtag/mslangid.hxx>
#include <i18nutil/i18nutildllapi.h>
#include <o3tl/cow_wrapper.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/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index 985ad5623e50..aca60a45641e 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -489,8 +489,8 @@ constexpr sal_uInt32 T_CFF = 0x43464620;
#endif
bool VCL_DLLPUBLIC getTTCoverage(
- o3tl::optional<std::bitset<UnicodeCoverage::MAX_UC_ENUM>> & rUnicodeCoverage,
- o3tl::optional<std::bitset<CodePageCoverage::MAX_CP_ENUM>> & rCodePageCoverage,
+ std::optional<std::bitset<UnicodeCoverage::MAX_UC_ENUM>> & rUnicodeCoverage,
+ std::optional<std::bitset<CodePageCoverage::MAX_CP_ENUM>> & rCodePageCoverage,
const unsigned char* pTable, size_t nLength);
/**
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index c91a6e4139ae..cefc8cb124fc 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -137,10 +137,10 @@ struct ImplSVAppData
SVAppKeyListeners maKeyListeners; // listeners for key events only (eg, extended toolkit)
std::vector<ImplPostEventPair> maPostedEventList;
ImplAccelManager* mpAccelMgr; // Accelerator Manager
- o3tl::optional<OUString> mxAppName; // Application name
- o3tl::optional<OUString> mxAppFileName; // Abs. Application FileName
- o3tl::optional<OUString> mxDisplayName; // Application Display Name
- o3tl::optional<OUString> mxToolkitName; // Toolkit Name
+ std::optional<OUString> mxAppName; // Application name
+ std::optional<OUString> mxAppFileName; // Abs. Application FileName
+ std::optional<OUString> mxDisplayName; // Application Display Name
+ std::optional<OUString> mxToolkitName; // Toolkit Name
Help* mpHelp = nullptr; // Application help
VclPtr<PopupMenu> mpActivePopupMenu; // Actives Popup-Menu (in Execute)
VclPtr<ImplWheelWindow> mpWheelWindow; // WheelWindow
diff --git a/vcl/inc/unx/screensaverinhibitor.hxx b/vcl/inc/unx/screensaverinhibitor.hxx
index fcc6f4917fa1..58c00e7fa382 100644
--- a/vcl/inc/unx/screensaverinhibitor.hxx
+++ b/vcl/inc/unx/screensaverinhibitor.hxx
@@ -16,24 +16,24 @@
#include <rtl/ustring.hxx>
#include <vcl/dllapi.h>
-#include <o3tl/optional.hxx>
+#include <optional>
class VCL_PLUGIN_PUBLIC ScreenSaverInhibitor
{
public:
void inhibit( bool bInhibit, const OUString& sReason,
- bool bIsX11, const o3tl::optional<unsigned int>& xid, o3tl::optional<Display*> pDisplay );
+ bool bIsX11, const std::optional<unsigned int>& xid, std::optional<Display*> pDisplay );
private:
// These are all used as guint, however this header may be included
// in kde/tde/etc backends, where we would ideally avoid having
// any glib dependencies, hence the direct use of unsigned int.
- o3tl::optional<unsigned int> mnFDOCookie; // FDO ScreenSaver Inhibit
- o3tl::optional<unsigned int> mnFDOPMCookie; // FDO PowerManagement Inhibit
- o3tl::optional<unsigned int> mnGSMCookie;
- o3tl::optional<unsigned int> mnMSMCookie;
+ std::optional<unsigned int> mnFDOCookie; // FDO ScreenSaver Inhibit
+ std::optional<unsigned int> mnFDOPMCookie; // FDO PowerManagement Inhibit
+ std::optional<unsigned int> mnGSMCookie;
+ std::optional<unsigned int> mnMSMCookie;
- o3tl::optional<int> mnXScreenSaverTimeout;
+ std::optional<int> mnXScreenSaverTimeout;
#if !defined(__sun) && !defined(AIX)
BOOL mbDPMSWasEnabled;
diff --git a/vcl/inc/wall2.hxx b/vcl/inc/wall2.hxx
index ec96d905cc7c..401593b3ff8b 100644
--- a/vcl/inc/wall2.hxx
+++ b/vcl/inc/wall2.hxx
@@ -20,14 +20,14 @@
#ifndef INCLUDED_VCL_INC_WALL2_HXX
#define INCLUDED_VCL_INC_WALL2_HXX
-#include <o3tl/optional.hxx>
+#include <optional>
class ImplWallpaper
{
friend class Wallpaper;
private:
- o3tl::optional<tools::Rectangle> mpRect;
+ std::optional<tools::Rectangle> mpRect;
std::unique_ptr<BitmapEx> mpBitmap;
std::unique_ptr<Gradient> mpGradient;
std::unique_ptr<BitmapEx> mpCache;
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 11271261f335..f4f4d6b29eb4 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -31,7 +31,7 @@
#include <o3tl/typed_flags_set.hxx>
#include <cppuhelper/weakref.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <list>
#include <memory>
#include <vector>
@@ -97,20 +97,20 @@ bool ImplWindowFrameProc( vcl::Window* pInst, SalEvent nEvent, const void* pEven
struct ImplWinData
{
- o3tl::optional<OUString>
+ std::optional<OUString>
mpExtOldText;
std::unique_ptr<ExtTextInputAttr[]>
mpExtOldAttrAry;
- o3tl::optional<tools::Rectangle>
+ std::optional<tools::Rectangle>
mpCursorRect;
long mnCursorExtWidth;
bool mbVertical;
std::unique_ptr<tools::Rectangle[]>
mpCompositionCharRects;
long mnCompositionCharRects;
- o3tl::optional<tools::Rectangle>
+ std::optional<tools::Rectangle>
mpFocusRect;
- o3tl::optional<tools::Rectangle>
+ std::optional<tools::Rectangle>
mpTrackRect;
ShowTrackFlags mnTrackFlags;
sal_uInt16 mnIsTopWindow;
@@ -183,9 +183,9 @@ struct ImplFrameData
struct ImplAccessibleInfos
{
sal_uInt16 nAccessibleRole;
- o3tl::optional<OUString>
+ std::optional<OUString>
pAccessibleName;
- o3tl::optional<OUString>
+ std::optional<OUString>
pAccessibleDescription;
VclPtr<vcl::Window> pLabeledByWindow;
VclPtr<vcl::Window> pLabelForWindow;
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 905e542a65b0..4a6075999096 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -735,8 +735,8 @@ void Qt5Frame::StartPresentation(bool bStart)
// meh - so there's no Qt platform independent solution
// https://forum.qt.io/topic/38504/solved-qdialog-in-fullscreen-disable-os-screensaver
#if QT5_USING_X11
- o3tl::optional<unsigned int> aRootWindow;
- o3tl::optional<Display*> aDisplay;
+ std::optional<unsigned int> aRootWindow;
+ std::optional<Display*> aDisplay;
if (QX11Info::isPlatformX11())
{
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index ee17e42f3a1d..4adc9328a161 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -199,7 +199,7 @@ struct ImplStyleData
BitmapEx maPersonaHeaderBitmap; ///< Cache the header bitmap.
BitmapEx maPersonaFooterBitmap; ///< Cache the footer bitmap.
- o3tl::optional<Color> maPersonaMenuBarTextColor; ///< Cache the menubar color.
+ std::optional<Color> maPersonaMenuBarTextColor; ///< Cache the menubar color.
};
struct ImplMiscData
@@ -2105,7 +2105,7 @@ enum WhichPersona { PERSONA_HEADER, PERSONA_FOOTER };
}
/** Update the setting of the Persona header / footer in ImplStyleData */
-static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFooter, BitmapEx& rHeaderFooterBitmap, o3tl::optional<Color>& rMenuBarTextColor )
+static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFooter, BitmapEx& rHeaderFooterBitmap, std::optional<Color>& rMenuBarTextColor )
{
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
if ( !xContext.is() )
@@ -2198,7 +2198,7 @@ BitmapEx const & StyleSettings::GetPersonaFooter() const
return mxData->maPersonaFooterBitmap;
}
-const o3tl::optional<Color>& StyleSettings::GetPersonaMenuBarTextColor() const
+const std::optional<Color>& StyleSettings::GetPersonaMenuBarTextColor() const
{
GetPersonaHeader();
return mxData->maPersonaMenuBarTextColor;
diff --git a/vcl/source/control/quickselectionengine.cxx b/vcl/source/control/quickselectionengine.cxx
index 9719f0e94734..d5434108582a 100644
--- a/vcl/source/control/quickselectionengine.cxx
+++ b/vcl/source/control/quickselectionengine.cxx
@@ -25,7 +25,7 @@
#include <vcl/settings.hxx>
#include <sal/log.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
namespace vcl
{
@@ -34,7 +34,7 @@ namespace vcl
{
ISearchableStringList& rEntryList;
OUString sCurrentSearchString;
- ::o3tl::optional< sal_Unicode > aSingleSearchChar;
+ ::std::optional< sal_Unicode > aSingleSearchChar;
Timer aSearchTimeout;
explicit QuickSelectionEngine_Data( ISearchableStringList& _entryList )
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index a0737320d257..249c8b7c8ce4 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2599,8 +2599,8 @@ append(std::bitset<N> & rSet, size_t const nOffset, sal_uInt32 const nValue)
}
bool getTTCoverage(
- o3tl::optional<std::bitset<UnicodeCoverage::MAX_UC_ENUM>> &rUnicodeRange,
- o3tl::optional<std::bitset<CodePageCoverage::MAX_CP_ENUM>> &rCodePageRange,
+ std::optional<std::bitset<UnicodeCoverage::MAX_UC_ENUM>> &rUnicodeRange,
+ std::optional<std::bitset<CodePageCoverage::MAX_CP_ENUM>> &rCodePageRange,
const unsigned char* pTable, size_t nLength)
{
bool bRet = false;
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index b2e52e5d8375..91cc10784bb4 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -48,7 +48,7 @@
#include <textlayout.hxx>
#include <textlineinfo.hxx>
#include <impglyphitem.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
#define TEXT_DRAW_ELLIPSIS (DrawTextFlags::EndEllipsis | DrawTextFlags::PathEllipsis | DrawTextFlags::NewsEllipsis)
@@ -1191,7 +1191,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
const sal_Unicode* pBase = rStr.getStr();
const sal_Unicode* pStr = pBase + nMinIndex;
const sal_Unicode* pEnd = pBase + nEndIndex;
- o3tl::optional<OUStringBuffer> xTmpStr;
+ std::optional<OUStringBuffer> xTmpStr;
for( ; pStr < pEnd; ++pStr )
{
// TODO: are there non-digit localizations?
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index b618ab8c8a7a..3ad836c082b9 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -57,7 +57,7 @@
#include <svdata.hxx>
#include <bitmaps.hlst>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <algorithm>
diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx
index 8c84a3ae5345..4cb4e273794b 100644
--- a/vcl/unx/generic/window/screensaverinhibitor.cxx
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -47,7 +47,7 @@
#include <sal/log.hxx>
void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason,
- bool bIsX11, const o3tl::optional<unsigned int>& xid, o3tl::optional<Display*> pDisplay )
+ bool bIsX11, const std::optional<unsigned int>& xid, std::optional<Display*> pDisplay )
{
const char* appname = SalGenericSystem::getFrameClassName();
const OString aReason = OUStringToOString( sReason, RTL_TEXTENCODING_UTF8 );
@@ -77,7 +77,7 @@ static void dbusInhibit( bool bInhibit,
const gchar* service, const gchar* path, const gchar* interface,
const std::function<GVariant*( GDBusProxy*, GError*& )>& fInhibit,
const std::function<GVariant*( GDBusProxy*, const guint, GError*& )>& fUnInhibit,
- o3tl::optional<guint>& rCookie )
+ std::optional<guint>& rCookie )
{
if ( ( !bInhibit && !rCookie ) ||
( bInhibit && rCookie ) )
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 3165067028d5..12df8c289fae 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1887,8 +1887,8 @@ void GtkSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen )
void GtkSalFrame::StartPresentation( bool bStart )
{
- o3tl::optional<guint> aWindow;
- o3tl::optional<Display*> aDisplay;
+ std::optional<guint> aWindow;
+ std::optional<Display*> aDisplay;
if( getDisplay()->IsX11Display() )
{
aWindow = widget_get_xid(m_pWindow);
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 7661ee3ca046..95750805ac4f 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -23,7 +23,7 @@
#include <unx/fontmanager.hxx>
#include "cairo_gtk3_cairo.hxx"
-#include <o3tl/optional.hxx>
+#include <optional>
GtkStyleContext* GtkSalGraphics::mpWindowStyle = nullptr;
GtkStyleContext* GtkSalGraphics::mpButtonStyle = nullptr;
diff --git a/vcl/unx/kf5/KF5SalFrame.cxx b/vcl/unx/kf5/KF5SalFrame.cxx
index ba34839a1291..27503444a0a1 100644
--- a/vcl/unx/kf5/KF5SalFrame.cxx
+++ b/vcl/unx/kf5/KF5SalFrame.cxx
@@ -40,7 +40,7 @@
#include <svdata.hxx>
-#include <o3tl/optional.hxx>
+#include <optional>
KF5SalFrame::KF5SalFrame(KF5SalFrame* pParent, SalFrameStyleFlags nState, bool bUseCairo)
: Qt5Frame(pParent, nState, bUseCairo)
diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx
index 4b4cd9cf3cd6..f5ac28e2a309 100644
--- a/vcl/win/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/gdi/salnativewidgets-luna.cxx
@@ -51,7 +51,7 @@
#include <map>
#include <string>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <ControlCacheKey.hxx>
using namespace std;
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 12d37a792def..0321dd731a35 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -2648,7 +2648,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetUseFlatBorders( false );
aStyleSettings.SetUseFlatMenus( false );
aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
- if ( o3tl::optional<Color> aColor = aStyleSettings.GetPersonaMenuBarTextColor() )
+ if ( std::optional<Color> aColor = aStyleSettings.GetPersonaMenuBarTextColor() )
{
aStyleSettings.SetMenuBarTextColor( *aColor );
aStyleSettings.SetMenuBarRolloverTextColor( *aColor );