diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-28 17:24:25 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-12-01 13:58:49 +0100 |
commit | 7b3190eda387bcd897095205732f6752dedf01ef (patch) | |
tree | 73aee445ec22583a418b579898f2566e615c4e95 /vcl | |
parent | 32b4936c9944111382d2491d99fc375b31d76723 (diff) |
boost::optional: replace uses of get_value_or with value_or
...in preparation for wholesale replacement of boost::optional with
o3tl::optional, which will be an alias for either std::optional or
boost::optional, and std::optional only has value_or.
boost::optional::value_or was added with <https://github.com/boostorg/optional/
commit/3984c9f9a157ef116cea69bc8bb20f433320eb61> "Added function value_or()",
which according to git-describe first appeared in tag boost-1.56.0. We appear
to have no strict Boost baseline (the closest we get is with
> [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)]
in configure.ac), and at least CentOS 7 TDF machine tb76 only has
boost-devel-1.53.0-27.el7.x86_64. However, any environment using Xcode < 10
that needs to make o3tl::optional fall back to boost::optional should use
--without-system-boost, and external/boost is currently at 1.69.0, so should be
safe.
ATTENTION: In isolation, this commit will break in any environment that uses
Boost older than 1.56.0. It requires the following commit introducing
o3tl::optional. (But doing these changes in individual commits was deemed more
valuable than supporting a hypothetical future git-bisect against an old Boost.)
Change-Id: Ib31affa3eebf0d0029d8620dc6abb7a60f6c7629
Reviewed-on: https://gerrit.libreoffice.org/84127
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/notebookbar.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 4 | ||||
-rw-r--r-- | vcl/win/gdi/salnativewidgets-luna.cxx | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 2ca319ee515c..21916ee56f13 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -1015,7 +1015,7 @@ void Qt5Frame::UpdateSettings(AllSettings& rSettings) Color aMenuBack = toColor(qMenuCG.color(QPalette::Window)); style.SetMenuTextColor(aMenuFore); - style.SetMenuBarTextColor(style.GetPersonaMenuBarTextColor().get_value_or(aMenuFore)); + style.SetMenuBarTextColor(style.GetPersonaMenuBarTextColor().value_or(aMenuFore)); style.SetMenuColor(aMenuBack); style.SetMenuBarColor(aMenuBack); style.SetMenuHighlightColor(toColor(qMenuCG.color(QPalette::Highlight))); diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index b178962f5d11..6ddc1c662c91 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -262,7 +262,7 @@ void NotebookBar::UpdatePersonaSettings() AllSettings aAllSettings( GetSettings() ); StyleSettings aStyleSet( aAllSettings.GetStyleSettings() ); - ::Color aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or(COL_BLACK ); + ::Color aTextColor = aStyleSet.GetPersonaMenuBarTextColor().value_or(COL_BLACK ); aStyleSet.SetDialogTextColor( aTextColor ); aStyleSet.SetButtonTextColor( aTextColor ); aStyleSet.SetRadioCheckTextColor( aTextColor ); diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 8b8f029b1897..2ffb60b4999b 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -2357,7 +2357,7 @@ void X11SalFrame::UpdateSettings( AllSettings& rSettings ) { StyleSettings aStyleSettings = rSettings.GetStyleSettings(); aStyleSettings.SetCursorBlinkTime( 500 ); - aStyleSettings.SetMenuBarTextColor( aStyleSettings.GetPersonaMenuBarTextColor().get_value_or( COL_BLACK ) ); + aStyleSettings.SetMenuBarTextColor( aStyleSettings.GetPersonaMenuBarTextColor().value_or( COL_BLACK ) ); rSettings.SetStyleSettings( aStyleSettings ); } diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index 6988f87df0f3..8a2e998f4e74 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -3145,13 +3145,13 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings) style_context_set_state(mpMenuBarItemStyle, GTK_STATE_FLAG_NORMAL); gtk_style_context_get_color( mpMenuBarItemStyle, gtk_style_context_get_state(mpMenuBarItemStyle), &text_color ); - aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( getColor( text_color ) ); + aTextColor = aStyleSet.GetPersonaMenuBarTextColor().value_or( getColor( text_color ) ); aStyleSet.SetMenuBarTextColor( aTextColor ); aStyleSet.SetMenuBarRolloverTextColor( aTextColor ); style_context_set_state(mpMenuBarItemStyle, GTK_STATE_FLAG_PRELIGHT); gtk_style_context_get_color( mpMenuBarItemStyle, gtk_style_context_get_state(mpMenuBarItemStyle), &text_color ); - aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( getColor( text_color ) ); + aTextColor = aStyleSet.GetPersonaMenuBarTextColor().value_or( getColor( text_color ) ); aStyleSet.SetMenuBarHighlightTextColor( aTextColor ); // menu items diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index ffba4b35ed85..41189555e55a 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -1538,7 +1538,7 @@ void WinSalGraphics::updateSettingsNative( AllSettings& rSettings ) pSVData->maNWFData.mbDockingAreaAvoidTBFrames = true; // FIXME get the color directly from the theme, not from the settings - Color aMenuBarTextColor = aStyleSettings.GetPersonaMenuBarTextColor().get_value_or( aStyleSettings.GetMenuTextColor() ); + Color aMenuBarTextColor = aStyleSettings.GetPersonaMenuBarTextColor().value_or( aStyleSettings.GetMenuTextColor() ); // in aero menuitem highlight text is drawn in the same color as normal aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetMenuTextColor() ); aStyleSettings.SetMenuBarRolloverTextColor( aMenuBarTextColor ); |