summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-08-19 08:08:20 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-08-20 14:25:38 +0200
commit2bc1a0431becd1c6d4c888a6e301237dcecefd97 (patch)
treef1a10ef12eeb5e854c561f98abcc57cf32dd4f1f /filter
parent46d3fdeb4fa35e0575395a3a91213fd81fda0e50 (diff)
New loplugin:unusedcapturedefault
In sc/qa/unit/ucalc_formula.cxx, dropping the capture-default from the lExpectedinF lambda revealed that MSVC in C++17 mode (i.e., when building without --with-latest-c++) requires ROW_RANGE (a local const int variable from the enclosing TestFormula::testTdf97369) to be captured, even though all uses of that variable within the lambda body are constant expressions. That is still true at least for the latest Visual Studio 2019 version 16.11.1. (This is not an issue for the lExpectedinH and lExpectedinI lambdas a few lines further down, as they, in addition to using that ROW_RANGE, also use the local const double variables SHIFT1 and SHIFT2, whose uses are not constant expressions, so they are implicitly captured and loplugin:unusedcapturedefault does not suggest dropping those lambdas' capture-defaults in the first place.) Change-Id: Iee7efb485187cbe8eba6a2d470afca4993eb1816 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120693 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/msvbahelper.cxx2
-rw-r--r--filter/source/msfilter/util.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index d682eb954e85..254d31e0550a 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -673,7 +673,7 @@ KeyCodeEntry const aMSKeyCodesData[] = {
awt::KeyEvent parseKeyEvent( const OUString& Key )
{
- static std::map< OUString, sal_uInt16 > s_KeyCodes = [&]()
+ static std::map< OUString, sal_uInt16 > s_KeyCodes = []()
{
std::map< OUString, sal_uInt16 > tmp;
for (KeyCodeEntry const & i : aMSKeyCodesData)
diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index 2ee9bf6edb08..148f165d3fb1 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -1199,7 +1199,7 @@ struct {
const char* GetOOXMLPresetGeometry( const char* sShapeType )
{
typedef std::unordered_map< const char*, const char*, rtl::CStringHash, rtl::CStringEqual> CustomShapeTypeTranslationHashMap;
- static CustomShapeTypeTranslationHashMap aCustomShapeTypeTranslationHashMap = [&]()
+ static CustomShapeTypeTranslationHashMap aCustomShapeTypeTranslationHashMap = []()
{
CustomShapeTypeTranslationHashMap tmp;
for(const msfilter::util::CustomShapeTypeTranslationTable& i : pCustomShapeTypeTranslationTable)
@@ -1216,7 +1216,7 @@ const char* GetOOXMLPresetGeometry( const char* sShapeType )
MSO_SPT GETVMLShapeType(const OString& aType)
{
typedef std::unordered_map< const char*, MSO_SPT, rtl::CStringHash, rtl::CStringEqual> DMLToVMLTranslationHashMap;
- static DMLToVMLTranslationHashMap aDMLToVMLMap = [&]()
+ static DMLToVMLTranslationHashMap aDMLToVMLMap = []()
{
DMLToVMLTranslationHashMap tmp;
for (auto& i : pDMLToVMLTable)