sw/inc/EnhancedPDFExportHelper.hxx              |    5 +++--
 sw/inc/ndgrf.hxx                                |    5 +++--
 sw/source/core/graphic/ndgrf.cxx                |   15 +++++++--------
 sw/source/core/text/EnhancedPDFExportHelper.cxx |    4 ++--
 4 files changed, 15 insertions(+), 14 deletions(-)

New commits:
commit 43c9c359471ed6a91bf4eff3f75dddba3ca2214c
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Nov 8 09:21:44 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Nov 9 06:25:15 2023 +0100

    loplugin:fieldcast in Num_Info
    
    Change-Id: I9d839c22579e5bc5fe6250a8aab0285ca9e0a4c7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159170
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/EnhancedPDFExportHelper.hxx 
b/sw/inc/EnhancedPDFExportHelper.hxx
index 6b2e2655ea43..dd20f54cbef8 100644
--- a/sw/inc/EnhancedPDFExportHelper.hxx
+++ b/sw/inc/EnhancedPDFExportHelper.hxx
@@ -44,6 +44,7 @@ class SwTextNode;
 class SwTable;
 class SwNumberTreeNode;
 class SwTextPaintInfo;
+class SwTextFrame;
 
 /*
  * Mapping of OOo elements to tagged pdf elements:
@@ -96,8 +97,8 @@ class SwTextPaintInfo;
 
 struct Num_Info
 {
-    const SwFrame& mrFrame;
-    Num_Info( const SwFrame& rFrame ) : mrFrame( rFrame ) {};
+    const SwTextFrame& mrFrame;
+    Num_Info( const SwTextFrame& rFrame ) : mrFrame( rFrame ) {};
 };
 
 struct Frame_Info
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index c9829e0f5ef1..2bf5ca3f883d 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -585,7 +585,7 @@ void SwTaggedPDFHelper::BeginTag( 
vcl::PDFWriter::StructElement eType, const OUS
 
     if ( mpNumInfo )
     {
-        const SwTextFrame& rTextFrame = static_cast<const 
SwTextFrame&>(mpNumInfo->mrFrame);
+        const SwTextFrame& rTextFrame = mpNumInfo->mrFrame;
         SwTextNode const*const pTextNd = rTextFrame.GetTextNodeForParaProps();
         const SwNodeNum* pNodeNum = pTextNd->GetNum(rTextFrame.getRootFrame());
 
@@ -1071,7 +1071,7 @@ void SwTaggedPDFHelper::SetAttributes( 
vcl::PDFWriter::StructElement eType )
     }
     else if (mpNumInfo && eType == vcl::PDFWriter::List)
     {
-        SwTextFrame const& rFrame(static_cast<SwTextFrame 
const&>(mpNumInfo->mrFrame));
+        SwTextFrame const& rFrame(mpNumInfo->mrFrame);
         SwTextNode const& rNode(*rFrame.GetTextNodeForParaProps());
         SwNumRule const*const pNumRule = rNode.GetNumRule();
         assert(pNumRule); // was required for List
commit 1564e33b861f22c0f6eac546deca5300d5d7b56f
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Nov 8 08:24:54 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Nov 9 06:25:05 2023 +0100

    loplugin:fieldcast in SwGrfNode
    
    Change-Id: I95411fa20c38238d1ee74e8d73dd0a9553b9ad45
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159169
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

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;
     }
 

Reply via email to