diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-05-16 11:12:48 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-06-29 07:25:22 +0000 |
commit | e57314f61f67b093510c5a8a8f34a62126ba8734 (patch) | |
tree | 7991c3a6f20c93b752628528196022474c6b4a7f /cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx | |
parent | 371200675c2fb2fef0ac8362ebd7bf4203835440 (diff) |
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/ifcontainer/cppu_ifcontainer.cxx')
-rw-r--r-- | cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx | 19 |
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; |