summaryrefslogtreecommitdiff
path: root/sc/inc/sheetevents.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-09-21 16:57:00 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-09-22 18:47:34 +0000
commit015eb39d963acf534bd5beaf9331a6d37af2acd6 (patch)
tree7ea14b53b25da7cd2132859486c21916d19dd467 /sc/inc/sheetevents.hxx
parentad1386300562779606d958ea8289916cb9cbb8f8 (diff)
convert SC_SHEETEVENT to scoped enum
Change-Id: I472e3f0a78f979bcf8333076f7560ebb7dd859d6 Reviewed-on: https://gerrit.libreoffice.org/18767 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc/inc/sheetevents.hxx')
-rw-r--r--sc/inc/sheetevents.hxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/sc/inc/sheetevents.hxx b/sc/inc/sheetevents.hxx
index 46549b882009..c9433607079c 100644
--- a/sc/inc/sheetevents.hxx
+++ b/sc/inc/sheetevents.hxx
@@ -22,14 +22,10 @@
#include <rtl/ustring.hxx>
-#define SC_SHEETEVENT_FOCUS 0
-#define SC_SHEETEVENT_UNFOCUS 1
-#define SC_SHEETEVENT_SELECT 2
-#define SC_SHEETEVENT_DOUBLECLICK 3
-#define SC_SHEETEVENT_RIGHTCLICK 4
-#define SC_SHEETEVENT_CHANGE 5
-#define SC_SHEETEVENT_CALCULATE 6
-#define SC_SHEETEVENT_COUNT 7
+enum class ScSheetEventId {
+ FOCUS, UNFOCUS, SELECT, DOUBLECLICK, RIGHTCLICK, CHANGE, CALCULATE, COUNT,
+ NOTFOUND = -1 // used as a an error return value
+};
class ScSheetEvents
{
@@ -44,12 +40,12 @@ public:
const ScSheetEvents& operator= (const ScSheetEvents& rOther);
- const OUString* GetScript(sal_Int32 nEvent) const;
- void SetScript(sal_Int32 nEvent, const OUString* pNew);
+ const OUString* GetScript(ScSheetEventId nEvent) const;
+ void SetScript(ScSheetEventId nEvent, const OUString* pNew);
- static OUString GetEventName(sal_Int32 nEvent);
- static sal_Int32 GetVbaSheetEventId(sal_Int32 nEvent);
- static sal_Int32 GetVbaDocumentEventId(sal_Int32 nEvent);
+ static OUString GetEventName(ScSheetEventId nEvent);
+ static sal_Int32 GetVbaSheetEventId(ScSheetEventId nEvent);
+ static sal_Int32 GetVbaDocumentEventId(ScSheetEventId nEvent);
};
#endif