diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-08-03 21:15:57 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-08-03 21:00:59 +0200 |
commit | 3ab2df3cf755ecd0e3e31ad06872426d24222c31 (patch) | |
tree | 0ed32557415ed2ce5d89c7f708071010ac94c37e /sc/source/core | |
parent | 30c551416d23ff09b8bfe09b69059c052c25c4e6 (diff) |
tdf#39593 Drop lcl_GetIndexFromName
Use comphelper::findValue instead
Change-Id: Id8490034b0f957084680fef18ba07974b5373fb2
Reviewed-on: https://gerrit.libreoffice.org/76896
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/dptabsrc.cxx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 0b3f79e35a0d..c72f34a559cc 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -24,6 +24,7 @@ #include <unordered_set> #include <vector> +#include <comphelper/sequence.hxx> #include <o3tl/any.hxx> #include <osl/diagnose.h> #include <rtl/math.hxx> @@ -589,17 +590,6 @@ static long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vecto return nTotal; } -static long lcl_GetIndexFromName( const OUString& rName, const uno::Sequence<OUString>& rElements ) -{ - long nCount = rElements.getLength(); - const OUString* pArray = rElements.getConstArray(); - for (long nPos=0; nPos<nCount; nPos++) - if (pArray[nPos] == rName) - return nPos; - - return -1; // not found -} - void ScDPSource::FillCalcInfo(bool bIsRow, ScDPTableData::CalcInfo& rInfo, bool &rHasAutoShow) { const std::vector<long>& rDims = bIsRow ? maRowDims : maColDims; @@ -796,8 +786,8 @@ void ScDPSource::CreateRes_Impl() eRefType == sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE || eRefType == sheet::DataPilotFieldReferenceType::RUNNING_TOTAL ) { - long nColumn = lcl_GetIndexFromName( - aDataRefValues.back().ReferenceField, GetDimensionsObject()->getElementNames()); + long nColumn = comphelper::findValue( + GetDimensionsObject()->getElementNames(), aDataRefValues.back().ReferenceField); if ( nColumn >= 0 ) { nDataRefOrient = GetOrientation(nColumn); |