summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno/unoatxt.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-25 10:03:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-25 12:21:22 +0200
commit31a85a9a13595a9aeae1932ee08c9b09ead384cd (patch)
treed3cf4136e21a3acee1ddbf77aca62f3d73c3ed55 /sw/source/uibase/uno/unoatxt.cxx
parent2fffaf6f05d829e345ad8b391646a6e8df9a9a26 (diff)
convert UNO event ids to scoped enum
I'm fairly sure there are more simplifications that could be make here. It seems like we have both an ID and a string name for all of these events, and we could probably get by with just one of those, or alternately, centralise the name<->id mapping somewhere Change-Id: I978073822ddbebce94ac5b560fea675bea905a35 Reviewed-on: https://gerrit.libreoffice.org/40392 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/uno/unoatxt.cxx')
-rw-r--r--sw/source/uibase/uno/unoatxt.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index 4ea2e22fc16d..5d57bb4cdc22 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -957,9 +957,9 @@ uno::Reference< container::XNameReplace > SwXAutoTextEntry::getEvents()
const struct SvEventDescription aAutotextEvents[] =
{
- { SW_EVENT_START_INS_GLOSSARY, "OnInsertStart" },
- { SW_EVENT_END_INS_GLOSSARY, "OnInsertDone" },
- { 0, nullptr }
+ { SvMacroItemId::SwStartInsGlossary, "OnInsertStart" },
+ { SvMacroItemId::SwEndInsGlossary, "OnInsertDone" },
+ { SvMacroItemId::NONE, nullptr }
};
SwAutoTextEventDescriptor::SwAutoTextEventDescriptor(
@@ -981,13 +981,13 @@ OUString SwAutoTextEventDescriptor::getImplementationName()
}
void SwAutoTextEventDescriptor::replaceByName(
- const sal_uInt16 nEvent,
+ const SvMacroItemId nEvent,
const SvxMacro& rMacro)
{
OSL_ENSURE( nullptr != rAutoTextEntry.GetGlossaries(),
"Strangely enough, the AutoText vanished!" );
- OSL_ENSURE( (nEvent == SW_EVENT_END_INS_GLOSSARY) ||
- (nEvent == SW_EVENT_START_INS_GLOSSARY) ,
+ OSL_ENSURE( (nEvent == SvMacroItemId::SwEndInsGlossary) ||
+ (nEvent == SvMacroItemId::SwStartInsGlossary) ,
"Unknown event ID" );
SwGlossaries *const pGlossaries =
@@ -1015,11 +1015,11 @@ void SwAutoTextEventDescriptor::replaceByName(
void SwAutoTextEventDescriptor::getByName(
SvxMacro& rMacro,
- const sal_uInt16 nEvent )
+ const SvMacroItemId nEvent )
{
OSL_ENSURE( nullptr != rAutoTextEntry.GetGlossaries(), "no AutoText" );
- OSL_ENSURE( (nEvent == SW_EVENT_END_INS_GLOSSARY) ||
- (nEvent == SW_EVENT_START_INS_GLOSSARY) ,
+ OSL_ENSURE( (nEvent == SvMacroItemId::SwEndInsGlossary) ||
+ (nEvent == SvMacroItemId::SwStartInsGlossary) ,
"Unknown event ID" );
SwGlossaries *const pGlossaries =