[Libreoffice-commits] core.git: 2 commits - xmloff/source xmlsecurity/qa xmlsecurity/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jul 21 06:52:30 UTC 2019
xmloff/source/chart/SchXMLChartContext.cxx | 17 +-
xmloff/source/chart/SchXMLExport.cxx | 15 -
xmloff/source/chart/SchXMLLegendContext.cxx | 2
xmloff/source/chart/SchXMLPlotAreaContext.cxx | 10 -
xmloff/source/chart/SchXMLPropertyMappingContext.cxx | 2
xmloff/source/chart/SchXMLSeries2Context.cxx | 8 -
xmloff/source/core/DocumentSettingsContext.cxx | 4
xmloff/source/core/RDFaImportHelper.cxx | 5
xmloff/source/core/SettingsExportHelper.cxx | 6
xmloff/source/core/xmlexp.cxx | 3
xmloff/source/draw/layerimp.cxx | 2
xmloff/source/draw/sdxmlexp.cxx | 129 ++++++-----------
xmloff/source/draw/sdxmlimp.cxx | 4
xmloff/source/draw/shapeexport.cxx | 7
xmloff/source/draw/ximpbody.cxx | 20 --
xmloff/source/draw/ximpstyl.cxx | 17 --
xmloff/source/forms/elementexport.cxx | 2
xmloff/source/meta/xmlversion.cxx | 10 -
xmloff/source/script/XMLEventExport.cxx | 5
xmloff/source/script/xmlbasici.cxx | 3
xmloff/source/table/XMLTableExport.cxx | 2
xmloff/source/text/XMLAutoTextEventExport.cxx | 3
xmloff/source/text/XMLTextShapeImportHelper.cxx | 2
xmloff/source/text/txtflde.cxx | 4
xmloff/source/text/txtfldi.cxx | 7
xmloff/source/text/txtimp.cxx | 2
xmloff/source/text/txtparae.cxx | 6
xmloff/source/text/txtparai.cxx | 6
xmloff/source/text/txtvfldi.cxx | 4
xmloff/source/xforms/SchemaRestrictionContext.cxx | 4
xmloff/source/xforms/xformsexport.cxx | 8 -
xmlsecurity/qa/unit/signing/signing.cxx | 8 -
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 2
xmlsecurity/source/helper/documentsignaturehelper.cxx | 23 +--
xmlsecurity/source/helper/documentsignaturemanager.cxx | 14 -
xmlsecurity/source/helper/xmlsignaturehelper.cxx | 15 -
xmlsecurity/source/helper/xmlsignaturehelper2.cxx | 3
37 files changed, 146 insertions(+), 238 deletions(-)
New commits:
commit 3c6b2b734a00f4844e0bfd5707d14fd4a3d279b0
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Jul 20 18:27:48 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 21 08:51:13 2019 +0200
loplugin:referencecasting in xmlsecurity
Change-Id: Ic3daba9e6e94516ea4d80f25f73e9e46a50edb5c
Reviewed-on: https://gerrit.libreoffice.org/76035
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index 19d233063ad7..e316a4dc7ef9 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -493,13 +493,11 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLRemoveAll)
// Make sure that the signature count is zero and the whole signature storage is removed completely.
CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(0), rInformations.size());
- uno::Reference<container::XNameAccess> xNameAccess(xStorage, uno::UNO_QUERY);
- CPPUNIT_ASSERT(!xNameAccess->hasByName("_xmlsignatures"));
+ CPPUNIT_ASSERT(!xStorage->hasByName("_xmlsignatures"));
// And that content types no longer contains signature types.
- uno::Reference<io::XStream> xStream(
- xStorage->openStreamElement("[Content_Types].xml", embed::ElementModes::READWRITE),
- uno::UNO_QUERY);
+ uno::Reference<io::XStream> xStream
+ = xStorage->openStreamElement("[Content_Types].xml", embed::ElementModes::READWRITE);
uno::Reference<io::XInputStream> xInputStream = xStream->getInputStream();
uno::Sequence<uno::Sequence<beans::StringPair>> aContentTypeInfo
= comphelper::OFOPXMLHelper::ReadContentTypeSequence(xInputStream, mxComponentContext);
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 03dcaca782e9..c2568eba803b 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -227,7 +227,7 @@ bool DigitalSignaturesDialog::canAddRemove()
//'canAdd' and 'canRemove' case
bool ret = true;
- uno::Reference<container::XNameAccess> xNameAccess(maSignatureManager.getStore(), uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xNameAccess = maSignatureManager.getStore();
if (xNameAccess.is() && xNameAccess->hasByName("[Content_Types].xml"))
// It's always possible to append an OOXML signature.
return ret;
diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx
index 37faa606c32f..6e173afdebff 100644
--- a/xmlsecurity/source/helper/documentsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx
@@ -86,8 +86,7 @@ static void ImplFillElementList(
const OUString& rRootStorageName, const bool bRecursive,
const DocumentSignatureAlgorithm mode)
{
- Reference < css::container::XNameAccess > xElements( rxStore, UNO_QUERY );
- Sequence< OUString > aElements = xElements->getElementNames();
+ Sequence< OUString > aElements = rxStore->getElementNames();
for ( const auto& rName : aElements )
{
@@ -214,8 +213,7 @@ DocumentSignatureHelper::CreateElementList(
xSubStore.clear();
// Object folders...
- Reference < css::container::XNameAccess > xElements( rxStore, UNO_QUERY );
- Sequence< OUString > aElementNames = xElements->getElementNames();
+ Sequence< OUString > aElementNames = rxStore->getElementNames();
for ( const auto& rName : aElementNames )
{
if ( ( rName.match( "Object " ) ) && rxStore->isStorageElement( rName ) )
@@ -288,8 +286,7 @@ DocumentSignatureHelper::CreateElementList(
void DocumentSignatureHelper::AppendContentTypes(const uno::Reference<embed::XStorage>& xStorage, std::vector<OUString>& rElements)
{
- uno::Reference<container::XNameAccess> xNameAccess(xStorage, uno::UNO_QUERY);
- if (!xNameAccess.is() || !xNameAccess->hasByName("[Content_Types].xml"))
+ if (!xStorage.is() || !xStorage->hasByName("[Content_Types].xml"))
// ODF
return;
@@ -341,11 +338,10 @@ SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream(
SignatureStreamHelper aHelper;
- uno::Reference<container::XNameAccess> xNameAccess(rxStore, uno::UNO_QUERY);
- if (!xNameAccess.is())
+ if (!rxStore.is())
return aHelper;
- if (xNameAccess->hasByName("META-INF"))
+ if (rxStore->hasByName("META-INF"))
{
try
{
@@ -369,11 +365,11 @@ SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream(
SAL_WARN_IF( nOpenMode != css::embed::ElementModes::READ, "xmlsecurity.helper", "Error creating signature stream..." );
}
}
- else if(xNameAccess->hasByName("[Content_Types].xml"))
+ else if(rxStore->hasByName("[Content_Types].xml"))
{
try
{
- if (xNameAccess->hasByName("_xmlsignatures") && (nOpenMode & embed::ElementModes::TRUNCATE))
+ if (rxStore->hasByName("_xmlsignatures") && (nOpenMode & embed::ElementModes::TRUNCATE))
// Truncate, then all signatures will be written -> remove previous ones.
rxStore->removeElement("_xmlsignatures");
@@ -394,11 +390,10 @@ bool DocumentSignatureHelper::CanSignWithGPG(
const Reference < css::embed::XStorage >& rxStore,
const OUString& sOdfVersion)
{
- uno::Reference<container::XNameAccess> xNameAccess(rxStore, uno::UNO_QUERY);
- if (!xNameAccess.is())
+ if (!rxStore.is())
return false;
- if (xNameAccess->hasByName("META-INF")) // ODF
+ if (rxStore->hasByName("META-INF")) // ODF
{
return !isODFPre_1_2(sOdfVersion);
}
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index 37f1baf10921..557557f6bae8 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -145,11 +145,7 @@ bool DocumentSignatureManager::readManifest()
uno::Reference<packages::manifest::XManifestReader> xReader
= packages::manifest::ManifestReader::create(mxContext);
- uno::Reference<container::XNameAccess> xNameAccess(mxStore, uno::UNO_QUERY);
- if (!xNameAccess.is())
- return false;
-
- if (xNameAccess->hasByName("META-INF"))
+ if (mxStore->hasByName("META-INF"))
{
//Get the manifest.xml
uno::Reference<embed::XStorage> xSubStore(
@@ -231,12 +227,8 @@ SignatureStreamHelper DocumentSignatureManager::ImplOpenSignatureStream(sal_Int3
bool bTempStream)
{
SignatureStreamHelper aHelper;
- if (mxStore.is())
- {
- uno::Reference<container::XNameAccess> xNameAccess(mxStore, uno::UNO_QUERY);
- if (xNameAccess.is() && xNameAccess->hasByName("[Content_Types].xml"))
- aHelper.nStorageFormat = embed::StorageFormats::OFOPXML;
- }
+ if (mxStore.is() && mxStore->hasByName("[Content_Types].xml"))
+ aHelper.nStorageFormat = embed::StorageFormats::OFOPXML;
if (bTempStream)
{
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index 0bc850b9af4f..6ec834053a17 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -230,8 +230,7 @@ void XMLSignatureHelper::ExportOOXMLSignature(const uno::Reference<embed::XStora
xSaxWriter->setOutputStream(xOutputStream);
xSaxWriter->startDocument();
- uno::Reference<xml::sax::XDocumentHandler> xDocumentHandler(xSaxWriter, uno::UNO_QUERY);
- mpXSecController->exportOOXMLSignature(xRootStorage, xDocumentHandler, rInformation);
+ mpXSecController->exportOOXMLSignature(xRootStorage, xSaxWriter, rInformation);
xSaxWriter->endDocument();
}
@@ -318,8 +317,7 @@ bool lcl_isSignatureOriginType(const beans::StringPair& rPair)
bool XMLSignatureHelper::ReadAndVerifySignatureStorage(const uno::Reference<embed::XStorage>& xStorage, bool bCacheLastSignature)
{
sal_Int32 nOpenMode = embed::ElementModes::READ;
- uno::Reference<container::XNameAccess> xNameAccess(xStorage, uno::UNO_QUERY);
- if (xNameAccess.is() && !xNameAccess->hasByName("_rels"))
+ if (xStorage.is() && !xStorage->hasByName("_rels"))
{
SAL_WARN("xmlsecurity.helper", "expected stream, in signature storage but not found: _rels");
return false;
@@ -338,7 +336,7 @@ bool XMLSignatureHelper::ReadAndVerifySignatureStorage(const uno::Reference<embe
std::vector<beans::StringPair>::iterator it = std::find_if(aRelation.begin(), aRelation.end(), [](const beans::StringPair& rPair) { return rPair.First == "Target"; });
if (it != aRelation.end())
{
- if (xNameAccess.is() && !xNameAccess->hasByName(it->Second))
+ if (xStorage.is() && !xStorage->hasByName(it->Second))
{
SAL_WARN("xmlsecurity.helper", "expected stream, but not found: " << it->Second);
continue;
@@ -477,7 +475,7 @@ void XMLSignatureHelper::ExportSignatureRelations(const css::uno::Reference<css:
xOriginStream->closeOutput();
// Write the relations.
- uno::Reference<embed::XStorage> xSubStorage(xStorage->openStorageElement("_rels", nOpenMode), uno::UNO_QUERY);
+ uno::Reference<embed::XStorage> xSubStorage = xStorage->openStorageElement("_rels", nOpenMode);
uno::Reference<io::XOutputStream> xRelStream(xSubStorage->openStreamElement("origin.sigs.rels", nOpenMode), uno::UNO_QUERY);
std::vector< uno::Sequence<beans::StringPair> > aRelations;
for (int i = 0; i < nSignatureCount; ++i)
@@ -495,7 +493,7 @@ void XMLSignatureHelper::ExportSignatureRelations(const css::uno::Reference<css:
void XMLSignatureHelper::ExportSignatureContentTypes(const css::uno::Reference<css::embed::XStorage>& xStorage, int nSignatureCount)
{
- uno::Reference<io::XStream> xStream(xStorage->openStreamElement("[Content_Types].xml", embed::ElementModes::READWRITE), uno::UNO_QUERY);
+ uno::Reference<io::XStream> xStream = xStorage->openStreamElement("[Content_Types].xml", embed::ElementModes::READWRITE);
uno::Reference<io::XInputStream> xInputStream = xStream->getInputStream();
uno::Sequence< uno::Sequence<beans::StringPair> > aContentTypeInfo = comphelper::OFOPXMLHelper::ReadContentTypeSequence(xInputStream, mxCtx);
if (aContentTypeInfo.getLength() < 2)
@@ -542,8 +540,7 @@ void XMLSignatureHelper::CreateAndWriteOOXMLSignature(const uno::Reference<embed
xSaxWriter->startDocument();
mbError = false;
- uno::Reference<xml::sax::XDocumentHandler> xDocumentHandler(xSaxWriter, uno::UNO_QUERY);
- if (!mpXSecController->WriteOOXMLSignature(xRootStorage, xDocumentHandler))
+ if (!mpXSecController->WriteOOXMLSignature(xRootStorage, xSaxWriter))
mbError = true;
xSaxWriter->endDocument();
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx
index 3e5d01b44861..f733f3a6a4c1 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx
@@ -88,8 +88,7 @@ uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno
throw uno::Exception("Could not decode URI for stream element.", nullptr);
uno::Reference< io::XStream > xStream;
- uno::Reference<container::XNameAccess> xNameAccess(rxStore, uno::UNO_QUERY);
- if (!xNameAccess->hasByName(sName))
+ if (!rxStore->hasByName(sName))
SAL_WARN("xmlsecurity.helper", "expected stream, but not found: " << sName);
else
xStream = rxStore->cloneStreamElement( sName );
commit 3284309f19bc76f1778988c5314a795a95620e71
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Jul 20 18:27:27 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 21 08:51:00 2019 +0200
loplugin:referencecasting in xmloff
Change-Id: Iac3d56511aacec73bc38f57890c44145a4c13b85
Reviewed-on: https://gerrit.libreoffice.org/76034
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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();
More information about the Libreoffice-commits
mailing list