summaryrefslogtreecommitdiffstats
path: root/cppuhelper/qa
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-05-16 11:12:48 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-06-29 07:25:22 +0000
commite57314f61f67b093510c5a8a8f34a62126ba8734 (patch)
tree7991c3a6f20c93b752628528196022474c6b4a7f /cppuhelper/qa
parentdrop yet another reimplementation of rtl::Reference (SotMutexHolderRef) (diff)
downloadcore-e57314f61f67b093510c5a8a8f34a62126ba8734.tar.gz
core-e57314f61f67b093510c5a8a8f34a62126ba8734.zip
return and use std::vector from OInterfaceContainerHelper
since most of the time we don’t need a heavyweight uno::Sequence. Adds a new method getElementsAsVector(). Change-Id: I9e72bef0c0c723ffd0dd7d4152db5baec6784a7a Reviewed-on: https://gerrit.libreoffice.org/15747 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'cppuhelper/qa')
-rw-r--r--cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
index ff7c7925276c..e98aab205adc 100644
--- a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
+++ b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
@@ -112,12 +112,11 @@ namespace cppu_ifcontainer
pContainer->addInterface(xRef);
aListeners.push_back(xRef);
}
- Sequence< Reference< XInterface > > aElements;
- aElements = pContainer->getElements();
+ std::vector< Reference< XInterface > > aElements = pContainer->getElementsAsVector();
CPPUNIT_ASSERT_MESSAGE("query contents",
- (int)aElements.getLength() == nTests);
- if ((int)aElements.getLength() == nTests)
+ (int)aElements.size() == nTests);
+ if ((int)aElements.size() == nTests)
{
for (i = 0; i < nTests; i++)
{
@@ -157,8 +156,8 @@ namespace cppu_ifcontainer
pHelper = pContainer->getContainer(pTypes[i]);
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != NULL);
- Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
- CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 2);
+ std::vector<Reference< XInterface > > aSeq = pHelper->getElementsAsVector();
+ CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.size() == 2);
CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]);
CPPUNIT_ASSERT_MESSAGE("match", aSeq[1] == xRefs[i*2+1]);
}
@@ -175,8 +174,8 @@ namespace cppu_ifcontainer
pHelper = pContainer->getContainer(pTypes[i]);
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != NULL);
- Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
- CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 1);
+ std::vector<Reference< XInterface > > aSeq = pHelper->getElementsAsVector();
+ CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.size() == 1);
CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]);
}
@@ -191,8 +190,8 @@ namespace cppu_ifcontainer
pHelper = pContainer->getContainer(pTypes[i]);
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != NULL);
- Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
- CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 0);
+ std::vector<Reference< XInterface > > aSeq = pHelper->getElementsAsVector();
+ CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.size() == 0);
}
delete pContainer;