summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorJacek Fraczek <fraczek.jacek@gmail.com>2016-10-05 22:00:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-10-10 08:48:30 +0000
commitf004aa99514d385f3ee254bba735f5eaeb7d9ad8 (patch)
treeaacd5792f553b8e9cbf029cc7e0797ed0dd423fe /sw/source/core
parent728c7327bd97602a38723553ed044ea4c01d13b2 (diff)
tdf#89307: Removed SvRef::operator T*()
Conditional statements are using SvRef::Is() method. Changed static_cast<T*>(svRef<T>) occurances to svRef.get(). Added operator == and != to SvRef. SbxObject::Execute is using SbxVariableRef internally. SbxObject::FindQualified is using SbxVariableRef internally. Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395 Reviewed-on: https://gerrit.libreoffice.org/29621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/crsr/bookmrk.cxx2
-rw-r--r--sw/source/core/doc/DocumentLinksAdministrationManager.cxx4
-rw-r--r--sw/source/core/docnode/section.cxx8
-rw-r--r--sw/source/core/fields/ddefld.cxx10
-rw-r--r--sw/source/core/graphic/ndgrf.cxx28
5 files changed, 26 insertions, 26 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index b5364d2b7c0d..ec2f70b29ebc 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -253,7 +253,7 @@ namespace sw { namespace mark
void DdeBookmark::DeregisterFromDoc(SwDoc* const pDoc)
{
if(m_aRefObj.Is())
- pDoc->getIDocumentLinksAdministration().GetLinkManager().RemoveServer(m_aRefObj);
+ pDoc->getIDocumentLinksAdministration().GetLinkManager().RemoveServer(m_aRefObj.get());
}
DdeBookmark::~DdeBookmark()
diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
index 0949aa77d582..1255eccc5433 100644
--- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
+++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
@@ -75,7 +75,7 @@ namespace
tools::SvRef<sfx2::SvBaseLink> xLink = pLnk;
OUString sFName;
- sfx2::LinkManager::GetDisplayNames( xLink, nullptr, &sFName );
+ sfx2::LinkManager::GetDisplayNames( xLink.get(), nullptr, &sFName );
INetURLObject aURL( sFName );
if( INetProtocol::File == aURL.GetProtocol() ||
@@ -417,7 +417,7 @@ bool DocumentLinksAdministrationManager::EmbedAllLinks()
// if one forgot to remove itself
if( xLink.Is() )
- rLnkMgr.Remove( xLink );
+ rLnkMgr.Remove( xLink.get() );
bRet = true;
}
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index cae15e316a47..c46e1ea633aa 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -243,7 +243,7 @@ SwSection::~SwSection()
if (CONTENT_SECTION != m_Data.GetType())
{
- pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( m_RefLink );
+ pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( m_RefLink.get() );
}
if (m_RefObj.Is())
@@ -559,7 +559,7 @@ OUString SwSection::GetLinkFileName() const
OUString sFilter;
if (m_RefLink->GetLinkManager() &&
sfx2::LinkManager::GetDisplayNames(
- m_RefLink, nullptr, &sTmp, &sRange, &sFilter ))
+ m_RefLink.get(), nullptr, &sTmp, &sRange, &sFilter ))
{
sTmp += OUStringLiteral1(sfx2::cTokenSeparator) + sFilter
+ OUStringLiteral1(sfx2::cTokenSeparator) + sRange;
@@ -1509,7 +1509,7 @@ void SwSection::CreateLink( LinkCreateType eCreateType )
}
else
{
- pFormat->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().Remove( m_RefLink );
+ pFormat->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().Remove( m_RefLink.get() );
}
SwIntrnlSectRefLink *const pLnk =
@@ -1574,7 +1574,7 @@ void SwSection::BreakLink()
OSL_ENSURE(pFormat, "SwSection::BreakLink: no format?");
if (pFormat)
{
- pFormat->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().Remove( m_RefLink );
+ pFormat->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().Remove( m_RefLink.get() );
}
m_RefLink.Clear();
}
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index 69493290342d..413b904e6f77 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -243,7 +243,7 @@ SwDDEFieldType::SwDDEFieldType(const OUString& rName,
SwDDEFieldType::~SwDDEFieldType()
{
if( pDoc && !pDoc->IsInDtor() )
- pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink );
+ pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink.get() );
refLink->Disconnect();
}
@@ -286,14 +286,14 @@ void SwDDEFieldType::SetDoc( SwDoc* pNewDoc )
if( pDoc && refLink.Is() )
{
OSL_ENSURE( !nRefCnt, "How do we get the references?" );
- pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink );
+ pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink.get() );
}
pDoc = pNewDoc;
if( pDoc && nRefCnt )
{
refLink->SetVisible( pDoc->getIDocumentLinksAdministration().IsVisibleLinks() );
- pDoc->getIDocumentLinksAdministration().GetLinkManager().InsertDDELink( refLink );
+ pDoc->getIDocumentLinksAdministration().GetLinkManager().InsertDDELink( refLink.get() );
}
}
@@ -302,14 +302,14 @@ void SwDDEFieldType::RefCntChgd()
if( nRefCnt )
{
refLink->SetVisible( pDoc->getIDocumentLinksAdministration().IsVisibleLinks() );
- pDoc->getIDocumentLinksAdministration().GetLinkManager().InsertDDELink( refLink );
+ pDoc->getIDocumentLinksAdministration().GetLinkManager().InsertDDELink( refLink.get() );
if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() )
UpdateNow();
}
else
{
Disconnect();
- pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink );
+ pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink.get() );
}
}
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index a5575c2172a4..36e1e37ba2d4 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -180,7 +180,7 @@ bool SwGrfNode::ReRead(
}
else // no name anymore, so remove link
{
- GetDoc()->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink );
+ GetDoc()->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink.get() );
refLink.Clear();
}
@@ -301,7 +301,7 @@ SwGrfNode::~SwGrfNode()
if( refLink.Is() )
{
OSL_ENSURE( !bInSwapIn, "DTOR: I am still in SwapIn" );
- pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink );
+ pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink.get() );
refLink->Disconnect();
}
else
@@ -522,7 +522,7 @@ bool SwGrfNode::SwapIn( bool bWaitForData )
bool bRet = false;
bInSwapIn = true;
- SwBaseLink* pLink = static_cast<SwBaseLink*>(static_cast<sfx2::SvBaseLink*>(refLink));
+ SwBaseLink* pLink = static_cast<SwBaseLink*>( refLink.get() );
if( pLink )
{
@@ -632,14 +632,14 @@ bool SwGrfNode::GetFileFilterNms( OUString* pFileNm, OUString* pFilterNm ) const
sal_uInt16 nType = refLink->GetObjType();
if( OBJECT_CLIENT_GRF == nType )
bRet = sfx2::LinkManager::GetDisplayNames(
- refLink, nullptr, pFileNm, nullptr, pFilterNm );
+ refLink.get(), nullptr, pFileNm, nullptr, pFilterNm );
else if( OBJECT_CLIENT_DDE == nType && pFileNm && pFilterNm )
{
OUString sApp;
OUString sTopic;
OUString sItem;
if( sfx2::LinkManager::GetDisplayNames(
- refLink, &sApp, &sTopic, &sItem ) )
+ refLink.get(), &sApp, &sTopic, &sItem ) )
{
*pFileNm = sApp + OUStringLiteral1(sfx2::cTokenSeparator)
+ sTopic + OUStringLiteral1(sfx2::cTokenSeparator)
@@ -661,7 +661,7 @@ bool SwGrfNode::SavePersistentData()
if( refLink.Is() )
{
OSL_ENSURE( !bInSwapIn, "SavePersistentData: I am still in SwapIn" );
- GetDoc()->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink );
+ GetDoc()->getIDocumentLinksAdministration().GetLinkManager().Remove( refLink.get() );
return true;
}
@@ -690,7 +690,7 @@ bool SwGrfNode::RestorePersistentData()
{
IDocumentLinksAdministration& rIDLA = getIDocumentLinksAdministration();
refLink->SetVisible( rIDLA.IsVisibleLinks() );
- rIDLA.GetLinkManager().InsertDDELink( refLink );
+ rIDLA.GetLinkManager().InsertDDELink( refLink.get() );
if( getIDocumentLayoutAccess().GetCurrentLayout() )
refLink->Update();
}
@@ -712,7 +712,7 @@ void SwGrfNode::InsertLink( const OUString& rGrfName, const OUString& rFltName )
sApp = rGrfName.getToken( 0, sfx2::cTokenSeparator, nTmp );
sTopic = rGrfName.getToken( 0, sfx2::cTokenSeparator, nTmp );
sItem = rGrfName.copy( nTmp );
- rIDLA.GetLinkManager().InsertDDELink( refLink,
+ rIDLA.GetLinkManager().InsertDDELink( refLink.get(),
sApp, sTopic, sItem );
}
else
@@ -739,12 +739,12 @@ void SwGrfNode::ReleaseLink()
{
bInSwapIn = true;
- SwBaseLink* pLink = static_cast<SwBaseLink*>(static_cast<sfx2::SvBaseLink*>(refLink));
+ SwBaseLink* pLink = static_cast<SwBaseLink*>( refLink.get() );
pLink->SwapIn( true, true );
bInSwapIn = false;
}
- getIDocumentLinksAdministration().GetLinkManager().Remove( refLink );
+ getIDocumentLinksAdministration().GetLinkManager().Remove( refLink.get() );
refLink.Clear();
maGrfObj.SetLink();
@@ -937,11 +937,11 @@ SwContentNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
OUString sFile, sFilter;
if( IsLinkedFile() )
- sfx2::LinkManager::GetDisplayNames( refLink, nullptr, &sFile, nullptr, &sFilter );
+ sfx2::LinkManager::GetDisplayNames( refLink.get(), nullptr, &sFile, nullptr, &sFilter );
else if( IsLinkedDDE() )
{
OUString sTmp1, sTmp2;
- sfx2::LinkManager::GetDisplayNames( refLink, &sTmp1, &sTmp2, &sFilter );
+ sfx2::LinkManager::GetDisplayNames( refLink.get(), &sTmp1, &sTmp2, &sFilter );
sfx2::MakeLnkName( sFile, &sTmp1, sTmp2, sFilter );
sFilter = "DDE";
}
@@ -1097,7 +1097,7 @@ void SwGrfNode::TriggerAsyncRetrieveInputStream()
mpThreadConsumer.reset( new SwAsyncRetrieveInputStreamThreadConsumer( *this ) );
OUString sGrfNm;
- sfx2::LinkManager::GetDisplayNames( refLink, nullptr, &sGrfNm );
+ sfx2::LinkManager::GetDisplayNames( refLink.get(), nullptr, &sGrfNm );
OUString sReferer;
SfxObjectShell * sh = GetDoc()->GetPersist();
if (sh != nullptr && sh->HasName())
@@ -1152,7 +1152,7 @@ bool SwGrfNode::IsAsyncRetrieveInputStreamPossible() const
if ( IsLinkedFile() )
{
OUString sGrfNm;
- sfx2::LinkManager::GetDisplayNames( refLink, nullptr, &sGrfNm );
+ sfx2::LinkManager::GetDisplayNames( refLink.get(), nullptr, &sGrfNm );
if ( !sGrfNm.startsWith( "vnd.sun.star.pkg:" ) )
{
bRet = true;