From 5708534b942c1d0ce384f6a8473da6bb569410e7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 7 Jun 2018 13:03:58 +0200 Subject: look for unnecessary calls to Reference::is() after an UNO_QUERY_THROW Since the previous call would throw if there was nothing to be assigned to the value. Idea from tml. Used the following script to find places: git grep -A3 -n UNO_QUERY_THROW | grep -B3 -F 'is()' Change-Id: I36ba7b00bcd014bdf16c0455ab91056f82194969 Reviewed-on: https://gerrit.libreoffice.org/55417 Tested-by: Jenkins Reviewed-by: Tor Lillqvist Reviewed-by: Mike Kaganski --- test/source/container/xindexaccess.cxx | 2 -- test/source/container/xnamereplace.cxx | 1 - 2 files changed, 3 deletions(-) (limited to 'test/source/container') diff --git a/test/source/container/xindexaccess.cxx b/test/source/container/xindexaccess.cxx index c17942507fe5..3791e2b76393 100644 --- a/test/source/container/xindexaccess.cxx +++ b/test/source/container/xindexaccess.cxx @@ -48,8 +48,6 @@ void XIndexAccess::testGetByIndex() void XIndexAccess::testGetByIndexException() { uno::Reference< container::XIndexAccess > xIndexAccess(init(), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xIndexAccess.is()); - xIndexAccess->getByIndex(mnItems); } diff --git a/test/source/container/xnamereplace.cxx b/test/source/container/xnamereplace.cxx index 77badb46a0c2..cd2a05ae8f9a 100644 --- a/test/source/container/xnamereplace.cxx +++ b/test/source/container/xnamereplace.cxx @@ -22,7 +22,6 @@ void XNameReplace::testReplaceByName() xNameReplace->replaceByName(maTestReplacementName, getAnyElementForNameReplace()); Any aAny = xNameReplace->getByName( maTestReplacementName ); uno::Reference< uno::XInterface > xElement(aAny, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xElement.is()); } } -- cgit