diff options
author | Oliver Specht <oliver.specht@cib.de> | 2015-09-30 16:10:07 +0200 |
---|---|---|
committer | Oliver Specht <oliver.specht@cib.de> | 2015-10-06 07:29:37 +0000 |
commit | 89d39bc100aabf5dccbe77c0b5c0c85736e85b39 (patch) | |
tree | 871a91210913ecee91530c95392534bf18f80f3f /include/sfx2/viewsh.hxx | |
parent | 32b9901dae7403453d773f5904de15551a323595 (diff) |
tdf#94559: 4th step to remove rtti.hxx
replaced use of PTR_CAST, IS_TYPE, ISA in
idl, editeng, sc, sd, sw, sfx2, sot, starmath
Change-Id: I4a5bba4fdc4829099618c09b690c83f876a3d653
Reviewed-on: https://gerrit.libreoffice.org/19132
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'include/sfx2/viewsh.hxx')
-rw-r--r-- | include/sfx2/viewsh.hxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index ca5090f4cce2..1928989aec85 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -41,6 +41,7 @@ #include <sfx2/tabdlg.hxx> #define LOK_USE_UNSTABLE_API #include <LibreOfficeKit/LibreOfficeKitTypes.h> +#include <functional> class SfxBaseController; class Size; @@ -137,6 +138,11 @@ public: \ #define SFX_VIEW_REGISTRATION(DocClass) \ DocClass::Factory().RegisterViewFactory( *Factory() ) +template<class T> bool checkSfxViewShell(const SfxViewShell* pShell) +{ + return dynamic_cast<const T*>(pShell) != nullptr; +} + class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener { #ifdef INCLUDED_SFX2_VIEWSH_HXX @@ -166,9 +172,10 @@ protected: public: // Iteration - static SfxViewShell* GetFirst( const TypeId* pType = 0, bool bOnlyVisible = true ); + static SfxViewShell* GetFirst( bool bOnlyVisible = true, std::function<bool ( const SfxViewShell* )> isViewShell = nullptr ); static SfxViewShell* GetNext( const SfxViewShell& rPrev, - const TypeId* pType = 0, bool bOnlyVisible = true ); + bool bOnlyVisible = true, + std::function<bool ( const SfxViewShell* )> isViewShell = nullptr ); static SfxViewShell* Current(); static SfxViewShell* Get( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController>& i_rController ); |