summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-07 13:03:58 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2018-06-08 01:29:32 +0200
commit5708534b942c1d0ce384f6a8473da6bb569410e7 (patch)
tree2ec4fe87624541c15bf89c8b839e8f8dba8a89f4 /oox
parent1e55a47e89a9d9d6cf9cb3993484022aaf2c097b (diff)
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 <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx3
-rw-r--r--oox/source/export/drawingml.cxx2
-rw-r--r--oox/source/ppt/slidepersist.cxx2
3 files changed, 3 insertions, 4 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index d12827629794..c6f30fb5600a 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -230,8 +230,7 @@ bool lcl_isSeriesAttachedToFirstAxis(
{
sal_Int32 nAxisIndex = 0;
Reference< beans::XPropertySet > xProp( xDataSeries, uno::UNO_QUERY_THROW );
- if( xProp.is() )
- xProp->getPropertyValue("AttachedAxisIndex") >>= nAxisIndex;
+ xProp->getPropertyValue("AttachedAxisIndex") >>= nAxisIndex;
bResult = (0==nAxisIndex);
}
catch( const uno::Exception & )
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 25ea475b2ac4..a7657c67d394 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1393,7 +1393,7 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa
nRotation = nRotation * -1 + 36000;
uno::Reference<lang::XServiceInfo> xServiceInfo(rXShape, uno::UNO_QUERY_THROW);
- bool bIsGroupShape = (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"));
+ bool bIsGroupShape = xServiceInfo->supportsService("com.sun.star.drawing.GroupShape");
WriteTransformation(tools::Rectangle(Point(aPos.X, aPos.Y), Size(aSize.Width, aSize.Height)), nXmlNamespace,
bFlipHWrite, bFlipVWrite, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation), bIsGroupShape);
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 8d6abaab47e1..4f337500761c 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -205,7 +205,7 @@ void SlidePersist::applyTextStyles( const XmlFilterBase& rFilterBase )
Reference< container::XNameAccess > aXNameAccess( aXStyleFamiliesSupplier->getStyleFamilies() );
Reference< container::XNamed > aXNamed( mxPage, UNO_QUERY_THROW );
- if ( aXNameAccess.is() && aXNamed.is() )
+ if ( aXNameAccess.is() )
{
oox::drawingml::TextListStylePtr pTextListStylePtr;
OUString aStyle;