diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-11 15:40:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-12 09:56:01 +0200 |
commit | 389da66dfc96d06c407bff156c4ea21e940c5e06 (patch) | |
tree | 2d1ebce6bdb2d952700ed5aaeb808289e9f72a7d /sw | |
parent | a651dbcfca9e198b5c2561076961504586bc6bea (diff) |
remove unused uno::Reference vars
found by temporarily marking Reference as SAL_WARN_UNUSED.
Change-Id: I18809b62654467f890016adcc92576980ced393b
Reviewed-on: https://gerrit.libreoffice.org/37511
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
36 files changed, 21 insertions, 87 deletions
diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx index 0c988ba85492..3a7cf745ccb9 100644 --- a/sw/source/core/access/accnotextframe.cxx +++ b/sw/source/core/access/accnotextframe.cxx @@ -312,8 +312,6 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL ThrowIfDisposed(); - uno::Reference< XAccessibleHyperlink > xRet; - SwFormatURL aURL( static_cast<const SwLayoutFrame*>(GetFrame())->GetFormat()->GetURL() ); if( nLinkIndex > 0 ) diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 46967a4eb069..6bebf435306c 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -307,7 +307,6 @@ uno::Any SwSpellIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) if ( !pCursor->HasMark() ) pCursor->SetMark(); - uno::Reference< beans::XPropertySet > xProp( GetLinguPropertySet() ); *pMySh->GetCursor()->GetPoint() = *GetCurr(); *pMySh->GetCursor()->GetMark() = *GetEnd(); pMySh->GetDoc()->Spell(*pMySh->GetCursor(), diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx index 6a303b1717ae..c2a548179238 100644 --- a/sw/source/core/frmedt/feflyole.cxx +++ b/sw/source/core/frmedt/feflyole.cxx @@ -105,7 +105,6 @@ bool SwFEShell::FinishOLEObj() // Server is terminated bool bRet = pIPClient->IsObjectInPlaceActive(); if( bRet ) { - uno::Reference < embed::XEmbeddedObject > xObj = pIPClient->GetObject(); if( CNT_OLE == GetCntType() ) ClearAutomaticContour(); diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx index 157608397612..ba3cb734ce3b 100644 --- a/sw/source/core/swg/SwXMLTextBlocks1.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx @@ -221,12 +221,6 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx, // connect parser and filter xParser->setDocumentHandler( xFilter ); - // connect model and filter - uno::Reference<document::XImporter> xImporter( xFilter, UNO_QUERY ); - - // we don't need a model - // xImporter->setTargetDocument( xModelComponent ); - // parse the stream try { diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index ad4f5d36e799..d6a3bdc40681 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -339,8 +339,7 @@ bool SwFormatINetFormat::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) // Create hyperlink event descriptor. Then copy events // from argument into descriptor. Then copy events from // the descriptor into the format. - SwHyperlinkEventDescriptor* pEvents = new SwHyperlinkEventDescriptor(); - uno::Reference< lang::XServiceInfo> xHold = pEvents; + rtl::Reference<SwHyperlinkEventDescriptor> pEvents = new SwHyperlinkEventDescriptor(); pEvents->copyMacrosFromNameReplace(xReplace); pEvents->copyMacrosIntoINetFormat(*this); } diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 576d0d08ff93..a5589b23885e 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -54,8 +54,6 @@ void SwChartHelper::DoUpdateAllCharts( SwDoc* pDoc ) if (!pDoc) return; - uno::Reference< frame::XModel > xRes; - SwOLENode *pONd; SwStartNode *pStNd; SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 6ef892f8f5c4..6f4c5d2de9d2 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -588,8 +588,6 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) } GetSvxPage()->add(xShape); - uno::Reference< uno::XAggregation > xAgg = pShape->GetAggregationInterface(); - OSL_ENSURE(pSvxShape, "Why is here no SvxShape?"); // this position is definitely in 1/100 mm awt::Point aMM100Pos(pSvxShape->getPosition()); @@ -2156,7 +2154,6 @@ void SwXShape::dispose() void SwXShape::addEventListener( const uno::Reference< lang::XEventListener > & aListener) { - uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShapeAgg, uno::UNO_QUERY); SvxShape* pSvxShape = GetSvxShape(); if(pSvxShape) pSvxShape->addEventListener(aListener); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index f874b2f32469..35641d6762cd 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -3048,7 +3048,6 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) attachToRange(xTextRange); else if(nullptr != (pFormat = GetFrameFormat())) { - uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY); SwDoc* pDoc = pFormat->GetDoc(); SwUnoInternalPaM aIntPam(*pDoc); if (::sw::XTextRangeToSwPaM(aIntPam, xTextRange)) diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 91a84c2e30f0..53800f99400a 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1191,7 +1191,6 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos) case SwFootnoteStartNode: { const size_t nFootnoteCnt = rDoc.GetFootnoteIdxs().size(); - uno::Reference< text::XFootnote > xRef; for (size_t n = 0; n < nFootnoteCnt; ++n ) { const SwTextFootnote* pTextFootnote = rDoc.GetFootnoteIdxs()[ n ]; diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index eb153b67b5cc..80d1adb4d405 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -505,7 +505,6 @@ void SwXRedline::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) uno::Reference< container::XEnumeration > SwXRedline::createEnumeration() { SolarMutexGuard aGuard; - uno::Reference< container::XEnumeration > xRet; if(!pDoc) throw uno::RuntimeException(); diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 37d5c1e6da2b..1a67dcca1dd3 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -2108,7 +2108,6 @@ uno::Reference<text::XTextTableCursor> SwXTextTable::createCursorByCellName(cons { SolarMutexGuard aGuard; SwFrameFormat* pFormat = lcl_EnsureCoreConnected(GetFrameFormat(), static_cast<cppu::OWeakObject*>(this)); - uno::Reference<text::XTextTableCursor> xRet; SwTable* pTable = SwTable::FindTable(pFormat); SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTableBox(sCellName)); if(!pBox || pBox->getRowSpan() == 0) @@ -2298,7 +2297,6 @@ uno::Reference<table::XCellRange> SwXTextTable::getCellRangeByPosition(sal_Int3 uno::Reference<table::XCellRange> SwXTextTable::getCellRangeByName(const OUString& sRange) { SolarMutexGuard aGuard; - uno::Reference< table::XCellRange > aRef; SwFrameFormat* pFormat = lcl_EnsureCoreConnected(GetFrameFormat(), static_cast<cppu::OWeakObject*>(this)); SwTable* pTable = lcl_EnsureTableNotComplex(SwTable::FindTable(pFormat), static_cast<cppu::OWeakObject*>(this)); sal_Int32 nPos = 0; diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 1fd184b1db6d..d166bba9ad6c 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2773,7 +2773,6 @@ SwXHeadFootText::createEnumeration() SwFrameFormat & rHeadFootFormat( m_pImpl->GetHeadFootFormatOrThrow() ); - uno::Reference< container::XEnumeration > aRef; const SwFormatContent& rFlyContent = rHeadFootFormat.GetContent(); const SwNode& rNode = rFlyContent.GetContentIdx()->GetNode(); SwPosition aPos(rNode); diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 08319ee5a1bc..ee8f0274221b 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -575,7 +575,6 @@ void SwHTMLImageWatcher::disposing(const lang::EventObject& evt) uno::Reference< awt::XImageConsumer > xTmp; // Wenn das Shape verschwindet soll muessen wir es loslassen - uno::Reference< drawing::XShape > xTmpShape; if( evt.Source == xShape ) { clear(); @@ -1849,9 +1848,8 @@ void SwHTMLParser::InsertInput() if( bSetGrfWidth || bSetGrfHeight ) { - SwHTMLImageWatcher* pWatcher = + rtl::Reference<SwHTMLImageWatcher> pWatcher = new SwHTMLImageWatcher( xShape, bSetGrfWidth, bSetGrfHeight ); - uno::Reference< awt::XImageConsumer > xCons = pWatcher; pWatcher->start(); } } diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 6eef5c94decb..a7a69e1e1f5a 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -1032,14 +1032,12 @@ void DocxSdrExport::writeDMLEffectLst(const SwFrameFormat& rFrameFormat) } -void DocxSdrExport::writeDiagramRels(const uno::Reference<xml::dom::XDocument>& xDom, - const uno::Sequence< uno::Sequence< uno::Any > >& xRelSeq, +void DocxSdrExport::writeDiagramRels(const uno::Sequence< uno::Sequence< uno::Any > >& xRelSeq, const uno::Reference<io::XOutputStream>& xOutStream, const OUString& sGrabBagProperyName, int nAnchorId) { // add image relationships of OOXData, OOXDiagram OUString sType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"); - uno::Reference< xml::sax::XSAXSerializable > xSerializer(xDom, uno::UNO_QUERY); uno::Reference< xml::sax::XWriter > xWriter = xml::sax::Writer::create(comphelper::getProcessComponentContext()); xWriter->setOutputStream(xOutStream); @@ -1251,7 +1249,7 @@ void DocxSdrExport::writeDiagram(const SdrObject* sdrObject, const SwFrameFormat uno::Sequence< beans::StringPair >()); // write the associated Images and rels for data file - writeDiagramRels(dataDom, xDataRelSeq, xDataOutputStream, "OOXDiagramDataRels", nAnchorId); + writeDiagramRels(xDataRelSeq, xDataOutputStream, "OOXDiagramDataRels", nAnchorId); // write layout file serializer.set(layoutDom, uno::UNO_QUERY); @@ -1288,7 +1286,7 @@ void DocxSdrExport::writeDiagram(const SdrObject* sdrObject, const SwFrameFormat // write the associated Images and rels for drawing file uno::Sequence< uno::Sequence< uno::Any > > xDrawingRelSeq; diagramDrawing[1] >>= xDrawingRelSeq; - writeDiagramRels(drawingDom, xDrawingRelSeq, xDrawingOutputStream, "OOXDiagramDrawingRels", nAnchorId); + writeDiagramRels(xDrawingRelSeq, xDrawingOutputStream, "OOXDiagramDrawingRels", nAnchorId); } } diff --git a/sw/source/filter/ww8/docxsdrexport.hxx b/sw/source/filter/ww8/docxsdrexport.hxx index e4f4a80eddad..a745dc68bbd6 100644 --- a/sw/source/filter/ww8/docxsdrexport.hxx +++ b/sw/source/filter/ww8/docxsdrexport.hxx @@ -97,8 +97,7 @@ public: void writeDMLEffectLst(const SwFrameFormat& rFrameFormat); /// Writes a diagram (smartart). void writeDiagram(const SdrObject* sdrObject, const SwFrameFormat& rFrameFormat, int nAnchorId); - void writeDiagramRels(const css::uno::Reference<css::xml::dom::XDocument>& xDom, - const css::uno::Sequence< css::uno::Sequence<css::uno::Any> >& xRelSeq, + void writeDiagramRels(const css::uno::Sequence< css::uno::Sequence<css::uno::Any> >& xRelSeq, const css::uno::Reference<css::io::XOutputStream>& xOutStream, const OUString& sGrabBagProperyName, int nAnchorId); /// Writes text frame in DML format. diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 0b4059161d82..cd26c4debb67 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -463,13 +463,12 @@ Reference<XTextCursor> XMLRedlineImportHelper::CreateRedlineTextSection( aFind->second->pContentIndex = new SwNodeIndex(aIndex); // create XText for document - SwXText* pXText = new SwXRedlineText(pDoc, aIndex); - Reference<XText> xText = pXText; // keep Reference until end of method + rtl::Reference<SwXRedlineText> pXText = new SwXRedlineText(pDoc, aIndex); // create (UNO-) cursor SwPosition aPos(*pRedlineNode); SwXTextCursor *const pXCursor = - new SwXTextCursor(*pDoc, pXText, CursorType::Redline, aPos); + new SwXTextCursor(*pDoc, pXText.get(), CursorType::Redline, aPos); pXCursor->GetCursor().Move(fnMoveForward, GoInNode); // cast to avoid ambiguity xReturn = static_cast<text::XWordCursor*>(pXCursor); diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index 154cb7382064..1c507b99a57f 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -500,15 +500,12 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - uno::Reference< io::XActiveDataSource > xSource; - uno::Reference< XInterface > xPipe; uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; SvXMLGraphicHelper *pGraphicHelper = nullptr; uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver; SvXMLEmbeddedObjectHelper *pObjectHelper = nullptr; // get the input stream (storage or stream) - uno::Reference<io::XInputStream> xInputStream; uno::Reference<embed::XStorage> xStorage; if( pMedium ) xStorage = pMedium->GetStorage(); diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index fcaeea8fcf09..ee70db8fc751 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -77,7 +77,6 @@ sal_uInt32 SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& comphelper::getProcessComponentContext(); // Get data sink ... - uno::Reference< io::XOutputStream > xOut; tools::SvRef<SotStorageStream> xDocStream; uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; SvXMLGraphicHelper *pGraphicHelper = nullptr; diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index ef108972ad20..7ee76a429f9f 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -202,8 +202,6 @@ void SwXMLExport::ExportAutoStyles_() if( getExportFlags() & SvXMLExportFlags::CONTENT ) { GetTextParagraphExport()->exportTrackedChanges( true ); - Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); - Reference < XText > xText = xTextDoc->getText(); // collect form autostyle // (do this before collectTextAutoStyles, 'cause the shapes need the results of the work diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 16c6a6c9069a..96ab523f636b 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -1281,9 +1281,7 @@ void DDListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) { ReleaseMouse(); - TransferDataContainer* pContainer = new TransferDataContainer; - uno::Reference< - datatransfer::XTransferable > xRef( pContainer ); + rtl::Reference<TransferDataContainer> pContainer = new TransferDataContainer; sal_Int32 nUserData = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData()); //special entries can only be once in the address / greeting diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 0c9ca99dd842..72b2bb61fbee 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -107,9 +107,6 @@ IMPL_LINK_NOARG(SwMultiTOXTabDialog, CreateExample_Hdl, SwOneExampleFrame&, void if( pDoc ) pDoc->GetDocShell()->LoadStyles_( *m_rWrtShell.GetView().GetDocShell(), true ); - uno::Reference< lang::XMultiServiceFactory > xFact( - xModel, uno::UNO_QUERY); - uno::Reference< text::XTextSectionsSupplier > xSectionSupplier( xModel, uno::UNO_QUERY); uno::Reference< container::XNameAccess > xSections = diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx index 0ca98f9bd478..2a73235d129e 100644 --- a/sw/source/ui/vba/vbadocument.cxx +++ b/sw/source/ui/vba/vbadocument.cxx @@ -280,7 +280,6 @@ SwVbaDocument::setAttachedTemplate( const css::uno::Any& _attachedtemplate ) else osl::FileBase::getFileURLFromSystemPath( sTemplate, aURL ); - uno::Reference< word::XTemplate > xTemplate; uno::Reference<css::document::XDocumentPropertiesSupplier> const xDocPropSupp( getModel(), uno::UNO_QUERY_THROW ); uno::Reference< css::document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW ); diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 12356405b8b3..41dd001ed534 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -808,8 +808,7 @@ void SwDocShell::Execute(SfxRequest& rReq) } else { - TransferDataContainer* pClipCntnr = new TransferDataContainer; - css::uno::Reference< css::datatransfer::XTransferable > xRef( pClipCntnr ); + rtl::Reference<TransferDataContainer> pClipCntnr = new TransferDataContainer; pClipCntnr->CopyAnyData( SotClipboardFormatId::RTF, static_cast<sal_Char const *>( pStrm->GetData()), pStrm->GetEndOfData() ); diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx index 78300a9e7ac7..28437f6e7d5e 100644 --- a/sw/source/uibase/app/swmodul1.cxx +++ b/sw/source/uibase/app/swmodul1.cxx @@ -372,7 +372,6 @@ SwChapterNumRules* SwModule::GetChapterNumRules() void SwModule::ShowDBObj(SwView& rView, const SwDBData& rData) { Reference<XFrame> xFrame = rView.GetViewFrame()->GetFrame().GetFrameInterface(); - Reference<XDispatchProvider> xDP(xFrame, uno::UNO_QUERY); uno::Reference<XFrame> xBeamerFrame = xFrame->findFrame("_beamer", FrameSearchFlag::CHILDREN); if (xBeamerFrame.is()) diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx index ca8baa5ba6f5..0a129288517f 100644 --- a/sw/source/uibase/config/StoredChapterNumbering.cxx +++ b/sw/source/uibase/config/StoredChapterNumbering.cxx @@ -414,9 +414,6 @@ void ExportStoredChapterNumberingRules(SwChapterNumRules & rRules, uno::Reference<io::XActiveDataSource> const xADS(xWriter, uno::UNO_QUERY); xADS->setOutputStream(xOutStream); - uno::Reference<xml::sax::XDocumentHandler> const xHandler( - xWriter, uno::UNO_QUERY); - rtl::Reference<StoredChapterNumberingExport> exp(new StoredChapterNumberingExport(xContext, rFileName, xWriter)); // if style name contains a space then name != display-name diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 02edbcaeb0a5..05f541ecc730 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -2332,11 +2332,9 @@ bool SwDBManager::OpenDataSource(const OUString& rDataSource, const OUString& rT aData.nCommandType = -1; SwDSParam* pFound = FindDSData(aData, true); - uno::Reference< sdbc::XDataSource> xSource; if(pFound->xResultSet.is()) return true; SwDSParam* pParam = FindDSConnection(rDataSource, false); - uno::Reference< sdbc::XConnection> xConnection; if(pParam && pParam->xConnection.is()) pFound->xConnection = pParam->xConnection; if(pFound->xConnection.is()) diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index cc8435b37dbb..c7ac900b50db 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -447,8 +447,7 @@ void SwDBTreeList::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) OUString sDBName( GetDBName( sTableName, sColumnName )); if (!sDBName.isEmpty()) { - TransferDataContainer* pContainer = new TransferDataContainer; - css::uno::Reference< css::datatransfer::XTransferable > xRef( pContainer ); + rtl::Reference<TransferDataContainer> pContainer = new TransferDataContainer; if( !sColumnName.isEmpty() ) { // drag database field @@ -457,7 +456,7 @@ void SwDBTreeList::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) sTableName, sColumnName, (ColumnTransferFormatFlags::FIELD_DESCRIPTOR|ColumnTransferFormatFlags::COLUMN_DESCRIPTOR) ) ); - xColTransfer->addDataToContainer( pContainer ); + xColTransfer->addDataToContainer( pContainer.get() ); } sDBName += "." + sTableName; diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx index 75c0c9eea027..8add26e4fb38 100644 --- a/sw/source/uibase/dochdl/gloshdl.cxx +++ b/sw/source/uibase/dochdl/gloshdl.cxx @@ -689,9 +689,7 @@ bool SwGlossaryHdl::CopyToClipboard(SwWrtShell& rSh, const OUString& rShortName) SwTextBlocks *pGlossary = pCurGrp ? pCurGrp.get() : rStatGlossaries.GetGroupDoc(aCurGrp); - SwTransferable* pTransfer = new SwTransferable( rSh ); -/*??*/uno::Reference< - datatransfer::XTransferable > xRef( pTransfer ); + rtl::Reference<SwTransferable> pTransfer = new SwTransferable( rSh ); int nRet = pTransfer->CopyGlossary( *pGlossary, rShortName ); if( !pCurGrp ) diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 28ae025eeb47..4787dc9a7a4d 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -3569,12 +3569,11 @@ void SwTransferable::CreateSelection( SwWrtShell& rSh, const SwFrameShell * _pCreatorView ) { SwModule *pMod = SW_MOD(); - SwTransferable* pNew = new SwTransferable( rSh ); + rtl::Reference<SwTransferable> pNew = new SwTransferable( rSh ); pNew->m_pCreatorView = _pCreatorView; - uno::Reference< XTransferable > xRef( pNew ); - pMod->m_pXSelection = pNew; + pMod->m_pXSelection = pNew.get(); pNew->CopyToSelection( rSh.GetWin() ); } diff --git a/sw/source/uibase/docvw/edtdd.cxx b/sw/source/uibase/docvw/edtdd.cxx index 59badc65b7ca..a355cefa2ca5 100644 --- a/sw/source/uibase/docvw/edtdd.cxx +++ b/sw/source/uibase/docvw/edtdd.cxx @@ -134,9 +134,7 @@ void SwEditWin::StartExecuteDrag() m_bIsInDrag = true; - SwTransferable* pTransfer = new SwTransferable( m_rView.GetWrtShell() ); - uno::Reference< - datatransfer::XTransferable > xRef( pTransfer ); + rtl::Reference<SwTransferable> pTransfer = new SwTransferable( m_rView.GetWrtShell() ); pTransfer->StartDrag( this, m_aMovePos ); } diff --git a/sw/source/uibase/docvw/romenu.cxx b/sw/source/uibase/docvw/romenu.cxx index 301c083220d4..a06abe1b5a1f 100644 --- a/sw/source/uibase/docvw/romenu.cxx +++ b/sw/source/uibase/docvw/romenu.cxx @@ -282,7 +282,7 @@ void SwReadOnlyPopup::Execute( vcl::Window* pWin, sal_uInt16 nId ) return; } - TransferDataContainer* pClipCntnr = nullptr; + rtl::Reference<TransferDataContainer> pClipCntnr; sal_uInt16 nExecId = USHRT_MAX; bool bFilterSet = false; @@ -351,10 +351,8 @@ void SwReadOnlyPopup::Execute( vcl::Window* pWin, sal_uInt16 nId ) if( bFilterSet ) ::LoadURL(rSh, sURL, nFilter, sTargetFrameName); - if( pClipCntnr ) + if( pClipCntnr && pClipCntnr->HasAnyData() ) { - css::uno::Reference< css::datatransfer::XTransferable > xRef( pClipCntnr ); - if( pClipCntnr->HasAnyData() ) pClipCntnr->CopyToClipboard( pWin ); } } diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 5367b0cac7fe..a5aeb348f25c 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -259,8 +259,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) rView.GetEditWin().FlushInBuffer(); if ( rSh.HasSelection() ) { - SwTransferable* pTransfer = new SwTransferable( rSh ); -/*??*/ uno::Reference< datatransfer::XTransferable > xRef( pTransfer ); + rtl::Reference<SwTransferable> pTransfer = new SwTransferable( rSh ); if ( nId == SID_CUT && FlyProtectFlags::NONE == rSh.IsSelObjProtected(FlyProtectFlags::Content|FlyProtectFlags::Parent) ) pTransfer->Cut(); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 229ca46cd00a..4627172c4728 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -730,10 +730,7 @@ void SwTextShell::Execute(SfxRequest &rReq) break; case FN_CALCULATE: { - SwTransferable* pTransfer = new SwTransferable( rWrtSh ); -/*??*/ uno::Reference< - datatransfer::XTransferable > xRef( - pTransfer ); + rtl::Reference<SwTransferable> pTransfer = new SwTransferable( rWrtSh ); pTransfer->CalculateAndCopy(); rReq.Done(); } diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 316054ad2d1e..719db274fac0 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -976,7 +976,6 @@ Reference< XInterface > SwXTextDocument::findNext(const Reference< XInterface > const Reference< util::XSearchDescriptor > & xDesc) { SolarMutexGuard aGuard; - Reference< XInterface > xTmp; sal_Int32 nResult = 0; Reference< XTextCursor > xCursor; if(!xStartAt.is()) diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 17b53047a784..94c19a4872b2 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -385,10 +385,6 @@ uno::Any SwXTextView::getSelection() case ShellMode::DrawText : case ShellMode::Bezier : { - uno::Reference< drawing::XDrawPageSupplier > xPageSupp; - uno::Reference< frame::XModel > xModel = m_pView->GetDocShell()->GetBaseModel(); - uno::Reference< lang::XUnoTunnel > xModelTunnel(xModel, uno::UNO_QUERY); - uno::Reference< drawing::XShapes > xShCol = drawing::ShapeCollection::create( comphelper::getProcessComponentContext()); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index ee788fd86840..796bfb10ebf7 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1008,9 +1008,7 @@ void SwContentTree::StartDrag( sal_Int8 nAction, const Point& rPosPixel ) { ReleaseMouse(); - TransferDataContainer* pContainer = new TransferDataContainer; - uno::Reference< - datatransfer::XTransferable > xRef( pContainer ); + rtl::Reference<TransferDataContainer> pContainer = new TransferDataContainer; sal_Int8 nDragMode = DND_ACTION_COPYMOVE | DND_ACTION_LINK; if( FillTransferData( *pContainer, nDragMode )) |