diff options
author | Eike Rathke <erack@redhat.com> | 2016-09-22 22:20:48 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-09-23 15:14:03 +0000 |
commit | 7d8196ea2f4ec3634dbad7367345e62c4ea9893d (patch) | |
tree | 4550d4ccc4205ae5ca9f134d29927b202e10fb70 /sd | |
parent | 751689283c9f3010f7978b6576b25ffc579202ef (diff) |
perf: eliminate SfxSimpleHint and move to SfxHint, tdf#87101 related
There were over 150 places in *::Notify() functions that did some
dynamic_cast<SfxSimpleHint*> of which ~98% were unnecessary because the
base class SfxHint passed was an SfxSimpleHint anyway. dynamic_cast
operations come with quite some cost, so avoid if possible. Specifically
for ScFormulaCell::Notify() that created a bottleneck in scenarios where
cells were notified that already handled a previous notification. In
mass operations doing the dynamic_cast before it could be decided
whether having to act on it or not this made 2/3 of all time spent in
the Notify() call.
To get rid of that rename/move SfxSimpleHint to SfxHint and let classes
derive from SfxHint instead of SfxSimpleHint. This comes only with a
slight cost that an additional sal_uInt32 is transported in such hints,
initialized to 0, but this is neglectable compared to the huge gain.
For the rare cases where a Notify() actually expects both, an SfxHint
(formerly SfxSimpleHint) and a derived hint, this changed order of the
dynamic_cast involved so the simple SfxHint::GetId() is handled last.
Modules using such combinations can further optimize by treating the
simple SfxHint::GetId() first once verified that none of the other
derived hints use an ID not equal to zero respectively none of the ID
values the simple hint uses.
Change-Id: I9fcf723e3a4487ceb92336189d23a62c344cf0ce
Reviewed-on: https://gerrit.libreoffice.org/29205
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sd')
29 files changed, 57 insertions, 80 deletions
diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index 2d4b06902513..bb12f7c1a65b 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -384,7 +384,7 @@ #include <svl/poolitem.hxx> #include <svl/ptitem.hxx> #include <svl/slstitm.hxx> -#include <svl/smplhint.hxx> +#include <svl/hint.hxx> #include <svl/srchitem.hxx> #include <svl/stritem.hxx> #include <svl/style.hxx> diff --git a/sd/inc/pch/precompiled_sdui.hxx b/sd/inc/pch/precompiled_sdui.hxx index e24f81916021..c4e11c489ed4 100644 --- a/sd/inc/pch/precompiled_sdui.hxx +++ b/sd/inc/pch/precompiled_sdui.hxx @@ -378,7 +378,6 @@ #include <svl/lstner.hxx> #include <svl/metitem.hxx> #include <svl/poolitem.hxx> -#include <svl/smplhint.hxx> #include <svl/stritem.hxx> #include <svl/style.hxx> #include <svl/stylesheetuser.hxx> diff --git a/sd/source/core/anminfo.cxx b/sd/source/core/anminfo.cxx index 1783bec9eae8..4b31dc1a82cd 100644 --- a/sd/source/core/anminfo.cxx +++ b/sd/source/core/anminfo.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <svl/smplhint.hxx> #include "svx/xtable.hxx" #include <svx/svdopath.hxx> #include <svl/urihelper.hxx> diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 0db59ddd32c7..65905c697c96 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -1601,7 +1601,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, pUndoMgr->AddUndoAction(pUndoChStyle); } pMySheet->GetItemSet().Put(pHisSheet->GetItemSet()); - pMySheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pMySheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } else { diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index c541afe979ce..733ab02a982d 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -40,7 +40,7 @@ #include <basic/basmgr.hxx> #include <editeng/pbinitem.hxx> #include <svx/svdundo.hxx> -#include <svl/smplhint.hxx> +#include <svl/hint.hxx> #include <editeng/adjustitem.hxx> #include <editeng/editobj.hxx> #include <editeng/scripttypeitem.hxx> @@ -1940,7 +1940,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR rSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CTL)); } - pTitleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pTitleSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } } else if (pObj == GetPresObj(PRESOBJ_OUTLINE, nIndexOutline)) @@ -2000,7 +2000,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR } pOutlineSheet->GetItemSet().Put(aTempSet); - pOutlineSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pOutlineSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } } } @@ -2016,7 +2016,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR rSet.Put( SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT )); rSet.Put( SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CJK )); rSet.Put( SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CTL )); - pNotesSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pNotesSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } } } diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 78bc0ad586fe..fe1cc0754fb2 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -37,7 +37,7 @@ #include <editeng/brushitem.hxx> #include <editeng/editeng.hxx> #include <editeng/cmapitem.hxx> -#include <svl/smplhint.hxx> +#include <svl/hint.hxx> #include <editeng/langitem.hxx> #include <editeng/charreliefitem.hxx> #include <editeng/emphasismarkitem.hxx> @@ -1117,7 +1117,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, } rSet.Put( SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET ) ); - static_cast<SfxStyleSheet*>(pSheet)->Broadcast(SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>(pSheet)->Broadcast(SfxHint( SFX_HINT_DATACHANGED ) ); } break; @@ -1150,7 +1150,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, } rSet.Put( SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET ) ); - static_cast<SfxStyleSheet*>(pSheet)->Broadcast(SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>(pSheet)->Broadcast(SfxHint( SFX_HINT_DATACHANGED ) ); } } break; @@ -1175,7 +1175,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, } rSet.Put( SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET ) ); - static_cast<SfxStyleSheet*>(pSheet)->Broadcast(SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>(pSheet)->Broadcast(SfxHint( SFX_HINT_DATACHANGED ) ); } break; } diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 2ddbdb199f31..a6652f7025a3 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -31,7 +31,7 @@ #include <editeng/fhgtitem.hxx> #include <svx/svdoattr.hxx> #include <editeng/ulspitem.hxx> -#include <svl/smplhint.hxx> +#include <svl/hint.hxx> #include <svl/itemset.hxx> #include <svx/xflbmtit.hxx> @@ -192,14 +192,14 @@ bool SdStyleSheet::SetParent(const OUString& rParentName) bResult = true; SfxItemSet& rParentSet = pStyle->GetItemSet(); GetItemSet().SetParent(&rParentSet); - Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + Broadcast( SfxHint( SFX_HINT_DATACHANGED ) ); } } else { bResult = true; GetItemSet().SetParent(nullptr); - Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + Broadcast( SfxHint( SFX_HINT_DATACHANGED ) ); } } else @@ -526,8 +526,7 @@ void SdStyleSheet::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) /* if the dummy gets a notify about a changed attribute, he takes care that the actual ment style sheet sends broadcasts. */ - const SfxSimpleHint* pSimple = dynamic_cast<const SfxSimpleHint*>(&rHint); - if (pSimple && pSimple->GetId() == SFX_HINT_DATACHANGED) + if (rHint.GetId() == SFX_HINT_DATACHANGED) { SdStyleSheet* pRealStyle = GetRealStyleSheet(); if (pRealStyle) @@ -889,7 +888,7 @@ void SAL_CALL SdStyleSheet::setName( const OUString& rName ) throw(RuntimeExcep if( SetName( rName ) ) { msApiName = rName; - Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } } @@ -1054,7 +1053,7 @@ void SAL_CALL SdStyleSheet::setPropertyValue( const OUString& aPropertyName, con } rStyleSet.Put( aSet ); - Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } } @@ -1287,7 +1286,7 @@ void SAL_CALL SdStyleSheet::setPropertyToDefault( const OUString& PropertyName ) { rStyleSet.ClearItem( pEntry->nWID ); } - Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } Any SAL_CALL SdStyleSheet::getPropertyDefault( const OUString& aPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception) @@ -1335,7 +1334,7 @@ void SdStyleSheet::BroadcastSdStyleSheetChange(SfxStyleSheetBase* pStyleSheet, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) { SdStyleSheet* pRealSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetRealStyleSheet(); - pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pRealSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); if( (ePO >= PO_OUTLINE_1) && (ePO <= PO_OUTLINE_8) ) { @@ -1350,7 +1349,7 @@ void SdStyleSheet::BroadcastSdStyleSheetChange(SfxStyleSheetBase* pStyleSheet, if(pSheet) { SdStyleSheet* pRealStyleSheet = static_cast<SdStyleSheet*>(pSheet)->GetRealStyleSheet(); - pRealStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pRealStyleSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } } } diff --git a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx index a586545cb2f2..d4c517726379 100644 --- a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx +++ b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx @@ -175,8 +175,7 @@ namespace accessibility if( &rBroadcaster == mpOutliner ) { - const SfxSimpleHint* pHint = dynamic_cast< const SfxSimpleHint * >( &rHint ); - if( pHint && (pHint->GetId() == SFX_HINT_DYING) ) + if( rHint.GetId() == SFX_HINT_DYING ) { bDispose = true; mpOutliner = nullptr; diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index 3da56e0ece1d..5ecdd8dfa36c 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -117,8 +117,7 @@ SdModule::~SdModule() /// get notifications void SdModule::Notify( SfxBroadcaster&, const SfxHint& rHint ) { - const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DEINITIALIZING ) + if( rHint.GetId() == SFX_HINT_DEINITIALIZING ) { delete pImpressOptions; pImpressOptions = nullptr; diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index cdf627953bfe..27b8aab55a38 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -809,8 +809,7 @@ void SdTransferable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } else { - const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint * >(&rHint); - if(pSimpleHint && (pSimpleHint->GetId() == SFX_HINT_DYING) ) + if( rHint.GetId() == SFX_HINT_DYING ) { if( &rBC == mpSourceDoc ) mpSourceDoc = nullptr; diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index e90752452106..e141119de251 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -268,8 +268,7 @@ void SdDocPreviewWin::updateViewSettings() void SdDocPreviewWin::Notify(SfxBroadcaster&, const SfxHint& rHint) { - const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_COLORS_CHANGED ) + if( rHint.GetId() == SFX_HINT_COLORS_CHANGED ) { updateViewSettings(); } diff --git a/sd/source/ui/dlg/unchss.cxx b/sd/source/ui/dlg/unchss.cxx index 397af1cc1f8c..f568d9513b8e 100644 --- a/sd/source/ui/dlg/unchss.cxx +++ b/sd/source/ui/dlg/unchss.cxx @@ -21,7 +21,7 @@ #include <svl/itemset.hxx> #include <svl/style.hxx> -#include <svl/smplhint.hxx> +#include <svl/hint.hxx> #include <svx/svdobj.hxx> #include <svx/svdpool.hxx> @@ -101,9 +101,9 @@ void StyleSheetUndoAction::Undo() mpStyleSheet->GetItemSet().Set(aNewSet); if( mpStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) - static_cast<SdStyleSheet*>(mpStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + static_cast<SdStyleSheet*>(mpStyleSheet)->GetRealStyleSheet()->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); else - mpStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + mpStyleSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } void StyleSheetUndoAction::Redo() @@ -113,9 +113,9 @@ void StyleSheetUndoAction::Redo() mpStyleSheet->GetItemSet().Set(aNewSet); if( mpStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) - static_cast<SdStyleSheet*>(mpStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + static_cast<SdStyleSheet*>(mpStyleSheet)->GetRealStyleSheet()->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); else - mpStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + mpStyleSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } OUString StyleSheetUndoAction::GetComment() const diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index 2cd6107d1b26..843235c4b018 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -172,7 +172,7 @@ DrawDocShell::~DrawDocShell() // destroyed. This has been introduced for the PreviewRenderer to // free its view (that uses the item poll of the doc shell) but // may be useful in other places as well. - Broadcast(SfxSimpleHint(SFX_HINT_DYING)); + Broadcast(SfxHint(SFX_HINT_DYING)); mbInDestruction = true; @@ -426,7 +426,7 @@ void DrawDocShell::SetModified( bool bSet /* = true */ ) if ( mpDoc ) mpDoc->NbcSetChanged( bSet ); - Broadcast( SfxSimpleHint( SFX_HINT_DOCCHANGED ) ); + Broadcast( SfxHint( SFX_HINT_DOCCHANGED ) ); } } diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index 8a9728ffd227..7c9efb6af117 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -980,8 +980,7 @@ void SAL_CALL LifetimeController::disposing (const lang::EventObject& rEvent) void LifetimeController::Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) { (void)rBroadcaster; - const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if (pSimpleHint != nullptr && pSimpleHint->GetId() == SFX_HINT_DYING) + if (rHint.GetId() == SFX_HINT_DYING) { mbListeningToViewShellBase = false; Update(); diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index b4c6095b64c1..5b669d32646c 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -412,7 +412,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) mpDocSh->GetUndoManager()->AddUndoAction(pAction); pStyleSheet->GetItemSet().Put( *(pTempSet.get()) ); sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() ); - pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pStyleSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } else if( bSetToAllPages ) { @@ -434,7 +434,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) pUndoGroup->AddAction(pAction); pStyle->GetItemSet().Put( *(pTempSet.get()) ); sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() ); - pStyle->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pStyle->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } //Remove background from all pages to reset to the master bg diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx index de294488ba78..b480102ca97a 100644 --- a/sd/source/ui/func/fuprlout.cxx +++ b/sd/source/ui/func/fuprlout.cxx @@ -20,7 +20,6 @@ #include "fuprlout.hxx" #include <vcl/wrkwin.hxx> #include <sfx2/dispatch.hxx> -#include <svl/smplhint.hxx> #include <svl/itempool.hxx> #include <sot/storage.hxx> #include <vcl/msgbox.hxx> diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx index b19b68fa98a6..daa979bf1fc5 100644 --- a/sd/source/ui/func/fuprobjs.cxx +++ b/sd/source/ui/func/fuprobjs.cxx @@ -22,7 +22,7 @@ #include <vcl/msgbox.hxx> #include <svl/style.hxx> #include <editeng/outliner.hxx> -#include <svl/smplhint.hxx> +#include <svl/hint.hxx> #include "app.hrc" #include "res_bmp.hrc" @@ -149,7 +149,7 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) mpDocSh->GetUndoManager()->AddUndoAction(pAction); pStyleSheet->GetItemSet().Put( *pOutSet ); - static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxHint( SFX_HINT_DATACHANGED ) ); } } } diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index 29b23f1d5694..a7a657239064 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -420,7 +420,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) { pFirstStyleSheet->GetItemSet().Put( SvxNumBulletItem( aRule, EE_PARA_NUMBULLET )); SdStyleSheet* pRealSheet = static_cast<SdStyleSheet*>(pFirstStyleSheet)->GetRealStyleSheet(); - pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pRealSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } aTempSet.ClearItem( EE_PARA_NUMBULLET ); @@ -507,7 +507,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) } } - static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxHint( SFX_HINT_DATACHANGED ) ); DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( mpViewShell ); if( pDrawViewShell ) @@ -596,7 +596,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) mpView->SetStyleSheet( static_cast<SfxStyleSheet*>(pStyleSheet)); } - static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxHint( SFX_HINT_DATACHANGED ) ); mpDoc->SetChanged(); mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 ); @@ -623,7 +623,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) mpView->SetStyleSheet( static_cast<SfxStyleSheet*>(pStyleSheet)); - static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxHint( SFX_HINT_DATACHANGED ) ); mpDoc->SetChanged(); mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 ); } diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx index a775b80e6a97..c85ea076aa60 100644 --- a/sd/source/ui/slidesorter/controller/SlsListener.cxx +++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx @@ -332,10 +332,9 @@ void Listener::Notify ( break; } } - else if (dynamic_cast<const SfxSimpleHint*>(&rHint)) + else { - const SfxSimpleHint& rSfxSimpleHint = static_cast<const SfxSimpleHint&>(rHint); - switch (rSfxSimpleHint.GetId()) + switch (rHint.GetId()) { case SFX_HINT_DOCCHANGED: mrController.CheckForMasterPageAssignment(); diff --git a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx index 8d0aa3ab17ba..34b85638bd31 100644 --- a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx +++ b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx @@ -70,10 +70,9 @@ TransferableData::~TransferableData() void TransferableData::Notify (SfxBroadcaster&, const SfxHint& rHint) { - const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if (pSimpleHint && mpViewShell) + if (mpViewShell) { - if (pSimpleHint->GetId() == SFX_HINT_DYING) + if (rHint.GetId() == SFX_HINT_DYING) { // This hint may come either from the ViewShell or from the // document (registered by SdTransferable). We do not know diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx index 8d0522c1e5f6..a208144a93ee 100644 --- a/sd/source/ui/tools/EventMultiplexer.cxx +++ b/sd/source/ui/tools/EventMultiplexer.cxx @@ -667,10 +667,9 @@ void EventMultiplexer::Implementation::Notify ( break; } } - else if (dynamic_cast<const SfxSimpleHint*>(&rHint)) + else { - const SfxSimpleHint& rSimpleHint = static_cast<const SfxSimpleHint&>(rHint); - if (rSimpleHint.GetId() == SFX_HINT_DYING) + if (rHint.GetId() == SFX_HINT_DYING) mpDocument = nullptr; } } diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index 3113e5069653..d4b8aca487cf 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -482,8 +482,7 @@ void PreviewRenderer::Notify(SfxBroadcaster&, const SfxHint& rHint) if (!mpDocShellOfView) return; - const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if (pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING) + if (rHint.GetId() == SFX_HINT_DYING) { // The doc shell is dying. Our view uses its item pool and // has to be destroyed as well. The next call to diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 34b9d7021073..72d53f7375e5 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -427,10 +427,8 @@ void SdXImpressDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } else { - const SfxSimpleHint* pSfxHint = dynamic_cast<const SfxSimpleHint*>( &rHint ); - // did our SdDrawDocument just died? - if(pSfxHint && pSfxHint->GetId() == SFX_HINT_DYING) + if(rHint.GetId() == SFX_HINT_DYING) { // yes, so we ask for a new one if( mpDocShell ) diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 86aa5e15cf19..5361f5abc725 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1180,8 +1180,7 @@ public: if (&rBroadcaster != &static_cast<SfxBroadcaster&>(mrBase)) return; - const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if (pSimpleHint != nullptr && pSimpleHint->GetId() == SFX_HINT_DYING) + if (rHint.GetId() == SFX_HINT_DYING) { Dispose(); } diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx index 373e72a1c3cd..62c69b622095 100644 --- a/sd/source/ui/view/FormShellManager.cxx +++ b/sd/source/ui/view/FormShellManager.cxx @@ -261,8 +261,7 @@ IMPL_LINK_TYPED(FormShellManager, WindowEventHandler, VclWindowEvent&, rEvent, v void FormShellManager::Notify(SfxBroadcaster&, const SfxHint& rHint) { - const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if (pSimpleHint!=nullptr && pSimpleHint->GetId()==SFX_HINT_DYING) + if (rHint.GetId()==SFX_HINT_DYING) { // If all goes well this listener is called after the // FormShellManager was notified about the dying form shell by the diff --git a/sd/source/ui/view/WindowUpdater.cxx b/sd/source/ui/view/WindowUpdater.cxx index 1eb5e524d501..4ed9b9fa93d6 100644 --- a/sd/source/ui/view/WindowUpdater.cxx +++ b/sd/source/ui/view/WindowUpdater.cxx @@ -26,7 +26,6 @@ #include <vcl/split.hxx> #include <sfx2/childwin.hxx> #include <sfx2/viewfrm.hxx> -#include <svl/smplhint.hxx> #include <algorithm> diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index 2e9e42cd92d0..81a0e0f39e46 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -167,7 +167,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, mpDocSh->GetUndoManager()->AddUndoAction(pAction); pSheet->GetItemSet().Put(aTempSet); - pSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); bOk = true; } else if (eObjKind == OBJ_OUTLINETEXT) @@ -218,7 +218,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, mpDocSh->GetUndoManager()->AddUndoAction(pAction); pSheet->GetItemSet().Put(aTempSet); - pSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); // now also broadcast any child sheets sal_Int16 nChild; @@ -229,7 +229,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, SfxStyleSheet* pOutlSheet = static_cast< SfxStyleSheet* >(pStShPool->Find(aSheetName, SD_STYLE_FAMILY_MASTERPAGE)); if( pOutlSheet ) - pOutlSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pOutlSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } } @@ -294,7 +294,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, mpDocSh->GetUndoManager()->AddUndoAction(pAction); pSheet->GetItemSet().Put(aTempSet,false); - pSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); bOk = true; } else if (eObjKind == OBJ_OUTLINETEXT) @@ -337,7 +337,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, mpDocSh->GetUndoManager()->AddUndoAction(pAction); pSheet->GetItemSet().Set(aTempSet,false); - pSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + pSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); } // remove all hard set items from shape that are now set in style diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 623392411dd2..1d7c6d895142 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -729,8 +729,7 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) void DrawViewShell::Notify (SfxBroadcaster&, const SfxHint& rHint) { - const SfxSimpleHint* pSimple = dynamic_cast< const SfxSimpleHint* >(&rHint); - if (pSimple!=nullptr && pSimple->GetId()==SFX_HINT_MODECHANGED) + if (rHint.GetId()==SFX_HINT_MODECHANGED) { // Change to selection when turning on read-only mode. if(GetDocSh()->IsReadOnly() && dynamic_cast< FuSelection* >( GetCurrentFunction().get() ) ) diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index e38765c55f28..86f87872af04 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -424,13 +424,9 @@ ViewOverlayManager::~ViewOverlayManager() void ViewOverlayManager::Notify(SfxBroadcaster&, const SfxHint& rHint) { - const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if (pSimpleHint != nullptr) + if (rHint.GetId() == SFX_HINT_DOCCHANGED) { - if (pSimpleHint->GetId() == SFX_HINT_DOCCHANGED) - { - UpdateTags(); - } + UpdateTags(); } } |