diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-27 15:12:58 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-10-27 15:35:36 +0000 |
commit | 623f5b26ffd77041d0b06d7ce9c3b32d05625440 (patch) | |
tree | ecd905d6657147b1c5a074b4d33f914f0039440c /sc/source | |
parent | 446f17f6c1f98b17ceb6750f5dc67a27330d1351 (diff) |
don't allocate rtl::Reference or SvRef on the heap
There is no point, since it's the size of a pointer anyway
Found by temporarily making their 'operator new' methods
deleted.
Change-Id: I265e40ce93ad4bad08b4f0bd49db08929e44b7d6
Reviewed-on: https://gerrit.libreoffice.org/19628
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/documen8.cxx | 24 | ||||
-rw-r--r-- | sc/source/core/data/global.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh6.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/documentlinkmgr.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/inc/transobj.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/navipi/content.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/undo/areasave.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk3.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/linkuno.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/drawvie4.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 10 |
16 files changed, 55 insertions, 55 deletions
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 81b8cda4aae8..a6aca8fbb338 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -725,7 +725,7 @@ void ScDocument::SaveDdeLinks(SvStream& rStream) const sal_uInt16 i; for (i=0; i<nCount; i++) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); if (ScDdeLink* pLink = dynamic_cast<ScDdeLink*>(pBase)) if ( !bExport40 || pLink->GetMode() == SC_DDE_DEFAULT ) ++nDdeCount; @@ -740,7 +740,7 @@ void ScDocument::SaveDdeLinks(SvStream& rStream) const for (i=0; i<nCount; i++) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); if (ScDdeLink* pLink = dynamic_cast<ScDdeLink*>(pBase)) { if ( !bExport40 || pLink->GetMode() == SC_DDE_DEFAULT ) @@ -809,7 +809,7 @@ void ScDocument::UpdateExternalRefLinks(vcl::Window* pWin) std::vector<ScExternalRefLink*> aRefLinks; for (sal_uInt16 i = 0; i < nCount; ++i) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); ScExternalRefLink* pRefLink = dynamic_cast<ScExternalRefLink*>(pBase); if (pRefLink) aRefLinks.push_back(pRefLink); @@ -891,7 +891,7 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const const sfx2::SvBaseLinks& rLinks = pMgr->GetLinks(); for (size_t i = 0, n = rLinks.size(); i < n; ++i) { - const sfx2::SvBaseLink* pBase = *rLinks[i]; + const sfx2::SvBaseLink* pBase = rLinks[i].get(); if (const ScDdeLink* p = dynamic_cast<const ScDdeLink*>(pBase)) { ScDdeLink* pNew = new ScDdeLink(pDestDoc, *p); @@ -919,7 +919,7 @@ ScDdeLink* lclGetDdeLink( if( pnDdePos ) *pnDdePos = 0; for( size_t nIndex = 0; nIndex < nCount; ++nIndex ) { - ::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ]; + ::sfx2::SvBaseLink* pLink = rLinks[ nIndex ].get(); if( ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>( pLink ) ) { if( (OUString(pDdeLink->GetAppl()) == rAppl) && @@ -946,7 +946,7 @@ ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, size_t nDdePos size_t nDdeIndex = 0; // counts only the DDE links for( size_t nIndex = 0; nIndex < nCount; ++nIndex ) { - ::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ]; + ::sfx2::SvBaseLink* pLink = rLinks[ nIndex ].get(); if( ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>( pLink ) ) { if( nDdeIndex == nDdePos ) @@ -1044,7 +1044,7 @@ bool ScDocument::HasAreaLinks() const const ::sfx2::SvBaseLinks& rLinks = pMgr->GetLinks(); sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) - if (0 != dynamic_cast<const ScAreaLink* >((*rLinks[i]).get())) + if (0 != dynamic_cast<const ScAreaLink* >(rLinks[i].get())) return true; return false; @@ -1059,7 +1059,7 @@ void ScDocument::UpdateAreaLinks() const ::sfx2::SvBaseLinks& rLinks = pMgr->GetLinks(); for (size_t i=0; i<rLinks.size(); i++) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr) pBase->Update(); } @@ -1075,7 +1075,7 @@ void ScDocument::DeleteAreaLinksOnTab( SCTAB nTab ) sal_uInt16 nPos = 0; while ( nPos < rLinks.size() ) { - const ::sfx2::SvBaseLink* pBase = *rLinks[nPos]; + const ::sfx2::SvBaseLink* pBase = rLinks[nPos].get(); const ScAreaLink* pLink = dynamic_cast<const ScAreaLink*>(pBase); if (pLink && pLink->GetDestArea().aStart.Tab() == nTab) pMgr->Remove(nPos); @@ -1097,7 +1097,7 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode, sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); if (ScAreaLink* pLink = dynamic_cast<ScAreaLink*>(pBase)) { ScRange aOutRange = pLink->GetDestArea(); @@ -1132,13 +1132,13 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode, while ( nFirstIndex < nCount ) { bool bFound = false; - ::sfx2::SvBaseLink* pFirst = *rLinks[nFirstIndex]; + ::sfx2::SvBaseLink* pFirst = rLinks[nFirstIndex].get(); if (ScAreaLink* pFirstLink = dynamic_cast<ScAreaLink*>(pFirst)) { ScAddress aFirstPos = pFirstLink->GetDestArea().aStart; for ( sal_uInt16 nSecondIndex = nFirstIndex + 1; nSecondIndex < nCount && !bFound; ++nSecondIndex ) { - ::sfx2::SvBaseLink* pSecond = *rLinks[nSecondIndex]; + ::sfx2::SvBaseLink* pSecond = rLinks[nSecondIndex].get(); ScAreaLink* pSecondLink = dynamic_cast<ScAreaLink*>(pSecond); if (pSecondLink && pSecondLink->GetDestArea().aStart == aFirstPos) { diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 46cd6bd30590..272ff854bce6 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -81,8 +81,9 @@ #include "scmod.hxx" #include "appoptio.hxx" #include "editutil.hxx" +#include "docsh.hxx" -tools::SvRef<ScDocShell>* ScGlobal::pDrawClipDocShellRef = NULL; +tools::SvRef<ScDocShell> ScGlobal::xDrawClipDocShellRef; SvxSearchItem* ScGlobal::pSearchItem = NULL; ScAutoFormat* ScGlobal::pAutoFormat = NULL; LegacyFuncCollection* ScGlobal::pLegacyFuncCollection = NULL; diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index e702fc1cd4a3..23c1aa90bf05 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2382,7 +2382,7 @@ static ScDdeLink* lcl_GetDdeLink( sfx2::LinkManager* pLinkMgr, size_t nCount = pLinkMgr->GetLinks().size(); for (size_t i=0; i<nCount; i++ ) { - ::sfx2::SvBaseLink* pBase = *pLinkMgr->GetLinks()[i]; + ::sfx2::SvBaseLink* pBase = pLinkMgr->GetLinks()[i].get(); if (ScDdeLink* pLink = dynamic_cast<ScDdeLink*>(pBase)) { if ( pLink->GetAppl() == rA && diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 4b47706f5279..ea9401bcb39e 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -705,7 +705,7 @@ void ScXMLExport::GetAreaLinks( ScMyAreaLinksContainer& rAreaLinks ) const sfx2::SvBaseLinks& rLinks = pDoc->GetLinkManager()->GetLinks(); for (size_t i = 0; i < rLinks.size(); i++) { - ScAreaLink *pLink = dynamic_cast<ScAreaLink*>(&(*(*rLinks[i]))); + ScAreaLink *pLink = dynamic_cast<ScAreaLink*>(rLinks[i].get()); if (pLink) { ScMyAreaLink aAreaLink; diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 1154c66448e3..f137e6562e8c 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -730,19 +730,18 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize) SfxObjectShell* ScTransferObj::SetDrawClipDoc( bool bAnyOle ) { - // update ScGlobal::pDrawClipDocShellRef + // update ScGlobal::xDrawClipDocShellRef - delete ScGlobal::pDrawClipDocShellRef; + ScGlobal::xDrawClipDocShellRef.Clear(); if (bAnyOle) { - ScGlobal::pDrawClipDocShellRef = - new ScDocShellRef(new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS)); // there must be a ref - (*ScGlobal::pDrawClipDocShellRef)->DoInitNew(); - return *ScGlobal::pDrawClipDocShellRef; + ScGlobal::xDrawClipDocShellRef = new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS); // there must be a ref + ScGlobal::xDrawClipDocShellRef->DoInitNew(); + return ScGlobal::xDrawClipDocShellRef.get(); } else { - ScGlobal::pDrawClipDocShellRef = NULL; + ScGlobal::xDrawClipDocShellRef.Clear(); return NULL; } } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 98152768c11f..c3e8551af5b5 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5219,7 +5219,7 @@ bool ScDocFunc::InsertAreaLink( const OUString& rFile, const OUString& rFilter, sal_uInt16 nLinkPos = 0; while (nLinkPos<nLinkCount) { - ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[nLinkPos]; + ::sfx2::SvBaseLink* pBase = pLinkManager->GetLinks()[nLinkPos].get(); ScAreaLink* pLink = dynamic_cast<ScAreaLink*>(pBase); if (pLink && pLink->GetDestArea().aStart == rDestRange.aStart) { diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 0a012928f572..1e6f46ce5e05 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -353,7 +353,7 @@ void ScDocShell::UpdateLinks() for (size_t k=nCount; k>0; ) { --k; - ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[k]; + ::sfx2::SvBaseLink* pBase = pLinkManager->GetLinks()[k].get(); if (ScTableLink* pTabLink = dynamic_cast<ScTableLink*>(pBase)) { if (pTabLink->IsUsed()) @@ -416,7 +416,7 @@ bool ScDocShell::ReloadTabLinks() size_t nCount = pLinkManager->GetLinks().size(); for (size_t i=0; i<nCount; i++ ) { - ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; + ::sfx2::SvBaseLink* pBase = pLinkManager->GetLinks()[i].get(); if (ScTableLink* pTabLink = dynamic_cast<ScTableLink*>(pBase)) { // pTabLink->SetAddUndo(sal_False); //! Undo's zusammenfassen diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx index 19a8f0953768..6a39a349ae92 100644 --- a/sc/source/ui/docshell/documentlinkmgr.cxx +++ b/sc/source/ui/docshell/documentlinkmgr.cxx @@ -100,7 +100,7 @@ bool DocumentLinkManager::idleCheckLinks() const sfx2::SvBaseLinks& rLinks = mpImpl->mpLinkManager->GetLinks(); for (size_t i = 0, n = rLinks.size(); i < n; ++i) { - sfx2::SvBaseLink* pBase = *rLinks[i]; + sfx2::SvBaseLink* pBase = rLinks[i].get(); ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase); if (!pDdeLink || !pDdeLink->NeedsUpdate()) continue; @@ -121,7 +121,7 @@ bool DocumentLinkManager::hasDdeLinks() const const sfx2::SvBaseLinks& rLinks = mpImpl->mpLinkManager->GetLinks(); for (size_t i = 0, n = rLinks.size(); i < n; ++i) { - sfx2::SvBaseLink* pBase = *rLinks[i]; + sfx2::SvBaseLink* pBase = rLinks[i].get(); if (dynamic_cast<ScDdeLink*>(pBase)) return true; } @@ -142,7 +142,7 @@ bool DocumentLinkManager::updateDdeLinks( vcl::Window* pWin ) bool bAny = false; for (size_t i = 0, n = rLinks.size(); i < n; ++i) { - sfx2::SvBaseLink* pBase = *rLinks[i]; + sfx2::SvBaseLink* pBase = rLinks[i].get(); ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase); if (!pDdeLink) continue; @@ -186,7 +186,7 @@ bool DocumentLinkManager::updateDdeLink( const OUString& rAppl, const OUString& bool bFound = false; for (size_t i = 0, n = rLinks.size(); i < n; ++i) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase); if (!pDdeLink) continue; @@ -212,7 +212,7 @@ size_t DocumentLinkManager::getDdeLinkCount() const const sfx2::SvBaseLinks& rLinks = mpImpl->mpLinkManager->GetLinks(); for (size_t i = 0, n = rLinks.size(); i < n; ++i) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase); if (!pDdeLink) continue; @@ -231,7 +231,7 @@ void DocumentLinkManager::disconnectDdeLinks() const sfx2::SvBaseLinks& rLinks = mpImpl->mpLinkManager->GetLinks(); for (size_t i = 0, n = rLinks.size(); i < n; ++i) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase); if (pDdeLink) pDdeLink->Disconnect(); diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx index a068c74540dc..855cc50c10b8 100644 --- a/sc/source/ui/inc/transobj.hxx +++ b/sc/source/ui/inc/transobj.hxx @@ -101,7 +101,7 @@ public: static SC_DLLPUBLIC ScTransferObj* GetOwnClipboard( vcl::Window* pUIWin ); - static SfxObjectShell* SetDrawClipDoc( bool bAnyOle ); // update ScGlobal::pDrawClipDocShellRef + static SfxObjectShell* SetDrawClipDoc( bool bAnyOle ); // update ScGlobal::xDrawClipDocShellRef virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException, std::exception ) override; static const com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); }; diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 9b03f5b0eff3..0247cdffeb39 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -1026,7 +1026,7 @@ void ScContentTree::GetLinkNames() sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr) InsertContent( ScContentId::AREALINK, static_cast<ScAreaLink*>(pBase)->GetSource() ); @@ -1047,7 +1047,7 @@ const ScAreaLink* ScContentTree::GetLink( sal_uLong nIndex ) sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr) { if (nFound == nIndex) diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx index 8c2bd5d9b0d1..b8678f376c1a 100644 --- a/sc/source/ui/undo/areasave.cxx +++ b/sc/source/ui/undo/areasave.cxx @@ -106,7 +106,7 @@ bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const sal_uInt16 nLinkCount = rLinks.size(); for (sal_uInt16 i=0; i<nLinkCount; i++) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr) { if ( nPos >= size() || !(*this)[nPos].IsEqual( *static_cast<ScAreaLink*>(pBase) ) ) @@ -127,7 +127,7 @@ static ScAreaLink* lcl_FindLink( const ::sfx2::SvBaseLinks& rLinks, const ScArea sal_uInt16 nLinkCount = rLinks.size(); for (sal_uInt16 i=0; i<nLinkCount; i++) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); if ( dynamic_cast<const ScAreaLink*>( pBase) != nullptr && rSaver.IsEqualSource( *static_cast<ScAreaLink*>(pBase) ) ) { @@ -172,7 +172,7 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum sal_uInt16 nLinkCount = rLinks.size(); for (sal_uInt16 i=0; i<nLinkCount; i++) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr) { if (!pColl) diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 187127c168ea..475cf1d280e8 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -1482,7 +1482,7 @@ static ScAreaLink* lcl_FindAreaLink( sfx2::LinkManager* pLinkManager, const OUSt sal_uInt16 nCount = pLinkManager->GetLinks().size(); for (sal_uInt16 i=0; i<nCount; i++) { - ::sfx2::SvBaseLink* pBase = *rLinks[i]; + ::sfx2::SvBaseLink* pBase = rLinks[i].get(); if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr) if ( static_cast<ScAreaLink*>(pBase)->IsEqual( rDoc, rFlt, rOpt, rSrc, rDest ) ) return static_cast<ScAreaLink*>(pBase); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 62dd3743110d..eb3cd065dada 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -7682,7 +7682,7 @@ void SAL_CALL ScTableSheetObj::link( const OUString& aUrl, const OUString& aShee sal_uInt16 nCount = pLinkManager->GetLinks().size(); for ( sal_uInt16 i=0; i<nCount; i++ ) { - ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; + ::sfx2::SvBaseLink* pBase = pLinkManager->GetLinks()[i].get(); if (dynamic_cast<const ScTableLink*>( pBase) != nullptr) { ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase); diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index 7dcfc8d2b4fc..0258478524fc 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -115,7 +115,7 @@ ScTableLink* ScSheetLinkObj::GetLink_Impl() const size_t nCount = pLinkManager->GetLinks().size(); for (size_t i=0; i<nCount; i++) { - ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; + ::sfx2::SvBaseLink* pBase = pLinkManager->GetLinks()[i].get(); if (dynamic_cast<const ScTableLink*>( pBase) != nullptr) { ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase); @@ -584,7 +584,7 @@ static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, size_t nPos ) size_t nAreaCount = 0; for (size_t i=0; i<nTotalCount; i++) { - ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; + ::sfx2::SvBaseLink* pBase = pLinkManager->GetLinks()[i].get(); if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr) { if ( nAreaCount == nPos ) @@ -1006,7 +1006,7 @@ sal_Int32 SAL_CALL ScAreaLinksObj::getCount() throw(uno::RuntimeException, std:: size_t nTotalCount = pLinkManager->GetLinks().size(); for (size_t i=0; i<nTotalCount; i++) { - ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; + ::sfx2::SvBaseLink* pBase = pLinkManager->GetLinks()[i].get(); if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr) ++nAreaCount; } diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 26b90adcd676..00cdb03dba2e 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -360,13 +360,13 @@ void ScDrawView::DoCopy() std::vector<ScRange> aRanges; getChartSourceRanges(pDoc, rMarkList, aRanges); - // update ScGlobal::pDrawClipDocShellRef + // update ScGlobal::xDrawClipDocShellRef ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc(!aRanges.empty()) ); - if (ScGlobal::pDrawClipDocShellRef) + if (ScGlobal::xDrawClipDocShellRef.Is()) { // Copy data referenced by the chart objects to the draw clip // document. We need to do this before GetMarkedObjModel() below. - ScDocShellRef xDocSh = *ScGlobal::pDrawClipDocShellRef; + ScDocShellRef xDocSh = ScGlobal::xDrawClipDocShellRef; ScDocument& rClipDoc = xDocSh->GetDocument(); copyChartRefDataToClipDoc(pDoc, &rClipDoc, aRanges); } @@ -388,9 +388,9 @@ void ScDrawView::DoCopy() ScDrawTransferObj* pTransferObj = new ScDrawTransferObj( pModel, pDocSh, aObjDesc ); uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj ); - if ( ScGlobal::pDrawClipDocShellRef ) + if ( ScGlobal::xDrawClipDocShellRef.Is() ) { - pTransferObj->SetDrawPersist( &(*ScGlobal::pDrawClipDocShellRef) ); // keep persist for ole objects alive + pTransferObj->SetDrawPersist( ScGlobal::xDrawClipDocShellRef.get() ); // keep persist for ole objects alive } pTransferObj->CopyToClipboard( pViewData->GetActiveWin() ); // system clipboard @@ -403,7 +403,7 @@ uno::Reference<datatransfer::XTransferable> ScDrawView::CopyToTransferable() const SdrMarkList& rMarkList = GetMarkedObjectList(); CheckOle( rMarkList, bAnyOle, bOneOle ); - // update ScGlobal::pDrawClipDocShellRef + // update ScGlobal::xDrawClipDocShellRef ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) ); SdrModel* pModel = GetMarkedObjModel(); ScDrawLayer::SetGlobalDrawPersist(NULL); @@ -424,9 +424,9 @@ uno::Reference<datatransfer::XTransferable> ScDrawView::CopyToTransferable() ScDrawTransferObj* pTransferObj = new ScDrawTransferObj( pModel, pDocSh, aObjDesc ); uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj ); - if ( ScGlobal::pDrawClipDocShellRef ) + if ( ScGlobal::xDrawClipDocShellRef.Is() ) { - pTransferObj->SetDrawPersist( &(*ScGlobal::pDrawClipDocShellRef) ); // keep persist for ole objects alive + pTransferObj->SetDrawPersist( ScGlobal::xDrawClipDocShellRef.get() ); // keep persist for ole objects alive } return xTransferable; diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index e0f6deb408f8..42a7c37d3781 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -217,7 +217,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b if ( bSysClip && bIncludeObjects ) { bool bAnyOle = pDoc->HasOLEObjectsInArea( aRange ); - // Update ScGlobal::pDrawClipDocShellRef. + // Update ScGlobal::xDrawClipDocShellRef. ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) ); } @@ -264,9 +264,9 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b ScTransferObj* pTransferObj = new ScTransferObj( pClipDoc, aObjDesc ); uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj ); - if ( ScGlobal::pDrawClipDocShellRef ) + if ( ScGlobal::xDrawClipDocShellRef.Is() ) { - SfxObjectShellRef aPersistRef( &(*ScGlobal::pDrawClipDocShellRef) ); + SfxObjectShellRef aPersistRef( ScGlobal::xDrawClipDocShellRef ); pTransferObj->SetDrawPersist( aPersistRef );// keep persist for ole objects alive } @@ -373,9 +373,9 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b ScTransferObj* pTransferObj = new ScTransferObj( pDocClip.release(), aObjDesc ); uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj ); - if ( ScGlobal::pDrawClipDocShellRef ) + if ( ScGlobal::xDrawClipDocShellRef.Is() ) { - SfxObjectShellRef aPersistRef( &(*ScGlobal::pDrawClipDocShellRef) ); + SfxObjectShellRef aPersistRef( ScGlobal::xDrawClipDocShellRef ); pTransferObj->SetDrawPersist( aPersistRef ); // keep persist for ole objects alive } |