cui/source/dialogs/SpellDialog.cxx            |    7 ++++---
 editeng/source/editeng/editeng.cxx            |    4 ++--
 editeng/source/editeng/impedit.hxx            |    8 ++++----
 editeng/source/outliner/outliner.cxx          |    4 ++--
 include/editeng/editeng.hxx                   |    5 +++--
 include/editeng/outliner.hxx                  |    5 +++--
 include/svx/svdedxv.hxx                       |    2 +-
 sc/source/ui/drawfunc/drtxtob.cxx             |    1 +
 sc/source/ui/drawfunc/futext.cxx              |    1 +
 sc/source/ui/view/editsh.cxx                  |    1 +
 sd/source/ui/annotations/annotationwindow.cxx |    1 +
 sd/source/ui/func/fubullet.cxx                |    5 +++--
 sd/source/ui/func/fuinsfil.cxx                |    1 +
 sd/source/ui/view/drtxtob.cxx                 |    1 +
 sd/source/ui/view/outlnvsh.cxx                |    1 +
 sd/source/ui/view/viewshel.cxx                |    1 +
 starmath/source/document.cxx                  |    1 +
 starmath/source/view.cxx                      |    1 +
 sw/source/uibase/docvw/AnnotationWin.cxx      |    1 +
 sw/source/uibase/docvw/AnnotationWin2.cxx     |    1 +
 sw/source/uibase/shells/annotsh.cxx           |    1 +
 sw/source/uibase/shells/drwtxtsh.cxx          |    1 +
 22 files changed, 36 insertions(+), 18 deletions(-)

New commits:
commit 9bba3a604d12566bfb5e8ab8d2788fe8d3690a96
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Nov 8 18:24:07 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Nov 11 11:03:58 2023 +0100

    use more concrete type in ImpEditEngine::SetUndoManager
    
    instead of dynamic_cast'ing to the type we want, and __ignoring__ the
    parameter if it is not, just adjust the type that we want, which
    luckily everything is already sending
    
    Change-Id: If083e11c9818cdcae199afc1261efbdb652e1c76
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159295
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index 67de5235d1ad..80e1301dcaf8 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -26,6 +26,7 @@
 #include <svl/undo.hxx>
 #include <tools/debug.hxx>
 #include <unotools/lingucfg.hxx>
+#include <editeng/editund2.hxx>
 #include <editeng/colritem.hxx>
 #include <editeng/eeitem.hxx>
 #include <editeng/langitem.hxx>
@@ -2078,7 +2079,7 @@ svx::SpellPortions 
SentenceEditWindow_Impl::CreateSpellPortions() const
 
 void SentenceEditWindow_Impl::Undo()
 {
-    SfxUndoManager& rUndoMgr = m_xEditEngine->GetUndoManager();
+    EditUndoManager& rUndoMgr = m_xEditEngine->GetUndoManager();
     DBG_ASSERT(GetUndoActionCount(), "no undo actions available" );
     if(!GetUndoActionCount())
         return;
@@ -2097,13 +2098,13 @@ void SentenceEditWindow_Impl::Undo()
 
 void SentenceEditWindow_Impl::ResetUndo()
 {
-    SfxUndoManager& rUndo = m_xEditEngine->GetUndoManager();
+    EditUndoManager& rUndo = m_xEditEngine->GetUndoManager();
     rUndo.Clear();
 }
 
 void SentenceEditWindow_Impl::AddUndoAction( std::unique_ptr<SfxUndoAction> 
pAction )
 {
-    SfxUndoManager& rUndoMgr = m_xEditEngine->GetUndoManager();
+    EditUndoManager& rUndoMgr = m_xEditEngine->GetUndoManager();
     rUndoMgr.AddUndoAction(std::move(pAction));
     GetSpellDialog()->m_xUndoPB->set_sensitive(true);
 }
diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 728609cd94e2..d27a38665950 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -112,12 +112,12 @@ bool EditEngine::IsInUndo() const
     return pImpEditEngine->IsInUndo();
 }
 
-SfxUndoManager& EditEngine::GetUndoManager()
+EditUndoManager& EditEngine::GetUndoManager()
 {
     return pImpEditEngine->GetUndoManager();
 }
 
-SfxUndoManager* EditEngine::SetUndoManager(SfxUndoManager* pNew)
+EditUndoManager* EditEngine::SetUndoManager(EditUndoManager* pNew)
 {
     return pImpEditEngine->SetUndoManager(pNew);
 }
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 6fcccccb58dc..d20ed8a1caae 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -838,7 +838,7 @@ public:
     ImpEditEngine&          operator=(const ImpEditEngine&) = delete;
 
     inline EditUndoManager& GetUndoManager();
-    inline SfxUndoManager* SetUndoManager(SfxUndoManager* pNew);
+    inline EditUndoManager* SetUndoManager(EditUndoManager* pNew);
 
     // @return the previous bUpdateLayout state
     bool                    SetUpdateLayout( bool bUpdate, EditView* pCurView 
= nullptr, bool bForceUpdate = false );
@@ -1295,16 +1295,16 @@ inline EditUndoManager& ImpEditEngine::GetUndoManager()
     return *pUndoManager;
 }
 
-inline SfxUndoManager* ImpEditEngine::SetUndoManager(SfxUndoManager* pNew)
+inline EditUndoManager* ImpEditEngine::SetUndoManager(EditUndoManager* pNew)
 {
-    SfxUndoManager* pRetval = pUndoManager;
+    EditUndoManager* pRetval = pUndoManager;
 
     if(pUndoManager)
     {
         pUndoManager->SetEditEngine(nullptr);
     }
 
-    pUndoManager = dynamic_cast< EditUndoManager* >(pNew);
+    pUndoManager = pNew;
 
     if(pUndoManager)
     {
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 1ff61216e0b6..bb8a8ac419ec 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1142,12 +1142,12 @@ void Outliner::ImpFilterIndents( sal_Int32 nFirstPara, 
sal_Int32 nLastPara )
     pEditEngine->SetUpdateLayout( bUpdate );
 }
 
-SfxUndoManager& Outliner::GetUndoManager()
+EditUndoManager& Outliner::GetUndoManager()
 {
     return pEditEngine->GetUndoManager();
 }
 
-SfxUndoManager* Outliner::SetUndoManager(SfxUndoManager* pNew)
+EditUndoManager* Outliner::SetUndoManager(EditUndoManager* pNew)
 {
     return pEditEngine->SetUndoManager(pNew);
 }
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 5e0d26b4b14c..b3bbcbd608ca 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -77,6 +77,7 @@ namespace editeng {
 }
 
 class ImpEditEngine;
+class EditUndoManager;
 class EditView;
 class OutputDevice;
 class SvxFont;
@@ -349,8 +350,8 @@ public:
 
     void            ShowParagraph( sal_Int32 nParagraph, bool bShow );
 
-    SfxUndoManager& GetUndoManager();
-    SfxUndoManager* SetUndoManager(SfxUndoManager* pNew);
+    EditUndoManager& GetUndoManager();
+    EditUndoManager* SetUndoManager(EditUndoManager* pNew);
     void            UndoActionStart( sal_uInt16 nId );
     void            UndoActionStart(sal_uInt16 nId, const ESelection& rSel);
     void            UndoActionEnd();
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 98edc7ef1d72..cc921f4cd0af 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -52,6 +52,7 @@ class OutlinerEditEng;
 class Outliner;
 class EditView;
 class EditUndo;
+class EditUndoManager;
 class ParagraphList;
 class OutlinerParaObject;
 class SvStream;
@@ -885,8 +886,8 @@ public:
 
     ErrCode             Read( SvStream& rInput, const OUString& rBaseURL, 
EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr );
 
-    SfxUndoManager& GetUndoManager();
-    SfxUndoManager* SetUndoManager(SfxUndoManager* pNew);
+    EditUndoManager& GetUndoManager();
+    EditUndoManager* SetUndoManager(EditUndoManager* pNew);
 
     void            QuickSetAttribs( const SfxItemSet& rSet, const ESelection& 
rSel );
     void            QuickInsertField( const SvxFieldItem& rFld, const 
ESelection& rSel );
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index d5901fbb7125..ff3fcbd19b79 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -109,7 +109,7 @@ protected:
     rtl::Reference< sdr::SelectionController > mxLastSelectionController;
 
 private:
-    SfxUndoManager* mpOldTextEditUndoManager;
+    EditUndoManager* mpOldTextEditUndoManager;
     std::unique_ptr<SdrUndoManager> mpLocalTextEditUndoManager;
 
 protected:
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx 
b/sc/source/ui/drawfunc/drtxtob.cxx
index afd3a595d824..bc9a3b792487 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -37,6 +37,7 @@
 #include <editeng/lspcitem.hxx>
 #include <editeng/ulspitem.hxx>
 #include <editeng/urlfieldhelper.hxx>
+#include <editeng/editund2.hxx>
 #include <svx/hlnkitem.hxx>
 #include <svx/svdoutl.hxx>
 #include <svx/sdooitm.hxx>
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index 7f3089fc076d..0a26c7693bf5 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -25,6 +25,7 @@
 #include <svx/svdotext.hxx>
 #include <svx/sdtagitm.hxx>
 #include <editeng/unolingu.hxx>
+#include <editeng/editund2.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/viewfrm.hxx>
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 2c4328d78145..737418d51d4b 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -35,6 +35,7 @@
 #include <editeng/flstitem.hxx>
 #include <editeng/fontitem.hxx>
 #include <editeng/urlfieldhelper.hxx>
+#include <editeng/editund2.hxx>
 #include <svx/hlnkitem.hxx>
 #include <vcl/EnumContext.hxx>
 #include <editeng/postitem.hxx>
diff --git a/sd/source/ui/annotations/annotationwindow.cxx 
b/sd/source/ui/annotations/annotationwindow.cxx
index a5ab1eb0b784..02495794aefa 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -28,6 +28,7 @@
 #include <editeng/postitem.hxx>
 #include <editeng/wghtitem.hxx>
 #include <editeng/crossedoutitem.hxx>
+#include <editeng/editund2.hxx>
 #include <svx/svxids.hrc>
 #include <unotools/useroptions.hxx>
 
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index f37770e587d4..688ac67a83e6 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -22,6 +22,7 @@
 #include <sfx2/bindings.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <editeng/eeitem.hxx>
+#include <editeng/editund2.hxx>
 #include <svl/poolitem.hxx>
 #include <editeng/fontitem.hxx>
 #include <OutlineView.hxx>
@@ -128,7 +129,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark )
     pOV->InsertText( "" );
 
     // prepare undo
-    SfxUndoManager& rUndoMgr =  pOL->GetUndoManager();
+    EditUndoManager& rUndoMgr =  pOL->GetUndoManager();
     rUndoMgr.EnterListAction(SdResId(STR_UNDO_INSERT_SPECCHAR),
                                 "", 0, 
mpViewShell->GetViewShellBase().GetViewShellId() );
 
@@ -239,7 +240,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & 
rReq )
     SfxItemSetFixed<EE_CHAR_FONTINFO, EE_CHAR_FONTINFO> aOldSet( 
mpDoc->GetPool() );
     aOldSet.Put( pOV->GetAttribs() );
 
-    SfxUndoManager& rUndoMgr =  pOL->GetUndoManager();
+    EditUndoManager& rUndoMgr = pOL->GetUndoManager();
     ViewShellId nViewShellId = mpViewShell ? 
mpViewShell->GetViewShellBase().GetViewShellId() : ViewShellId(-1);
     rUndoMgr.EnterListAction(SdResId(STR_UNDO_INSERT_SPECCHAR),
                              "", 0, nViewShellId );
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index f18d6779f203..790c3d0c8d00 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -23,6 +23,7 @@
 #include <editeng/outliner.hxx>
 #include <editeng/outlobj.hxx>
 #include <editeng/editeng.hxx>
+#include <editeng/editund2.hxx>
 #include <svl/stritem.hxx>
 #include <sfx2/request.hxx>
 #include <sfx2/app.hxx>
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index db2161c247f9..710518185dcc 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -32,6 +32,7 @@
 #include <editeng/outliner.hxx>
 #include <editeng/unolingu.hxx>
 #include <editeng/kernitem.hxx>
+#include <editeng/editund2.hxx>
 #include <svl/whiter.hxx>
 #include <svl/itempool.hxx>
 #include <svl/stritem.hxx>
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 71de36c10206..718b28514e60 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -32,6 +32,7 @@
 #include <editeng/editview.hxx>
 #include <editeng/eeitem.hxx>
 #include <editeng/flditem.hxx>
+#include <editeng/editund2.hxx>
 #include <sfx2/shell.hxx>
 #include <sfx2/request.hxx>
 #include <svx/hlnkitem.hxx>
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 9a1e52539bee..09c1f95102f9 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -82,6 +82,7 @@
 #include <editeng/eeitem.hxx>
 #include <editeng/editview.hxx>
 #include <editeng/editeng.hxx>
+#include <editeng/editund2.hxx>
 #include <svl/itempool.hxx>
 #include <svl/intitem.hxx>
 #include <svl/poolitem.hxx>
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index e644288ff35e..ff28f448cbbd 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -83,6 +83,7 @@
 #include <oox/mathml/imexport.hxx>
 #include <ElementsDockingWindow.hxx>
 #include <smediteng.hxx>
+#include <editeng/editund2.hxx>
 
 #define ShellClass_SmDocShell
 #include <smslots.hxx>
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 704d15b1ad7a..fd765986c659 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -63,6 +63,7 @@
 #include <svx/zoomslideritem.hxx>
 #include <editeng/editeng.hxx>
 #include <editeng/editview.hxx>
+#include <editeng/editund2.hxx>
 #include <svx/svxdlg.hxx>
 #include <sfx2/zoomitem.hxx>
 #include <vcl/commandevent.hxx>
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 5ed6780b455a..714c1419d2ed 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -41,6 +41,7 @@
 #include <editeng/postitem.hxx>
 #include <editeng/fhgtitem.hxx>
 #include <editeng/langitem.hxx>
+#include <editeng/editund2.hxx>
 
 #include <editeng/editview.hxx>
 #include <editeng/outliner.hxx>
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 6a97433272b6..4864cba499c4 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -45,6 +45,7 @@
 #include <editeng/editeng.hxx>
 #include <editeng/eeitem.hxx>
 #include <editeng/outlobj.hxx>
+#include <editeng/editund2.hxx>
 
 #include <svl/undo.hxx>
 #include <svl/stritem.hxx>
diff --git a/sw/source/uibase/shells/annotsh.cxx 
b/sw/source/uibase/shells/annotsh.cxx
index 920089b623c0..4c6d5becc5f0 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -33,6 +33,7 @@
 #include <sfx2/bindings.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/request.hxx>
+#include <editeng/editund2.hxx>
 #include <editeng/eeitem.hxx>
 #include <editeng/flstitem.hxx>
 #include <editeng/spltitem.hxx>
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx 
b/sw/source/uibase/shells/drwtxtsh.cxx
index e767c8b86c11..4d9a1817305f 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -24,6 +24,7 @@
 #include <svl/slstitm.hxx>
 #include <svl/stritem.hxx>
 #include <editeng/fontitem.hxx>
+#include <editeng/editund2.hxx>
 #include <svx/svdview.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <sfx2/objface.hxx>

Reply via email to