summaryrefslogtreecommitdiff
path: root/xmloff
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 /xmloff
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 'xmloff')
-rw-r--r--xmloff/source/core/xmlimp.cxx2
-rw-r--r--xmloff/source/draw/shapeimport.cxx2
-rw-r--r--xmloff/source/forms/controlpropertymap.cxx2
3 files changed, 3 insertions, 3 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 23e7807c7157..77f24885b3c4 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -1984,7 +1984,7 @@ sal_Int32 SvXMLImport::getTokenFromName( const OUString& rName )
void SvXMLImport::initializeNamespaceMaps()
{
- auto mapTokenToNamespace = [&]( sal_Int32 nToken, sal_Int32 nPrefix, sal_Int32 nNamespace )
+ auto mapTokenToNamespace = []( sal_Int32 nToken, sal_Int32 nPrefix, sal_Int32 nNamespace )
{
if ( nToken >= 0 )
{
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 4fe64c9e1730..cc114a8f636b 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -626,7 +626,7 @@ void ShapeGroupContext::popGroupAndPostProcess()
}
bool bSorted = std::is_sorted(maZOrderList.begin(), maZOrderList.end(),
- [&](const ZOrderHint& rLeft, const ZOrderHint& rRight)
+ [](const ZOrderHint& rLeft, const ZOrderHint& rRight)
{ return rLeft.nShould < rRight.nShould; } );
if (bSorted)
diff --git a/xmloff/source/forms/controlpropertymap.cxx b/xmloff/source/forms/controlpropertymap.cxx
index 116e84cfd148..5e5cb97df607 100644
--- a/xmloff/source/forms/controlpropertymap.cxx
+++ b/xmloff/source/forms/controlpropertymap.cxx
@@ -93,7 +93,7 @@ namespace xmloff
for ( pEnd = aControlStyleProperties; pEnd->msApiName; ++pEnd)
;
assert( ::std::is_sorted(aControlStyleProperties, pEnd,
- [&](const XMLPropertyMapEntry& _rLeft, const XMLPropertyMapEntry& _rRight)
+ [](const XMLPropertyMapEntry& _rLeft, const XMLPropertyMapEntry& _rRight)
{ return strcmp(_rLeft.msApiName, _rRight.msApiName) < 0; }) );
bSorted = true;
}