Kaydet (Commit) 7d8196ea authored tarafından Eike Rathke's avatar Eike Rathke

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/29205Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst 75168928
......@@ -286,7 +286,6 @@
#include <rsc/rsc-vcl-shared-types.hxx>
#include <sot/formats.hxx>
#include <svl/hint.hxx>
#include <svl/smplhint.hxx>
#include <svl/svldllapi.h>
#include <svtools/AccessibleBrowseBoxObjType.hxx>
#include <svtools/accessibletable.hxx>
......
......@@ -418,7 +418,6 @@
#include <svl/languageoptions.hxx>
#include <svl/lstner.hxx>
#include <svl/poolitem.hxx>
#include <svl/smplhint.hxx>
#include <svl/srchitem.hxx>
#include <svl/stritem.hxx>
#include <svl/style.hxx>
......
......@@ -480,71 +480,68 @@ void Shell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if (GetShell())
{
if (SfxSimpleHint const* pSimpleHint = dynamic_cast<SfxSimpleHint const*>(&rHint))
switch (rHint.GetId())
{
switch (pSimpleHint->GetId())
{
case SFX_HINT_DYING:
case SFX_HINT_DYING:
{
EndListening( rBC, true /* log off all */ );
aObjectCatalog->UpdateEntries();
}
break;
}
break;
}
if (SbxHint const* pSbxHint = dynamic_cast<SbxHint const*>(&rHint))
if (SbxHint const* pSbxHint = dynamic_cast<SbxHint const*>(&rHint))
{
const sal_uInt32 nHintId = pSbxHint->GetId();
if ( ( nHintId == SBX_HINT_BASICSTART ) ||
( nHintId == SBX_HINT_BASICSTOP ) )
{
const sal_uInt32 nHintId = pSbxHint->GetId();
if ( ( nHintId == SBX_HINT_BASICSTART ) ||
( nHintId == SBX_HINT_BASICSTOP ) )
if (SfxBindings* pBindings = GetBindingsPtr())
{
if (SfxBindings* pBindings = GetBindingsPtr())
{
pBindings->Invalidate( SID_BASICRUN );
pBindings->Update( SID_BASICRUN );
pBindings->Invalidate( SID_BASICCOMPILE );
pBindings->Update( SID_BASICCOMPILE );
pBindings->Invalidate( SID_BASICSTEPOVER );
pBindings->Update( SID_BASICSTEPOVER );
pBindings->Invalidate( SID_BASICSTEPINTO );
pBindings->Update( SID_BASICSTEPINTO );
pBindings->Invalidate( SID_BASICSTEPOUT );
pBindings->Update( SID_BASICSTEPOUT );
pBindings->Invalidate( SID_BASICSTOP );
pBindings->Update( SID_BASICSTOP );
pBindings->Invalidate( SID_BASICIDE_TOGGLEBRKPNT );
pBindings->Update( SID_BASICIDE_TOGGLEBRKPNT );
pBindings->Invalidate( SID_BASICIDE_MANAGEBRKPNTS );
pBindings->Update( SID_BASICIDE_MANAGEBRKPNTS );
pBindings->Invalidate( SID_BASICIDE_MODULEDLG );
pBindings->Update( SID_BASICIDE_MODULEDLG );
pBindings->Invalidate( SID_BASICLOAD );
pBindings->Update( SID_BASICLOAD );
}
pBindings->Invalidate( SID_BASICRUN );
pBindings->Update( SID_BASICRUN );
pBindings->Invalidate( SID_BASICCOMPILE );
pBindings->Update( SID_BASICCOMPILE );
pBindings->Invalidate( SID_BASICSTEPOVER );
pBindings->Update( SID_BASICSTEPOVER );
pBindings->Invalidate( SID_BASICSTEPINTO );
pBindings->Update( SID_BASICSTEPINTO );
pBindings->Invalidate( SID_BASICSTEPOUT );
pBindings->Update( SID_BASICSTEPOUT );
pBindings->Invalidate( SID_BASICSTOP );
pBindings->Update( SID_BASICSTOP );
pBindings->Invalidate( SID_BASICIDE_TOGGLEBRKPNT );
pBindings->Update( SID_BASICIDE_TOGGLEBRKPNT );
pBindings->Invalidate( SID_BASICIDE_MANAGEBRKPNTS );
pBindings->Update( SID_BASICIDE_MANAGEBRKPNTS );
pBindings->Invalidate( SID_BASICIDE_MODULEDLG );
pBindings->Update( SID_BASICIDE_MODULEDLG );
pBindings->Invalidate( SID_BASICLOAD );
pBindings->Update( SID_BASICLOAD );
}
if ( nHintId == SBX_HINT_BASICSTOP )
{
// not only at error/break or explicit stoppage,
// if the update is turned off due to a programming bug
BasicStopped();
if (pLayout)
pLayout->UpdateDebug(true); // clear...
if( m_pCurLocalizationMgr )
m_pCurLocalizationMgr->handleBasicStopped();
}
else if( m_pCurLocalizationMgr )
{
m_pCurLocalizationMgr->handleBasicStarted();
}
if ( nHintId == SBX_HINT_BASICSTOP )
{
// not only at error/break or explicit stoppage,
// if the update is turned off due to a programming bug
BasicStopped();
if (pLayout)
pLayout->UpdateDebug(true); // clear...
if( m_pCurLocalizationMgr )
m_pCurLocalizationMgr->handleBasicStopped();
}
else if( m_pCurLocalizationMgr )
{
m_pCurLocalizationMgr->handleBasicStarted();
}
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
{
BaseWindow* pWin = it->second;
if ( nHintId == SBX_HINT_BASICSTART )
pWin->BasicStarted();
else
pWin->BasicStopped();
}
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
{
BaseWindow* pWin = it->second;
if ( nHintId == SBX_HINT_BASICSTART )
pWin->BasicStarted();
else
pWin->BasicStopped();
}
}
}
......
......@@ -30,7 +30,7 @@
#include <svtools/ehdl.hxx>
#include <svtools/sfxecode.hxx>
#include <unotools/pathoptions.hxx>
#include <svl/smplhint.hxx>
#include <svl/hint.hxx>
#include <vcl/svapp.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
......@@ -577,8 +577,7 @@ namespace basic
void ImplRepository::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint )
{
const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >( &_rHint );
if ( !pSimpleHint || ( pSimpleHint->GetId() != SFX_HINT_DYING ) )
if ( _rHint.GetId() != SFX_HINT_DYING )
// not interested in
return;
......
......@@ -20,7 +20,7 @@
#include <tools/stream.hxx>
#include <sot/storage.hxx>
#include <tools/urlobj.hxx>
#include <svl/smplhint.hxx>
#include <svl/hint.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
......@@ -851,7 +851,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
BasicManager::~BasicManager()
{
// Notify listener if something needs to be saved
Broadcast( SfxSimpleHint( SFX_HINT_DYING) );
Broadcast( SfxHint( SFX_HINT_DYING) );
}
void BasicManager::LegacyDeleteBasicManager( BasicManager*& _rpManager )
......
......@@ -382,7 +382,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>
......
......@@ -348,7 +348,6 @@
#include <svl/lstner.hxx>
#include <svl/macitem.hxx>
#include <svl/poolitem.hxx>
#include <svl/smplhint.hxx>
#include <svl/stritem.hxx>
#include <svl/style.hxx>
#include <svl/stylesheetuser.hxx>
......
......@@ -33,7 +33,6 @@
#include "querycontroller.hxx"
#include "undosqledit.hxx"
#include "QueryDesignView.hxx"
#include <svl/smplhint.hxx>
#include <vcl/settings.hxx>
#include <cppuhelper/implbase.hxx>
......
......@@ -24,7 +24,7 @@
#include <impedit.hxx>
#include <editeng/editeng.hxx>
#include <editdbg.hxx>
#include <svl/smplhint.hxx>
#include <svl/hint.hxx>
#include <editeng/lrspitem.hxx>
void ImpEditEngine::SetStyleSheetPool( SfxStyleSheetPool* pSPool )
......@@ -153,10 +153,10 @@ void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
pStyle = static_cast<SfxStyleSheet*>( pStyleSheetHint->GetStyleSheet() );
nId = pStyleSheetHint->GetHint();
}
else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && dynamic_cast< const SfxStyleSheet* >(&rBC) != nullptr )
else if ( dynamic_cast< const SfxStyleSheet* >(&rBC) != nullptr )
{
pStyle = static_cast<SfxStyleSheet*>(&rBC);
nId = dynamic_cast<const SfxSimpleHint*>(&rHint)->GetId();
nId = rHint.GetId();
}
if ( pStyle )
......
......@@ -21,7 +21,7 @@
#define INCLUDED_BASIC_SBX_HXX
#include <tools/ref.hxx>
#include <svl/smplhint.hxx>
#include <svl/hint.hxx>
#include <svl/lstner.hxx>
#include <basic/sbxdef.hxx>
......@@ -90,11 +90,11 @@ public:
void SetComment( const OUString& r ) { aComment = r; }
};
class BASIC_DLLPUBLIC SbxHint : public SfxSimpleHint
class BASIC_DLLPUBLIC SbxHint : public SfxHint
{
SbxVariable* pVar;
public:
SbxHint( sal_uInt32 n, SbxVariable* v ) : SfxSimpleHint( n ), pVar( v ) {}
SbxHint( sal_uInt32 n, SbxVariable* v ) : SfxHint( n ), pVar( v ) {}
SbxVariable* GetVar() const { return pVar; }
};
......
......@@ -23,7 +23,6 @@
#include <sfx2/dllapi.h>
#include <sal/types.h>
#include <tools/errcode.hxx>
#include <svl/smplhint.hxx>
#include <svl/poolitem.hxx>
#include <vcl/image.hxx>
#include <com/sun/star/script/XLibraryContainer.hpp>
......
......@@ -19,15 +19,43 @@
#ifndef INCLUDED_SVL_HINT_HXX
#define INCLUDED_SVL_HINT_HXX
#include <sal/types.h>
#include <svl/svldllapi.h>
#define SFX_HINT_DYING 0x00000001
#define SFX_HINT_NAMECHANGED 0x00000002
#define SFX_HINT_TITLECHANGED 0x00000004
#define SFX_HINT_DATACHANGED 0x00000008
#define SFX_HINT_DOCCHANGED 0x00000010
#define SFX_HINT_UPDATEDONE 0x00000020
#define SFX_HINT_DEINITIALIZING 0x00000040
#define SFX_HINT_MODECHANGED 0x00000080
// unused, formerly SFX_HINT_CANCELLABLE
// unused, formerly SFX_HINT_DATAAVAILABLE
// unused, formerly SFX_HINT_SAVECOMPLETED
// unused, formerly SFX_HINT_RELEASEREF
#define SFX_HINT_COLORS_CHANGED 0x00001000
#define SFX_HINT_CTL_SETTINGS_CHANGED 0x00002000
#define SFX_HINT_ACCESSIBILITY_CHANGED 0x00004000
// unused, formerly SFX_HINT_VIEWCREATED
#define SFX_HINT_USER00 0x00010000
#define SFX_HINT_USER01 0x00020000
#define SFX_HINT_USER02 0x00040000
#define SFX_HINT_USER03 0x00080000
#define SFX_HINT_USER04 0x00100000
#define SFX_HINT_USER05 0x00200000
class SVL_DLLPUBLIC SfxHint
{
private:
sal_uInt32 mnId;
public:
SfxHint() : mnId(0) {}
explicit SfxHint( sal_uInt32 nId ) : mnId(nId) {}
virtual ~SfxHint();
sal_uInt32 GetId() const { return mnId; }
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SVL_SMPLHINT_HXX
#define INCLUDED_SVL_SMPLHINT_HXX
#include <svl/svldllapi.h>
#include <svl/hint.hxx>
#include <tools/solar.h>
#define SFX_HINT_DYING 0x00000001
#define SFX_HINT_NAMECHANGED 0x00000002
#define SFX_HINT_TITLECHANGED 0x00000004
#define SFX_HINT_DATACHANGED 0x00000008
#define SFX_HINT_DOCCHANGED 0x00000010
#define SFX_HINT_UPDATEDONE 0x00000020
#define SFX_HINT_DEINITIALIZING 0x00000040
#define SFX_HINT_MODECHANGED 0x00000080
// unused, formerly SFX_HINT_CANCELLABLE
// unused, formerly SFX_HINT_DATAAVAILABLE
// unused, formerly SFX_HINT_SAVECOMPLETED
// unused, formerly SFX_HINT_RELEASEREF
#define SFX_HINT_COLORS_CHANGED 0x00001000
#define SFX_HINT_CTL_SETTINGS_CHANGED 0x00002000
#define SFX_HINT_ACCESSIBILITY_CHANGED 0x00004000
// unused, formerly SFX_HINT_VIEWCREATED
#define SFX_HINT_USER00 0x00010000
#define SFX_HINT_USER01 0x00020000
#define SFX_HINT_USER02 0x00040000
#define SFX_HINT_USER03 0x00080000
#define SFX_HINT_USER04 0x00100000
#define SFX_HINT_USER05 0x00200000
class SVL_DLLPUBLIC SfxSimpleHint: public SfxHint
{
private:
sal_uInt32 mnId;
public:
SfxSimpleHint( sal_uInt32 nId ) { mnId = nId; }
sal_uInt32 GetId() const { return mnId; }
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -22,7 +22,6 @@
#include <svl/SfxBroadcaster.hxx>
#include <svl/lstner.hxx>
#include <svl/smplhint.hxx>
#include <svl/undo.hxx>
#include <svx/svddrag.hxx>
#include <svx/svdlayer.hxx>
......
......@@ -20,8 +20,10 @@
#ifndef INCLUDED_VCL_TEXTDATA_HXX
#define INCLUDED_VCL_TEXTDATA_HXX
#include <sal/types.h>
#include <tools/solar.h>
#include <rtl/ustring.hxx>
#include <svl/smplhint.hxx>
#include <svl/hint.hxx>
#include <vcl/dllapi.h>
enum class ExtTextInputAttr;
......@@ -125,7 +127,7 @@ inline bool TextSelection::operator != ( const TextSelection& rSel ) const
#define TEXT_HINT_VIEWSELECTIONCHANGED 101
#define TEXT_HINT_VIEWCARETCHANGED 102
class VCL_DLLPUBLIC TextHint : public SfxSimpleHint
class VCL_DLLPUBLIC TextHint : public SfxHint
{
private:
sal_uLong mnValue;
......
......@@ -400,7 +400,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>
......
......@@ -37,7 +37,6 @@
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <connectivity/dbtools.hxx>
#include <svl/smplhint.hxx>
#include <tools/diagnose_ex.h>
#include <comphelper/stl_types.hxx>
#include <vcl/svapp.hxx>
......
......@@ -39,7 +39,7 @@
#include <com/sun/star/beans/XIntrospection.hpp>
#include <connectivity/dbtools.hxx>
#include <svl/smplhint.hxx>
#include <svl/hint.hxx>
#include <tools/diagnose_ex.h>
#include <comphelper/stl_types.hxx>
#include <vcl/svapp.hxx>
......@@ -191,8 +191,7 @@ void OXUndoEnvironment::ModeChanged()
void OXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if (pSimpleHint && pSimpleHint->GetId() == SFX_HINT_MODECHANGED )
if (rHint.GetId() == SFX_HINT_MODECHANGED )
ModeChanged();
}
......
......@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "ColorListener.hxx"
#include <svl/smplhint.hxx>
#include <svl/hint.hxx>
#include <vcl/settings.hxx>
#include "uistrings.hrc"
......@@ -51,8 +51,7 @@ void OColorListener::dispose()
void OColorListener::Notify(SfxBroadcaster & /*rBc*/, SfxHint const & rHint)
{
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if (pSimpleHint && pSimpleHint->GetId() == SFX_HINT_COLORS_CHANGED)
if (rHint.GetId() == SFX_HINT_COLORS_CHANGED)
{
m_nColor = m_aExtendedColorConfig.GetColorValue(CFG_REPORTDESIGNER,m_sColorEntry).getColor();
m_nTextBoundaries = m_aColorConfig.GetColorValue(::svtools::DOCBOUNDARIES).nColor;
......
......@@ -23,7 +23,6 @@
#include <ReportControllerObserver.hxx>
#include <ReportController.hxx>
#include <svl/smplhint.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
......
......@@ -32,7 +32,6 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <unotools/syslocale.hxx>
#include <svl/smplhint.hxx>
#define CORNER_SPACE 5
......@@ -254,8 +253,7 @@ void OStartMarker::setTitle(const OUString& _sTitle)
void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint)
{
OColorListener::Notify(rBc, rHint);
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if (pSimpleHint && pSimpleHint->GetId() == SFX_HINT_COLORS_CHANGED)
if (rHint.GetId() == SFX_HINT_COLORS_CHANGED)
{
setColor();
Invalidate(InvalidateFlags::Children);
......
......@@ -25,7 +25,7 @@
class SvtBroadcaster;
class ScHint : public SfxSimpleHint
class ScHint : public SfxHint
{
ScAddress aAddress;
......
......@@ -19,7 +19,7 @@ namespace sc {
class ColumnSpanSet;
class BulkDataHint : public SfxSimpleHint
class BulkDataHint : public SfxHint
{
struct Impl;
std::unique_ptr<Impl> mpImpl;
......
......@@ -454,7 +454,6 @@
#include <svl/poolitem.hxx>
#include <svl/sharedstring.hxx>
#include <svl/sharedstringpool.hxx>
#include <svl/smplhint.hxx>
#include <svl/srchitem.hxx>
#include <svl/stritem.hxx>
#include <svl/stylesheetuser.hxx>
......
......@@ -18,7 +18,7 @@ namespace sc {
struct RefUpdateContext;
class ColRowReorderMapType;
class RefHint : public SfxSimpleHint
class RefHint : public SfxHint
{
public:
enum Type {
......
......@@ -10,7 +10,7 @@
#ifndef INCLUDED_SC_INC_SIMPLEHINTIDS_HXX
#define INCLUDED_SC_INC_SIMPLEHINTIDS_HXX
#include <svl/smplhint.hxx>
#include <svl/hint.hxx>
#define SC_HINT_DATACHANGED SFX_HINT_DATACHANGED
#define SC_HINT_TABLEOPDIRTY SFX_HINT_USER00
......
......@@ -135,8 +135,7 @@ void ScFormulaListener::Notify(const SfxHint& rHint)
{
mbDirty = true;
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if (pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING)
if (rHint.GetId() == SFX_HINT_DYING)
return;
if (maCallbackFunction)
......
......@@ -328,7 +328,7 @@ IMPL_LINK_NOARG_TYPED(ScDocument, TrackTimeHdl, Idle *, void)
else if (pShell) // execute
{
TrackFormulas();
pShell->Broadcast( SfxSimpleHint( FID_DATACHANGED ) );
pShell->Broadcast( SfxHint( FID_DATACHANGED ) );
// modified...
......
......@@ -940,9 +940,8 @@ void ScDocument::BroadcastUno( const SfxHint &rHint )
// The listener calls must be processed after completing the broadcast,
// because they can add or remove objects from pUnoBroadcaster.
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if ( pUnoListenerCalls && pSimpleHint &&
pSimpleHint->GetId() == SFX_HINT_DATACHANGED &&
if ( pUnoListenerCalls &&
rHint.GetId() == SFX_HINT_DATACHANGED &&
!bInUnoListenerCall )
{
// Listener calls may lead to BroadcastUno calls again. The listener calls
......
......@@ -126,7 +126,7 @@ void ScDocument::BroadcastCells( const ScRange& rRange, sal_uInt32 nHint, bool b
pTab->SetStreamValid(false);
}
BroadcastUno(SfxSimpleHint(SC_HINT_DATACHANGED));
BroadcastUno(SfxHint(SC_HINT_DATACHANGED));
}
namespace {
......
......@@ -849,7 +849,7 @@ void ScDocument::UpdateExternalRefLinks(vcl::Window* pWin)
if (bAny)
{
TrackFormulas();
pShell->Broadcast( SfxSimpleHint(FID_DATACHANGED) );
pShell->Broadcast( SfxHint(FID_DATACHANGED) );
// #i101960# set document modified, as in TrackTimeHdl for DDE links
if (!pShell->IsModified())
......
......@@ -2205,11 +2205,7 @@ void ScFormulaCell::SetInChangeTrack( bool bVal )
void ScFormulaCell::Notify( const SfxHint& rHint )
{
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if (!pSimpleHint)
return;
const sal_uInt32 nHint = pSimpleHint->GetId();
const sal_uInt32 nHint = rHint.GetId();
if (nHint == SC_HINT_REFERENCE)
{
const sc::RefHint& rRefHint = static_cast<const sc::RefHint&>(rHint);
......
......@@ -33,7 +33,7 @@
#include <sfx2/printer.hxx>
#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
#include <svl/smplhint.hxx>
#include <svl/hint.hxx>
#include "attrib.hxx"
#include <vcl/svapp.hxx>
......@@ -269,8 +269,7 @@ bool ScStyleSheet::IsUsed() const
void ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
if ( rHint.GetId() == SFX_HINT_DYING )
GetItemSet().SetParent( nullptr );
}
......
......@@ -120,7 +120,7 @@ void SAL_CALL ScAddInListener::modified( const css::sheet::ResultEvent& aEvent )
{
ScDocument* pDoc = *it;
pDoc->TrackFormulas();
pDoc->GetDocumentShell()->Broadcast( SfxSimpleHint( FID_DATACHANGED ) );
pDoc->GetDocumentShell()->Broadcast( SfxHint( FID_DATACHANGED ) );
}
}
......
......@@ -112,7 +112,7 @@ void ScAddInAsync::CallBack( sal_uLong nHandleP, void* pData )
{
ScDocument* pDoc = *it;