summaryrefslogtreecommitdiff
path: root/svtools
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 /svtools
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 'svtools')
-rw-r--r--svtools/inc/pch/precompiled_svt.hxx2
-rw-r--r--svtools/inc/table/tablemodel.hxx22
-rw-r--r--svtools/source/misc/sampletext.cxx4
-rw-r--r--svtools/source/table/gridtablerenderer.cxx14
-rw-r--r--svtools/source/table/tablecontrol_impl.cxx40
-rw-r--r--svtools/source/uno/svtxgridcontrol.cxx4
-rw-r--r--svtools/source/uno/unocontroltablemodel.cxx42
-rw-r--r--svtools/source/uno/unocontroltablemodel.hxx20
8 files changed, 74 insertions, 74 deletions
diff --git a/svtools/inc/pch/precompiled_svt.hxx b/svtools/inc/pch/precompiled_svt.hxx
index 341212e13319..2797de08da3a 100644
--- a/svtools/inc/pch/precompiled_svt.hxx
+++ b/svtools/inc/pch/precompiled_svt.hxx
@@ -314,7 +314,7 @@
#include <i18nutil/transliteration.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/svtools/inc/table/tablemodel.hxx b/svtools/inc/table/tablemodel.hxx
index a27d6b0e5834..b2913615b201 100644
--- a/svtools/inc/table/tablemodel.hxx
+++ b/svtools/inc/table/tablemodel.hxx
@@ -29,7 +29,7 @@
#include <sal/types.h>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <memory>
#include <vector>
#include <o3tl/typed_flags_set.hxx>
@@ -364,55 +364,55 @@ namespace svt { namespace table
If this value is not set, a default color from the style settings will be used.
*/
- virtual ::o3tl::optional< ::Color > getLineColor() const = 0;
+ virtual ::std::optional< ::Color > getLineColor() const = 0;
/** returns the color to be used for rendering the header background.
If this value is not set, a default color from the style settings will be used.
*/
- virtual ::o3tl::optional< ::Color > getHeaderBackgroundColor() const = 0;
+ virtual ::std::optional< ::Color > getHeaderBackgroundColor() const = 0;
/** returns the color to be used for rendering the header text.
If this value is not set, a default color from the style settings will be used.
*/
- virtual ::o3tl::optional< ::Color > getHeaderTextColor() const = 0;
+ virtual ::std::optional< ::Color > getHeaderTextColor() const = 0;
/** returns the color to be used for the background of selected cells, when the control has the focus
If this value is not set, a default color from the style settings will be used.
*/
- virtual ::o3tl::optional< ::Color > getActiveSelectionBackColor() const = 0;
+ virtual ::std::optional< ::Color > getActiveSelectionBackColor() const = 0;
/** returns the color to be used for the background of selected cells, when the control does not have the focus
If this value is not set, a default color from the style settings will be used.
*/
- virtual ::o3tl::optional< ::Color > getInactiveSelectionBackColor() const = 0;
+ virtual ::std::optional< ::Color > getInactiveSelectionBackColor() const = 0;
/** returns the color to be used for the text of selected cells, when the control has the focus
If this value is not set, a default color from the style settings will be used.
*/
- virtual ::o3tl::optional< ::Color > getActiveSelectionTextColor() const = 0;
+ virtual ::std::optional< ::Color > getActiveSelectionTextColor() const = 0;
/** returns the color to be used for the text of selected cells, when the control does not have the focus
If this value is not set, a default color from the style settings will be used.
*/
- virtual ::o3tl::optional< ::Color > getInactiveSelectionTextColor() const = 0;
+ virtual ::std::optional< ::Color > getInactiveSelectionTextColor() const = 0;
/** returns the color to be used for rendering cell texts.
If this value is not set, a default color from the style settings will be used.
*/
- virtual ::o3tl::optional< ::Color > getTextColor() const = 0;
+ virtual ::std::optional< ::Color > getTextColor() const = 0;
/** returns the color to be used for text lines (underline, strikethrough) when rendering cell text.
If this value is not set, a default color from the style settings will be used.
*/
- virtual ::o3tl::optional< ::Color > getTextLineColor() const = 0;
+ virtual ::std::optional< ::Color > getTextLineColor() const = 0;
/** returns the colors to be used for the row backgrounds.
@@ -425,7 +425,7 @@ namespace svt { namespace table
If value is a non-empty sequence, then rows will have the background colors as specified in the sequence,
in alternating order.
*/
- virtual ::o3tl::optional< ::std::vector< ::Color > >
+ virtual ::std::optional< ::std::vector< ::Color > >
getRowBackgroundColors() const = 0;
/** determines the vertical alignment of content within a cell
diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx
index e62da1690090..a08c2867abfc 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -705,7 +705,7 @@ static OUString makeRepresentativeTextForLanguage(LanguageType eLang)
namespace
{
#if OSL_DEBUG_LEVEL > 0
- void lcl_dump_unicode_coverage(const o3tl::optional<std::bitset<vcl::UnicodeCoverage::MAX_UC_ENUM>> &roIn)
+ void lcl_dump_unicode_coverage(const std::optional<std::bitset<vcl::UnicodeCoverage::MAX_UC_ENUM>> &roIn)
{
if (!roIn)
{
@@ -976,7 +976,7 @@ namespace
SAL_INFO("svtools", "RESERVED5");
}
- void lcl_dump_codepage_coverage(const o3tl::optional<std::bitset<vcl::CodePageCoverage::MAX_CP_ENUM>> &roIn)
+ void lcl_dump_codepage_coverage(const std::optional<std::bitset<vcl::CodePageCoverage::MAX_CP_ENUM>> &roIn)
{
if (!roIn)
{
diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx
index 5fb786cd13d3..8ab7ae182d48 100644
--- a/svtools/source/table/gridtablerenderer.cxx
+++ b/svtools/source/table/gridtablerenderer.cxx
@@ -203,7 +203,7 @@ namespace svt::table
namespace
{
- Color lcl_getEffectiveColor(o3tl::optional<Color> const& i_modelColor,
+ Color lcl_getEffectiveColor(std::optional<Color> const& i_modelColor,
StyleSettings const& i_styleSettings,
Color const& (StyleSettings::*i_getDefaultColor) () const)
{
@@ -229,7 +229,7 @@ namespace svt::table
rRenderContext.DrawRect(_rArea);
// delimiter lines at bottom/right
- o3tl::optional<Color> aLineColor(m_pImpl->rModel.getLineColor());
+ std::optional<Color> aLineColor(m_pImpl->rModel.getLineColor());
Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
rRenderContext.SetLineColor(lineColor);
rRenderContext.DrawLine(_rArea.BottomLeft(), _rArea.BottomRight());
@@ -261,7 +261,7 @@ namespace svt::table
nDrawTextFlags |= DrawTextFlags::Disable;
rRenderContext.DrawText( aTextRect, sHeaderText, nDrawTextFlags );
- o3tl::optional<Color> const aLineColor( m_pImpl->rModel.getLineColor() );
+ std::optional<Color> const aLineColor( m_pImpl->rModel.getLineColor() );
Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
rRenderContext.SetLineColor( lineColor );
rRenderContext.DrawLine( _rArea.BottomRight(), _rArea.TopRight());
@@ -309,7 +309,7 @@ namespace svt::table
Color backgroundColor = _rStyle.GetFieldColor();
- o3tl::optional<Color> const aLineColor( m_pImpl->rModel.getLineColor() );
+ std::optional<Color> const aLineColor( m_pImpl->rModel.getLineColor() );
Color lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
Color const activeSelectionBackColor = lcl_getEffectiveColor(m_pImpl->rModel.getActiveSelectionBackColor(),
@@ -325,7 +325,7 @@ namespace svt::table
}
else
{
- o3tl::optional< std::vector<Color> > aRowColors = m_pImpl->rModel.getRowBackgroundColors();
+ std::optional< std::vector<Color> > aRowColors = m_pImpl->rModel.getRowBackgroundColors();
if (!aRowColors)
{
// use alternating default colors
@@ -370,7 +370,7 @@ namespace svt::table
{
rRenderContext.Push( PushFlags::LINECOLOR | PushFlags::TEXTCOLOR );
- o3tl::optional<Color> const aLineColor( m_pImpl->rModel.getLineColor() );
+ std::optional<Color> const aLineColor( m_pImpl->rModel.getLineColor() );
Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
rRenderContext.SetLineColor(lineColor);
rRenderContext.DrawLine(_rArea.BottomLeft(), _rArea.BottomRight());
@@ -428,7 +428,7 @@ namespace svt::table
if ( m_pImpl->bUseGridLines )
{
- ::o3tl::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
+ ::std::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
::Color lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
if ( _bSelected && !aLineColor )
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index dbdaa91ce536..b4cf5591761f 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -149,45 +149,45 @@ namespace svt::table
}
virtual void addTableModelListener( const PTableModelListener& ) override {}
virtual void removeTableModelListener( const PTableModelListener& ) override {}
- virtual ::o3tl::optional< ::Color > getLineColor() const override
+ virtual ::std::optional< ::Color > getLineColor() const override
{
- return ::o3tl::optional< ::Color >();
+ return ::std::optional< ::Color >();
}
- virtual ::o3tl::optional< ::Color > getHeaderBackgroundColor() const override
+ virtual ::std::optional< ::Color > getHeaderBackgroundColor() const override
{
- return ::o3tl::optional< ::Color >();
+ return ::std::optional< ::Color >();
}
- virtual ::o3tl::optional< ::Color > getHeaderTextColor() const override
+ virtual ::std::optional< ::Color > getHeaderTextColor() const override
{
- return ::o3tl::optional< ::Color >();
+ return ::std::optional< ::Color >();
}
- virtual ::o3tl::optional< ::Color > getActiveSelectionBackColor() const override
+ virtual ::std::optional< ::Color > getActiveSelectionBackColor() const override
{
- return ::o3tl::optional< ::Color >();
+ return ::std::optional< ::Color >();
}
- virtual ::o3tl::optional< ::Color > getInactiveSelectionBackColor() const override
+ virtual ::std::optional< ::Color > getInactiveSelectionBackColor() const override
{
- return ::o3tl::optional< ::Color >();
+ return ::std::optional< ::Color >();
}
- virtual ::o3tl::optional< ::Color > getActiveSelectionTextColor() const override
+ virtual ::std::optional< ::Color > getActiveSelectionTextColor() const override
{
- return ::o3tl::optional< ::Color >();
+ return ::std::optional< ::Color >();
}
- virtual ::o3tl::optional< ::Color > getInactiveSelectionTextColor() const override
+ virtual ::std::optional< ::Color > getInactiveSelectionTextColor() const override
{
- return ::o3tl::optional< ::Color >();
+ return ::std::optional< ::Color >();
}
- virtual ::o3tl::optional< ::Color > getTextColor() const override
+ virtual ::std::optional< ::Color > getTextColor() const override
{
- return ::o3tl::optional< ::Color >();
+ return ::std::optional< ::Color >();
}
- virtual ::o3tl::optional< ::Color > getTextLineColor() const override
+ virtual ::std::optional< ::Color > getTextLineColor() const override
{
- return ::o3tl::optional< ::Color >();
+ return ::std::optional< ::Color >();
}
- virtual ::o3tl::optional< ::std::vector< ::Color > > getRowBackgroundColors() const override
+ virtual ::std::optional< ::std::vector< ::Color > > getRowBackgroundColors() const override
{
- return ::o3tl::optional< ::std::vector< ::Color > >();
+ return ::std::optional< ::std::vector< ::Color > >();
}
virtual css::style::VerticalAlignment getVerticalAlign() const override
{
diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx
index 0526b2e4f680..c19137a313c4 100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -452,7 +452,7 @@ void SVTXGridControl::impl_checkTableModelInit()
namespace
{
- void lcl_convertColor( ::o3tl::optional< ::Color > const & i_color, Any & o_colorValue )
+ void lcl_convertColor( ::std::optional< ::Color > const & i_color, Any & o_colorValue )
{
if ( !i_color )
o_colorValue.clear();
@@ -535,7 +535,7 @@ Any SVTXGridControl::getProperty( const OUString& PropertyName )
case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS:
{
- ::o3tl::optional< ::std::vector< ::Color > > aColors( m_xTableModel->getRowBackgroundColors() );
+ ::std::optional< ::std::vector< ::Color > > aColors( m_xTableModel->getRowBackgroundColors() );
if ( !aColors )
aPropertyValue.clear();
else
diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx
index 0477b82ca53d..e1adde72524e 100644
--- a/svtools/source/uno/unocontroltablemodel.cxx
+++ b/svtools/source/uno/unocontroltablemodel.cxx
@@ -70,16 +70,16 @@ namespace svt::table
TableMetrics nRowHeight;
TableMetrics nColumnHeaderHeight;
TableMetrics nRowHeaderWidth;
- ::o3tl::optional< ::Color > m_aGridLineColor;
- ::o3tl::optional< ::Color > m_aHeaderBackgroundColor;
- ::o3tl::optional< ::Color > m_aHeaderTextColor;
- ::o3tl::optional< ::Color > m_aActiveSelectionBackColor;
- ::o3tl::optional< ::Color > m_aInactiveSelectionBackColor;
- ::o3tl::optional< ::Color > m_aActiveSelectionTextColor;
- ::o3tl::optional< ::Color > m_aInactiveSelectionTextColor;
- ::o3tl::optional< ::Color > m_aTextColor;
- ::o3tl::optional< ::Color > m_aTextLineColor;
- ::o3tl::optional< ::std::vector< ::Color > > m_aRowColors;
+ ::std::optional< ::Color > m_aGridLineColor;
+ ::std::optional< ::Color > m_aHeaderBackgroundColor;
+ ::std::optional< ::Color > m_aHeaderTextColor;
+ ::std::optional< ::Color > m_aActiveSelectionBackColor;
+ ::std::optional< ::Color > m_aInactiveSelectionBackColor;
+ ::std::optional< ::Color > m_aActiveSelectionTextColor;
+ ::std::optional< ::Color > m_aInactiveSelectionTextColor;
+ ::std::optional< ::Color > m_aTextColor;
+ ::std::optional< ::Color > m_aTextLineColor;
+ ::std::optional< ::std::vector< ::Color > > m_aRowColors;
VerticalAlignment m_eVerticalAlign;
bool bEnabled;
ModellListeners m_aListeners;
@@ -532,7 +532,7 @@ namespace svt::table
namespace
{
- void lcl_setColor( Any const & i_color, ::o3tl::optional< ::Color > & o_convertedColor )
+ void lcl_setColor( Any const & i_color, ::std::optional< ::Color > & o_convertedColor )
{
if ( !i_color.hasValue() )
o_convertedColor.reset();
@@ -552,7 +552,7 @@ namespace svt::table
}
- ::o3tl::optional< ::Color > UnoControlTableModel::getLineColor() const
+ ::std::optional< ::Color > UnoControlTableModel::getLineColor() const
{
DBG_CHECK_ME();
return m_pImpl->m_aGridLineColor;
@@ -566,7 +566,7 @@ namespace svt::table
}
- ::o3tl::optional< ::Color > UnoControlTableModel::getHeaderBackgroundColor() const
+ ::std::optional< ::Color > UnoControlTableModel::getHeaderBackgroundColor() const
{
DBG_CHECK_ME();
return m_pImpl->m_aHeaderBackgroundColor;
@@ -580,35 +580,35 @@ namespace svt::table
}
- ::o3tl::optional< ::Color > UnoControlTableModel::getHeaderTextColor() const
+ ::std::optional< ::Color > UnoControlTableModel::getHeaderTextColor() const
{
DBG_CHECK_ME();
return m_pImpl->m_aHeaderTextColor;
}
- ::o3tl::optional< ::Color > UnoControlTableModel::getActiveSelectionBackColor() const
+ ::std::optional< ::Color > UnoControlTableModel::getActiveSelectionBackColor() const
{
DBG_CHECK_ME();
return m_pImpl->m_aActiveSelectionBackColor;
}
- ::o3tl::optional< ::Color > UnoControlTableModel::getInactiveSelectionBackColor() const
+ ::std::optional< ::Color > UnoControlTableModel::getInactiveSelectionBackColor() const
{
DBG_CHECK_ME();
return m_pImpl->m_aInactiveSelectionBackColor;
}
- ::o3tl::optional< ::Color > UnoControlTableModel::getActiveSelectionTextColor() const
+ ::std::optional< ::Color > UnoControlTableModel::getActiveSelectionTextColor() const
{
DBG_CHECK_ME();
return m_pImpl->m_aActiveSelectionTextColor;
}
- ::o3tl::optional< ::Color > UnoControlTableModel::getInactiveSelectionTextColor() const
+ ::std::optional< ::Color > UnoControlTableModel::getInactiveSelectionTextColor() const
{
DBG_CHECK_ME();
return m_pImpl->m_aInactiveSelectionTextColor;
@@ -650,7 +650,7 @@ namespace svt::table
}
- ::o3tl::optional< ::Color > UnoControlTableModel::getTextColor() const
+ ::std::optional< ::Color > UnoControlTableModel::getTextColor() const
{
DBG_CHECK_ME();
return m_pImpl->m_aTextColor;
@@ -664,7 +664,7 @@ namespace svt::table
}
- ::o3tl::optional< ::Color > UnoControlTableModel::getTextLineColor() const
+ ::std::optional< ::Color > UnoControlTableModel::getTextLineColor() const
{
DBG_CHECK_ME();
return m_pImpl->m_aTextColor;
@@ -678,7 +678,7 @@ namespace svt::table
}
- ::o3tl::optional< ::std::vector< ::Color > > UnoControlTableModel::getRowBackgroundColors() const
+ ::std::optional< ::std::vector< ::Color > > UnoControlTableModel::getRowBackgroundColors() const
{
DBG_CHECK_ME();
return m_pImpl->m_aRowColors;
diff --git a/svtools/source/uno/unocontroltablemodel.hxx b/svtools/source/uno/unocontroltablemodel.hxx
index 8dddb1c27690..cbaae6b151bb 100644
--- a/svtools/source/uno/unocontroltablemodel.hxx
+++ b/svtools/source/uno/unocontroltablemodel.hxx
@@ -67,16 +67,16 @@ namespace svt { namespace table
virtual void getCellContent( ColPos const i_col, RowPos const i_row, css::uno::Any& o_cellContent ) override;
virtual void getCellToolTip( ColPos const i_col, RowPos const i_row, css::uno::Any & o_cellToolTip ) override;
virtual css::uno::Any getRowHeading( RowPos const i_rowPos ) const override;
- virtual ::o3tl::optional< ::Color > getLineColor() const override;
- virtual ::o3tl::optional< ::Color > getHeaderBackgroundColor() const override;
- virtual ::o3tl::optional< ::Color > getHeaderTextColor() const override;
- virtual ::o3tl::optional< ::Color > getActiveSelectionBackColor() const override;
- virtual ::o3tl::optional< ::Color > getInactiveSelectionBackColor() const override;
- virtual ::o3tl::optional< ::Color > getActiveSelectionTextColor() const override;
- virtual ::o3tl::optional< ::Color > getInactiveSelectionTextColor() const override;
- virtual ::o3tl::optional< ::Color > getTextColor() const override;
- virtual ::o3tl::optional< ::Color > getTextLineColor() const override;
- virtual ::o3tl::optional< ::std::vector< ::Color > >
+ virtual ::std::optional< ::Color > getLineColor() const override;
+ virtual ::std::optional< ::Color > getHeaderBackgroundColor() const override;
+ virtual ::std::optional< ::Color > getHeaderTextColor() const override;
+ virtual ::std::optional< ::Color > getActiveSelectionBackColor() const override;
+ virtual ::std::optional< ::Color > getInactiveSelectionBackColor() const override;
+ virtual ::std::optional< ::Color > getActiveSelectionTextColor() const override;
+ virtual ::std::optional< ::Color > getInactiveSelectionTextColor() const override;
+ virtual ::std::optional< ::Color > getTextColor() const override;
+ virtual ::std::optional< ::Color > getTextLineColor() const override;
+ virtual ::std::optional< ::std::vector< ::Color > >
getRowBackgroundColors() const override;
virtual css::style::VerticalAlignment
getVerticalAlign() const override;