Skip to content

Commit

Permalink
Drop ScDataPilotFieldObj::HasString
Browse files Browse the repository at this point in the history
Use comphelper::findValue instead

Change-Id: I59a3ef2781643dfdb7ecbfe578fb9e1faebb0c42
Reviewed-on: https://gerrit.libreoffice.org/76502
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
  • Loading branch information
qarkai committed Jul 29, 2019
1 parent d458ade commit 515cce5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
1 change: 0 additions & 1 deletion sc/inc/dapiuno.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ public:
void setGroupInfo(const css::sheet::DataPilotFieldGroupInfo* pInfo);

// XDataPilotFieldGrouping
static bool HasString(const css::uno::Sequence< OUString >& aItems, const OUString& aString);
virtual css::uno::Reference < css::sheet::XDataPilotField > SAL_CALL
createNameGroup(const css::uno::Sequence< OUString >& aItems) override;
virtual css::uno::Reference < css::sheet::XDataPilotField > SAL_CALL
Expand Down
17 changes: 1 addition & 16 deletions sc/source/ui/unoobj/dapiuno.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2458,21 +2458,6 @@ void ScDataPilotFieldObj::setGroupInfo( const DataPilotFieldGroupInfo* pInfo )
}
}

bool ScDataPilotFieldObj::HasString(const Sequence< OUString >& rItems, const OUString& aString)
{
bool bRet = false;

sal_Int32 nCount(rItems.getLength());
sal_Int32 nItem(0);
while (nItem < nCount && !bRet)
{
bRet = rItems[nItem] == aString;
++nItem;
}

return bRet;
}

// XDataPilotFieldGrouping
Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( const Sequence< OUString >& rItems )
{
Expand Down Expand Up @@ -2565,7 +2550,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons
{
const ScDPSaveGroupItem& rBaseGroup = pBaseGroupDim->GetGroupByIndex( nGroup );

if (!HasString(rItems, rBaseGroup.GetGroupName())) //! ignore case?
if (comphelper::findValue(rItems, rBaseGroup.GetGroupName()) == -1) //! ignore case?
{
// add an additional group for each item that is not in the selection
ScDPSaveGroupItem aGroup( rBaseGroup.GetGroupName() );
Expand Down

0 comments on commit 515cce5

Please sign in to comment.