summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-11-08 08:24:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-11-09 06:25:05 +0100
commit1564e33b861f22c0f6eac546deca5300d5d7b56f (patch)
tree25c51a9790811563133e4d2ea682189fa44d0a7a
parent358d31b4c862782a3717b8ad00cd8d5ddd6ea1e3 (diff)
loplugin:fieldcast in SwGrfNode
Change-Id: I95411fa20c38238d1ee74e8d73dd0a9553b9ad45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/inc/ndgrf.hxx5
-rw-r--r--sw/source/core/graphic/ndgrf.cxx15
2 files changed, 10 insertions, 10 deletions
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 955ada009aae..93673990fff8 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -23,6 +23,7 @@
#include <sfx2/lnkbase.hxx>
#include <vcl/GraphicObject.hxx>
#include "ndnotxt.hxx"
+#include "swbaslnk.hxx"
#include <memory>
class SwAsyncRetrieveInputStreamThreadConsumer;
@@ -37,7 +38,7 @@ class SW_DLLPUBLIC SwGrfNode final: public SwNoTextNode
GraphicObject maGrfObj;
std::unique_ptr<GraphicObject> mpReplacementGraphic;
- tools::SvRef<sfx2::SvBaseLink> mxLink; ///< If graphics only as link then pointer is set.
+ tools::SvRef<SwBaseLink> mxLink; ///< If graphics only as link then pointer is set.
Size mnGrfSize;
bool mbInSwapIn :1; // to avoid recursion in SwGrfNode::SwapIn
bool mbInBaseLinkSwapIn :1; // to avoid recursion in SwBaseLink::SwapIn
@@ -125,7 +126,7 @@ public:
bool IsGrfLink() const { return mxLink.is(); }
bool IsLinkedFile() const;
bool IsLinkedDDE() const;
- const tools::SvRef<sfx2::SvBaseLink>& GetLink() const { return mxLink; }
+ const tools::SvRef<SwBaseLink>& GetLink() const { return mxLink; }
bool GetFileFilterNms( OUString* pFileNm, OUString* pFilterNm ) const;
void ReleaseLink();
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 7a26709a8de3..8db55a3887e7 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -107,7 +107,7 @@ SwGrfNode::SwGrfNode( SwNode& rWhere,
FStatHelper::IsDocument( aUrl.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ))
{
// file exists, so create connection without an update
- static_cast<SwBaseLink*>( mxLink.get() )->Connect();
+ mxLink->Connect();
}
}
}
@@ -164,7 +164,7 @@ bool SwGrfNode::ReRead(
if( nNewType != mxLink->GetObjType() )
{
mxLink->Disconnect();
- static_cast<SwBaseLink*>( mxLink.get() )->SetObjType( nNewType );
+ mxLink->SetObjType( nNewType );
}
}
@@ -198,7 +198,7 @@ bool SwGrfNode::ReRead(
else if ( bNewGrf )
{
//TODO refLink->setInputStream(getInputStream());
- static_cast<SwBaseLink*>( mxLink.get() )->SwapIn();
+ mxLink->SwapIn();
}
}
onGraphicChanged();
@@ -227,7 +227,7 @@ bool SwGrfNode::ReRead(
onGraphicChanged();
bReadGrf = true;
// create connection without update, as we have the graphic
- static_cast<SwBaseLink*>( mxLink.get() )->Connect();
+ mxLink->Connect();
}
else
{
@@ -237,7 +237,7 @@ bool SwGrfNode::ReRead(
onGraphicChanged();
if ( bNewGrf )
{
- static_cast<SwBaseLink*>( mxLink.get() )->SwapIn();
+ mxLink->SwapIn();
}
}
}
@@ -426,7 +426,7 @@ bool SwGrfNode::SwapIn(bool bWaitForData)
bool bRet = false;
mbInSwapIn = true;
- SwBaseLink* pLink = static_cast<SwBaseLink*>( mxLink.get() );
+ SwBaseLink* pLink = mxLink.get();
if( pLink )
{
@@ -579,8 +579,7 @@ void SwGrfNode::ReleaseLink()
{
mbInSwapIn = true;
- SwBaseLink* pLink = static_cast<SwBaseLink*>( mxLink.get() );
- pLink->SwapIn( true, true );
+ mxLink->SwapIn( true, true );
mbInSwapIn = false;
}