diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-23 13:47:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-28 09:43:40 +0200 |
commit | 68e797402692c5c8abf1b2c4374e12a8d2707d07 (patch) | |
tree | d10643f2ce00efe809de0e9548a2c38943e2d11f /sc/source/filter/oox | |
parent | 5733cdba90b099637805648b193510268def74be (diff) |
new loplugin:optionalbool
which warns against using the 'operator bool' conversion of
std::optional<bool> which can lead to interesting bugs
The bugs that this plugin have been submitted independantly,
so this change is just using has_value() in relevant places.
Change-Id: I259b837feeecddcb8cd1d7e5db1e85bf505907cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155978
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter/oox')
-rw-r--r-- | sc/source/filter/oox/autofilterbuffer.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/filter/oox/autofilterbuffer.cxx b/sc/source/filter/oox/autofilterbuffer.cxx index ca0f031923a9..9c9328176095 100644 --- a/sc/source/filter/oox/autofilterbuffer.cxx +++ b/sc/source/filter/oox/autofilterbuffer.cxx @@ -773,7 +773,7 @@ void AutoFilter::finalizeImport( const Reference< XDatabaseRange >& rxDatabaseRa the global mode in obNeedsRegExp. If either one is still in don't-care state, all is fine. If both are set, they must be equal. */ - bool bRegExpCompatible = !obNeedsRegExp || !aSettings.mobNeedsRegExp || (obNeedsRegExp.value() == aSettings.mobNeedsRegExp.value()); + bool bRegExpCompatible = !obNeedsRegExp.has_value() || !aSettings.mobNeedsRegExp.has_value() || (obNeedsRegExp.value() == aSettings.mobNeedsRegExp.value()); // check whether fields are connected by 'or' (see comments above). if( rColumnFields.size() >= 2 ) |