diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-03-19 01:05:39 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-19 06:26:31 +0000 |
commit | 3c9ebafd0d98c6ea4425aba93cf134fa444be340 (patch) | |
tree | f1efc4be6c5d9d46ece95831c53ae8de21b275e8 /sc/inc/servuno.hxx | |
parent | b86b97e54590872fc0ea85fbea22c2d00d241181 (diff) |
tdf#84938 replace #defined constant with scoped enum class
put 'enum class Type' into ScServiceProvider
The mapping of historic stardiv.* service names relied on
correct order in array aOldNames and fixed numbers for service
types via #define.
This mapping is now done the same way as for the other service names.
Nice side-effect, we don't need to assign numbers any more.
getFieldType moved up in one namespace with the other stuff
for ScServiceProvider.
Change-Id: I932d1d1475563db82061ec7b5913f2361a6f4362
Reviewed-on: https://gerrit.libreoffice.org/23365
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc/inc/servuno.hxx')
-rw-r--r-- | sc/inc/servuno.hxx | 104 |
1 files changed, 35 insertions, 69 deletions
diff --git a/sc/inc/servuno.hxx b/sc/inc/servuno.hxx index 368b5ce5ea83..44049dd0f98e 100644 --- a/sc/inc/servuno.hxx +++ b/sc/inc/servuno.hxx @@ -25,81 +25,47 @@ class ScDocShell; -//! AutoFormat here or global?????? - -#define SC_SERVICE_SHEET 0 -#define SC_SERVICE_URLFIELD 1 -#define SC_SERVICE_PAGEFIELD 2 -#define SC_SERVICE_PAGESFIELD 3 -#define SC_SERVICE_DATEFIELD 4 -#define SC_SERVICE_TIMEFIELD 5 -#define SC_SERVICE_TITLEFIELD 6 -#define SC_SERVICE_FILEFIELD 7 -#define SC_SERVICE_SHEETFIELD 8 -#define SC_SERVICE_CELLSTYLE 9 -#define SC_SERVICE_PAGESTYLE 10 -#define SC_SERVICE_AUTOFORMAT 11 -#define SC_SERVICE_CELLRANGES 12 - -// drawing layer tables -#define SC_SERVICE_GRADTAB 13 -#define SC_SERVICE_HATCHTAB 14 -#define SC_SERVICE_BITMAPTAB 15 -#define SC_SERVICE_TRGRADTAB 16 -#define SC_SERVICE_MARKERTAB 17 -#define SC_SERVICE_DASHTAB 18 -#define SC_SERVICE_NUMRULES 19 - -#define SC_SERVICE_DOCDEFLTS 20 -#define SC_SERVICE_DRAWDEFLTS 21 - -#define SC_SERVICE_DOCSPRSETT 22 -#define SC_SERVICE_DOCCONF 23 - -#define SC_SERVICE_IMAP_RECT 24 -#define SC_SERVICE_IMAP_CIRC 25 -#define SC_SERVICE_IMAP_POLY 26 - -// Support creation of GraphicObjectResolver and EmbeddedObjectResolver -#define SC_SERVICE_EXPORT_GOR 27 -#define SC_SERVICE_IMPORT_GOR 28 -#define SC_SERVICE_EXPORT_EOR 29 -#define SC_SERVICE_IMPORT_EOR 30 - -#define SC_SERVICE_VALBIND 31 -#define SC_SERVICE_LISTCELLBIND 32 -#define SC_SERVICE_LISTSOURCE 33 - -#define SC_SERVICE_CELLADDRESS 34 -#define SC_SERVICE_RANGEADDRESS 35 - -#define SC_SERVICE_SHEETDOCSET 36 - -// BM -#define SC_SERVICE_CHDATAPROV 37 - -// formula parser -#define SC_SERVICE_FORMULAPARS 38 -#define SC_SERVICE_OPCODEMAPPER 39 - -// VBA specific -#define SC_SERVICE_VBAOBJECTPROVIDER 40 -#define SC_SERVICE_VBACODENAMEPROVIDER 41 -#define SC_SERVICE_VBAGLOBALS 42 - -#define SC_SERVICE_COUNT 44 -#define SC_SERVICE_INVALID USHRT_MAX - -#define SC_SERVICE_EXT_TIMEFIELD 43 - class ScServiceProvider { public: + enum class Type + { + SHEET , URLFIELD , PAGEFIELD , PAGESFIELD , DATEFIELD , TIMEFIELD , TITLEFIELD , FILEFIELD , + SHEETFIELD , CELLSTYLE , PAGESTYLE , AUTOFORMAT , CELLRANGES , + // drawing layer tables + GRADTAB , HATCHTAB , BITMAPTAB , TRGRADTAB , MARKERTAB , DASHTAB , NUMRULES , + + DOCDEFLTS , DRAWDEFLTS , + + DOCSPRSETT , DOCCONF , + + IMAP_RECT , IMAP_CIRC , IMAP_POLY , + // Support creation of GraphicObjectResolver and EmbeddedObjectResolver + EXPORT_GOR , IMPORT_GOR , EXPORT_EOR , IMPORT_EOR , + + VALBIND , LISTCELLBIND , LISTSOURCE , + + CELLADDRESS , RANGEADDRESS , + + SHEETDOCSET , + + // BM + CHDATAPROV , + // formula parser + FORMULAPARS , OPCODEMAPPER , + // VBA specific + VBAOBJECTPROVIDER , VBACODENAMEPROVIDER , VBAGLOBALS , + + EXT_TIMEFIELD , + + INVALID + }; + // pDocShell is not needed for all Services static css::uno::Reference< css::uno::XInterface > - MakeInstance( sal_uInt16 nType, ScDocShell* pDocShell ); + MakeInstance( Type nType, ScDocShell* pDocShell ); static css::uno::Sequence<OUString> GetAllServiceNames(); - static sal_uInt16 GetProviderType(const OUString& rServiceName); + static Type GetProviderType(const OUString& rServiceName); }; #endif |