summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-20 13:29:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-21 08:49:01 +0200
commit17db60eb46b31b6e4b7e664b01e6f7bb6a3016ab (patch)
treea2f64eca956aa2daf0e74de31bc2d419f769f2c0 /starmath
parent8a3912c8eb25d1acacbc0a18355f2ca75d418908 (diff)
loplugin:referencecasting in slideshow..svtools
Change-Id: Id0f0332d5d66c0bce309643bf42059b9bdc7d448 Reviewed-on: https://gerrit.libreoffice.org/75997 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/document.cxx5
-rw-r--r--starmath/source/mathmlexport.cxx6
-rw-r--r--starmath/source/mathmlimport.cxx5
-rw-r--r--starmath/source/view.cxx5
4 files changed, 8 insertions, 13 deletions
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index da0411cbd974..b8222e2c0a02 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -717,14 +717,13 @@ bool SmDocShell::Load( SfxMedium& rMedium )
if( SfxObjectShell::Load( rMedium ))
{
uno::Reference < embed::XStorage > xStorage = GetMedium()->GetStorage();
- uno::Reference < container::XNameAccess > xAccess (xStorage, uno::UNO_QUERY);
if (
(
- xAccess->hasByName( "content.xml" ) &&
+ xStorage->hasByName( "content.xml" ) &&
xStorage->isStreamElement( "content.xml" )
) ||
(
- xAccess->hasByName( "Content.xml" ) &&
+ xStorage->hasByName( "Content.xml" ) &&
xStorage->isStreamElement( "Content.xml" )
)
)
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index e5523c7ed122..aa850f62f29b 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -95,7 +95,7 @@ bool SmXMLExportWrapper::Export(SfxMedium &rMedium)
uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
//Get model
- uno::Reference< lang::XComponent > xModelComp(xModel, uno::UNO_QUERY );
+ uno::Reference< lang::XComponent > xModelComp = xModel;
bool bEmbedded = false;
uno::Reference <lang::XUnoTunnel> xTunnel(xModel,uno::UNO_QUERY);
@@ -263,10 +263,8 @@ bool SmXMLExportWrapper::WriteThroughComponent(
xSaxWriter->setOutputStream( xOutputStream );
// prepare arguments (prepend doc handler to given arguments)
- Reference<xml::sax::XDocumentHandler> xDocHandler( xSaxWriter,UNO_QUERY);
-
Sequence<Any> aArgs( 2 );
- aArgs[0] <<= xDocHandler;
+ aArgs[0] <<= xSaxWriter;
aArgs[1] <<= rPropSet;
// get filter component
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 4f9510aaac12..fcc4a6c45bd4 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -100,7 +100,7 @@ ErrCode SmXMLImportWrapper::Import(SfxMedium &rMedium)
uno::Reference<uno::XComponentContext> xContext( comphelper::getProcessComponentContext() );
//Make a model component from our SmModel
- uno::Reference< lang::XComponent > xModelComp( xModel, uno::UNO_QUERY );
+ uno::Reference< lang::XComponent > xModelComp = xModel;
OSL_ENSURE( xModelComp.is(), "XMLReader::Read: got no model" );
// try to get an XStatusIndicator from the Medium
@@ -366,8 +366,7 @@ ErrCode SmXMLImportWrapper::ReadThroughComponent(
// open stream (and set parser input)
OUString sStreamName = OUString::createFromAscii(pStreamName);
- uno::Reference < container::XNameAccess > xAccess( xStorage, uno::UNO_QUERY );
- if ( !xAccess->hasByName(sStreamName) || !xStorage->isStreamElement(sStreamName) )
+ if ( !xStorage->hasByName(sStreamName) || !xStorage->isStreamElement(sStreamName) )
{
// stream name not found! Then try the compatibility name.
// do we even have an alternative name?
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 96874023c9dc..195b4506bd54 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1330,10 +1330,9 @@ void SmViewShell::Insert( SfxMedium& rMedium )
bool bRet = false;
uno::Reference <embed::XStorage> xStorage = rMedium.GetStorage();
- uno::Reference <container::XNameAccess> xNameAccess(xStorage, uno::UNO_QUERY);
- if (xNameAccess.is() && xNameAccess->getElementNames().hasElements())
+ if (xStorage.is() && xStorage->getElementNames().hasElements())
{
- if (xNameAccess->hasByName("content.xml") || xNameAccess->hasByName("Content.xml"))
+ if (xStorage->hasByName("content.xml") || xStorage->hasByName("Content.xml"))
{
// is this a fabulous math package ?
Reference<css::frame::XModel> xModel(pDoc->GetModel());