summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-02 10:36:43 +0200
committerNoel Grandin <noelgrandin@gmail.com>2013-05-22 10:44:29 +0000
commit6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 (patch)
tree2746468845d6f1159e3759ee2cf7a620fca15b6e /sdext
parent697a007c61b9cabceb9767fad87cd5822b300452 (diff)
Use the new type-checking Reference constructor to reduce code noise
Also create a Clang compiler plugin to detect such cases. Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752 Reviewed-on: https://gerrit.libreoffice.org/4001 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/minimizer/graphiccollector.cxx18
-rw-r--r--sdext/source/presenter/PresenterViewFactory.cxx2
2 files changed, 7 insertions, 13 deletions
diff --git a/sdext/source/minimizer/graphiccollector.cxx b/sdext/source/minimizer/graphiccollector.cxx
index 13fcff570d09..b488ed85c606 100644
--- a/sdext/source/minimizer/graphiccollector.cxx
+++ b/sdext/source/minimizer/graphiccollector.cxx
@@ -283,14 +283,12 @@ void GraphicCollector::CollectGraphics( const Reference< XComponentContext >& rx
{
Reference< XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), UNO_QUERY_THROW );
ImpCollectBackgroundGraphic( rxMSF, xDrawPage, rGraphicSettings, rGraphicList );
- Reference< XShapes > xDrawShapes( xDrawPage, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xDrawShapes, rGraphicSettings, rGraphicList );
+ ImpCollectGraphicObjects( rxMSF, xDrawPage, rGraphicSettings, rGraphicList );
Reference< XPresentationPage > xPresentationPage( xDrawPage, UNO_QUERY_THROW );
Reference< XDrawPage > xNotesPage( xPresentationPage->getNotesPage() );
ImpCollectBackgroundGraphic( rxMSF, xNotesPage, rGraphicSettings, rGraphicList );
- Reference< XShapes > xNotesShapes( xNotesPage, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xNotesShapes, rGraphicSettings, rGraphicList );
+ ImpCollectGraphicObjects( rxMSF, xNotesPage, rGraphicSettings, rGraphicList );
}
Reference< XMasterPagesSupplier > xMasterPagesSupplier( rxModel, UNO_QUERY_THROW );
Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_QUERY_THROW );
@@ -298,8 +296,7 @@ void GraphicCollector::CollectGraphics( const Reference< XComponentContext >& rx
{
Reference< XDrawPage > xMasterPage( xMasterPages->getByIndex( i ), UNO_QUERY_THROW );
ImpCollectBackgroundGraphic( rxMSF, xMasterPage, rGraphicSettings, rGraphicList );
- Reference< XShapes > xMasterPageShapes( xMasterPage, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xMasterPageShapes, rGraphicSettings, rGraphicList );
+ ImpCollectGraphicObjects( rxMSF, xMasterPage, rGraphicSettings, rGraphicList );
}
std::vector< GraphicCollector::GraphicEntity >::iterator aGraphicIter( rGraphicList.begin() );
@@ -421,14 +418,12 @@ void GraphicCollector::CountGraphics( const Reference< XComponentContext >& rxMS
{
Reference< XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), UNO_QUERY_THROW );
ImpCountBackgroundGraphic( xDrawPage, rnGraphics );
- Reference< XShapes > xDrawShapes( xDrawPage, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xDrawShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxMSF, xDrawPage, rGraphicSettings, rnGraphics );
Reference< XPresentationPage > xPresentationPage( xDrawPage, UNO_QUERY_THROW );
Reference< XDrawPage > xNotesPage( xPresentationPage->getNotesPage() );
ImpCountBackgroundGraphic( xNotesPage, rnGraphics );
- Reference< XShapes > xNotesShapes( xNotesPage, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xNotesShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxMSF, xNotesPage, rGraphicSettings, rnGraphics );
}
Reference< XMasterPagesSupplier > xMasterPagesSupplier( rxModel, UNO_QUERY_THROW );
Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_QUERY_THROW );
@@ -436,8 +431,7 @@ void GraphicCollector::CountGraphics( const Reference< XComponentContext >& rxMS
{
Reference< XDrawPage > xMasterPage( xMasterPages->getByIndex( i ), UNO_QUERY_THROW );
ImpCountBackgroundGraphic( xMasterPage, rnGraphics );
- Reference< XShapes > xMasterPageShapes( xMasterPage, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xMasterPageShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxMSF, xMasterPage, rGraphicSettings, rnGraphics );
}
}
catch ( Exception& )
diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx
index 4ebc8fe59245..1e24207166fe 100644
--- a/sdext/source/presenter/PresenterViewFactory.cxx
+++ b/sdext/source/presenter/PresenterViewFactory.cxx
@@ -392,7 +392,7 @@ Reference<XResource> PresenterViewFactory::CreateView(
xView = NULL;
}
- return Reference<XResource>(xView, UNO_QUERY);
+ return xView;
}
Reference<XView> PresenterViewFactory::CreateSlideShowView(