summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-20 18:27:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-21 08:51:00 +0200
commit3284309f19bc76f1778988c5314a795a95620e71 (patch)
treef8c4cee5861bccdfc4b86bc080bf988d3fe78c9f
parentf9b5657c4cff29f4a0cd65d2789e091f1297a152 (diff)
loplugin:referencecasting in xmloff
Change-Id: Iac3d56511aacec73bc38f57890c44145a4c13b85 Reviewed-on: https://gerrit.libreoffice.org/76034 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx17
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx15
-rw-r--r--xmloff/source/chart/SchXMLLegendContext.cxx2
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx10
-rw-r--r--xmloff/source/chart/SchXMLPropertyMappingContext.cxx2
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx8
-rw-r--r--xmloff/source/core/DocumentSettingsContext.cxx4
-rw-r--r--xmloff/source/core/RDFaImportHelper.cxx5
-rw-r--r--xmloff/source/core/SettingsExportHelper.cxx6
-rw-r--r--xmloff/source/core/xmlexp.cxx3
-rw-r--r--xmloff/source/draw/layerimp.cxx2
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx129
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx4
-rw-r--r--xmloff/source/draw/shapeexport.cxx7
-rw-r--r--xmloff/source/draw/ximpbody.cxx20
-rw-r--r--xmloff/source/draw/ximpstyl.cxx17
-rw-r--r--xmloff/source/forms/elementexport.cxx2
-rw-r--r--xmloff/source/meta/xmlversion.cxx10
-rw-r--r--xmloff/source/script/XMLEventExport.cxx5
-rw-r--r--xmloff/source/script/xmlbasici.cxx3
-rw-r--r--xmloff/source/table/XMLTableExport.cxx2
-rw-r--r--xmloff/source/text/XMLAutoTextEventExport.cxx3
-rw-r--r--xmloff/source/text/XMLTextShapeImportHelper.cxx2
-rw-r--r--xmloff/source/text/txtflde.cxx4
-rw-r--r--xmloff/source/text/txtfldi.cxx7
-rw-r--r--xmloff/source/text/txtimp.cxx2
-rw-r--r--xmloff/source/text/txtparae.cxx6
-rw-r--r--xmloff/source/text/txtparai.cxx6
-rw-r--r--xmloff/source/text/txtvfldi.cxx4
-rw-r--r--xmloff/source/xforms/SchemaRestrictionContext.cxx4
-rw-r--r--xmloff/source/xforms/xformsexport.cxx8
31 files changed, 123 insertions, 196 deletions
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index df143274ac32..5d38b50b1dce 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -436,7 +436,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
}
// set auto-styles for Area
- uno::Reference<beans::XPropertySet> xProp(mrImportHelper.GetChartDocument()->getArea(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xProp = mrImportHelper.GetChartDocument()->getArea();
mrImportHelper.FillAutoStyle(sAutoStyleName, xProp);
}
@@ -677,10 +677,9 @@ static void lcl_ApplyDataFromRectangularRangeToDiagram(
//work around wrong writer ranges ( see Issue 58464 )
{
OUString aChartOleObjectName;
- uno::Reference< frame::XModel > xModel(xNewDoc, uno::UNO_QUERY );
- if( xModel.is() )
+ if( xNewDoc.is() )
{
- utl::MediaDescriptor aMediaDescriptor( xModel->getArgs() );
+ utl::MediaDescriptor aMediaDescriptor( xNewDoc->getArgs() );
utl::MediaDescriptor::const_iterator aIt(
aMediaDescriptor.find( OUString( "HierarchicalDocumentName" )));
@@ -823,7 +822,7 @@ void SchXMLChartContext::EndElement()
if( xNewDoc->hasInternalDataProvider() )
SchXMLTableHelper::applyTableToInternalDataProvider( maTable, xNewDoc );
- bool bOlderThan2_3 = SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan2_3( Reference< frame::XModel >( xNewDoc, uno::UNO_QUERY ));
+ bool bOlderThan2_3 = SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan2_3( xNewDoc );
bool bOldFileWithOwnDataFromRows = (bOlderThan2_3 && bHasOwnData && (meDataRowSource==chart::ChartDataRowSource_ROWS)); // in this case there are range addresses that are simply wrong.
if( mbAllRangeAddressesAvailable && !bSpecialHandlingForDonutChart && !mbIsStockChart &&
@@ -886,7 +885,7 @@ void SchXMLChartContext::EndElement()
, SchXMLSeriesHelper::getDataSeriesIndexMapFromDiagram(xNewDiagram) );
}
- SchXMLSeries2Context::initSeriesPropertySets( maSeriesDefaultsAndStyles, uno::Reference< frame::XModel >(xDoc, uno::UNO_QUERY ) );
+ SchXMLSeries2Context::initSeriesPropertySets( maSeriesDefaultsAndStyles, xDoc );
//set defaults from diagram to the new series:
//check whether we need to remove lines from symbol only charts
@@ -1056,7 +1055,7 @@ SvXMLImportContextRef SchXMLChartContext::CreateChildContext(
{
xProp->setPropertyValue("HasMainTitle", uno::makeAny(true) );
}
- uno::Reference< drawing::XShape > xTitleShape( xDoc->getTitle(), uno::UNO_QUERY );
+ uno::Reference< drawing::XShape > xTitleShape = xDoc->getTitle();
pContext = new SchXMLTitleContext( mrImportHelper, GetImport(),
rLocalName, maMainTitle, xTitleShape );
}
@@ -1069,7 +1068,7 @@ SvXMLImportContextRef SchXMLChartContext::CreateChildContext(
{
xProp->setPropertyValue("HasSubTitle", uno::makeAny(true) );
}
- uno::Reference< drawing::XShape > xTitleShape( xDoc->getSubTitle(), uno::UNO_QUERY );
+ uno::Reference< drawing::XShape > xTitleShape = xDoc->getSubTitle();
pContext = new SchXMLTitleContext( mrImportHelper, GetImport(),
rLocalName, maSubTitle, xTitleShape );
}
@@ -1117,7 +1116,7 @@ SvXMLImportContextRef SchXMLChartContext::CreateChildContext(
{
uno::Reference< drawing::XDrawPageSupplier > xSupp( xDoc, uno::UNO_QUERY );
if( xSupp.is())
- mxDrawPage.set( xSupp->getDrawPage(), uno::UNO_QUERY );
+ mxDrawPage = xSupp->getDrawPage();
SAL_WARN_IF( !mxDrawPage.is(), "xmloff.chart", "Invalid Chart Page" );
}
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 46214498958b..c898c9514fdc 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -1149,7 +1149,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >
// get property states for autostyles
if( mxExpPropMapper.is())
{
- Reference< beans::XPropertySet > xPropSet( rChartDoc->getArea(), uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xPropSet = rChartDoc->getArea();
if( xPropSet.is())
aPropertyStates = mxExpPropMapper->Filter( xPropSet );
}
@@ -1448,7 +1448,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >
SAL_WARN_IF( !xSupplier.is(), "xmloff.chart", "Cannot retrieve draw page to initialize shape export" );
if( xSupplier.is() )
{
- Reference< drawing::XShapes > xDrawPage( xSupplier->getDrawPage(), uno::UNO_QUERY );
+ Reference< drawing::XShapes > xDrawPage = xSupplier->getDrawPage();
SAL_WARN_IF( !xDrawPage.is(), "xmloff.chart", "Invalid draw page for initializing shape export" );
if( xDrawPage.is())
mrExport.GetShapeExport()->seekShapes( xDrawPage );
@@ -1856,11 +1856,10 @@ void SchXMLExportHelper_Impl::exportPlotArea(
}
// attributes
- Reference< drawing::XShape > xShape ( xDiagram, uno::UNO_QUERY );
- if( xShape.is())
+ if( xDiagram.is())
{
- addPosition( xShape );
- addSize( xShape );
+ addPosition( xDiagram );
+ addSize( xDiagram );
}
bool bIs3DChart = false;
@@ -1996,7 +1995,7 @@ void SchXMLExportHelper_Impl::exportPlotArea(
// remove property states for autostyles
aPropertyStates.clear();
- Reference< beans::XPropertySet > xWallPropSet( xWallFloorSupplier->getWall(), uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xWallPropSet = xWallFloorSupplier->getWall();
if( xWallPropSet.is())
{
aPropertyStates = mxExpPropMapper->Filter( xWallPropSet );
@@ -2022,7 +2021,7 @@ void SchXMLExportHelper_Impl::exportPlotArea(
// remove property states for autostyles
aPropertyStates.clear();
- Reference< beans::XPropertySet > xFloorPropSet( xWallFloorSupplier->getFloor(), uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xFloorPropSet = xWallFloorSupplier->getFloor();
if( xFloorPropSet.is())
{
aPropertyStates = mxExpPropMapper->Filter( xFloorPropSet );
diff --git a/xmloff/source/chart/SchXMLLegendContext.cxx b/xmloff/source/chart/SchXMLLegendContext.cxx
index 1f0f25f2c138..c1c3da637a5d 100644
--- a/xmloff/source/chart/SchXMLLegendContext.cxx
+++ b/xmloff/source/chart/SchXMLLegendContext.cxx
@@ -106,7 +106,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
}
}
- uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY );
+ uno::Reference< drawing::XShape > xLegendShape = xDoc->getLegend();
uno::Reference< beans::XPropertySet > xLegendProps( xLegendShape, uno::UNO_QUERY );
if( !xLegendShape.is() || !xLegendProps.is() )
{
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 1cf2785030a1..342fd37bdb90 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -170,7 +170,7 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext(
m_rbHasRangeAtPlotArea = false;
// get Diagram
- uno::Reference< chart::XChartDocument > xDoc( rImpHelper.GetChartDocument(), uno::UNO_QUERY );
+ uno::Reference< chart::XChartDocument > xDoc = rImpHelper.GetChartDocument();
if( xDoc.is())
{
mxDiagram = xDoc->getDiagram();
@@ -785,10 +785,9 @@ void SchXMLWallFloorContext::StartElement( const uno::Reference< xml::sax::XAttr
}
// set properties
- uno::Reference< beans::XPropertySet > xProp( ( meContextType == CONTEXT_TYPE_WALL )
+ uno::Reference< beans::XPropertySet > xProp = ( meContextType == CONTEXT_TYPE_WALL )
? mxWallFloorSupplier->getWall()
- : mxWallFloorSupplier->getFloor(),
- uno::UNO_QUERY );
+ : mxWallFloorSupplier->getFloor();
if (!sAutoStyleName.isEmpty())
mrImportHelper.FillAutoStyle(sAutoStyleName, xProp);
@@ -1106,8 +1105,7 @@ void SchXMLStatisticsObjectContext::StartElement( const uno::Reference< xml::sax
{
aStyle.meType = DataRowPointStyle::ERROR_INDICATOR;
- uno::Reference< lang::XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory(),
- uno::UNO_QUERY );
+ uno::Reference< lang::XMultiServiceFactory > xFact = comphelper::getProcessServiceFactory();
uno::Reference< beans::XPropertySet > xBarProp( xFact->createInstance("com.sun.star.chart2.ErrorBar" ),
uno::UNO_QUERY );
diff --git a/xmloff/source/chart/SchXMLPropertyMappingContext.cxx b/xmloff/source/chart/SchXMLPropertyMappingContext.cxx
index 1319704669af..7f193316cb69 100644
--- a/xmloff/source/chart/SchXMLPropertyMappingContext.cxx
+++ b/xmloff/source/chart/SchXMLPropertyMappingContext.cxx
@@ -111,7 +111,7 @@ void SchXMLPropertyMappingContext::StartElement(const uno::Reference< xml::sax::
createAndAddSequenceToSeries(aRole, aRange, xChartDoc, mxDataSeries);
mrLSequencesPerIndex.emplace(
tSchXMLIndexWithPart( 0, SCH_XML_PART_VALUES),
- Reference< chart2::data::XLabeledDataSequence >( xSeq, UNO_QUERY ));
+ xSeq);
}
}
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 857e47435c5c..9b2af97f4c33 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -846,7 +846,7 @@ void SchXMLSeries2Context::setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDe
if( bIsStockChart )
{
if( SchXMLSeriesHelper::isCandleStickSeries( seriesStyle.m_xSeries
- , uno::Reference< frame::XModel >( rImportHelper.GetChartDocument(), uno::UNO_QUERY ) ) )
+ , rImportHelper.GetChartDocument() ) )
bIsMinMaxSeries = true;
}
if( !bIsMinMaxSeries )
@@ -913,7 +913,7 @@ void SchXMLSeries2Context::setStylesToRegressionCurves(
if( !aServiceName.isEmpty() )
{
- Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
+ Reference< lang::XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory();
Reference< chart2::XRegressionCurve > xRegCurve( xMSF->createInstance( aServiceName ), uno::UNO_QUERY_THROW );
Reference< chart2::XRegressionCurveContainer > xRegCurveCont( regressionStyle.m_xSeries, uno::UNO_QUERY_THROW );
@@ -1028,7 +1028,7 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri
//... todo ...
if( bIsStockChart )
{
- if( SchXMLSeriesHelper::isCandleStickSeries( seriesStyle.m_xSeries, uno::Reference< frame::XModel >( rImportHelper.GetChartDocument(), uno::UNO_QUERY ) ) )
+ if( SchXMLSeriesHelper::isCandleStickSeries( seriesStyle.m_xSeries, rImportHelper.GetChartDocument() ) )
continue;
}
@@ -1039,7 +1039,7 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri
{
uno::Reference< beans::XPropertySet > xPointProp(
SchXMLSeriesHelper::createOldAPIDataPointPropertySet( seriesStyle.m_xSeries, seriesStyle.m_nPointIndex + i
- , uno::Reference< frame::XModel >( rImportHelper.GetChartDocument(), uno::UNO_QUERY ) ) );
+ , rImportHelper.GetChartDocument() ) );
if( !xPointProp.is() )
continue;
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index 305d1d94853b..27d242abe19e 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -692,7 +692,7 @@ void XMLConfigItemMapIndexedContext::EndElement()
if( xForbChars.is() )
{
- uno::Reference< container::XIndexAccess > xIndex( maProps.GetIndexContainer(), uno::UNO_QUERY );
+ uno::Reference< container::XIndexAccess > xIndex = maProps.GetIndexContainer();
const sal_Int32 nCount = xIndex->getCount();
uno::Sequence < beans::PropertyValue > aProps;
@@ -764,7 +764,7 @@ void XMLConfigItemMapIndexedContext::EndElement()
}
else if ( maConfigItemName == "Symbols" )
{
- uno::Reference< container::XIndexAccess > xIndex( maProps.GetIndexContainer(), uno::UNO_QUERY );
+ uno::Reference< container::XIndexAccess > xIndex = maProps.GetIndexContainer();
const sal_Int32 nCount = xIndex->getCount();
uno::Sequence < beans::PropertyValue > aProps;
diff --git a/xmloff/source/core/RDFaImportHelper.cxx b/xmloff/source/core/RDFaImportHelper.cxx
index d2255d17640b..4ee20b4e478b 100644
--- a/xmloff/source/core/RDFaImportHelper.cxx
+++ b/xmloff/source/core/RDFaImportHelper.cxx
@@ -295,12 +295,11 @@ RDFaInserter::MakeResource( OUString const & i_rResource)
OUString name( i_rResource.copy(2) );
const uno::Reference< rdf::XBlankNode > xBNode( LookupBlankNode(name) );
SAL_WARN_IF(!xBNode.is(), "xmloff.core", "no blank node?");
- return uno::Reference<rdf::XResource>( xBNode, uno::UNO_QUERY);
+ return xBNode;
}
else
{
- return uno::Reference<rdf::XResource>( MakeURI( i_rResource ),
- uno::UNO_QUERY);
+ return MakeURI( i_rResource );
}
}
diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx
index 9a5c58ab6712..4defc9d35049 100644
--- a/xmloff/source/core/SettingsExportHelper.cxx
+++ b/xmloff/source/core/SettingsExportHelper.cxx
@@ -331,8 +331,7 @@ void XMLSettingsExportHelper::exportSymbolDescriptors(
xBox->insertByIndex(nIndex, uno::makeAny( aSequence ));
}
- uno::Reference< container::XIndexAccess > xIA( xBox, uno::UNO_QUERY );
- exportIndexAccess( xIA, rName );
+ exportIndexAccess( xBox, rName );
}
void XMLSettingsExportHelper::exportbase64Binary(
const uno::Sequence<sal_Int8>& aProps,
@@ -460,8 +459,7 @@ void XMLSettingsExportHelper::exportForbiddenCharacters(
}
}
- uno::Reference< container::XIndexAccess > xIA( xBox, uno::UNO_QUERY );
- exportIndexAccess( xIA, rName );
+ exportIndexAccess( xBox, rName );
}
void XMLSettingsExportHelper::exportAllSettings(
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 702d75231015..2ca4a01fd0a3 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1499,8 +1499,7 @@ void SvXMLExport::ExportScripts_()
Reference < XDocumentHandler > xHdl( new XMLBasicExportFilter( mxHandler ) );
Reference< document::XXMLBasicExporter > xExporter = document::XMLOasisBasicExporter::createWithHandler( m_xContext, xHdl );
- Reference< XComponent > xComp( mxModel, UNO_QUERY );
- xExporter->setSourceDocument( xComp );
+ xExporter->setSourceDocument( mxModel );
Sequence< PropertyValue > aMediaDesc( 0 );
xExporter->filter( aMediaDesc );
}
diff --git a/xmloff/source/draw/layerimp.cxx b/xmloff/source/draw/layerimp.cxx
index 13071e600246..abad8cf7a938 100644
--- a/xmloff/source/draw/layerimp.cxx
+++ b/xmloff/source/draw/layerimp.cxx
@@ -125,7 +125,7 @@ void SdXMLLayerContext::EndElement()
{
Reference< XLayerManager > xLayerManager( mxLayerManager, UNO_QUERY );
if( xLayerManager.is() )
- xLayer.set( xLayerManager->insertNewByIndex( xLayerManager->getCount() ), UNO_QUERY );
+ xLayer = xLayerManager->insertNewByIndex( xLayerManager->getCount() );
SAL_WARN_IF( !xLayer.is(), "xmloff", "xmloff::SdXMLLayerContext::EndElement(), failed to create new XLayer!" );
if( xLayer.is() )
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index f16050f08243..2ab0161e8b5e 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -446,7 +446,7 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
Reference < drawing::XMasterPagesSupplier > xMasterPagesSupplier(GetModel(), UNO_QUERY);
if(xMasterPagesSupplier.is())
{
- mxDocMasterPages.set(xMasterPagesSupplier->getMasterPages(), css::uno::UNO_QUERY);
+ mxDocMasterPages = xMasterPagesSupplier->getMasterPages();
if(mxDocMasterPages.is())
{
mnDocMasterPageCount = mxDocMasterPages->getCount();
@@ -458,7 +458,7 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
Reference <XDrawPagesSupplier> xDrawPagesSupplier(GetModel(), UNO_QUERY);
if(xDrawPagesSupplier.is())
{
- mxDocDrawPages.set(xDrawPagesSupplier->getDrawPages(), css::uno::UNO_QUERY);
+ mxDocDrawPages = xDrawPagesSupplier->getDrawPages();
if(mxDocDrawPages.is())
{
mnDocDrawPageCount = mxDocDrawPages->getCount();
@@ -485,14 +485,8 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
if(xHandoutSupp.is())
{
Reference<XDrawPage> xHandoutPage(xHandoutSupp->getHandoutMasterPage());
- if(xHandoutPage.is())
- {
- Reference<drawing::XShapes> xShapes(xHandoutPage, UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- {
- mnObjectCount += ImpRecursiveObjectCount(xShapes);
- }
- }
+ if(xHandoutPage.is() && xHandoutPage->getCount())
+ mnObjectCount += ImpRecursiveObjectCount(xHandoutPage);
}
}
@@ -515,14 +509,8 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
if((aAny >>= xPresPage) && xPresPage.is())
{
Reference<XDrawPage> xNotesPage(xPresPage->getNotesPage());
- if(xNotesPage.is())
- {
- Reference<drawing::XShapes> xShapes(xNotesPage, UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- {
- mnObjectCount += ImpRecursiveObjectCount(xShapes);
- }
- }
+ if(xNotesPage.is() && xNotesPage->getCount())
+ mnObjectCount += ImpRecursiveObjectCount(xNotesPage);
}
}
}
@@ -547,14 +535,8 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
if((aAny >>= xPresPage) && xPresPage.is())
{
Reference<XDrawPage> xNotesPage(xPresPage->getNotesPage());
- if(xNotesPage.is())
- {
- Reference<drawing::XShapes> xShapes(xNotesPage, UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- {
- mnObjectCount += ImpRecursiveObjectCount(xShapes);
- }
- }
+ if(xNotesPage.is() && xNotesPage->getCount())
+ mnObjectCount += ImpRecursiveObjectCount(xNotesPage);
}
}
}
@@ -1787,9 +1769,8 @@ void SdXMLExport::ExportContent_()
exportFormsElement( xDrawPage );
// write graphic objects on this page (if any)
- Reference< drawing::XShapes > xExportShapes(xDrawPage, UNO_QUERY);
- if(xExportShapes.is() && xExportShapes->getCount())
- GetShapeExport()->exportShapes( xExportShapes );
+ if(xDrawPage.is() && xDrawPage->getCount())
+ GetShapeExport()->exportShapes( xDrawPage );
// write animations and presentation notes (ONLY if presentation)
if(IsImpress())
@@ -1816,23 +1797,19 @@ void SdXMLExport::ExportContent_()
Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
if(xNotesPage.is())
{
- Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
- if(xShapes.is())
- {
- if( !maDrawNotesPagesStyleNames[nPageInd].isEmpty() )
- AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, maDrawNotesPagesStyleNames[nPageInd]);
+ if( !maDrawNotesPagesStyleNames[nPageInd].isEmpty() )
+ AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, maDrawNotesPagesStyleNames[nPageInd]);
- ImplExportHeaderFooterDeclAttributes( maDrawNotesPagesHeaderFooterSettings[nPageInd] );
+ ImplExportHeaderFooterDeclAttributes( maDrawNotesPagesHeaderFooterSettings[nPageInd] );
- // write presentation notes
- SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, true, true);
+ // write presentation notes
+ SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, true, true);
- // write optional office:forms
- exportFormsElement( xNotesPage );
+ // write optional office:forms
+ exportFormsElement( xNotesPage );
- // write shapes per se
- GetShapeExport()->exportShapes( xShapes );
- }
+ // write shapes per se
+ GetShapeExport()->exportShapes( xNotesPage );
}
}
}
@@ -2104,12 +2081,8 @@ void SdXMLExport::collectAutoStyles()
if( xHandoutSupp.is() )
{
Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
- if( xHandoutPage.is() )
- {
- Reference< drawing::XShapes > xShapes(xHandoutPage, UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- GetShapeExport()->collectShapesAutoStyles( xShapes );
- }
+ if( xHandoutPage.is() && xHandoutPage->getCount())
+ GetShapeExport()->collectShapesAutoStyles( xHandoutPage );
}
}
@@ -2136,9 +2109,8 @@ void SdXMLExport::collectAutoStyles()
}
GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
- Reference< drawing::XShapes > xMasterShapes(xMasterPage, UNO_QUERY);
- if(xMasterShapes.is() && xMasterShapes->getCount())
- GetShapeExport()->collectShapesAutoStyles( xMasterShapes );
+ if(xMasterPage.is() && xMasterPage->getCount())
+ GetShapeExport()->collectShapesAutoStyles( xMasterPage );
if(IsImpress())
{
@@ -2151,9 +2123,8 @@ void SdXMLExport::collectAutoStyles()
// collect layer information
GetFormExport()->examineForms( xNotesPage );
- Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- GetShapeExport()->collectShapesAutoStyles( xShapes );
+ if(xNotesPage->getCount())
+ GetShapeExport()->collectShapesAutoStyles( xNotesPage );
}
}
}
@@ -2203,9 +2174,8 @@ void SdXMLExport::collectAutoStyles()
GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
// prepare object infos
- Reference< drawing::XShapes > xDrawShapes(xDrawPage, UNO_QUERY);
- if(xDrawShapes.is() && xDrawShapes->getCount())
- GetShapeExport()->collectShapesAutoStyles( xDrawShapes );
+ if(xDrawPage.is() && xDrawPage->getCount())
+ GetShapeExport()->collectShapesAutoStyles( xDrawPage );
// prepare presentation notes page object infos (ONLY if presentation)
if(IsImpress())
@@ -2219,9 +2189,8 @@ void SdXMLExport::collectAutoStyles()
// collect layer information
GetFormExport()->examineForms( xNotesPage );
- Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- GetShapeExport()->collectShapesAutoStyles( xShapes );
+ if(xNotesPage->getCount())
+ GetShapeExport()->collectShapesAutoStyles( xNotesPage );
}
}
}
@@ -2301,9 +2270,8 @@ void SdXMLExport::ExportMasterStyles_()
SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, XML_HANDOUT_MASTER, true, true);
// write graphic objects on this master page (if any)
- Reference< drawing::XShapes > xShapes(xHandoutPage, UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- GetShapeExport()->exportShapes( xShapes );
+ if(xHandoutPage.is() && xHandoutPage->getCount())
+ GetShapeExport()->exportShapes( xHandoutPage );
}
}
}
@@ -2348,9 +2316,8 @@ void SdXMLExport::ExportMasterStyles_()
exportFormsElement( xMasterPage );
// write graphic objects on this master page (if any)
- Reference< drawing::XShapes > xMasterShapes(xMasterPage, UNO_QUERY);
- if(xMasterShapes.is() && xMasterShapes->getCount())
- GetShapeExport()->exportShapes( xMasterShapes );
+ if(xMasterPage.is() && xMasterPage->getCount())
+ GetShapeExport()->exportShapes( xMasterPage );
// write presentation notes (ONLY if presentation)
if(IsImpress())
@@ -2361,25 +2328,21 @@ void SdXMLExport::ExportMasterStyles_()
Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
if(xNotesPage.is())
{
- Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
- if(xShapes.is())
+ ImpXMLEXPPageMasterInfo* pMasterInfo = mvNotesPageMasterUsageList.at( nMPageId );
+ if(pMasterInfo)
{
- ImpXMLEXPPageMasterInfo* pMasterInfo = mvNotesPageMasterUsageList.at( nMPageId );
- if(pMasterInfo)
- {
- const OUString& sString = pMasterInfo->GetName();
- AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString);
- }
+ const OUString& sString = pMasterInfo->GetName();
+ AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString);
+ }
- // write presentation notes
- SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, true, true);
+ // write presentation notes
+ SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, true, true);
- // write optional office:forms
- exportFormsElement( xNotesPage );
+ // write optional office:forms
+ exportFormsElement( xNotesPage );
- // write shapes per se
- GetShapeExport()->exportShapes( xShapes );
- }
+ // write shapes per se
+ GetShapeExport()->exportShapes( xNotesPage );
}
}
}
@@ -2503,7 +2466,7 @@ OUString SdXMLExport::getNavigationOrder( const Reference< XDrawPage >& xDrawPag
Reference< XPropertySet > xSet( xDrawPage, UNO_QUERY_THROW );
Reference< XIndexAccess > xNavOrder( xSet->getPropertyValue("NavigationOrder"), UNO_QUERY_THROW );
- Reference< XIndexAccess > xZOrderAccess( xDrawPage, UNO_QUERY );
+ Reference< XIndexAccess > xZOrderAccess = xDrawPage;
// only export navigation order if it is different from the z-order
if( (xNavOrder.get() != xZOrderAccess.get()) && (xNavOrder->getCount() == xDrawPage->getCount()) )
@@ -2734,7 +2697,7 @@ XMLFontAutoStylePool* SdXMLExport::CreateFontAutoStylePool()
if (xFactory.is())
xProps.set(xFactory->createInstance("com.sun.star.document.Settings"), UNO_QUERY);
if (xProps.is())
- xInfo.set(xProps->getPropertySetInfo(), uno::UNO_QUERY);
+ xInfo = xProps->getPropertySetInfo();
if (xInfo.is() && xProps.is())
{
if (xInfo->hasPropertyByName("EmbedFonts"))
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index 98f23ab34b74..d161d68d657b 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -399,14 +399,14 @@ void SAL_CALL SdXMLImport::setTargetDocument( const uno::Reference< lang::XCompo
// prepare access to master pages
uno::Reference < drawing::XMasterPagesSupplier > xMasterPagesSupplier(GetModel(), uno::UNO_QUERY);
if(xMasterPagesSupplier.is())
- mxDocMasterPages.set(xMasterPagesSupplier->getMasterPages(), css::uno::UNO_QUERY);
+ mxDocMasterPages = xMasterPagesSupplier->getMasterPages();
// prepare access to draw pages
uno::Reference <drawing::XDrawPagesSupplier> xDrawPagesSupplier(GetModel(), uno::UNO_QUERY);
if(!xDrawPagesSupplier.is())
throw lang::IllegalArgumentException();
- mxDocDrawPages.set(xDrawPagesSupplier->getDrawPages(), css::uno::UNO_QUERY);
+ mxDocDrawPages = xDrawPagesSupplier->getDrawPages();
if(!mxDocDrawPages.is())
throw lang::IllegalArgumentException();
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 89a40effd932..b56f99bc3359 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -1062,10 +1062,9 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x
// set in every case, so init here
eShapeType = XmlShapeTypeUnknown;
- uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xShape, uno::UNO_QUERY);
- if(xShapeDescriptor.is())
+ if(xShape.is())
{
- OUString aType(xShapeDescriptor->getShapeType());
+ OUString aType(xShape->getShapeType());
if(aType.match("com.sun.star."))
{
@@ -1576,7 +1575,7 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x
if( !xEventsSupplier.is() )
return;
- uno::Reference< container::XNameAccess > xEvents( xEventsSupplier->getEvents(), uno::UNO_QUERY );
+ uno::Reference< container::XNameAccess > xEvents = xEventsSupplier->getEvents();
SAL_WARN_IF( !xEvents.is(), "xmloff", "XEventsSupplier::getEvents() returned NULL" );
if( !xEvents.is() )
return;
diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx
index de7a9cac23d1..7dac691723d2 100644
--- a/xmloff/source/draw/ximpbody.cxx
+++ b/xmloff/source/draw/ximpbody.cxx
@@ -231,15 +231,11 @@ SvXMLImportContextRef SdXMLDrawPageContext::CreateChildContext( sal_uInt16 nPref
uno::Reference< presentation::XPresentationPage > xPresPage(GetLocalShapesContext(), uno::UNO_QUERY);
if(xPresPage.is())
{
- uno::Reference< drawing::XDrawPage > xNotesDrawPage(xPresPage->getNotesPage(), uno::UNO_QUERY);
+ uno::Reference< drawing::XDrawPage > xNotesDrawPage = xPresPage->getNotesPage();
if(xNotesDrawPage.is())
{
- uno::Reference< drawing::XShapes > xNewShapes(xNotesDrawPage, uno::UNO_QUERY);
- if(xNewShapes.is())
- {
- // presentation:notes inside draw:page context
- xContext = new SdXMLNotesContext( GetSdImport(), nPrefix, rLocalName, xAttrList, xNewShapes);
- }
+ // presentation:notes inside draw:page context
+ xContext = new SdXMLNotesContext( GetSdImport(), nPrefix, rLocalName, xAttrList, xNotesDrawPage);
}
}
}
@@ -342,13 +338,9 @@ SvXMLImportContextRef SdXMLBodyContext::CreateChildContext(
if(xNewDrawPage.is())
{
- uno::Reference< drawing::XShapes > xNewShapes(xNewDrawPage, uno::UNO_QUERY);
- if(xNewShapes.is())
- {
- // draw:page inside office:body context
- xContext = new SdXMLDrawPageContext(GetSdImport(), nPrefix, rLocalName, xAttrList,
- xNewShapes);
- }
+ // draw:page inside office:body context
+ xContext = new SdXMLDrawPageContext(GetSdImport(), nPrefix, rLocalName, xAttrList,
+ xNewDrawPage);
}
}
break;
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 01f0f3e9e659..4259097e9540 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -855,15 +855,11 @@ SvXMLImportContextRef SdXMLMasterPageContext::CreateChildContext(
uno::Reference< presentation::XPresentationPage > xPresPage(GetLocalShapesContext(), uno::UNO_QUERY);
if(xPresPage.is())
{
- uno::Reference< drawing::XDrawPage > xNotesDrawPage(xPresPage->getNotesPage(), uno::UNO_QUERY);
+ uno::Reference< drawing::XDrawPage > xNotesDrawPage = xPresPage->getNotesPage();
if(xNotesDrawPage.is())
{
- uno::Reference< drawing::XShapes > xNewShapes(xNotesDrawPage, uno::UNO_QUERY);
- if(xNewShapes.is())
- {
- // presentation:notes inside master-page context
- xContext = new SdXMLNotesContext( GetSdImport(), nPrefix, rLocalName, xAttrList, xNewShapes);
- }
+ // presentation:notes inside master-page context
+ xContext = new SdXMLNotesContext( GetSdImport(), nPrefix, rLocalName, xAttrList, xNotesDrawPage);
}
}
}
@@ -1417,12 +1413,11 @@ SvXMLImportContextRef SdXMLMasterStylesContext::CreateChildContext(
if(xNewMasterPage.is())
{
- uno::Reference< drawing::XShapes > xNewShapes(xNewMasterPage, uno::UNO_QUERY);
- if(xNewShapes.is() && GetSdImport().GetShapeImport()->GetStylesContext())
+ if(GetSdImport().GetShapeImport()->GetStylesContext())
{
const rtl::Reference<SdXMLMasterPageContext> xLclContext{
new SdXMLMasterPageContext(GetSdImport(),
- nPrefix, rLocalName, xAttrList, xNewShapes)};
+ nPrefix, rLocalName, xAttrList, xNewMasterPage)};
xContext = xLclContext.get();
maMasterPageList.push_back(xLclContext);
}
@@ -1435,7 +1430,7 @@ SvXMLImportContextRef SdXMLMasterStylesContext::CreateChildContext(
uno::Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetSdImport().GetModel(), uno::UNO_QUERY );
if( xHandoutSupp.is() )
{
- uno::Reference< drawing::XShapes > xHandoutPage( xHandoutSupp->getHandoutMasterPage(), uno::UNO_QUERY );
+ uno::Reference< drawing::XShapes > xHandoutPage = xHandoutSupp->getHandoutMasterPage();
if(xHandoutPage.is() && GetSdImport().GetShapeImport()->GetStylesContext())
{
xContext = new SdXMLMasterPageContext(GetSdImport(),
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index a2e61bdc7c6a..c79cb806cc12 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -1817,7 +1817,7 @@ namespace xmloff
Reference< XListEntrySink > xSink( m_xProps, UNO_QUERY );
Reference< XListEntrySource > xSource;
if ( xSink.is() )
- xSource.set(xSink->getListEntrySource(), css::uno::UNO_QUERY);
+ xSource = xSink->getListEntrySource();
OSL_ENSURE( xSource.is(), "OControlExport::exportCellListSourceRange: list source or sink!" );
if ( xSource.is() )
{
diff --git a/xmloff/source/meta/xmlversion.cxx b/xmloff/source/meta/xmlversion.cxx
index 08e92e00dd0a..27fca376f195 100644
--- a/xmloff/source/meta/xmlversion.cxx
+++ b/xmloff/source/meta/xmlversion.cxx
@@ -347,12 +347,9 @@ void SAL_CALL XMLVersionListPersistence::store( const uno::Reference< embed::XSt
if ( !xOut.is() )
throw uno::RuntimeException(); // the stream was successfully opened for writing already
- Reference< io::XActiveDataSource > xSrc( xWriter, uno::UNO_QUERY );
- xSrc->setOutputStream(xOut);
+ xWriter->setOutputStream(xOut);
- Reference< XDocumentHandler > xHandler( xWriter, uno::UNO_QUERY );
-
- rtl::Reference< XMLVersionListExport > xExp( new XMLVersionListExport( xContext, rVersions, sVerName, xHandler ) );
+ rtl::Reference< XMLVersionListExport > xExp( new XMLVersionListExport( xContext, rVersions, sVerName, xWriter ) );
xExp->exportDoc( ::xmloff::token::XML_VERSION );
@@ -370,10 +367,9 @@ uno::Sequence< util::RevisionTag > SAL_CALL XMLVersionListPersistence::load( con
css::uno::Sequence < css::util::RevisionTag > aVersions;
const OUString sDocName( XMLN_VERSIONSLIST );
- uno::Reference< container::XNameAccess > xRootNames( xRoot, uno::UNO_QUERY );
try {
- if ( xRootNames.is() && xRootNames->hasByName( sDocName ) && xRoot->isStreamElement( sDocName ) )
+ if ( xRoot.is() && xRoot->hasByName( sDocName ) && xRoot->isStreamElement( sDocName ) )
{
Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx
index f6d5b3b07912..02e720b643db 100644
--- a/xmloff/source/script/XMLEventExport.cxx
+++ b/xmloff/source/script/XMLEventExport.cxx
@@ -85,8 +85,7 @@ void XMLEventExport::Export( Reference<XEventsSupplier> const & rSupplier,
{
if (rSupplier.is())
{
- Reference<XNameAccess> xAccess(rSupplier->getEvents(), UNO_QUERY);
- Export(xAccess, bWhitespace);
+ Export(rSupplier->getEvents(), bWhitespace);
}
// else: no supplier, no export -> ignore!
}
@@ -94,7 +93,7 @@ void XMLEventExport::Export( Reference<XEventsSupplier> const & rSupplier,
void XMLEventExport::Export( Reference<XNameReplace> const & rReplace,
bool bWhitespace)
{
- Reference<XNameAccess> xAccess(rReplace, UNO_QUERY);
+ Reference<XNameAccess> xAccess(rReplace);
Export(xAccess, bWhitespace);
}
diff --git a/xmloff/source/script/xmlbasici.cxx b/xmloff/source/script/xmlbasici.cxx
index 0a7e5163e5d0..da38c060b7a3 100644
--- a/xmloff/source/script/xmlbasici.cxx
+++ b/xmloff/source/script/xmlbasici.cxx
@@ -36,8 +36,7 @@ XMLBasicImportContext::XMLBasicImportContext( SvXMLImport& rImport, sal_uInt16 n
Reference< uno::XComponentContext > xContext = GetImport().GetComponentContext();
m_xHandler = document::XMLOasisBasicImporter::create( xContext );
- Reference< lang::XComponent > xComp( m_xModel, UNO_QUERY );
- m_xHandler->setTargetDocument( xComp );
+ m_xHandler->setTargetDocument( m_xModel );
}
XMLBasicImportContext::~XMLBasicImportContext()
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index b1e79f7f8733..563d57ca7e94 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -579,7 +579,7 @@ void XMLTableExport::exportTableTemplates()
if (mbWriter)
{
mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, xTableStyle->getName());
- Reference<XPropertySet> xTableStylePropSet(xTableStyle.get(), UNO_QUERY_THROW);
+ Reference<XPropertySet> xTableStylePropSet(xTableStyle, UNO_QUERY_THROW);
pElements = getWriterSpecificTableStyleAttributes();
while(pElements->meElement != XML_TOKEN_END)
{
diff --git a/xmloff/source/text/XMLAutoTextEventExport.cxx b/xmloff/source/text/XMLAutoTextEventExport.cxx
index ddd42571607f..68735eabde38 100644
--- a/xmloff/source/text/XMLAutoTextEventExport.cxx
+++ b/xmloff/source/text/XMLAutoTextEventExport.cxx
@@ -78,8 +78,7 @@ void XMLAutoTextEventExport::initialize(
rArguments[1] >>= xSupplier;
if (xSupplier.is())
{
- Reference<XNameAccess> xAccess(xSupplier->getEvents(), UNO_QUERY);
- xEvents = xAccess;
+ xEvents = xSupplier->getEvents();
}
else
{
diff --git a/xmloff/source/text/XMLTextShapeImportHelper.cxx b/xmloff/source/text/XMLTextShapeImportHelper.cxx
index f724fb8faf96..cbac12006d95 100644
--- a/xmloff/source/text/XMLTextShapeImportHelper.cxx
+++ b/xmloff/source/text/XMLTextShapeImportHelper.cxx
@@ -53,7 +53,7 @@ XMLTextShapeImportHelper::XMLTextShapeImportHelper(
Reference < XDrawPageSupplier > xDPS( rImp.GetModel(), UNO_QUERY );
if( xDPS.is() )
{
- Reference < XShapes > xShapes( xDPS->getDrawPage(), UNO_QUERY );
+ Reference < XShapes > xShapes = xDPS->getDrawPage();
pushGroupForSorting( xShapes );
}
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 8202d44e995d..dd71ec72d3ba 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -1918,8 +1918,8 @@ void XMLTextFieldExport::ExportFieldDeclarations(
if( !xTextFieldsSupp.is() )
return;
- Reference<container::XNameAccess> xFieldMasterNameAccess(
- xTextFieldsSupp->getTextFieldMasters(), UNO_QUERY);
+ Reference<container::XNameAccess> xFieldMasterNameAccess =
+ xTextFieldsSupp->getTextFieldMasters();
// where to get the text field masters from?
// a) we get a specific XText: then use pUsedMasters
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index ca2324471958..7bba48a20444 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -2881,8 +2881,8 @@ void XMLDdeFieldImportContext::EndElement()
Reference<XTextFieldsSupplier> xTextFieldsSupp(GetImport().GetModel(),
UNO_QUERY);
- Reference<container::XNameAccess> xFieldMasterNameAccess(
- xTextFieldsSupp->getTextFieldMasters(), UNO_QUERY);
+ Reference<container::XNameAccess> xFieldMasterNameAccess =
+ xTextFieldsSupp->getTextFieldMasters();
if (xFieldMasterNameAccess->hasByName(sMasterName))
{
@@ -3427,9 +3427,8 @@ void XMLAnnotationImportContext::EndElement()
uno::Reference<text::XTextCursor> xCursor =
xText->createTextCursorByRange(GetImportHelper().GetCursorAsRange());
xCursor->gotoRange(xPrevField->getAnchor(), true);
- uno::Reference<text::XTextRange> xTextRange(xCursor, uno::UNO_QUERY);
- xText->insertTextContent(xTextRange, xPrevField, !xCursor->isCollapsed());
+ xText->insertTextContent(xCursor, xPrevField, !xCursor->isCollapsed());
}
}
else
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index a100616f6e74..9f57ac3ac08a 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1100,7 +1100,7 @@ void XMLTextImportHelper::SetCursor( const Reference < XTextCursor > & rCursor )
{
m_xImpl->m_xCursor.set(rCursor);
m_xImpl->m_xText.set(rCursor->getText());
- m_xImpl->m_xCursorAsRange.set( rCursor, UNO_QUERY );
+ m_xImpl->m_xCursorAsRange = rCursor;
}
void XMLTextImportHelper::ResetCursor()
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 3f774ae1a521..1cbc325f604d 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2272,7 +2272,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
if (xFormField.is())
{
OUString sName;
- Reference< css::container::XNameAccess > xParameters(xFormField->getParameters(), UNO_QUERY);
+ Reference< css::container::XNameAccess > xParameters = xFormField->getParameters();
if (xParameters.is() && xParameters->hasByName("Name"))
{
const Any aValue = xParameters->getByName("Name");
@@ -2323,7 +2323,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
if (xFormField.is())
{
OUString sName;
- Reference< css::container::XNameAccess > xParameters(xFormField->getParameters(), UNO_QUERY);
+ Reference< css::container::XNameAccess > xParameters = xFormField->getParameters();
if (xParameters.is() && xParameters->hasByName("Name"))
{
const Any aValue = xParameters->getByName("Name");
@@ -2503,7 +2503,7 @@ void XMLTextParagraphExport::exportTextMark(
if (nElement == 1)
{
Reference<XPropertySet> bkmkProps(rPropSet->getPropertyValue(rProperty), UNO_QUERY);
- Reference<XPropertySetInfo> bkmkPropInfo(bkmkProps->getPropertySetInfo(), UNO_QUERY);
+ Reference<XPropertySetInfo> bkmkPropInfo = bkmkProps->getPropertySetInfo();
OUString sHidden("BookmarkHidden");
if (bkmkPropInfo->hasPropertyByName(sHidden))
{
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index 8676390dabe6..287b26722781 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -2120,8 +2120,7 @@ void XMLParaContext::EndElement()
if ( TextContentAnchorType_AT_CHARACTER == eAnchorType )
{
// set anchor position for at-character anchored objects
- Reference<XTextRange> xRange(xAttrCursor, UNO_QUERY);
- xPropSet->setPropertyValue("TextRange", Any(xRange));
+ xPropSet->setPropertyValue("TextRange", Any(xAttrCursor));
}
}
}
@@ -2148,8 +2147,7 @@ void XMLParaContext::EndElement()
if ( TextContentAnchorType_AT_CHARACTER == eAnchorType )
{
// set anchor position for at-character anchored objects
- Reference<XTextRange> xRange(xAttrCursor, UNO_QUERY);
- xPropSet->setPropertyValue("TextRange", Any(xRange));
+ xPropSet->setPropertyValue("TextRange", Any(xAttrCursor));
}
}
}
diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx
index c6d6ba0f6e73..058fe41ab022 100644
--- a/xmloff/source/text/txtvfldi.cxx
+++ b/xmloff/source/text/txtvfldi.cxx
@@ -826,8 +826,8 @@ bool XMLVariableDeclImportContext::FindFieldMaster(
// get text fields supplier and field masters
Reference<XTextFieldsSupplier> xTextFieldsSupp(rImport.GetModel(),
UNO_QUERY);
- Reference<container::XNameAccess> xFieldMasterNameAccess(
- xTextFieldsSupp->getTextFieldMasters(), UNO_QUERY);
+ Reference<container::XNameAccess> xFieldMasterNameAccess =
+ xTextFieldsSupp->getTextFieldMasters();
OUStringBuffer sBuffer;
sBuffer.append(sAPI_fieldmaster_prefix);
diff --git a/xmloff/source/xforms/SchemaRestrictionContext.cxx b/xmloff/source/xforms/SchemaRestrictionContext.cxx
index fcf58ce5eb2f..f295dff5e3ea 100644
--- a/xmloff/source/xforms/SchemaRestrictionContext.cxx
+++ b/xmloff/source/xforms/SchemaRestrictionContext.cxx
@@ -105,13 +105,11 @@ void SchemaRestrictionContext::CreateDataType()
try
{
mxDataType =
- Reference<XPropertySet>(
mxRepository->cloneDataType(
xforms_getBasicTypeName( mxRepository,
GetImport().GetNamespaceMap(),
msBaseName ),
- msTypeName ),
- UNO_QUERY );
+ msTypeName );
}
catch( const Exception& )
{
diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx
index edd3b1434918..09053850c952 100644
--- a/xmloff/source/xforms/xformsexport.cxx
+++ b/xmloff/source/xforms/xformsexport.cxx
@@ -299,9 +299,8 @@ void exportXFormsBinding( SvXMLExport& rExport,
xModel.is() ? xModel->getDataTypeRepository() : Reference<XDataTypeRepository>() );
if( xRepository.is() )
{
- Reference<XPropertySet> xDataType(
- xRepository->getDataType( sTypeName ),
- UNO_QUERY );
+ Reference<XPropertySet> xDataType =
+ xRepository->getDataType( sTypeName );
// if it's a basic data type, write out the XSD name
// for the XSD type class
@@ -555,8 +554,7 @@ void exportXFormsSchemas( SvXMLExport& rExport,
true, true );
// now get data type repository, and export
- Reference<XEnumerationAccess> xTypes( xModel->getDataTypeRepository(),
- UNO_QUERY );
+ Reference<XEnumerationAccess> xTypes = xModel->getDataTypeRepository();
if( xTypes.is() )
{
Reference<XEnumeration> xEnum = xTypes->createEnumeration();