diff options
Diffstat (limited to 'svx')
30 files changed, 118 insertions, 155 deletions
diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index 8b7de6c3a3bd..4c4c87601a3b 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -313,9 +313,8 @@ OUString AccessibleControlShape::CreateAccessibleBaseName() break; default: sName = "UnknownAccessibleControlShape"; - Reference< XShapeDescriptor > xDescriptor (mxShape, UNO_QUERY); - if (xDescriptor.is()) - sName += ": " + xDescriptor->getShapeType(); + if (mxShape.is()) + sName += ": " + mxShape->getShapeType(); } return sName; @@ -345,11 +344,10 @@ OUString default: aDG.Initialize ("Unknown accessible control shape"); - Reference< XShapeDescriptor > xDescriptor (mxShape, UNO_QUERY); - if (xDescriptor.is()) + if (mxShape.is()) { aDG.AppendString ("service name="); - aDG.AppendString (xDescriptor->getShapeType()); + aDG.AppendString (mxShape->getShapeType()); } } diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index bdd5bfaeca33..e08a5c2b0a6e 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -305,10 +305,9 @@ void ChildrenManagerImpl::CreateListOfVisibleShapes ( } // Add the visible shapes for which only the XShapes exist. - uno::Reference<container::XIndexAccess> xShapeAccess (mxShapeList, uno::UNO_QUERY); - if (xShapeAccess.is()) + if (mxShapeList.is()) { - sal_Int32 nShapeCount = xShapeAccess->getCount(); + sal_Int32 nShapeCount = mxShapeList->getCount(); raDescriptorList.reserve( nShapeCount ); awt::Point aPos; awt::Size aSize; @@ -316,7 +315,7 @@ void ChildrenManagerImpl::CreateListOfVisibleShapes ( uno::Reference<drawing::XShape> xShape; for (sal_Int32 i=0; i<nShapeCount; ++i) { - xShapeAccess->getByIndex(i) >>= xShape; + mxShapeList->getByIndex(i) >>= xShape; aPos = xShape->getPosition(); aSize = xShape->getSize(); diff --git a/svx/source/accessibility/ShapeTypeHandler.cxx b/svx/source/accessibility/ShapeTypeHandler.cxx index b00fe30c8e3b..ac830cd7b05c 100644 --- a/svx/source/accessibility/ShapeTypeHandler.cxx +++ b/svx/source/accessibility/ShapeTypeHandler.cxx @@ -94,9 +94,8 @@ ShapeTypeId ShapeTypeHandler::GetTypeId (const OUString& aServiceName) const */ ShapeTypeId ShapeTypeHandler::GetTypeId (const uno::Reference<drawing::XShape>& rxShape) const { - uno::Reference<drawing::XShapeDescriptor> xDescriptor (rxShape, uno::UNO_QUERY); - if (xDescriptor.is()) - return GetTypeId (xDescriptor->getShapeType()); + if (rxShape.is()) + return GetTypeId (rxShape->getShapeType()); else return -1; } @@ -185,9 +184,8 @@ long ShapeTypeHandler::GetSlotId (const OUString& aServiceName) const // method. long ShapeTypeHandler::GetSlotId (const uno::Reference<drawing::XShape>& rxShape) const { - uno::Reference<drawing::XShapeDescriptor> xDescriptor (rxShape, uno::UNO_QUERY); - if (xDescriptor.is()) - return GetSlotId (xDescriptor->getShapeType()); + if (rxShape.is()) + return GetSlotId (rxShape->getShapeType()); else return 0; } @@ -292,9 +290,8 @@ OUString ShapeTypeHandler::CreateAccessibleBaseName (const uno::Reference<drawin default: pResourceId = nullptr; sName = "UnknownAccessibleShape"; - uno::Reference<drawing::XShapeDescriptor> xDescriptor (rxShape, uno::UNO_QUERY); - if (xDescriptor.is()) - sName += ": " + xDescriptor->getShapeType(); + if (rxShape.is()) + sName += ": " + rxShape->getShapeType(); break; } diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx index 3d12a2c9e1c7..e9fa4c819a24 100644 --- a/svx/source/core/graphichelper.cxx +++ b/svx/source/core/graphichelper.cxx @@ -212,11 +212,9 @@ OUString GraphicHelper::ExportGraphic(weld::Window* pParent, const Graphic& rGra aExtension = aExtension.toAsciiLowerCase(); sal_uInt16 nDefaultFilter = USHRT_MAX; - Reference<XFilterManager> xFilterManager(xFilePicker, UNO_QUERY); - for ( sal_uInt16 i = 0; i < nCount; i++ ) { - xFilterManager->appendFilter( rGraphicFilter.GetExportFormatName( i ), rGraphicFilter.GetExportWildcard( i ) ); + xFilePicker->appendFilter( rGraphicFilter.GetExportFormatName( i ), rGraphicFilter.GetExportWildcard( i ) ); OUString aFormatShortName = rGraphicFilter.GetExportFormatShortName( i ); if ( aFormatShortName.equalsIgnoreAsciiCase( aExtension ) ) { @@ -237,7 +235,7 @@ OUString GraphicHelper::ExportGraphic(weld::Window* pParent, const Graphic& rGra if( USHRT_MAX != nDefaultFilter ) { - xFilterManager->setCurrentFilter( rGraphicFilter.GetExportFormatName( nDefaultFilter ) ) ; + xFilePicker->setCurrentFilter( rGraphicFilter.GetExportFormatName( nDefaultFilter ) ) ; if( aDialogHelper.Execute() == ERRCODE_NONE ) { @@ -247,7 +245,7 @@ OUString GraphicHelper::ExportGraphic(weld::Window* pParent, const Graphic& rGra sGraphicsPath = aPath.GetPath(); if( !rGraphicName.isEmpty() && - nDefaultFilter == rGraphicFilter.GetExportFormatNumber( xFilterManager->getCurrentFilter())) + nDefaultFilter == rGraphicFilter.GetExportFormatNumber( xFilePicker->getCurrentFilter())) { // try to save the original graphic SfxMedium aIn( rGraphicName, StreamMode::READ | StreamMode::NOCREATE ); @@ -269,9 +267,9 @@ OUString GraphicHelper::ExportGraphic(weld::Window* pParent, const Graphic& rGra } sal_uInt16 nFilter; - if ( !xFilterManager->getCurrentFilter().isEmpty() && rGraphicFilter.GetExportFormatCount() ) + if ( !xFilePicker->getCurrentFilter().isEmpty() && rGraphicFilter.GetExportFormatCount() ) { - nFilter = rGraphicFilter.GetExportFormatNumber( xFilterManager->getCurrentFilter() ); + nFilter = rGraphicFilter.GetExportFormatNumber( xFilePicker->getCurrentFilter() ); } else { @@ -366,7 +364,6 @@ void GraphicHelper::SaveShapeAsGraphic(weld::Window* pParent, const Reference< // populate filter dialog filter list and select default filter to match graphic mime type GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); - Reference<XFilterManager> xFilterManager( xFilePicker, UNO_QUERY ); const OUString aDefaultMimeType("image/png"); OUString aDefaultFormatName; sal_uInt16 nCount = rGraphicFilter.GetExportFormatCount(); @@ -377,21 +374,21 @@ void GraphicHelper::SaveShapeAsGraphic(weld::Window* pParent, const Reference< { const OUString aExportFormatName( rGraphicFilter.GetExportFormatName( i ) ); const OUString aFilterMimeType( rGraphicFilter.GetExportFormatMediaType( i ) ); - xFilterManager->appendFilter( aExportFormatName, rGraphicFilter.GetExportWildcard( i ) ); + xFilePicker->appendFilter( aExportFormatName, rGraphicFilter.GetExportWildcard( i ) ); aMimeTypeMap[ aExportFormatName ] = aFilterMimeType; if( aDefaultMimeType == aFilterMimeType ) aDefaultFormatName = aExportFormatName; } if( !aDefaultFormatName.isEmpty() ) - xFilterManager->setCurrentFilter( aDefaultFormatName ); + xFilePicker->setCurrentFilter( aDefaultFormatName ); // execute dialog if( aDialogHelper.Execute() == ERRCODE_NONE ) { OUString sPath( xFilePicker->getFiles().getConstArray()[0] ); - OUString aExportMimeType( aMimeTypeMap[xFilterManager->getCurrentFilter()] ); + OUString aExportMimeType( aMimeTypeMap[xFilePicker->getCurrentFilter()] ); Reference< XInputStream > xGraphStream; diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 8fca2a6a29f9..cd1f7ce8c77f 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -241,7 +241,7 @@ void SvxLanguageBoxBase::SetLanguageList( SvxLanguageListFlags nLangList, } if (SvxLanguageListFlags::SPELL_USED & nLangList) { - Reference< XSpellChecker1 > xTmp1( LinguMgr::GetSpellChecker(), UNO_QUERY ); + Reference< XSpellChecker1 > xTmp1 = LinguMgr::GetSpellChecker(); if (xTmp1.is()) aSpellUsedLang = xTmp1->getLanguages(); } @@ -330,7 +330,7 @@ sal_Int32 SvxLanguageBoxBase::ImplInsertLanguage( const LanguageType nLangType, if (!m_pSpellUsedLang) { - Reference< XSpellChecker1 > xSpell( LinguMgr::GetSpellChecker(), UNO_QUERY ); + Reference< XSpellChecker1 > xSpell = LinguMgr::GetSpellChecker(); if ( xSpell.is() ) m_pSpellUsedLang.reset( new Sequence< sal_Int16 >( xSpell->getLanguages() ) ); } @@ -519,7 +519,7 @@ void LanguageBox::SetLanguageList( SvxLanguageListFlags nLangList, } if (SvxLanguageListFlags::SPELL_USED & nLangList) { - Reference< XSpellChecker1 > xTmp1( LinguMgr::GetSpellChecker(), UNO_QUERY ); + Reference< XSpellChecker1 > xTmp1 = LinguMgr::GetSpellChecker(); if (xTmp1.is()) aSpellUsedLang = xTmp1->getLanguages(); } @@ -624,7 +624,7 @@ weld::ComboBoxEntry LanguageBox::BuildEntry(const LanguageType nLangType) { if (!m_xSpellUsedLang) { - Reference<XSpellChecker1> xSpell(LinguMgr::GetSpellChecker(), UNO_QUERY); + Reference<XSpellChecker1> xSpell = LinguMgr::GetSpellChecker(); if (xSpell.is()) m_xSpellUsedLang.reset(new Sequence<sal_Int16>(xSpell->getLanguages())); } diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 221060d1abd3..8605f053e07c 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -138,7 +138,7 @@ sal_uInt16 FmGridHeader::GetModelColumnPos(sal_uInt16 nId) const void FmGridHeader::notifyColumnSelect(sal_uInt16 nColumnId) { sal_uInt16 nPos = GetModelColumnPos(nColumnId); - Reference< XIndexAccess > xColumns(static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns(), UNO_QUERY); + Reference< XIndexAccess > xColumns = static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns(); if ( nPos < xColumns->getCount() ) { Reference< XSelectionSupplier > xSelSupplier(xColumns, UNO_QUERY); @@ -1985,7 +1985,7 @@ void FmGridControl::Select() try { - Reference< XIndexAccess > xColumns(GetPeer()->getColumns(), UNO_QUERY); + Reference< XIndexAccess > xColumns = GetPeer()->getColumns(); Reference< XSelectionSupplier > xSelSupplier(xColumns, UNO_QUERY); if (xSelSupplier.is()) { diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index a1cfd03bb854..007d1d8de543 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -562,8 +562,7 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< css::awt::XToolkit >& // as the FmGridControl touches the data source it is connected to we have to remember the current // cursor position (and restore afterwards) // OJ: but only when we stand on a valid row - Reference< XResultSet > xResultSet(xForm, UNO_QUERY); - if ( !xResultSet->isBeforeFirst() && !xResultSet->isAfterLast() ) + if ( !xForm->isBeforeFirst() && !xForm->isAfterLast() ) { try { @@ -2083,9 +2082,8 @@ void FmXGridPeer::startCursorListening() { if (!m_nCursorListening) { - Reference< XRowSet > xRowSet(m_xCursor, UNO_QUERY); - if (xRowSet.is()) - xRowSet->addRowSetListener(this); + if (m_xCursor.is()) + m_xCursor->addRowSetListener(this); Reference< XReset > xReset(m_xCursor, UNO_QUERY); if (xReset.is()) @@ -2107,9 +2105,8 @@ void FmXGridPeer::stopCursorListening() { if (!--m_nCursorListening) { - Reference< XRowSet > xRowSet(m_xCursor, UNO_QUERY); - if (xRowSet.is()) - xRowSet->removeRowSetListener(this); + if (m_xCursor.is()) + m_xCursor->removeRowSetListener(this); Reference< XReset > xReset(m_xCursor, UNO_QUERY); if (xReset.is()) @@ -2429,10 +2426,9 @@ void FmXGridPeer::registerDispatchProviderInterceptor(const Reference< css::fram { if (m_xFirstDispatchInterceptor.is()) { - Reference< css::frame::XDispatchProvider > xFirstProvider(m_xFirstDispatchInterceptor, UNO_QUERY); // there is already an interceptor; the new one will become its master - _xInterceptor->setSlaveDispatchProvider(xFirstProvider); - m_xFirstDispatchInterceptor->setMasterDispatchProvider(xFirstProvider); + _xInterceptor->setSlaveDispatchProvider(m_xFirstDispatchInterceptor); + m_xFirstDispatchInterceptor->setMasterDispatchProvider(m_xFirstDispatchInterceptor); } else { diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 5904a892904a..ab5705fd4cab 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -542,12 +542,12 @@ DbCellControl::DbCellControl( DbGridColumn& _rColumn ) ,m_pPainter( nullptr ) ,m_pWindow( nullptr ) { - Reference< XPropertySet > xColModelProps( _rColumn.getModel(), UNO_QUERY ); + Reference< XPropertySet > xColModelProps = _rColumn.getModel(); if ( !xColModelProps.is() ) return; // if our model's format key changes we want to propagate the new value to our windows - m_pModelChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, Reference< css::beans::XPropertySet > (_rColumn.getModel(), UNO_QUERY)); + m_pModelChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, _rColumn.getModel()); // be listener for some common properties implDoPropertyListening( FM_PROP_READONLY, false ); @@ -589,7 +589,7 @@ void DbCellControl::implDoPropertyListening(const OUString& _rPropertyName, bool { try { - Reference< XPropertySet > xColModelProps( m_rColumn.getModel(), UNO_QUERY ); + Reference< XPropertySet > xColModelProps = m_rColumn.getModel(); Reference< XPropertySetInfo > xPSI; if ( xColModelProps.is() ) xPSI = xColModelProps->getPropertySetInfo(); @@ -1316,10 +1316,9 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x // No? Maybe the css::form::component::Form behind the cursor? if (!m_xSupplier.is()) { - Reference< XRowSet > xCursorForm(xCursor, UNO_QUERY); - if (xCursorForm.is()) + if (xCursor.is()) { // If we take the formatter from the cursor, then also the key from the field to which we are bound - m_xSupplier = getNumberFormats(getConnection(xCursorForm)); + m_xSupplier = getNumberFormats(getConnection(xCursor)); if (m_rColumn.GetField().is()) nFormatKey = ::comphelper::getINT32(m_rColumn.GetField()->getPropertyValue(FM_PROP_FORMATKEY)); diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index ba1e06a712a8..202efac174f4 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -1449,8 +1449,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, DbGridCo Reference< css::util::XNumberFormatsSupplier > xSupplier = getNumberFormats(getConnection(_xCursor), true); if (xSupplier.is()) { - m_xFormatter.set( css::util::NumberFormatter::create(m_xContext), - UNO_QUERY); + m_xFormatter = css::util::NumberFormatter::create(m_xContext); m_xFormatter->attachNumberFormatsSupplier(xSupplier); // retrieve the datebase of the Numberformatter diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index d0af70020036..8390adda415c 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -495,10 +495,9 @@ namespace svxform try { Reference< css::xforms::XSubmission > xNewSubmission = aDlg.GetNewSubmission(); - Reference< XSet > xSubmissions( xModel->getSubmissions(), UNO_QUERY ); + Reference< XSet > xSubmissions = xModel->getSubmissions(); xSubmissions->insert( makeAny( xNewSubmission ) ); - Reference< XPropertySet > xNewPropSet( xNewSubmission, UNO_QUERY ); - SvTreeListEntry* pEntry = AddEntry( xNewPropSet ); + SvTreeListEntry* pEntry = AddEntry( xNewSubmission ); m_pItemList->Select( pEntry ); bIsDocModified = true; } @@ -612,7 +611,7 @@ namespace svxform { pResId = RID_STR_DATANAV_ADD_BINDING; xNewBinding = xModel->createBinding(); - Reference< XSet > xBindings( xModel->getBindings(), UNO_QUERY ); + Reference< XSet > xBindings = xModel->getBindings(); xBindings->insert( makeAny( xNewBinding ) ); pNode.reset(new ItemNode( xNewBinding )); eType = DITBinding; @@ -667,7 +666,7 @@ namespace svxform { try { - Reference< XSet > xBindings( xModel->getBindings(), UNO_QUERY ); + Reference< XSet > xBindings = xModel->getBindings(); xBindings->remove( makeAny( xNewBinding ) ); } catch ( Exception const & ) @@ -1092,7 +1091,7 @@ namespace svxform if ( xContainer.is() ) m_pNaviWin->AddContainerBroadcaster( xContainer ); - Reference< XEnumerationAccess > xNumAccess( _xModel->getInstances(), UNO_QUERY ); + Reference< XEnumerationAccess > xNumAccess = _xModel->getInstances(); if ( xNumAccess.is() ) { Reference < XEnumeration > xNum = xNumAccess->createEnumeration(); @@ -1139,7 +1138,7 @@ namespace svxform if ( xContainer.is() ) m_pNaviWin->AddContainerBroadcaster( xContainer ); - Reference< XEnumerationAccess > xNumAccess( _xModel->getSubmissions(), UNO_QUERY ); + Reference< XEnumerationAccess > xNumAccess = _xModel->getSubmissions(); if ( xNumAccess.is() ) { Reference < XEnumeration > xNum = xNumAccess->createEnumeration(); @@ -1172,7 +1171,7 @@ namespace svxform if ( xContainer.is() ) m_pNaviWin->AddContainerBroadcaster( xContainer ); - Reference< XEnumerationAccess > xNumAccess( _xModel->getBindings(), UNO_QUERY ); + Reference< XEnumerationAccess > xNumAccess = _xModel->getBindings(); if ( xNumAccess.is() ) { Reference < XEnumeration > xNum = xNumAccess->createEnumeration(); @@ -1417,8 +1416,7 @@ namespace svxform // get our frame DBG_ASSERT( pBindings != nullptr, "DataNavigatorWindow::LoadModels(): no SfxBindings; can't get frame" ); - m_xFrame.set( pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), - UNO_QUERY ); + m_xFrame = pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(); DBG_ASSERT( m_xFrame.is(), "DataNavigatorWindow::LoadModels(): no frame" ); // add frameaction listener Reference< XFrameActionListener > xListener( @@ -1973,7 +1971,7 @@ namespace svxform Reference< css::xforms::XModel > xModel; if ( aAny >>= xModel ) { - Reference< XEnumerationAccess > xNumAccess( xModel->getInstances(), UNO_QUERY ); + Reference< XEnumerationAccess > xNumAccess = xModel->getInstances(); if ( xNumAccess.is() ) { Reference < XEnumeration > xNum = xNumAccess->createEnumeration(); @@ -3088,7 +3086,7 @@ namespace svxform try { m_xNewSubmission = xModel->createSubmission(); - m_xSubmission.set( m_xNewSubmission, UNO_QUERY ); + m_xSubmission = m_xNewSubmission; } catch ( Exception const & ) { @@ -3143,7 +3141,7 @@ namespace svxform { try { - Reference< XEnumerationAccess > xNumAccess( xModel->getBindings(), UNO_QUERY ); + Reference< XEnumerationAccess > xNumAccess = xModel->getBindings(); if ( xNumAccess.is() ) { Reference < XEnumeration > xNum = xNumAccess->createEnumeration(); diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index dc406e6bd9ea..27d7c2d61a37 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1810,7 +1810,7 @@ void FmFilterNavigatorWin::UpdateContent(FmFormShell const * pFormShell) Reference< XIndexAccess > xContainer; if (xController.is()) { - Reference< XChild > xChild(xController, UNO_QUERY); + Reference< XChild > xChild = xController; for (Reference< XInterface > xParent(xChild->getParent()); xParent.is(); xParent = xChild.is() ? xChild->getParent() : Reference< XInterface > ()) diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx index e03e9cb98d85..1674c5806824 100644 --- a/svx/source/form/fmPropBrw.cxx +++ b/svx/source/form/fmPropBrw.cxx @@ -559,10 +559,10 @@ void FmPropBrw::impl_createPropertyBrowser_throw( FmFormShell* _pFormShell ) : DefaultFormComponentInspectorModel::createDefault( m_xInspectorContext ); // an object inspector - m_xBrowserController.set( + m_xBrowserController = ObjectInspector::createWithModel( m_xInspectorContext, m_xInspectorModel - ), css::uno::UNO_QUERY); + ); if ( !m_xBrowserController.is() ) { diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index 7011a4c3faef..9146fe6605fd 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -239,7 +239,7 @@ namespace void lcl_insertFormObject_throw( const FmFormObj& _object, const Reference< XMap >& _map ) { // the control model - Reference< XControlModel > xControlModel( _object.GetUnoControlModel(), UNO_QUERY ); + Reference< XControlModel > xControlModel = _object.GetUnoControlModel(); OSL_ENSURE( xControlModel.is(), "lcl_insertFormObject_throw: suspicious: no control model!" ); if ( !xControlModel.is() ) return; @@ -255,7 +255,7 @@ namespace void lcl_removeFormObject_throw( const FmFormObj& _object, const Reference< XMap >& _map ) { // the control model - Reference< XControlModel > xControlModel( _object.GetUnoControlModel(), UNO_QUERY ); + Reference< XControlModel > xControlModel = _object.GetUnoControlModel(); OSL_ENSURE( xControlModel.is(), "lcl_removeFormObject: suspicious: no control model!" ); if ( !xControlModel.is() ) { @@ -276,10 +276,10 @@ Reference< XMap > FmFormPageImpl::impl_createControlShapeMap_nothrow() try { - xMap.set( EnumerableMap::create( comphelper::getProcessComponentContext(), + xMap = EnumerableMap::create( comphelper::getProcessComponentContext(), ::cppu::UnoType< XControlModel >::get(), ::cppu::UnoType< XControlShape >::get() - ).get(), UNO_SET_THROW ); + ); SdrObjListIter aPageIter( &m_rPage ); while ( aPageIter.IsMore() ) @@ -344,9 +344,7 @@ bool FmFormPageImpl::validateCurForm() if ( !xCurrentForm.is() ) return false; - Reference< XChild > xAsChild( xCurrentForm, UNO_QUERY ); - DBG_ASSERT( xAsChild.is(), "FmFormPageImpl::validateCurForm: a form which is no child??" ); - if ( !xAsChild.is() || !xAsChild->getParent().is() ) + if ( !xCurrentForm->getParent().is() ) xCurrentForm.clear(); return xCurrentForm.is(); @@ -464,7 +462,7 @@ Reference< css::form::XForm > FmFormPageImpl::findPlaceInFormComponentHierarchy // first search in the current form xForm = findFormForDataSource( xCurrentForm, rDatabase, rCursorSource, nCommandType ); - Reference< css::container::XIndexAccess > xFormsByIndex( getForms(), UNO_QUERY ); + Reference< css::container::XIndexAccess > xFormsByIndex = getForms(); DBG_ASSERT(xFormsByIndex.is(), "FmFormPageImpl::findPlaceInFormComponentHierarchy : no index access for my forms collection !"); sal_Int32 nCount = xFormsByIndex->getCount(); for (sal_Int32 i = 0; !xForm.is() && i < nCount; i++) @@ -506,7 +504,7 @@ Reference< css::form::XForm > FmFormPageImpl::findPlaceInFormComponentHierarchy xFormProps->setPropertyValue(FM_PROP_COMMAND,makeAny(rCursorSource)); xFormProps->setPropertyValue(FM_PROP_COMMANDTYPE, makeAny(nCommandType)); - Reference< css::container::XNameAccess > xNamedSet( getForms(), UNO_QUERY ); + Reference< css::container::XNameAccess > xNamedSet = getForms(); const bool bTableOrQuery = ( CommandType::TABLE == nCommandType ) || ( CommandType::QUERY == nCommandType ); OUString sName = FormControlFactory::getUniqueName( xNamedSet, @@ -516,7 +514,7 @@ Reference< css::form::XForm > FmFormPageImpl::findPlaceInFormComponentHierarchy if( bUndo ) { - Reference< css::container::XIndexContainer > xContainer( getForms(), UNO_QUERY ); + Reference< css::container::XIndexContainer > xContainer = getForms(); rModel.AddUndo( std::make_unique<FmUndoContainerAction>( static_cast< FmFormModel& >(rModel), diff --git a/svx/source/form/fmservs.cxx b/svx/source/form/fmservs.cxx index 5cd0b79991b6..86b6960ad1e4 100644 --- a/svx/source/form/fmservs.cxx +++ b/svx/source/form/fmservs.cxx @@ -38,7 +38,7 @@ namespace svxform { void ImplSmartRegisterUnoServices() { - uno::Reference< lang::XMultiServiceFactory > xServiceFactory(::comphelper::getProcessServiceFactory(), uno::UNO_QUERY); + uno::Reference< lang::XMultiServiceFactory > xServiceFactory = ::comphelper::getProcessServiceFactory(); uno::Reference< container::XSet > xSet(xServiceFactory, uno::UNO_QUERY); if (!xSet.is()) return; diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index cd0474fd5fad..5f796a94e9ab 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -752,9 +752,8 @@ void SAL_CALL FmXFormShell::disposing(const lang::EventObject& e) if (xFormController.is()) xFormController->removeActivateListener(static_cast<XFormControllerListener*>(this)); - Reference< css::lang::XComponent> xComp(m_xExternalViewController, UNO_QUERY); - if (xComp.is()) - xComp->removeEventListener(static_cast<XEventListener*>(static_cast<XPropertyChangeListener*>(this))); + if (m_xExternalViewController.is()) + m_xExternalViewController->removeEventListener(static_cast<XEventListener*>(static_cast<XPropertyChangeListener*>(this))); m_xExternalViewController = nullptr; m_xExternalDisplayedForm = nullptr; @@ -1522,7 +1521,7 @@ void FmXFormShell::ExecuteSearch_Lock() Reference< XGridPeer> xGridPeer(xActiveControl->getPeer(), UNO_QUERY); Reference< XIndexAccess> xColumns; if (xGridPeer.is()) - xColumns.set(xGridPeer->getColumns(),UNO_QUERY); + xColumns = xGridPeer->getColumns(); sal_Int16 nViewCol = xGrid->getCurrentColumnPosition(); sal_Int32 nModelCol = GridView2ModelPos(xColumns, nViewCol); @@ -1645,7 +1644,7 @@ void FmXFormShell::SetY2KState_Lock(sal_uInt16 n) if (!xCurrentForms.is()) { // in the alive mode, my forms are not set, but the ones on the page are if (m_pShell->GetCurPage()) - xCurrentForms.set( m_pShell->GetCurPage()->GetForms( false ), UNO_QUERY ); + xCurrentForms = m_pShell->GetCurPage()->GetForms( false ); } if (!xCurrentForms.is()) return; @@ -1797,14 +1796,13 @@ void FmXFormShell::ExecuteFormSlot_Lock( sal_Int32 _nSlot ) void FmXFormShell::impl_switchActiveControllerListening_Lock(const bool _bListen) { - Reference< XComponent> xComp( m_xActiveController, UNO_QUERY ); - if ( !xComp.is() ) + if ( !m_xActiveController.is() ) return; if ( _bListen ) - xComp->addEventListener( static_cast<XFormControllerListener*>(this) ); + m_xActiveController->addEventListener( static_cast<XFormControllerListener*>(this) ); else - xComp->removeEventListener( static_cast<XFormControllerListener*>(this) ); + m_xActiveController->removeEventListener( static_cast<XFormControllerListener*>(this) ); } @@ -2079,7 +2077,7 @@ void FmXFormShell::startListening_Lock() case NavigationBarMode_PARENT: { // search for the controller via which navigation is possible - Reference< XChild> xChild(m_xActiveController, UNO_QUERY); + Reference< XChild> xChild = m_xActiveController; Reference< runtime::XFormController > xParent; while (xChild.is()) { @@ -2380,7 +2378,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest_Lock, FmSearchContext&, rfmscCont if (!xPeerContainer.is()) break; - Reference< XIndexAccess> xModelColumns(xGridPeer->getColumns(), UNO_QUERY); + Reference< XIndexAccess> xModelColumns = xGridPeer->getColumns(); DBG_ASSERT(xModelColumns.is(), "FmXFormShell::OnSearchContextRequest : there is a grid control without columns !"); // the case 'no columns' should be indicated with an empty container, I think ... DBG_ASSERT(xModelColumns->getCount() >= xPeerContainer->getCount(), "FmXFormShell::OnSearchContextRequest : impossible : have more view than model columns !"); @@ -2543,7 +2541,7 @@ void FmXFormShell::UpdateForms_Lock(bool _bInvalidate) FmFormPage* pPage = m_pShell->GetCurPage(); if ( pPage && m_pShell->m_bDesignMode ) - xForms.set(pPage->GetForms( false ), css::uno::UNO_QUERY); + xForms = pPage->GetForms( false ); if ( m_xForms != xForms ) { @@ -2965,13 +2963,12 @@ static void saveFilter(const Reference< runtime::XFormController >& _rxControlle { Reference< XPropertySet> xFormAsSet(_rxController->getModel(), UNO_QUERY); Reference< XPropertySet> xControllerAsSet(_rxController, UNO_QUERY); - Reference< XIndexAccess> xControllerAsIndex(_rxController, UNO_QUERY); // call the subcontroller Reference< runtime::XFormController > xController; - for (sal_Int32 i = 0, nCount = xControllerAsIndex->getCount(); i < nCount; ++i) + for (sal_Int32 i = 0, nCount = _rxController->getCount(); i < nCount; ++i) { - xControllerAsIndex->getByIndex(i) >>= xController; + _rxController->getByIndex(i) >>= xController; saveFilter(xController); } @@ -3157,9 +3154,8 @@ void FmXFormShell::CreateExternalView_Lock() if (xExternalViewFrame.is()) { m_xExternalViewController = xExternalViewFrame->getController(); - Reference< css::lang::XComponent> xComp(m_xExternalViewController, UNO_QUERY); - if (xComp.is()) - xComp->addEventListener(static_cast<XEventListener*>(static_cast<XPropertyChangeListener*>(this))); + if (m_xExternalViewController.is()) + m_xExternalViewController->addEventListener(static_cast<XEventListener*>(static_cast<XPropertyChangeListener*>(this))); } } else @@ -3663,7 +3659,7 @@ void FmXFormShell::impl_defaultCurrentForm_nothrow_Lock() try { - Reference< XIndexAccess > xForms( pPage->GetForms( false ), UNO_QUERY ); + Reference< XIndexAccess > xForms = pPage->GetForms( false ); if ( !xForms.is() || !xForms->hasElements() ) return; @@ -3807,8 +3803,7 @@ void FmXFormShell::loadForms_Lock(FmFormPage* _pPage, const LoadFormsFlags _nBeh rFmFormModel.GetUndoEnv().Lock(); // load all forms - Reference< XIndexAccess > xForms; - xForms.set(_pPage->GetForms( false ), css::uno::UNO_QUERY); + Reference< XIndexAccess > xForms = _pPage->GetForms( false ); if ( xForms.is() ) { diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index 397b5efc5f45..56c57f529fc5 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -1039,7 +1039,7 @@ FmUndoContainerAction::FmUndoContainerAction(FmFormModel& _rMod, if ( xCont.is() && xElem.is() ) { // normalize - m_xElement.set(xElem, css::uno::UNO_QUERY); + m_xElement = xElem; if ( m_eAction == Removed ) { if (m_nIndex >= 0) diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 588c6757f55a..2e48c95e7950 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -378,7 +378,7 @@ void FormViewPageWindowAdapter::updateTabOrder( const Reference< XForm >& _rxFor // there is a parent form -> look for the respective controller Reference< XFormController > xParentController; if ( xParentForm.is() ) - xParentController.set( getController( xParentForm ), UNO_QUERY ); + xParentController = getController( xParentForm ); setController( _rxForm, xParentController ); } @@ -661,16 +661,15 @@ namespace if(xController == xActiveController && isActivableDatabaseForm(xController)) return xController; - Reference< XIndexAccess > xSubControllers( xController, UNO_QUERY ); - if ( !xSubControllers.is() ) + if ( !xController.is() ) { SAL_WARN( "svx.form", "FmXFormView::OnActivate: a form controller which does not have children?" ); return nullptr; } - for(sal_Int32 i = 0; i < xSubControllers->getCount(); ++i) + for(sal_Int32 i = 0; i < xController->getCount(); ++i) { - const Any a(xSubControllers->getByIndex(i)); + const Any a(xController->getByIndex(i)); Reference < XFormController > xI; if ((a >>= xI) && xI.is()) { @@ -920,7 +919,7 @@ IMPL_LINK_NOARG(FmXFormView, OnAutoFocus, void*, void) SdrPage *pSdrPage = pPageView ? pPageView->GetPage() : nullptr; // get the forms collection of the page we belong to FmFormPage* pPage = dynamic_cast<FmFormPage*>( pSdrPage ); - Reference< XIndexAccess > xForms( pPage ? Reference< XIndexAccess >( pPage->GetForms(), UNO_QUERY ) : Reference< XIndexAccess >() ); + Reference< XIndexAccess > xForms( pPage ? Reference< XIndexAccess >( pPage->GetForms() ) : Reference< XIndexAccess >() ); const PFormViewPageWindowAdapter pAdapter = m_aPageWindowAdapters.empty() ? nullptr : m_aPageWindowAdapters[0]; const vcl::Window* pWindow = pAdapter.get() ? pAdapter->getWindow() : nullptr; diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 1884b7a03f09..d1e12886d6ab 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -1038,7 +1038,7 @@ namespace svxform FmEntryData* pCurrentUserData = static_cast<FmEntryData*>(pCurrent->GetUserData()); - Reference< XChild > xCurrentChild(pCurrentUserData->GetChildIFace(), UNO_QUERY); + Reference< XChild > xCurrentChild = pCurrentUserData->GetChildIFace(); Reference< XIndexContainer > xContainer(xCurrentChild->getParent(), UNO_QUERY); FmFormData* pCurrentParentUserData = static_cast<FmFormData*>(pCurrentUserData->GetParent()); @@ -1081,7 +1081,7 @@ namespace svxform if (pTargetData) xContainer.set(pTargetData->GetElement(), UNO_QUERY); else - xContainer.set(GetNavModel()->GetForms(), UNO_QUERY); + xContainer = GetNavModel()->GetForms(); // always insert at the end nIndex = xContainer->getCount(); diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx index cdbdeaac4e6b..c58c79f1e3a3 100644 --- a/svx/source/form/navigatortreemodel.cxx +++ b/svx/source/form/navigatortreemodel.cxx @@ -270,7 +270,7 @@ namespace svxform if (pFolder) xContainer.set(pFolder->GetFormIface(), UNO_QUERY); else - xContainer.set(GetForms(), UNO_QUERY); + xContainer = GetForms(); bool bUndo = m_pFormModel->IsUndoEnabled(); @@ -487,7 +487,7 @@ namespace svxform // insert forms from root if( pFormData == nullptr ) { - Reference< XIndexContainer > xForms(GetForms(), UNO_QUERY); + Reference< XIndexContainer > xForms = GetForms(); if (!xForms.is()) return; diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index ed20a28de227..b798263e7498 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -342,25 +342,22 @@ GalleryProgress::GalleryProgress( const GraphicFilter* pFilter ) if ( xMonitor.is() ) { - mxProgressBar.set( xMonitor, uno::UNO_QUERY ); + mxProgressBar = xMonitor; - if( mxProgressBar.is() ) - { - OUString aProgressText; - - if( pFilter ) - { - aProgressText = SvxResId(RID_SVXSTR_GALLERY_FILTER); -// pFilter->SetUpdatePercentHdl( LINK( this, GalleryProgress, Update ) ); // sj: progress wasn't working up from SO7 at all -// // so I am removing this. The gallery progress should -// // be changed to use the XStatusIndicator instead of XProgressMonitor - } - else - aProgressText = "Gallery"; + OUString aProgressText; - xMonitor->addText( "Gallery", aProgressText, false ) ; - mxProgressBar->setRange( 0, GALLERY_PROGRESS_RANGE ); + if( pFilter ) + { + aProgressText = SvxResId(RID_SVXSTR_GALLERY_FILTER); +// pFilter->SetUpdatePercentHdl( LINK( this, GalleryProgress, Update ) ); // sj: progress wasn't working up from SO7 at all +// // so I am removing this. The gallery progress should +// // be changed to use the XStatusIndicator instead of XProgressMonitor } + else + aProgressText = "Gallery"; + + xMonitor->addText( "Gallery", aProgressText, false ) ; + mxProgressBar->setRange( 0, GALLERY_PROGRESS_RANGE ); } } diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 9fcd285572e2..725978f1bd6d 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -320,7 +320,7 @@ namespace sdr { namespace contact { { try { - Reference< XComponent > xControlComp( _rControl.getControl(), UNO_QUERY ); + Reference< XComponent > xControlComp = _rControl.getControl(); if ( xControlComp.is() ) xControlComp->dispose(); } diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index a795f07650da..9a2aff11b913 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -368,7 +368,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::activatingUI() uno::Reference < beans::XPropertySet > xFrame( lcl_getFrame_throw(mpObj)); uno::Reference < frame::XFrame > xOwnFrame( xFrame,uno::UNO_QUERY); - uno::Reference < frame::XFramesSupplier > xParentFrame( xOwnFrame->getCreator(), uno::UNO_QUERY ); + uno::Reference < frame::XFramesSupplier > xParentFrame = xOwnFrame->getCreator(); if ( xParentFrame.is() ) xParentFrame->setActiveFrame( xOwnFrame ); diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index 410def6761cb..37c6ccd94477 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -274,7 +274,7 @@ SdrUnoObj& SdrUnoObj::operator= (const SdrUnoObj& rObj) aUnoControlTypeName = rObj.aUnoControlTypeName; // copy the uno control model - const uno::Reference< awt::XControlModel > xSourceControlModel( rObj.GetUnoControlModel(), uno::UNO_QUERY ); + const uno::Reference< awt::XControlModel > xSourceControlModel = rObj.GetUnoControlModel(); if ( xSourceControlModel.is() ) { try diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 88d97fb2a1a3..185fae3746d1 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2034,7 +2034,7 @@ IMPL_LINK_NOARG(SvxColorWindow, OpenPickerClickHdl, Button*, void) } else { - const css::uno::Reference<css::awt::XWindow> xParent(mxFrame->getContainerWindow(), uno::UNO_QUERY); + const css::uno::Reference<css::awt::XWindow> xParent = mxFrame->getContainerWindow(); pParentFrame = Application::GetFrameWeld(xParent); } mxPaletteManager->PopupColorPicker(pParentFrame, maCommand, GetSelectEntryColor().first); diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index b0046aeeca9d..84eb7b700548 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -350,10 +350,10 @@ ChineseDictionaryDialog::ChineseDictionaryDialog(weld::Window* pParent) else { aLocale.Country = "TW"; - xDictionary_To_Simplified.set( + xDictionary_To_Simplified = xDictionaryList->addNewDictionary( aNameTo_Simplified , aLocale, linguistic2::ConversionDictionaryType::SCHINESE_TCHINESE - ), UNO_QUERY ); + ); } if (xDictionary_To_Simplified.is()) xDictionary_To_Simplified->setActive( true ); @@ -365,10 +365,9 @@ ChineseDictionaryDialog::ChineseDictionaryDialog(weld::Window* pParent) else { aLocale.Country = "CN"; - xDictionary_To_Traditional.set( + xDictionary_To_Traditional = xDictionaryList->addNewDictionary( aNameTo_Traditional - ,aLocale, linguistic2::ConversionDictionaryType::SCHINESE_TCHINESE), - UNO_QUERY ); + ,aLocale, linguistic2::ConversionDictionaryType::SCHINESE_TCHINESE); } if (xDictionary_To_Traditional.is()) xDictionary_To_Traditional->setActive( true ); diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 5f326ceaaf72..fd718b69098c 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -481,8 +481,7 @@ void SAL_CALL SvxDrawPage::ungroup( const Reference< drawing::XShapeGroup >& aGr SdrPageView* pPageView = mpView->ShowSdrPage( mpPage ); - Reference< drawing::XShape > xShape( aGroup, UNO_QUERY ); - SelectObjectInView( xShape, pPageView ); + SelectObjectInView( aGroup, pPageView ); mpView->UnGroupMarked(); mpView->HideSdrPage(); diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 864d79756300..33325a963cb4 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -516,7 +516,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() m_xLinguServiceManager.set(css::linguistic2::LinguServiceManager::create(xContext)); } - css::uno::Reference< css::linguistic2::XHyphenator > xHyphenator( m_xLinguServiceManager->getHyphenator(), css::uno::UNO_QUERY ); + css::uno::Reference< css::linguistic2::XHyphenator > xHyphenator = m_xLinguServiceManager->getHyphenator(); if( xHyphenator.is() ) mpOutliner->SetHyphenator( xHyphenator ); } diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx index 11aa5cd57212..59fcdaa4db6d 100644 --- a/svx/source/xml/xmleohlp.cxx +++ b/svx/source/xml/xmleohlp.cxx @@ -146,8 +146,7 @@ void SAL_CALL SvXMLEmbeddedObjectHelper::disposing() { if( mxTempStorage.is() ) { - Reference < XComponent > xComp( mxTempStorage, UNO_QUERY ); - xComp->dispose(); + mxTempStorage->dispose(); } } diff --git a/svx/source/xml/xmlexport.cxx b/svx/source/xml/xmlexport.cxx index 4c65a19491c8..351765e34cb3 100644 --- a/svx/source/xml/xmlexport.cxx +++ b/svx/source/xml/xmlexport.cxx @@ -84,11 +84,10 @@ bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputSt xGraphicHelper = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Write ); xGraphicStorageHandler = xGraphicHelper.get(); - uno::Reference<xml::sax::XDocumentHandler> xHandler( xWriter, uno::UNO_QUERY ); + uno::Reference<xml::sax::XDocumentHandler> xHandler = xWriter; // doc export - uno::Reference< io::XActiveDataSource > xDocSrc( xWriter, uno::UNO_QUERY ); - xDocSrc->setOutputStream( xOut ); + xWriter->setOutputStream( xOut ); uno::Sequence< uno::Any > aArgs( xObjectResolver.is() ? 3 : 2 ); aArgs[0] <<= xHandler; diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx index 70c1805bd58f..8175f3f7589e 100644 --- a/svx/source/xml/xmlxtexp.cxx +++ b/svx/source/xml/xmlxtexp.cxx @@ -220,8 +220,6 @@ bool SvxXMLXTableExportComponent::save( uno::Reference<embed::XStorage > xSubStorage; uno::Reference<XGraphicStorageHandler> xGraphicStorageHandler; - uno::Reference<xml::sax::XDocumentHandler> xHandler( xWriter, uno::UNO_QUERY ); - if( !bToStorage || !xStorage.is() ) { // local URL -> SfxMedium route if( bSaveAsStorage ) @@ -276,14 +274,13 @@ bool SvxXMLXTableExportComponent::save( if( !xOut.is() ) return false; - uno::Reference<io::XActiveDataSource> xMetaSrc( xWriter, uno::UNO_QUERY ); - xMetaSrc->setOutputStream( xOut ); + xWriter->setOutputStream( xOut ); if( xGraphicHelper.is() ) xGraphicStorageHandler = xGraphicHelper.get(); // Finally do the export const OUString aName; - rtl::Reference< SvxXMLXTableExportComponent > xExporter( new SvxXMLXTableExportComponent( xContext, aName, xHandler, xTable, xGraphicStorageHandler ) ); + rtl::Reference< SvxXMLXTableExportComponent > xExporter( new SvxXMLXTableExportComponent( xContext, aName, xWriter, xTable, xGraphicStorageHandler ) ); bRet = xExporter->exportTable(); if( xGraphicHelper ) @@ -296,9 +293,7 @@ bool SvxXMLXTableExportComponent::save( if( xTrans.is() ) xTrans->commit(); - uno::Reference< XComponent > xComp( xSubStorage, UNO_QUERY ); - if( xComp.is() ) - xSubStorage->dispose(); + xSubStorage->dispose(); } } catch( uno::Exception& ) |