summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 6845eec59551..4aebc8a0ebac 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -3230,6 +3230,7 @@ Any SAL_CALL ScDataPilotItemsObj::getByName( const OUString& aName )
{
SolarMutexGuard aGuard;
Reference<XNameAccess> xMembers = GetMembers();
+ Any aRet;
if (xMembers.is())
{
Reference<XIndexAccess> xMembersIndex(new ScNameToIndexAccess( xMembers ));
@@ -3240,13 +3241,16 @@ Any SAL_CALL ScDataPilotItemsObj::getByName( const OUString& aName )
{
Reference<XNamed> xMember(xMembersIndex->getByIndex(nItem), UNO_QUERY);
if (xMember.is() && (aName == xMember->getName()))
- return Any( Reference< XPropertySet >( GetObjectByIndex_Impl( nItem ) ) );
+ {
+ aRet = Any( Reference< XPropertySet >( GetObjectByIndex_Impl( nItem ) ) );
+ break;
+ }
++nItem;
}
if (!bFound)
throw NoSuchElementException();
}
- return Any();
+ return aRet;
}
Sequence<OUString> SAL_CALL ScDataPilotItemsObj::getElementNames()