tdf#145614: Convert #define to enum class

Change-Id: Ic1147219d09c064817e273309f106d9c091caee4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202945
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:
David Rosenfeld
2026-04-04 17:38:37 +02:00
committed by Ilmari Lauhakangas
parent 9b06135233
commit 4fec122182
2 changed files with 31 additions and 19 deletions
+22 -12
View File
@@ -949,18 +949,28 @@ void LockedEmbedDocument_Impl::ExecuteMethod( sal_Int16 nId )
{ {
if ( m_pEmbedDocument ) if ( m_pEmbedDocument )
{ {
if ( nId == OLESERV_SAVEOBJECT ) switch( static_cast<OLEServ>(nId) )
m_pEmbedDocument->SaveObject(); {
else if ( nId == OLESERV_CLOSE ) case OLEServ::SaveObject:
m_pEmbedDocument->Close( 0 ); m_pEmbedDocument->SaveObject();
else if ( nId == OLESERV_NOTIFY ) break;
m_pEmbedDocument->notify(); case OLEServ::Close:
else if ( nId == OLESERV_NOTIFYCLOSING ) m_pEmbedDocument->Close( 0 );
m_pEmbedDocument->OLENotifyClosing(); break;
else if ( nId == OLESERV_SHOWOBJECT ) case OLEServ::Notify:
m_pEmbedDocument->ShowObject(); m_pEmbedDocument->notify();
else if ( nId == OLESERV_DEACTIVATE ) break;
m_pEmbedDocument->Deactivate(); case OLEServ::NotifyClosing:
m_pEmbedDocument->OLENotifyClosing();
break;
case OLEServ::ShowObject:
m_pEmbedDocument->ShowObject();
break;
case OLEServ::Deactivate:
m_pEmbedDocument->Deactivate();
break;
default:;
}
} }
} }
+9 -7
View File
@@ -19,13 +19,6 @@
#pragma once #pragma once
#define OLESERV_SAVEOBJECT 1
#define OLESERV_CLOSE 2
#define OLESERV_NOTIFY 3
#define OLESERV_NOTIFYCLOSING 4
#define OLESERV_SHOWOBJECT 5
#define OLESERV_DEACTIVATE 6
#include <oleidl.h> #include <oleidl.h>
#if defined __clang__ #if defined __clang__
#pragma clang diagnostic push #pragma clang diagnostic push
@@ -39,6 +32,15 @@
#endif #endif
#include <cppuhelper/weak.hxx> #include <cppuhelper/weak.hxx>
enum class OLEServ : sal_Int16 {
SaveObject = 1,
Close = 2,
Notify = 3,
NotifyClosing = 4,
ShowObject = 5,
Deactivate = 6
};
class EmbedDocument_Impl; class EmbedDocument_Impl;
struct LockedEmbedDocument_Impl struct LockedEmbedDocument_Impl
{ {