diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-28 15:01:43 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-29 10:41:40 +0200 |
commit | 6bb742b9cbbdabbbd53dd9cdf6cb165e4b30bf86 (patch) | |
tree | e483f00c38dd38429e307a170f80d95dddf57d0e /sc | |
parent | a9bfa6547ae2a4721363289f3816568e6a7e6a2d (diff) |
convert STR_EVENT constants to scoped enum
- also add needed infrastructure to o3tl::enumarray so we can use
std::find on it
- move the Impl inside the .cxx file, no need to expose it in the header
Change-Id: I7758a6175849f46723d97b1e657f846524c3b7cd
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/vba/vbaeventshelper.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx index 078060d87e25..d0415abab096 100644 --- a/sc/source/ui/vba/vbaeventshelper.cxx +++ b/sc/source/ui/vba/vbaeventshelper.cxx @@ -564,36 +564,36 @@ ScVbaEventsHelper::~ScVbaEventsHelper() void SAL_CALL ScVbaEventsHelper::notifyEvent( const css::document::EventObject& rEvent ) throw (css::uno::RuntimeException, std::exception) { static const uno::Sequence< uno::Any > saEmptyArgs; - if( (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC )) || - (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CREATEDOC )) ) // CREATEDOC triggered e.g. during VBA Workbooks.Add + if( (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::OPENDOC )) || + (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::CREATEDOC )) ) // CREATEDOC triggered e.g. during VBA Workbooks.Add { processVbaEventNoThrow( WORKBOOK_OPEN, saEmptyArgs ); } - else if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ) ) + else if( rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::ACTIVATEDOC ) ) { processVbaEventNoThrow( WORKBOOK_ACTIVATE, saEmptyArgs ); } - else if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC ) ) + else if( rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::DEACTIVATEDOC ) ) { processVbaEventNoThrow( WORKBOOK_DEACTIVATE, saEmptyArgs ); } - else if( (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVEDOCDONE )) || - (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVEASDOCDONE )) || - (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVETODOCDONE )) ) + else if( (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVEDOCDONE )) || + (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVEASDOCDONE )) || + (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVETODOCDONE )) ) { uno::Sequence< uno::Any > aArgs( 1 ); aArgs[ 0 ] <<= true; processVbaEventNoThrow( WORKBOOK_AFTERSAVE, aArgs ); } - else if( (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVEDOCFAILED )) || - (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVEASDOCFAILED )) || - (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVETODOCFAILED )) ) + else if( (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVEDOCFAILED )) || + (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVEASDOCFAILED )) || + (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVETODOCFAILED )) ) { uno::Sequence< uno::Any > aArgs( 1 ); aArgs[ 0 ] <<= false; processVbaEventNoThrow( WORKBOOK_AFTERSAVE, aArgs ); } - else if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ) ) + else if( rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ) ) { /* Trigger the WORKBOOK_WINDOWDEACTIVATE and WORKBOOK_DEACTIVATE events and stop listening to the model (done in base class). */ @@ -606,7 +606,7 @@ void SAL_CALL ScVbaEventsHelper::notifyEvent( const css::document::EventObject& } processVbaEventNoThrow( WORKBOOK_DEACTIVATE, saEmptyArgs ); } - else if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ) ) + else if( rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::VIEWCREATED ) ) { uno::Reference< frame::XController > xController( mxModel->getCurrentController() ); if( mxListener.get() && xController.is() ) |