sw/source/filter/html/htmldrawreader.cxx |    8 ++++----
 sw/source/filter/html/htmltab.cxx        |    1 +
 sw/source/filter/html/swhtml.cxx         |    1 +
 sw/source/filter/html/swhtml.hxx         |    2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit e1d15b223ad741acc90690918ee43096b494b942
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Nov 7 15:48:57 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Nov 8 17:26:08 2023 +0100

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

diff --git a/sw/source/filter/html/htmldrawreader.cxx 
b/sw/source/filter/html/htmldrawreader.cxx
index 4e5cb320408a..fdbc187348e9 100644
--- a/sw/source/filter/html/htmldrawreader.cxx
+++ b/sw/source/filter/html/htmldrawreader.cxx
@@ -345,10 +345,10 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
     // #i52858# - method name changed
     SwDrawModel* pModel = 
m_xDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
     SdrPage* pPg = pModel->GetPage( 0 );
-    m_pMarquee = SdrObjFactory::MakeNewObject(
+    m_pMarquee = static_cast<SdrTextObj*>(SdrObjFactory::MakeNewObject(
         *pModel,
         SdrInventor::Default,
-        SdrObjKind::Text);
+        SdrObjKind::Text).get());
 
     if( !m_pMarquee )
         return;
@@ -533,13 +533,13 @@ void SwHTMLParser::EndMarquee()
     }
 
     // insert the collected text
-    static_cast<SdrTextObj*>(m_pMarquee.get())->SetText( m_aContents );
+    m_pMarquee->SetText( m_aContents );
     m_pMarquee->SetMergedItemSetAndBroadcast( m_pMarquee->GetMergedItemSet() );
 
     if (m_bFixMarqueeWidth && !bFuzzing)
     {
         // adjust the size to the text
-        static_cast<SdrTextObj*>(m_pMarquee.get())->FitFrameToTextSize();
+        m_pMarquee->FitFrameToTextSize();
     }
 
     m_aContents.clear();
diff --git a/sw/source/filter/html/htmltab.cxx 
b/sw/source/filter/html/htmltab.cxx
index e1e50865f624..8b4756986f27 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -36,6 +36,7 @@
 #include <svl/numformat.hxx>
 #include <svl/urihelper.hxx>
 #include <svx/sdrobjectuser.hxx>
+#include <svx/svdotext.hxx>
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
 
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 17c0da4e25c2..01670a3d2220 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -31,6 +31,7 @@
 #include <o3tl/safeint.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <svx/svxids.hrc>
+#include <svx/svdotext.hxx>
 #if OSL_DEBUG_LEVEL > 0
 #include <stdlib.h>
 #endif
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 1c88e8add932..33f03ecf3fc3 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -403,7 +403,7 @@ class SwHTMLParser : public SfxHTMLParser, public 
SvtListener
     std::vector<HTMLTable*> m_aTables;
     std::shared_ptr<HTMLTable> m_xTable; // current "outermost" table
     SwHTMLForm_Impl* m_pFormImpl;   // current form
-    rtl::Reference<SdrObject> m_pMarquee;    // current marquee
+    rtl::Reference<SdrTextObj> m_pMarquee;    // current marquee
     std::unique_ptr<SwField> m_xField; // current field
     ImageMap        *m_pImageMap;   // current image map
     std::unique_ptr<ImageMaps> m_pImageMaps;  ///< all Image-Maps that have 
been read

Reply via email to