diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-03-23 20:14:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-27 09:43:58 +0000 |
commit | d615af618cc6a7152c76a49b3cd09db38eaa9e07 (patch) | |
tree | bc0d69070444dc687708de9a4a146c5c2d3b6852 /sd | |
parent | 6f968f00b1534406a2943be374fab924c3396482 (diff) |
create SfxInterfaceId o3tl::strong_int
Change-Id: Ie52f63382a9fb36f9a472801be012b140bfb51f6
Reviewed-on: https://gerrit.libreoffice.org/35722
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/inc/FactoryIds.hxx | 15 | ||||
-rw-r--r-- | sd/inc/glob.hxx | 36 | ||||
-rw-r--r-- | sd/source/ui/inc/ViewShellImplementation.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/GraphicViewShellBase.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/ImpressViewShellBase.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/OutlineViewShellBase.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/PresentationViewShellBase.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/SlideSorterViewShellBase.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/ViewShellImplementation.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/viewshe2.cxx | 6 |
10 files changed, 34 insertions, 37 deletions
diff --git a/sd/inc/FactoryIds.hxx b/sd/inc/FactoryIds.hxx index 61f276c01388..b6a5284b479c 100644 --- a/sd/inc/FactoryIds.hxx +++ b/sd/inc/FactoryIds.hxx @@ -20,6 +20,8 @@ #ifndef INCLUDED_SD_INC_FACTORYIDS_HXX #define INCLUDED_SD_INC_FACTORYIDS_HXX +#include <sfx2/shell.hxx> + namespace sd { /** This are ids used by SfxTopFrame::Create() or CreateViewFrame() to @@ -28,14 +30,11 @@ namespace sd { with a certain view instead of first create a default view and then switch to the desired view. */ -enum ViewShellFactoryIds -{ - IMPRESS_FACTORY_ID = 1, - DRAW_FACTORY_ID = 1, - SLIDE_SORTER_FACTORY_ID = 2, - OUTLINE_FACTORY_ID = 3, - PRESENTATION_FACTORY_ID = 4 -}; +constexpr auto IMPRESS_FACTORY_ID = SfxInterfaceId(1); +constexpr auto DRAW_FACTORY_ID = SfxInterfaceId(1); +constexpr auto SLIDE_SORTER_FACTORY_ID = SfxInterfaceId(2); +constexpr auto OUTLINE_FACTORY_ID = SfxInterfaceId(3); +constexpr auto PRESENTATION_FACTORY_ID = SfxInterfaceId(4); } // end of namespace sd diff --git a/sd/inc/glob.hxx b/sd/inc/glob.hxx index f5c5ebc59dba..6df60e38889e 100644 --- a/sd/inc/glob.hxx +++ b/sd/inc/glob.hxx @@ -23,24 +23,24 @@ #include <rsc/rscsfx.hxx> #include <sal/types.h> -#define SD_IF_SDAPP SFX_INTERFACE_SD_START + 0 -#define SD_IF_SDDRAWDOCSHELL SFX_INTERFACE_SD_START + 1 -#define SD_IF_SDDRAWVIEWSHELL SFX_INTERFACE_SD_START + 3 -#define SD_IF_SDOUTLINEVIEWSHELL SFX_INTERFACE_SD_START + 5 -#define SD_IF_SDDRAWTEXTOBJECTBAR SFX_INTERFACE_SD_START + 7 -#define SD_IF_SDDRAWBEZIEROBJECTBAR SFX_INTERFACE_SD_START + 8 -#define SD_IF_SDGRAPHICDOCSHELL SFX_INTERFACE_SD_START + 10 -#define SD_IF_SDGRAPHICVIEWSHELL SFX_INTERFACE_SD_START + 11 -#define SD_IF_SDDRAWGRAFOBJECTBAR SFX_INTERFACE_SD_START + 13 -#define SD_IF_SDPRESVIEWSHELL SFX_INTERFACE_SD_START + 14 -#define SD_IF_SDVIEWSHELLBASE SFX_INTERFACE_SD_START + 16 -#define SD_IF_SDSLIDESORTERVIEWSHELL SFX_INTERFACE_SD_START + 19 -#define SD_IF_SDDRAWMEDIAOBJECTBAR SFX_INTERFACE_SD_START + 23 -#define SD_IF_SDLEFTIMPRESSPANESHELL SFX_INTERFACE_SD_START + 24 -#define SD_IF_SDLEFTDRAWPANESHELL SFX_INTERFACE_SD_START + 25 -#define SD_IF_SDDRAWTABLEOBJECTBAR SFX_INTERFACE_SD_START + 27 -#define SD_IF_SDTOOLPANELPANESHELL SFX_INTERFACE_SD_START + 29 -#define SD_IF_SDTOOLPANELSHELL SFX_INTERFACE_SD_START + 30 +#define SD_IF_SDAPP SFX_INTERFACE_SD_START + SfxInterfaceId(0) +#define SD_IF_SDDRAWDOCSHELL SFX_INTERFACE_SD_START + SfxInterfaceId(1) +#define SD_IF_SDDRAWVIEWSHELL SFX_INTERFACE_SD_START + SfxInterfaceId(3) +#define SD_IF_SDOUTLINEVIEWSHELL SFX_INTERFACE_SD_START + SfxInterfaceId(5) +#define SD_IF_SDDRAWTEXTOBJECTBAR SFX_INTERFACE_SD_START + SfxInterfaceId(7) +#define SD_IF_SDDRAWBEZIEROBJECTBAR SFX_INTERFACE_SD_START + SfxInterfaceId(8) +#define SD_IF_SDGRAPHICDOCSHELL SFX_INTERFACE_SD_START + SfxInterfaceId(10) +#define SD_IF_SDGRAPHICVIEWSHELL SFX_INTERFACE_SD_START + SfxInterfaceId(11) +#define SD_IF_SDDRAWGRAFOBJECTBAR SFX_INTERFACE_SD_START + SfxInterfaceId(13) +#define SD_IF_SDPRESVIEWSHELL SFX_INTERFACE_SD_START + SfxInterfaceId(14) +#define SD_IF_SDVIEWSHELLBASE SFX_INTERFACE_SD_START + SfxInterfaceId(16) +#define SD_IF_SDSLIDESORTERVIEWSHELL SFX_INTERFACE_SD_START + SfxInterfaceId(19) +#define SD_IF_SDDRAWMEDIAOBJECTBAR SFX_INTERFACE_SD_START + SfxInterfaceId(23) +#define SD_IF_SDLEFTIMPRESSPANESHELL SFX_INTERFACE_SD_START + SfxInterfaceId(24) +#define SD_IF_SDLEFTDRAWPANESHELL SFX_INTERFACE_SD_START + SfxInterfaceId(25) +#define SD_IF_SDDRAWTABLEOBJECTBAR SFX_INTERFACE_SD_START + SfxInterfaceId(27) +#define SD_IF_SDTOOLPANELPANESHELL SFX_INTERFACE_SD_START + SfxInterfaceId(29) +#define SD_IF_SDTOOLPANELSHELL SFX_INTERFACE_SD_START + SfxInterfaceId(30) // Object-Ids for StarDraw UserData diff --git a/sd/source/ui/inc/ViewShellImplementation.hxx b/sd/source/ui/inc/ViewShellImplementation.hxx index cdcf95bf6444..4a8ba8d9f73a 100644 --- a/sd/source/ui/inc/ViewShellImplementation.hxx +++ b/sd/source/ui/inc/ViewShellImplementation.hxx @@ -134,7 +134,7 @@ public: configuration that has in the center pane a view shell of the same type as mrViewShell. */ - sal_uInt16 GetViewId(); + SfxInterfaceId GetViewId(); /** Return a pointer to the image map dialog that is displayed in some child window. diff --git a/sd/source/ui/view/GraphicViewShellBase.cxx b/sd/source/ui/view/GraphicViewShellBase.cxx index a3926ddf3249..acbde9e978cc 100644 --- a/sd/source/ui/view/GraphicViewShellBase.cxx +++ b/sd/source/ui/view/GraphicViewShellBase.cxx @@ -43,7 +43,7 @@ SfxViewShell* GraphicViewShellBase::CreateInstance ( pBase->LateInit(framework::FrameworkHelper::msDrawViewURL); return pBase; } -void GraphicViewShellBase::RegisterFactory( sal_uInt16 nPrio ) +void GraphicViewShellBase::RegisterFactory( SfxInterfaceId nPrio ) { pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Default"); InitFactory(); diff --git a/sd/source/ui/view/ImpressViewShellBase.cxx b/sd/source/ui/view/ImpressViewShellBase.cxx index e74440f08010..50ac668def1e 100644 --- a/sd/source/ui/view/ImpressViewShellBase.cxx +++ b/sd/source/ui/view/ImpressViewShellBase.cxx @@ -44,7 +44,7 @@ SfxViewShell* ImpressViewShellBase::CreateInstance ( pBase->LateInit(""); return pBase; } -void ImpressViewShellBase::RegisterFactory( sal_uInt16 nPrio ) +void ImpressViewShellBase::RegisterFactory( SfxInterfaceId nPrio ) { pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Default"); InitFactory(); diff --git a/sd/source/ui/view/OutlineViewShellBase.cxx b/sd/source/ui/view/OutlineViewShellBase.cxx index 8b8bd9a69bac..145e52cb4d07 100644 --- a/sd/source/ui/view/OutlineViewShellBase.cxx +++ b/sd/source/ui/view/OutlineViewShellBase.cxx @@ -41,7 +41,7 @@ SfxViewShell* OutlineViewShellBase::CreateInstance ( pBase->LateInit(framework::FrameworkHelper::msOutlineViewURL); return pBase; } -void OutlineViewShellBase::RegisterFactory( sal_uInt16 nPrio ) +void OutlineViewShellBase::RegisterFactory( SfxInterfaceId nPrio ) { pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Outline"); InitFactory(); diff --git a/sd/source/ui/view/PresentationViewShellBase.cxx b/sd/source/ui/view/PresentationViewShellBase.cxx index 14a134c3f1b8..4278ec5a011e 100644 --- a/sd/source/ui/view/PresentationViewShellBase.cxx +++ b/sd/source/ui/view/PresentationViewShellBase.cxx @@ -49,7 +49,7 @@ SfxViewShell* PresentationViewShellBase::CreateInstance ( pBase->LateInit(framework::FrameworkHelper::msPresentationViewURL); return pBase; } -void PresentationViewShellBase::RegisterFactory( sal_uInt16 nPrio ) +void PresentationViewShellBase::RegisterFactory( SfxInterfaceId nPrio ) { pFactory = new SfxViewFactory( &CreateInstance,nPrio,"FullScreenPresentation"); diff --git a/sd/source/ui/view/SlideSorterViewShellBase.cxx b/sd/source/ui/view/SlideSorterViewShellBase.cxx index 16842043fa58..732de03497fe 100644 --- a/sd/source/ui/view/SlideSorterViewShellBase.cxx +++ b/sd/source/ui/view/SlideSorterViewShellBase.cxx @@ -42,7 +42,7 @@ SfxViewShell* SlideSorterViewShellBase::CreateInstance ( return pBase; } -void SlideSorterViewShellBase::RegisterFactory( sal_uInt16 nPrio ) +void SlideSorterViewShellBase::RegisterFactory( SfxInterfaceId nPrio ) { pFactory = new SfxViewFactory(&CreateInstance,nPrio,"SlideSorter"); InitFactory(); diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx index 582eb84d1f20..be79b7387cd9 100644 --- a/sd/source/ui/view/ViewShellImplementation.cxx +++ b/sd/source/ui/view/ViewShellImplementation.cxx @@ -280,7 +280,7 @@ void ViewShell::Implementation::AssignLayout ( SfxRequest& rRequest, PageKind eP } } -sal_uInt16 ViewShell::Implementation::GetViewId() +SfxInterfaceId ViewShell::Implementation::GetViewId() { switch (mrViewShell.GetShellType()) { diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index ae3a19a6db17..e556e5ef2f2c 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -970,13 +970,11 @@ void ViewShell::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert // Get the view id from the view shell in the center pane. This will // usually be the called view shell, but to be on the safe side we call // the main view shell explicitly. - sal_uInt16 nViewID (IMPRESS_FACTORY_ID); + SfxInterfaceId nViewID (IMPRESS_FACTORY_ID); if (GetViewShellBase().GetMainViewShell().get() != nullptr) nViewID = GetViewShellBase().GetMainViewShell()->mpImpl->GetViewId(); rSequence[nIndex].Name = sUNO_View_ViewId; - OUStringBuffer sBuffer( "view" ); - sBuffer.append( static_cast<sal_Int32>(nViewID)); - rSequence[nIndex].Value <<= sBuffer.makeStringAndClear(); + rSequence[nIndex].Value <<= "view" + OUString::number( static_cast<sal_uInt16>(nViewID)); mpFrameView->WriteUserDataSequence( rSequence, bBrowse ); } |